policy

package
v0.20230623.1103505 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2023 License: MPL-2.0 Imports: 7 Imported by: 0

README

github.com/hashicorp/go-azure-sdk/resource-manager/apimanagement/2021-08-01/policy Documentation

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

Client Initialization

client := policy.NewPolicyClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: PolicyClient.CreateOrUpdate

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

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


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

Example Usage: PolicyClient.Delete

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

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

Example Usage: PolicyClient.Get

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

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

Example Usage: PolicyClient.GetEntityTag

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

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

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

read, err := client.ListByService(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 PossibleValuesForPolicyContentFormat

func PossibleValuesForPolicyContentFormat() []string

func PossibleValuesForPolicyExportFormat

func PossibleValuesForPolicyExportFormat() []string

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

type CreateOrUpdateOperationResponse

type CreateOrUpdateOperationResponse struct {
	HttpResponse *http.Response
	Model        *PolicyContract
}

type DeleteOperationOptions

type DeleteOperationOptions struct {
	IfMatch *string
}

func DefaultDeleteOperationOptions

func DefaultDeleteOperationOptions() DeleteOperationOptions

type DeleteOperationResponse

type DeleteOperationResponse struct {
	HttpResponse *http.Response
}

type GetEntityTagOperationResponse

type GetEntityTagOperationResponse struct {
	HttpResponse *http.Response
}

type GetOperationOptions

type GetOperationOptions struct {
	Format *PolicyExportFormat
}

func DefaultGetOperationOptions

func DefaultGetOperationOptions() GetOperationOptions

type GetOperationResponse

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

type ListByServiceOperationResponse

type ListByServiceOperationResponse struct {
	HttpResponse *http.Response
	Model        *PolicyCollection
}

type PolicyClient

type PolicyClient struct {
	Client autorest.Client
	// contains filtered or unexported fields
}

func NewPolicyClientWithBaseURI

func NewPolicyClientWithBaseURI(endpoint string) PolicyClient

func (PolicyClient) CreateOrUpdate

CreateOrUpdate ...

func (PolicyClient) Delete

Delete ...

func (PolicyClient) Get

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

Get ...

func (PolicyClient) GetEntityTag

func (c PolicyClient) GetEntityTag(ctx context.Context, id ServiceId) (result GetEntityTagOperationResponse, err error)

GetEntityTag ...

func (PolicyClient) ListByService

func (c PolicyClient) ListByService(ctx context.Context, id ServiceId) (result ListByServiceOperationResponse, err error)

ListByService ...

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"
)

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 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"
)

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) 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