tag

package
v0.20240527.1094340 Latest Latest
Warning

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

Go to latest
Published: May 27, 2024 License: MPL-2.0 Imports: 10 Imported by: 0

README

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

The tag 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/tag"

Client Initialization

client := tag.NewTagClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: TagClient.CreateOrUpdate

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

payload := tag.TagCreateUpdateParameters{
	// ...
}


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

Example Usage: TagClient.Delete

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

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

Example Usage: TagClient.Get

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

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
}

Example Usage: TagClient.GetEntityState

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

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

Example Usage: TagClient.ListByService

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

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

Example Usage: TagClient.Update

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

payload := tag.TagCreateUpdateParameters{
	// ...
}


read, err := client.Update(ctx, id, payload, tag.DefaultUpdateOperationOptions())
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 ValidateServiceID

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

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

func ValidateTagID

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

ValidateTagID checks that 'input' can be parsed as a Tag 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        *TagContract
}

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 GetEntityStateOperationResponse

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

type GetOperationResponse

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

type ListByServiceCompleteResult

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

type ListByServiceOperationOptions

type ListByServiceOperationOptions struct {
	Filter *string
	Scope  *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        *[]TagContract
}

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

type TagClient

type TagClient struct {
	Client *resourcemanager.Client
}

func NewTagClientWithBaseURI

func NewTagClientWithBaseURI(sdkApi sdkEnv.Api) (*TagClient, error)

func (TagClient) CreateOrUpdate

CreateOrUpdate ...

func (TagClient) Delete

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

Delete ...

func (TagClient) Get

func (c TagClient) Get(ctx context.Context, id TagId) (result GetOperationResponse, err error)

Get ...

func (TagClient) GetEntityState

func (c TagClient) GetEntityState(ctx context.Context, id TagId) (result GetEntityStateOperationResponse, err error)

GetEntityState ...

func (TagClient) ListByService

ListByService ...

func (TagClient) ListByServiceComplete

ListByServiceComplete retrieves all the results into a single object

func (TagClient) ListByServiceCompleteMatchingPredicate

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

ListByServiceCompleteMatchingPredicate retrieves all the results and then applies the predicate

func (TagClient) Update

Update ...

type TagContract

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

type TagContractOperationPredicate

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

func (TagContractOperationPredicate) Matches

type TagContractProperties

type TagContractProperties struct {
	DisplayName string `json:"displayName"`
}

type TagCreateUpdateParameters

type TagCreateUpdateParameters struct {
	Properties *TagContractProperties `json:"properties,omitempty"`
}

type TagId

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

TagId is a struct representing the Resource ID for a Tag

func NewTagID

func NewTagID(subscriptionId string, resourceGroupName string, serviceName string, tagId string) TagId

NewTagID returns a new TagId struct

func ParseTagID

func ParseTagID(input string) (*TagId, error)

ParseTagID parses 'input' into a TagId

func ParseTagIDInsensitively

func ParseTagIDInsensitively(input string) (*TagId, error)

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

func (*TagId) FromParseResult

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

func (TagId) ID

func (id TagId) ID() string

ID returns the formatted Tag ID

func (TagId) Segments

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

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

func (TagId) String

func (id TagId) String() string

String returns a human-readable description of this Tag ID

type UpdateOperationOptions

type UpdateOperationOptions struct {
	IfMatch *string
}

func DefaultUpdateOperationOptions

func DefaultUpdateOperationOptions() UpdateOperationOptions

func (UpdateOperationOptions) ToHeaders

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

func (UpdateOperationOptions) ToOData

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

func (UpdateOperationOptions) ToQuery

type UpdateOperationResponse

type UpdateOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *TagContract
}

Jump to

Keyboard shortcuts

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