tags

package
v0.20240320.1000025 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: 12 Imported by: 0

README

github.com/hashicorp/go-azure-sdk/resource-manager/resources/2023-07-01/tags Documentation

The tags SDK allows for interaction with the Azure Resource Manager Service resources (API Version 2023-07-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-helpers/resourcemanager/commonids"
import "github.com/hashicorp/go-azure-sdk/resource-manager/resources/2023-07-01/tags"

Client Initialization

client := tags.NewTagsClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: TagsClient.CreateOrUpdate

ctx := context.TODO()
id := tags.NewTagNameID("12345678-1234-9876-4563-123456789012", "tagValue")

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

Example Usage: TagsClient.CreateOrUpdateAtScope

ctx := context.TODO()
id := commonids.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group")

payload := tags.TagsResource{
	// ...
}


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

Example Usage: TagsClient.CreateOrUpdateValue

ctx := context.TODO()
id := tags.NewTagValueID("12345678-1234-9876-4563-123456789012", "tagValue", "tagValueValue")

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

Example Usage: TagsClient.Delete

ctx := context.TODO()
id := tags.NewTagNameID("12345678-1234-9876-4563-123456789012", "tagValue")

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

Example Usage: TagsClient.DeleteAtScope

ctx := context.TODO()
id := commonids.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group")

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

Example Usage: TagsClient.DeleteValue

ctx := context.TODO()
id := tags.NewTagValueID("12345678-1234-9876-4563-123456789012", "tagValue", "tagValueValue")

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

Example Usage: TagsClient.GetAtScope

ctx := context.TODO()
id := commonids.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group")

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

Example Usage: TagsClient.List

ctx := context.TODO()
id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012")

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

Example Usage: TagsClient.UpdateAtScope

ctx := context.TODO()
id := commonids.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group")

payload := tags.TagsPatchResource{
	// ...
}


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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PossibleValuesForTagsPatchOperation

func PossibleValuesForTagsPatchOperation() []string

func ValidateTagNameID

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

ValidateTagNameID checks that 'input' can be parsed as a Tag Name ID

func ValidateTagValueID

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

ValidateTagValueID checks that 'input' can be parsed as a Tag Value ID

Types

type CreateOrUpdateAtScopeOperationResponse

type CreateOrUpdateAtScopeOperationResponse struct {
	Poller       pollers.Poller
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *TagsResource
}

type CreateOrUpdateOperationResponse

type CreateOrUpdateOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *TagDetails
}

type CreateOrUpdateValueOperationResponse

type CreateOrUpdateValueOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *TagValue
}

type DeleteAtScopeOperationResponse

type DeleteAtScopeOperationResponse struct {
	Poller       pollers.Poller
	HttpResponse *http.Response
	OData        *odata.OData
}

type DeleteOperationResponse

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

type DeleteValueOperationResponse

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

type GetAtScopeOperationResponse

type GetAtScopeOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *TagsResource
}

type ListCompleteResult

type ListCompleteResult struct {
	LatestHttpResponse *http.Response
	Items              []TagDetails
}

type ListOperationResponse

type ListOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *[]TagDetails
}

type TagCount

type TagCount struct {
	Type  *string `json:"type,omitempty"`
	Value *int64  `json:"value,omitempty"`
}

type TagDetails

type TagDetails struct {
	Count   *TagCount   `json:"count,omitempty"`
	Id      *string     `json:"id,omitempty"`
	TagName *string     `json:"tagName,omitempty"`
	Values  *[]TagValue `json:"values,omitempty"`
}

type TagDetailsOperationPredicate

type TagDetailsOperationPredicate struct {
	Id      *string
	TagName *string
}

func (TagDetailsOperationPredicate) Matches

func (p TagDetailsOperationPredicate) Matches(input TagDetails) bool

type TagNameId

type TagNameId struct {
	SubscriptionId string
	TagName        string
}

TagNameId is a struct representing the Resource ID for a Tag Name

func NewTagNameID

func NewTagNameID(subscriptionId string, tagName string) TagNameId

NewTagNameID returns a new TagNameId struct

func ParseTagNameID

func ParseTagNameID(input string) (*TagNameId, error)

ParseTagNameID parses 'input' into a TagNameId

func ParseTagNameIDInsensitively

func ParseTagNameIDInsensitively(input string) (*TagNameId, error)

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

func (*TagNameId) FromParseResult

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

func (TagNameId) ID

func (id TagNameId) ID() string

ID returns the formatted Tag Name ID

func (TagNameId) Segments

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

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

func (TagNameId) String

func (id TagNameId) String() string

String returns a human-readable description of this Tag Name ID

type TagValue

type TagValue struct {
	Count    *TagCount `json:"count,omitempty"`
	Id       *string   `json:"id,omitempty"`
	TagValue *string   `json:"tagValue,omitempty"`
}

type TagValueId

