apipolicy

package
v0.20231129.1103252 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2023 License: MPL-2.0 Imports: 10 Imported by: 1

README

github.com/hashicorp/go-azure-sdk/resource-manager/apimanagement/2023-03-01-preview/apipolicy Documentation

The apipolicy SDK allows for interaction with the Azure Resource Manager Service apimanagement (API Version 2023-03-01-preview).

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/2023-03-01-preview/apipolicy"

Client Initialization

client := apipolicy.NewApiPolicyClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: ApiPolicyClient.CreateOrUpdate

ctx := context.TODO()
id := apipolicy.NewApiID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceValue", "apiIdValue")

payload := apipolicy.PolicyContract{
	// ...
}


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

Example Usage: ApiPolicyClient.Delete

ctx := context.TODO()
id := apipolicy.NewApiID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceValue", "apiIdValue")

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

Example Usage: ApiPolicyClient.Get

ctx := context.TODO()
id := apipolicy.NewApiID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceValue", "apiIdValue")

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

Example Usage: ApiPolicyClient.GetEntityTag

ctx := context.TODO()
id := apipolicy.NewApiID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceValue", "apiIdValue")

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

Example Usage: ApiPolicyClient.ListByApi

ctx := context.TODO()
id := apipolicy.NewApiID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceValue", "apiIdValue")

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

Example Usage: ApiPolicyClient.WorkspaceApiPolicyCreateOrUpdate

ctx := context.TODO()
id := apipolicy.NewWorkspaceApiID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceValue", "workspaceIdValue", "apiIdValue")

payload := apipolicy.PolicyContract{
	// ...
}


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

Example Usage: ApiPolicyClient.WorkspaceApiPolicyDelete

ctx := context.TODO()
id := apipolicy.NewWorkspaceApiID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceValue", "workspaceIdValue", "apiIdValue")

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

Example Usage: ApiPolicyClient.WorkspaceApiPolicyGet

ctx := context.TODO()
id := apipolicy.NewWorkspaceApiID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceValue", "workspaceIdValue", "apiIdValue")

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

Example Usage: ApiPolicyClient.WorkspaceApiPolicyGetEntityTag

ctx := context.TODO()
id := apipolicy.NewWorkspaceApiID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceValue", "workspaceIdValue", "apiIdValue")

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

Example Usage: ApiPolicyClient.WorkspaceApiPolicyListByApi

ctx := context.TODO()
id := apipolicy.NewWorkspaceApiID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceValue", "workspaceIdValue", "apiIdValue")

