authorization

package
v0.20240923.1142107 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 23, 2024 License: MPL-2.0 Imports: 11 Imported by: 0

README

github.com/hashicorp/go-azure-sdk/resource-manager/apimanagement/2024-05-01/authorization Documentation

The authorization SDK allows for interaction with Azure Resource Manager apimanagement (API Version 2024-05-01).

This readme covers example usages, but further information on using this SDK can be found in the project root.

Import Path

import "github.com/hashicorp/go-azure-sdk/resource-manager/apimanagement/2024-05-01/authorization"

Client Initialization

client := authorization.NewAuthorizationClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: AuthorizationClient.CreateOrUpdate

ctx := context.TODO()
id := authorization.NewAuthorizationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "authorizationProviderId", "authorizationId")

payload := authorization.AuthorizationContract{
	// ...
}


read, err := client.CreateOrUpdate(ctx, id, payload, authorization.DefaultCreateOrUpdateOperationOptions())
if err != nil {
	// handle the error
}
if model := read.Model; model != nil {
	// do something with the model/response object
}

Example Usage: AuthorizationClient.Delete

ctx := context.TODO()
id := authorization.NewAuthorizationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "authorizationProviderId", "authorizationId")

read, err := client.Delete(ctx, id, authorization.DefaultDeleteOperationOptions())
if err != nil {
	// handle the error
}
if model := read.Model; model != nil {
	// do something with the model/response object
}

Example Usage: AuthorizationClient.Get

ctx := context.TODO()
id := authorization.NewAuthorizationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "authorizationProviderId", "authorizationId")

read, err := client.Get(ctx, id)
if err != nil {
	// handle the error
}
if model := read.Model; model != nil {
	// do something with the model/response object
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PossibleValuesForAuthorizationType

func PossibleValuesForAuthorizationType() []string

func PossibleValuesForOAuth2GrantType

func PossibleValuesForOAuth2GrantType() []string

func ValidateAuthorizationID

func ValidateAuthorizationID(input interface{}, key string) (warnings []string, errors []error)

ValidateAuthorizationID checks that 'input' can be parsed as a Authorization ID

Types

type AuthorizationClient

type AuthorizationClient struct {
	Client *resourcemanager.Client
}

func NewAuthorizationClientWithBaseURI

func NewAuthorizationClientWithBaseURI(sdkApi sdkEnv.Api) (*AuthorizationClient, error)

func (AuthorizationClient) CreateOrUpdate

CreateOrUpdate ...

func (AuthorizationClient) Delete

Delete ...

func (AuthorizationClient) Get

Get ...

type AuthorizationContract

type AuthorizationContract struct {
	Id         *string                          `json:"id,omitempty"`
	Name       *string                          `json:"name,omitempty"`
	Properties *AuthorizationContractProperties `json:"properties,omitempty"`
	Type       *string                          `json:"type,omitempty"`
}

type AuthorizationContractProperties

type AuthorizationContractProperties struct {
	AuthorizationType *AuthorizationType  `json:"authorizationType,omitempty"`
	Error             *AuthorizationError `json:"error,omitempty"`
	Oauth2grantType   *OAuth2GrantType    `json:"oauth2grantType,omitempty"`
	Parameters        *map[string]string  `json:"parameters,omitempty"`
	Status            *string             `json:"status,omitempty"`
}

type AuthorizationError

type AuthorizationError struct {
	Code    *string `json:"code,omitempty"`
	Message *string `json:"message,omitempty"`
}

type AuthorizationId

type AuthorizationId struct {
	SubscriptionId          string
	ResourceGroupName       string
	ServiceName             string
	AuthorizationProviderId string
	AuthorizationId         string
}

AuthorizationId is a struct representing the Resource ID for a Authorization

func NewAuthorizationID

func NewAuthorizationID(subscriptionId string, resourceGroupName string, serviceName string, authorizationProviderId string, authorizationId string) AuthorizationId

NewAuthorizationID returns a new AuthorizationId struct

func ParseAuthorizationID

func ParseAuthorizationID(input string) (*AuthorizationId, error)

ParseAuthorizationID parses 'input' into a AuthorizationId

func ParseAuthorizationIDInsensitively

func ParseAuthorizationIDInsensitively(input string) (*AuthorizationId, error)

ParseAuthorizationIDInsensitively parses 'input' case-insensitively into a AuthorizationId note: this method should only be used for API response data and not user input

func (*AuthorizationId) FromParseResult

func (id *AuthorizationId) FromParseResult(input resourceids.ParseResult) error

func (AuthorizationId) ID

func (id AuthorizationId) ID() string

ID returns the formatted Authorization ID

func (AuthorizationId) Segments

func (id AuthorizationId) Segments() []resourceids.Segment

Segments returns a slice of Resource ID Segments which comprise this Authorization ID

func (AuthorizationId) String

func (id AuthorizationId) String() string

String returns a human-readable description of this Authorization ID

type AuthorizationType

type AuthorizationType string
const (
	AuthorizationTypeOAuthTwo AuthorizationType = "OAuth2"
)

func (*AuthorizationType) UnmarshalJSON

func (s *AuthorizationType) UnmarshalJSON(bytes []byte) error

type CreateOrUpdateOperationOptions

type CreateOrUpdateOperationOptions struct {
	IfMatch *string
}

func DefaultCreateOrUpdateOperationOptions

func DefaultCreateOrUpdateOperationOptions() CreateOrUpdateOperationOptions

func (CreateOrUpdateOperationOptions) ToHeaders

func (CreateOrUpdateOperationOptions) ToOData

func (CreateOrUpdateOperationOptions) ToQuery

type CreateOrUpdateOperationResponse

type CreateOrUpdateOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *AuthorizationContract
}

type DeleteOperationOptions

type DeleteOperationOptions struct {
	IfMatch *string
}

func DefaultDeleteOperationOptions

func DefaultDeleteOperationOptions() DeleteOperationOptions

func (DeleteOperationOptions) ToHeaders

func (o DeleteOperationOptions) ToHeaders() *client.Headers

func (DeleteOperationOptions) ToOData

func (o DeleteOperationOptions) ToOData() *odata.Query

func (DeleteOperationOptions) ToQuery

type DeleteOperationResponse

type DeleteOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
}

type GetOperationResponse

type GetOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *AuthorizationContract
}

type OAuth2GrantType

type OAuth2GrantType string
const (
	OAuth2GrantTypeAuthorizationCode OAuth2GrantType = "AuthorizationCode"
	OAuth2GrantTypeClientCredentials OAuth2GrantType = "ClientCredentials"
)

func (*OAuth2GrantType) UnmarshalJSON

func (s *OAuth2GrantType) UnmarshalJSON(bytes []byte) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL