policyfragment

package
v0.20240320.1105218 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2024 License: MPL-2.0 Imports: 11 Imported by: 1

README

github.com/hashicorp/go-azure-sdk/resource-manager/apimanagement/2022-08-01/policyfragment Documentation

The policyfragment SDK allows for interaction with the Azure Resource Manager Service apimanagement (API Version 2022-08-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/2022-08-01/policyfragment"

Client Initialization

client := policyfragment.NewPolicyFragmentClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: PolicyFragmentClient.CreateOrUpdate

ctx := context.TODO()
id := policyfragment.NewPolicyFragmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceValue", "policyFragmentValue")

payload := policyfragment.PolicyFragmentContract{
	// ...
}


if err := client.CreateOrUpdateThenPoll(ctx, id, payload, policyfragment.DefaultCreateOrUpdateOperationOptions()); err != nil {
	// handle the error
}

Example Usage: PolicyFragmentClient.Delete

ctx := context.TODO()
id := policyfragment.NewPolicyFragmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceValue", "policyFragmentValue")

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

Example Usage: PolicyFragmentClient.Get

ctx := context.TODO()
id := policyfragment.NewPolicyFragmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceValue", "policyFragmentValue")

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

Example Usage: PolicyFragmentClient.GetEntityTag

ctx := context.TODO()
id := policyfragment.NewPolicyFragmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceValue", "policyFragmentValue")

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: PolicyFragmentClient.ListByService

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

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

Example Usage: PolicyFragmentClient.ListReferences

ctx := context.TODO()
id := policyfragment.NewPolicyFragmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceValue", "policyFragmentValue")

// alternatively `client.ListReferences(ctx, id, policyfragment.DefaultListReferencesOperationOptions())` can be used to do batched pagination
items, err := client.ListReferencesComplete(ctx, id, policyfragment.DefaultListReferencesOperationOptions())
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 PossibleValuesForPolicyFragmentContentFormat

func PossibleValuesForPolicyFragmentContentFormat() []string

func ValidatePolicyFragmentID

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

ValidatePolicyFragmentID checks that 'input' can be parsed as a Policy Fragment ID

func ValidateServiceID

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

ValidateServiceID checks that 'input' can be parsed as a Service ID

Types

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 {
	Poller       pollers.Poller
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *PolicyFragmentContract
}

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

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

type ListByServiceCompleteResult added in v0.20240226.1173038

type ListByServiceCompleteResult struct {
	LatestHttpResponse *http.Response
	Items              []PolicyFragmentContract
}

type ListByServiceOperationOptions

type ListByServiceOperationOptions struct {
	Filter  *string
	Orderby *string
	Skip    *int64
	Top     *int64
}

func DefaultListByServiceOperationOptions

func DefaultListByServiceOperationOptions() ListByServiceOperationOptions

func (ListByServiceOperationOptions) ToHeaders

func (ListByServiceOperationOptions) ToOData

func (ListByServiceOperationOptions) ToQuery

type ListByServiceOperationResponse

type ListByServiceOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *[]PolicyFragmentContract
}

type ListReferencesCompleteResult added in v0.20240227.1172434

type ListReferencesCompleteResult struct {
	LatestHttpResponse *http.Response
	Items              []Resource
}

type ListReferencesOperationOptions

type ListReferencesOperationOptions struct {
	Skip *int64
	Top  *int64
}

func DefaultListReferencesOperationOptions

func DefaultListReferencesOperationOptions() ListReferencesOperationOptions

func (ListReferencesOperationOptions) ToHeaders

func (ListReferencesOperationOptions) ToOData

func (ListReferencesOperationOptions) ToQuery

type ListReferencesOperationResponse

type ListReferencesOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *[]Resource
}

type PolicyFragmentClient

type PolicyFragmentClient struct {
	Client *resourcemanager.Client
}

func NewPolicyFragmentClientWithBaseURI

func NewPolicyFragmentClientWithBaseURI(sdkApi sdkEnv.Api) (*PolicyFragmentClient, error)

func (PolicyFragmentClient) CreateOrUpdate

CreateOrUpdate ...

func (PolicyFragmentClient) CreateOrUpdateThenPoll

CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed

func (PolicyFragmentClient) Delete

Delete ...

func (PolicyFragmentClient) Get

Get ...

func (PolicyFragmentClient) GetEntityTag

GetEntityTag ...

func (PolicyFragmentClient) ListByService

ListByService ...

func (PolicyFragmentClient) ListByServiceComplete added in v0.20240226.1173038