// alternatively `client.WorkspaceApiPolicyListByApi(ctx, id)` can be used to do batched pagination
items, err := client.WorkspaceApiPolicyListByApiComplete(ctx, id)
if err != nil {
	// handle the error
}
for _, item := range items {
	// do something
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PossibleValuesForPolicyContentFormat

func PossibleValuesForPolicyContentFormat() []string

func PossibleValuesForPolicyExportFormat

func PossibleValuesForPolicyExportFormat() []string

func ValidateApiID

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

ValidateApiID checks that 'input' can be parsed as a Api ID

func ValidateWorkspaceApiID

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

ValidateWorkspaceApiID checks that 'input' can be parsed as a Workspace Api ID

Types

type ApiId

type ApiId struct {
	SubscriptionId    string
	ResourceGroupName string
	ServiceName       string
	ApiId             string
}

ApiId is a struct representing the Resource ID for a Api

func NewApiID

func NewApiID(subscriptionId string, resourceGroupName string, serviceName string, apiId string) ApiId

NewApiID returns a new ApiId struct

func ParseApiID

func ParseApiID(input string) (*ApiId, error)

ParseApiID parses 'input' into a ApiId

func ParseApiIDInsensitively

func ParseApiIDInsensitively(input string) (*ApiId, error)

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

func (*ApiId) FromParseResult added in v0.20231127.1171502

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

func (ApiId) ID

func (id ApiId) ID() string

ID returns the formatted Api ID

func (ApiId) Segments

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

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

func (ApiId) String

func (id ApiId) String() string

String returns a human-readable description of this Api ID

type ApiPolicyClient

type ApiPolicyClient struct {
	Client *resourcemanager.Client
}

func NewApiPolicyClientWithBaseURI

func NewApiPolicyClientWithBaseURI(sdkApi sdkEnv.Api) (*ApiPolicyClient, error)

func (ApiPolicyClient) CreateOrUpdate

CreateOrUpdate ...

func (ApiPolicyClient) Delete

func (c ApiPolicyClient) Delete(ctx context.Context, id ApiId, options DeleteOperationOptions) (result DeleteOperationResponse, err error)

Delete ...

func (ApiPolicyClient) Get

func (c ApiPolicyClient) Get(ctx context.Context, id ApiId, options GetOperationOptions) (result GetOperationResponse, err error)

Get ...

func (ApiPolicyClient) GetEntityTag

func (c ApiPolicyClient) GetEntityTag(ctx context.Context, id ApiId) (result GetEntityTagOperationResponse, err error)

GetEntityTag ...

func (ApiPolicyClient) ListByApi

func (c ApiPolicyClient) ListByApi(ctx context.Context, id ApiId) (result ListByApiOperationResponse, err error)

ListByApi ...

func (ApiPolicyClient) WorkspaceApiPolicyCreateOrUpdate

WorkspaceApiPolicyCreateOrUpdate ...

func (ApiPolicyClient) WorkspaceApiPolicyDelete

WorkspaceApiPolicyDelete ...

func (ApiPolicyClient) WorkspaceApiPolicyGet

WorkspaceApiPolicyGet ...

func (ApiPolicyClient) WorkspaceApiPolicyGetEntityTag

func (c ApiPolicyClient) WorkspaceApiPolicyGetEntityTag(ctx context.Context, id WorkspaceApiId) (result WorkspaceApiPolicyGetEntityTagOperationResponse, err error)

WorkspaceApiPolicyGetEntityTag ...

func (ApiPolicyClient) WorkspaceApiPolicyListByApi

func (c ApiPolicyClient) WorkspaceApiPolicyListByApi(ctx context.Context, id WorkspaceApiId) (result WorkspaceApiPolicyListByApiOperationResponse, err error)

WorkspaceApiPolicyListByApi ...

func (ApiPolicyClient) WorkspaceApiPolicyListByApiComplete

func (c ApiPolicyClient) WorkspaceApiPolicyListByApiComplete(ctx context.Context, id WorkspaceApiId) (WorkspaceApiPolicyListByApiCompleteResult, error)

WorkspaceApiPolicyListByApiComplete retrieves all the results into a single object

func (ApiPolicyClient) WorkspaceApiPolicyListByApiCompleteMatchingPredicate

func (c ApiPolicyClient) WorkspaceApiPolicyListByApiCompleteMatchingPredicate(ctx context.Context, id WorkspaceApiId, predicate PolicyContractOperationPredicate) (result WorkspaceApiPolicyListByApiCompleteResult, err error)

WorkspaceApiPolicyListByApiCompleteMatchingPredicate retrieves all the results and then applies the predicate

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        *PolicyContract
}

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 GetEntityTagOperationResponse

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

type GetOperationOptions

type GetOperationOptions struct {
	Format *PolicyExportFormat
}

func DefaultGetOperationOptions

func DefaultGetOperationOptions() GetOperationOptions

func (GetOperationOptions) ToHeaders

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

func (GetOperationOptions) ToOData

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

func (GetOperationOptions) ToQuery

func (o GetOperationOptions) ToQuery() *client.QueryParams

type GetOperationResponse

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

type ListByApiOperationResponse

type ListByApiOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *PolicyCollection
}

type PolicyCollection

type PolicyCollection struct {
	Count    *int64            `json:"count,omitempty"`
	NextLink *string           `json:"nextLink,omitempty"`
	Value    *[]PolicyContract `json:"value,omitempty"`
}

type PolicyContentFormat

type PolicyContentFormat string
const (
	PolicyContentFormatRawxml             PolicyContentFormat = "rawxml"
	PolicyContentFormatRawxmlNegativelink PolicyContentFormat = "rawxml-link"
	PolicyContentFormatXml                PolicyContentFormat = "xml"
	PolicyContentFormatXmlNegativelink    PolicyContentFormat = "xml-link"
)

func (*PolicyContentFormat) UnmarshalJSON

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

type PolicyContract

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

type PolicyContractOperationPredicate

type PolicyContractOperationPredicate struct {
	Id   *string
	Name *string
	Type *string
}

func (PolicyContractOperationPredicate) Matches

type PolicyContractProperties