type TagValueId struct {
	SubscriptionId string
	TagName        string
	TagValueName   string
}

TagValueId is a struct representing the Resource ID for a Tag Value

func NewTagValueID

func NewTagValueID(subscriptionId string, tagName string, tagValueName string) TagValueId

NewTagValueID returns a new TagValueId struct

func ParseTagValueID

func ParseTagValueID(input string) (*TagValueId, error)

ParseTagValueID parses 'input' into a TagValueId

func ParseTagValueIDInsensitively

func ParseTagValueIDInsensitively(input string) (*TagValueId, error)

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

func (*TagValueId) FromParseResult

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

func (TagValueId) ID

func (id TagValueId) ID() string

ID returns the formatted Tag Value ID

func (TagValueId) Segments

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

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

func (TagValueId) String

func (id TagValueId) String() string

String returns a human-readable description of this Tag Value ID

type Tags

type Tags struct {
	Tags *map[string]string `json:"tags,omitempty"`
}

type TagsClient

type TagsClient struct {
	Client *resourcemanager.Client
}

func NewTagsClientWithBaseURI

func NewTagsClientWithBaseURI(sdkApi sdkEnv.Api) (*TagsClient, error)

func (TagsClient) CreateOrUpdate

func (c TagsClient) CreateOrUpdate(ctx context.Context, id TagNameId) (result CreateOrUpdateOperationResponse, err error)

CreateOrUpdate ...

func (TagsClient) CreateOrUpdateAtScope

func (c TagsClient) CreateOrUpdateAtScope(ctx context.Context, id commonids.ScopeId, input TagsResource) (result CreateOrUpdateAtScopeOperationResponse, err error)

CreateOrUpdateAtScope ...

func (TagsClient) CreateOrUpdateAtScopeThenPoll

func (c TagsClient) CreateOrUpdateAtScopeThenPoll(ctx context.Context, id commonids.ScopeId, input TagsResource) error

CreateOrUpdateAtScopeThenPoll performs CreateOrUpdateAtScope then polls until it's completed

func (TagsClient) CreateOrUpdateValue

func (c TagsClient) CreateOrUpdateValue(ctx context.Context, id TagValueId) (result CreateOrUpdateValueOperationResponse, err error)

CreateOrUpdateValue ...

func (TagsClient) Delete

func (c TagsClient) Delete(ctx context.Context, id TagNameId) (result DeleteOperationResponse, err error)

Delete ...

func (TagsClient) DeleteAtScope

func (c TagsClient) DeleteAtScope(ctx context.Context, id commonids.ScopeId) (result DeleteAtScopeOperationResponse, err error)

DeleteAtScope ...

func (TagsClient) DeleteAtScopeThenPoll

func (c TagsClient) DeleteAtScopeThenPoll(ctx context.Context, id commonids.ScopeId) error

DeleteAtScopeThenPoll performs DeleteAtScope then polls until it's completed

func (TagsClient) DeleteValue

func (c TagsClient) DeleteValue(ctx context.Context, id TagValueId) (result DeleteValueOperationResponse, err error)

DeleteValue ...

func (TagsClient) GetAtScope

func (c TagsClient) GetAtScope(ctx context.Context, id commonids.ScopeId) (result GetAtScopeOperationResponse, err error)

GetAtScope ...

func (TagsClient) List

List ...

func (TagsClient) ListComplete

ListComplete retrieves all the results into a single object

func (TagsClient) ListCompleteMatchingPredicate

func (c TagsClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate TagDetailsOperationPredicate) (result ListCompleteResult, err error)

ListCompleteMatchingPredicate retrieves all the results and then applies the predicate

func (TagsClient) UpdateAtScope

func (c TagsClient) UpdateAtScope(ctx context.Context, id commonids.ScopeId, input TagsPatchResource) (result UpdateAtScopeOperationResponse, err error)

UpdateAtScope ...

func (TagsClient) UpdateAtScopeThenPoll

func (c TagsClient) UpdateAtScopeThenPoll(ctx context.Context, id commonids.ScopeId, input TagsPatchResource) error

UpdateAtScopeThenPoll performs UpdateAtScope then polls until it's completed

type TagsPatchOperation

type TagsPatchOperation string
const (
	TagsPatchOperationDelete  TagsPatchOperation = "Delete"
	TagsPatchOperationMerge   TagsPatchOperation = "Merge"
	TagsPatchOperationReplace TagsPatchOperation = "Replace"
)

func (*TagsPatchOperation) UnmarshalJSON

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

type TagsPatchResource

type TagsPatchResource struct {
	Operation  *TagsPatchOperation `json:"operation,omitempty"`
	Properties *Tags               `json:"properties,omitempty"`
}

type TagsResource

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

type UpdateAtScopeOperationResponse

type UpdateAtScopeOperationResponse struct {
	Poller       pollers.Poller
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *TagsResource
}

Jump to

Keyboard shortcuts

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