productpolicy

package
v0.20240611.1085123 Latest Latest
Warning

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

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

README

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

The productpolicy SDK allows for interaction with the Azure Resource Manager Service apimanagement (API Version 2023-05-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-05-01-preview/productpolicy"

Client Initialization

client := productpolicy.NewProductPolicyClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: ProductPolicyClient.CreateOrUpdate

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

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


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

Example Usage: ProductPolicyClient.Delete

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

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

Example Usage: ProductPolicyClient.Get

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

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

Example Usage: ProductPolicyClient.GetEntityTag

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

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: ProductPolicyClient.ListByProduct

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

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

Example Usage: ProductPolicyClient.WorkspaceProductPolicyCreateOrUpdate

ctx := context.TODO()
id := productpolicy.NewWorkspaceProductID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceValue", "workspaceIdValue", "productIdValue")

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


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

Example Usage: ProductPolicyClient.WorkspaceProductPolicyDelete

ctx := context.TODO()
id := productpolicy.NewWorkspaceProductID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceValue", "workspaceIdValue", "productIdValue")

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

Example Usage: ProductPolicyClient.WorkspaceProductPolicyGet

ctx := context.TODO()
id := productpolicy.NewWorkspaceProductID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceValue", "workspaceIdValue", "productIdValue")

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

Example Usage: ProductPolicyClient.WorkspaceProductPolicyGetEntityTag

ctx := context.TODO()
id := productpolicy.NewWorkspaceProductID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceValue", "workspaceIdValue", "productIdValue")

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

Example Usage: ProductPolicyClient.WorkspaceProductPolicyListByProduct

ctx := context.TODO()
id := productpolicy.NewWorkspaceProductID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceValue", "workspaceIdValue", "productIdValue")

// alternatively `client.WorkspaceProductPolicyListByProduct(ctx, id)` can be used to do batched pagination
items, err := client.WorkspaceProductPolicyListByProductComplete(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 ValidateProductID

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

ValidateProductID checks that 'input' can be parsed as a Product ID

func ValidateWorkspaceProductID

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

ValidateWorkspaceProductID checks that 'input' can be parsed as a Workspace Product 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 {
	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 ListByProductCompleteResult

type ListByProductCompleteResult struct {
	LatestHttpResponse *http.Response
	Items              []PolicyContract
}

type ListByProductOperationResponse

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

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 ProductId

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

ProductId is a struct representing the Resource ID for a Product

func NewProductID

func NewProductID(subscriptionId string, resourceGroupName string, serviceName string, productId string) ProductId

NewProductID returns a new ProductId struct

func ParseProductID

func ParseProductID(input string) (*ProductId, error)

ParseProductID parses 'input' into a ProductId

func ParseProductIDInsensitively

func ParseProductIDInsensitively(input string) (*ProductId, error)

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

func (*ProductId) FromParseResult

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

func (ProductId) ID

func (id ProductId) ID() string

ID returns the formatted Product ID

func (ProductId) Segments

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

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

func (ProductId) String

func (id ProductId) String() string

String returns a human-readable description of this Product ID

type ProductPolicyClient

type ProductPolicyClient struct {
	Client *resourcemanager.Client
}

func NewProductPolicyClientWithBaseURI

func NewProductPolicyClientWithBaseURI(sdkApi sdkEnv.Api) (*ProductPolicyClient, error)

func (ProductPolicyClient) CreateOrUpdate

CreateOrUpdate ...

func (ProductPolicyClient) Delete

Delete ...

func (ProductPolicyClient) Get

Get ...

func (ProductPolicyClient) GetEntityTag

func (c ProductPolicyClient) GetEntityTag(ctx context.Context, id ProductId) (result GetEntityTagOperationResponse, err error)

GetEntityTag ...

func (ProductPolicyClient) ListByProduct

func (c ProductPolicyClient) ListByProduct(ctx context.Context, id ProductId) (result ListByProductOperationResponse, err error)

ListByProduct ...

func (ProductPolicyClient) ListByProductComplete

func (c ProductPolicyClient) ListByProductComplete(ctx context.Context, id ProductId) (ListByProductCompleteResult, error)

ListByProductComplete retrieves all the results into a single object

func (ProductPolicyClient) ListByProductCompleteMatchingPredicate

func (c ProductPolicyClient) ListByProductCompleteMatchingPredicate(ctx context.Context, id ProductId, predicate PolicyContractOperationPredicate) (result ListByProductCompleteResult, err error)

ListByProductCompleteMatchingPredicate retrieves all the results and then applies the predicate

func (ProductPolicyClient) WorkspaceProductPolicyCreateOrUpdate

WorkspaceProductPolicyCreateOrUpdate ...

func (ProductPolicyClient) WorkspaceProductPolicyDelete

WorkspaceProductPolicyDelete ...

func (ProductPolicyClient) WorkspaceProductPolicyGet

WorkspaceProductPolicyGet ...

func (ProductPolicyClient) WorkspaceProductPolicyGetEntityTag

func (c ProductPolicyClient) WorkspaceProductPolicyGetEntityTag(ctx context.Context, id WorkspaceProductId) (result WorkspaceProductPolicyGetEntityTagOperationResponse, err error)

WorkspaceProductPolicyGetEntityTag ...

func (ProductPolicyClient) WorkspaceProductPolicyListByProduct

func (c ProductPolicyClient) WorkspaceProductPolicyListByProduct(ctx context.Context, id WorkspaceProductId) (result WorkspaceProductPolicyListByProductOperationResponse, err error)

WorkspaceProductPolicyListByProduct ...

func (ProductPolicyClient) WorkspaceProductPolicyListByProductComplete added in v0.20240226.1173038

func (c ProductPolicyClient) WorkspaceProductPolicyListByProductComplete(ctx context.Context, id WorkspaceProductId) (WorkspaceProductPolicyListByProductCompleteResult, error)

WorkspaceProductPolicyListByProductComplete retrieves all the results into a single object

func (ProductPolicyClient) WorkspaceProductPolicyListByProductCompleteMatchingPredicate added in v0.20240226.1173038

func (c ProductPolicyClient) WorkspaceProductPolicyListByProductCompleteMatchingPredicate(ctx context.Context, id WorkspaceProductId, predicate PolicyContractOperationPredicate) (result WorkspaceProductPolicyListByProductCompleteResult, err error)

WorkspaceProductPolicyListByProductCompleteMatchingPredicate retrieves all the results and then applies the predicate

type WorkspaceProductId

type WorkspaceProductId struct {
	SubscriptionId    string
	ResourceGroupName string
	ServiceName       string
	WorkspaceId       string
	ProductId         string
}

WorkspaceProductId is a struct representing the Resource ID for a Workspace Product

func NewWorkspaceProductID

func NewWorkspaceProductID(subscriptionId string, resourceGroupName string, serviceName string, workspaceId string, productId string) WorkspaceProductId

NewWorkspaceProductID returns a new WorkspaceProductId struct

func ParseWorkspaceProductID

func ParseWorkspaceProductID(input string) (*WorkspaceProductId, error)

ParseWorkspaceProductID parses 'input' into a WorkspaceProductId

func ParseWorkspaceProductIDInsensitively

func ParseWorkspaceProductIDInsensitively(input string) (*WorkspaceProductId, error)

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

func (*WorkspaceProductId) FromParseResult

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

func (WorkspaceProductId) ID

func (id WorkspaceProductId) ID() string

ID returns the formatted Workspace Product ID

func (WorkspaceProductId) Segments

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

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

func (WorkspaceProductId) String

func (id WorkspaceProductId) String() string

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

type WorkspaceProductPolicyCreateOrUpdateOperationOptions

type WorkspaceProductPolicyCreateOrUpdateOperationOptions struct {
	IfMatch *string
}

func DefaultWorkspaceProductPolicyCreateOrUpdateOperationOptions

func DefaultWorkspaceProductPolicyCreateOrUpdateOperationOptions() WorkspaceProductPolicyCreateOrUpdateOperationOptions

func (WorkspaceProductPolicyCreateOrUpdateOperationOptions) ToHeaders

func (WorkspaceProductPolicyCreateOrUpdateOperationOptions) ToOData

func (WorkspaceProductPolicyCreateOrUpdateOperationOptions) ToQuery

type WorkspaceProductPolicyCreateOrUpdateOperationResponse

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

type WorkspaceProductPolicyDeleteOperationOptions

type WorkspaceProductPolicyDeleteOperationOptions struct {
	IfMatch *string
}

func DefaultWorkspaceProductPolicyDeleteOperationOptions

func DefaultWorkspaceProductPolicyDeleteOperationOptions() WorkspaceProductPolicyDeleteOperationOptions

func (WorkspaceProductPolicyDeleteOperationOptions) ToHeaders

func (WorkspaceProductPolicyDeleteOperationOptions) ToOData

func (WorkspaceProductPolicyDeleteOperationOptions) ToQuery

type WorkspaceProductPolicyDeleteOperationResponse

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

type WorkspaceProductPolicyGetEntityTagOperationResponse

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

type WorkspaceProductPolicyGetOperationOptions

type WorkspaceProductPolicyGetOperationOptions struct {
	Format *PolicyExportFormat
}

func DefaultWorkspaceProductPolicyGetOperationOptions

func DefaultWorkspaceProductPolicyGetOperationOptions() WorkspaceProductPolicyGetOperationOptions

func (WorkspaceProductPolicyGetOperationOptions) ToHeaders

func (WorkspaceProductPolicyGetOperationOptions) ToOData

func (WorkspaceProductPolicyGetOperationOptions) ToQuery

type WorkspaceProductPolicyGetOperationResponse

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

type WorkspaceProductPolicyListByProductCompleteResult added in v0.20240226.1173038

type WorkspaceProductPolicyListByProductCompleteResult struct {
	LatestHttpResponse *http.Response
	Items              []PolicyContract
}

type WorkspaceProductPolicyListByProductOperationResponse

type WorkspaceProductPolicyListByProductOperationResponse 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