type PolicyContractProperties struct {
	Format *PolicyContentFormat `json:"format,omitempty"`
	Value  string               `json:"value"`
}

type PolicyExportFormat

type PolicyExportFormat string
const (
	PolicyExportFormatRawxml PolicyExportFormat = "rawxml"
	PolicyExportFormatXml    PolicyExportFormat = "xml"
)

func (*PolicyExportFormat) UnmarshalJSON

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

type WorkspaceApiId

type WorkspaceApiId struct {
	SubscriptionId    string
	ResourceGroupName string
	ServiceName       string
	WorkspaceId       string
	ApiId             string
}

WorkspaceApiId is a struct representing the Resource ID for a Workspace Api

func NewWorkspaceApiID

func NewWorkspaceApiID(subscriptionId string, resourceGroupName string, serviceName string, workspaceId string, apiId string) WorkspaceApiId

NewWorkspaceApiID returns a new WorkspaceApiId struct

func ParseWorkspaceApiID

func ParseWorkspaceApiID(input string) (*WorkspaceApiId, error)

ParseWorkspaceApiID parses 'input' into a WorkspaceApiId

func ParseWorkspaceApiIDInsensitively

func ParseWorkspaceApiIDInsensitively(input string) (*WorkspaceApiId, error)

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

func (*WorkspaceApiId) FromParseResult added in v0.20231127.1171502

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

func (WorkspaceApiId) ID

func (id WorkspaceApiId) ID() string

ID returns the formatted Workspace Api ID

func (WorkspaceApiId) Segments

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

Segments returns a slice of Resource ID Segments which comprise this Workspace Api ID

func (WorkspaceApiId) String

func (id WorkspaceApiId) String() string

String returns a human-readable description of this Workspace Api ID

type WorkspaceApiPolicyCreateOrUpdateOperationOptions

type WorkspaceApiPolicyCreateOrUpdateOperationOptions struct {
	IfMatch *string
}

func DefaultWorkspaceApiPolicyCreateOrUpdateOperationOptions

func DefaultWorkspaceApiPolicyCreateOrUpdateOperationOptions() WorkspaceApiPolicyCreateOrUpdateOperationOptions

func (WorkspaceApiPolicyCreateOrUpdateOperationOptions) ToHeaders

func (WorkspaceApiPolicyCreateOrUpdateOperationOptions) ToOData

func (WorkspaceApiPolicyCreateOrUpdateOperationOptions) ToQuery

type WorkspaceApiPolicyCreateOrUpdateOperationResponse

type WorkspaceApiPolicyCreateOrUpdateOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *PolicyContract
}

type WorkspaceApiPolicyDeleteOperationOptions

type WorkspaceApiPolicyDeleteOperationOptions struct {
	IfMatch *string
}

func DefaultWorkspaceApiPolicyDeleteOperationOptions

func DefaultWorkspaceApiPolicyDeleteOperationOptions() WorkspaceApiPolicyDeleteOperationOptions

func (WorkspaceApiPolicyDeleteOperationOptions) ToHeaders

func (WorkspaceApiPolicyDeleteOperationOptions) ToOData

func (WorkspaceApiPolicyDeleteOperationOptions) ToQuery

type WorkspaceApiPolicyDeleteOperationResponse

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

type WorkspaceApiPolicyGetEntityTagOperationResponse

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

type WorkspaceApiPolicyGetOperationOptions

type WorkspaceApiPolicyGetOperationOptions struct {
	Format *PolicyExportFormat
}

func DefaultWorkspaceApiPolicyGetOperationOptions

func DefaultWorkspaceApiPolicyGetOperationOptions() WorkspaceApiPolicyGetOperationOptions

func (WorkspaceApiPolicyGetOperationOptions) ToHeaders

func (WorkspaceApiPolicyGetOperationOptions) ToOData

func (WorkspaceApiPolicyGetOperationOptions) ToQuery

type WorkspaceApiPolicyGetOperationResponse

type WorkspaceApiPolicyGetOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *PolicyContract
}

type WorkspaceApiPolicyListByApiCompleteResult

type WorkspaceApiPolicyListByApiCompleteResult struct {
	Items []PolicyContract
}

type WorkspaceApiPolicyListByApiOperationResponse

type WorkspaceApiPolicyListByApiOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *[]PolicyContract
}

Jump to

Keyboard shortcuts

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