ListByServiceComplete retrieves all the results into a single object

func (PolicyFragmentClient) ListByServiceCompleteMatchingPredicate added in v0.20240226.1173038

func (c PolicyFragmentClient) ListByServiceCompleteMatchingPredicate(ctx context.Context, id ServiceId, options ListByServiceOperationOptions, predicate PolicyFragmentContractOperationPredicate) (result ListByServiceCompleteResult, err error)

ListByServiceCompleteMatchingPredicate retrieves all the results and then applies the predicate

func (PolicyFragmentClient) ListReferences

ListReferences ...

func (PolicyFragmentClient) ListReferencesComplete added in v0.20240227.1172434

ListReferencesComplete retrieves all the results into a single object

func (PolicyFragmentClient) ListReferencesCompleteMatchingPredicate added in v0.20240227.1172434

func (c PolicyFragmentClient) ListReferencesCompleteMatchingPredicate(ctx context.Context, id PolicyFragmentId, options ListReferencesOperationOptions, predicate ResourceOperationPredicate) (result ListReferencesCompleteResult, err error)

ListReferencesCompleteMatchingPredicate retrieves all the results and then applies the predicate

type PolicyFragmentContentFormat

type PolicyFragmentContentFormat string
const (
	PolicyFragmentContentFormatRawxml PolicyFragmentContentFormat = "rawxml"
	PolicyFragmentContentFormatXml    PolicyFragmentContentFormat = "xml"
)

func (*PolicyFragmentContentFormat) UnmarshalJSON

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

type PolicyFragmentContract

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

type PolicyFragmentContractOperationPredicate added in v0.20240226.1173038

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

func (PolicyFragmentContractOperationPredicate) Matches added in v0.20240226.1173038

type PolicyFragmentContractProperties

type PolicyFragmentContractProperties struct {
	Description *string                      `json:"description,omitempty"`
	Format      *PolicyFragmentContentFormat `json:"format,omitempty"`
	Value       string                       `json:"value"`
}

type PolicyFragmentId

type PolicyFragmentId struct {
	SubscriptionId     string
	ResourceGroupName  string
	ServiceName        string
	PolicyFragmentName string
}

PolicyFragmentId is a struct representing the Resource ID for a Policy Fragment

func NewPolicyFragmentID

func NewPolicyFragmentID(subscriptionId string, resourceGroupName string, serviceName string, policyFragmentName string) PolicyFragmentId

NewPolicyFragmentID returns a new PolicyFragmentId struct

func ParsePolicyFragmentID

func ParsePolicyFragmentID(input string) (*PolicyFragmentId, error)

ParsePolicyFragmentID parses 'input' into a PolicyFragmentId

func ParsePolicyFragmentIDInsensitively

func ParsePolicyFragmentIDInsensitively(input string) (*PolicyFragmentId, error)

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

func (*PolicyFragmentId) FromParseResult

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

func (PolicyFragmentId) ID

func (id PolicyFragmentId) ID() string

ID returns the formatted Policy Fragment ID

func (PolicyFragmentId) Segments

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

Segments returns a slice of Resource ID Segments which comprise this Policy Fragment ID

func (PolicyFragmentId) String

func (id PolicyFragmentId) String() string

String returns a human-readable description of this Policy Fragment ID

type Resource

type Resource struct {
	Id   *string `json:"id,omitempty"`
	Name *string `json:"name,omitempty"`
	Type *string `json:"type,omitempty"`
}

type ResourceOperationPredicate added in v0.20240227.1172434

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

func (ResourceOperationPredicate) Matches added in v0.20240227.1172434

func (p ResourceOperationPredicate) Matches(input Resource) bool

type ServiceId

type ServiceId struct {
	SubscriptionId    string
	ResourceGroupName string
	ServiceName       string
}

ServiceId is a struct representing the Resource ID for a Service

func NewServiceID

func NewServiceID(subscriptionId string, resourceGroupName string, serviceName string) ServiceId

NewServiceID returns a new ServiceId struct

func ParseServiceID

func ParseServiceID(input string) (*ServiceId, error)

ParseServiceID parses 'input' into a ServiceId

func ParseServiceIDInsensitively

func ParseServiceIDInsensitively(input string) (*ServiceId, error)

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

func (*ServiceId) FromParseResult

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

func (ServiceId) ID

func (id ServiceId) ID() string

ID returns the formatted Service ID

func (ServiceId) Segments

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

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

func (ServiceId) String

func (id ServiceId) String() string

String returns a human-readable description of this Service ID

Jump to

Keyboard shortcuts

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