tokens

package
v0.20240327.1161949 Latest Latest
Warning

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

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

README

github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2022-12-01/tokens Documentation

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

Client Initialization

client := tokens.NewTokensClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: TokensClient.Create

ctx := context.TODO()
id := tokens.NewTokenID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue", "tokenValue")

payload := tokens.Token{
	// ...
}


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

Example Usage: TokensClient.Delete

ctx := context.TODO()
id := tokens.NewTokenID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue", "tokenValue")

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

Example Usage: TokensClient.Get

ctx := context.TODO()
id := tokens.NewTokenID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue", "tokenValue")

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: TokensClient.List

ctx := context.TODO()
id := tokens.NewRegistryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue")

// 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: TokensClient.Update

ctx := context.TODO()
id := tokens.NewTokenID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue", "tokenValue")

payload := tokens.TokenUpdateParameters{
	// ...
}


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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PossibleValuesForProvisioningState

func PossibleValuesForProvisioningState() []string

func PossibleValuesForTokenCertificateName

func PossibleValuesForTokenCertificateName() []string

func PossibleValuesForTokenPasswordName

func PossibleValuesForTokenPasswordName() []string

func PossibleValuesForTokenStatus

func PossibleValuesForTokenStatus() []string

func ValidateRegistryID

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

ValidateRegistryID checks that 'input' can be parsed as a Registry ID

func ValidateTokenID

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

ValidateTokenID checks that 'input' can be parsed as a Token ID

Types

type CreateOperationResponse

type CreateOperationResponse struct {
	Poller       pollers.Poller
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *Token
}

type DeleteOperationResponse

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

type GetOperationResponse

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

type ListCompleteResult

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

type ListOperationResponse

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

type ProvisioningState

type ProvisioningState string
const (
	ProvisioningStateCanceled  ProvisioningState = "Canceled"
	ProvisioningStateCreating  ProvisioningState = "Creating"
	ProvisioningStateDeleting  ProvisioningState = "Deleting"
	ProvisioningStateFailed    ProvisioningState = "Failed"
	ProvisioningStateSucceeded ProvisioningState = "Succeeded"
	ProvisioningStateUpdating  ProvisioningState = "Updating"
)

func (*ProvisioningState) UnmarshalJSON

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

type RegistryId

type RegistryId struct {
	SubscriptionId    string
	ResourceGroupName string
	RegistryName      string
}

RegistryId is a struct representing the Resource ID for a Registry

func NewRegistryID

func NewRegistryID(subscriptionId string, resourceGroupName string, registryName string) RegistryId

NewRegistryID returns a new RegistryId struct

func ParseRegistryID

func ParseRegistryID(input string) (*RegistryId, error)

ParseRegistryID parses 'input' into a RegistryId

func ParseRegistryIDInsensitively

func ParseRegistryIDInsensitively(input string) (*RegistryId, error)

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

func (*RegistryId) FromParseResult

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

func (RegistryId) ID

func (id RegistryId) ID() string

ID returns the formatted Registry ID

func (RegistryId) Segments

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

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

func (RegistryId) String

func (id RegistryId) String() string

String returns a human-readable description of this Registry ID

type Token

type Token struct {
	Id         *string                `json:"id,omitempty"`
	Name       *string                `json:"name,omitempty"`
	Properties *TokenProperties       `json:"properties,omitempty"`
	SystemData *systemdata.SystemData `json:"systemData,omitempty"`
	Type       *string                `json:"type,omitempty"`
}

type TokenCertificate

type TokenCertificate struct {
	EncodedPemCertificate *string               `json:"encodedPemCertificate,omitempty"`
	Expiry                *string               `json:"expiry,omitempty"`
	Name                  *TokenCertificateName `json:"name,omitempty"`
	Thumbprint            *string               `json:"thumbprint,omitempty"`
}

func (*TokenCertificate) GetExpiryAsTime

func (o *TokenCertificate) GetExpiryAsTime() (*time.Time, error)

func (*TokenCertificate) SetExpiryAsTime

func (o *TokenCertificate) SetExpiryAsTime(input time.Time)

type TokenCertificateName

type TokenCertificateName string
const (
	TokenCertificateNameCertificateOne TokenCertificateName = "certificate1"
	TokenCertificateNameCertificateTwo TokenCertificateName = "certificate2"
)

func (*TokenCertificateName) UnmarshalJSON

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

type TokenCredentialsProperties

type TokenCredentialsProperties struct {
	Certificates *[]TokenCertificate `json:"certificates,omitempty"`
	Passwords    *[]TokenPassword    `json:"passwords,omitempty"`
}

type TokenId

type TokenId struct {
	SubscriptionId    string
	ResourceGroupName string
	RegistryName      string
	TokenName         string
}

TokenId is a struct representing the Resource ID for a Token

func NewTokenID

func NewTokenID(subscriptionId string, resourceGroupName string, registryName string, tokenName string) TokenId

NewTokenID returns a new TokenId struct

func ParseTokenID

func ParseTokenID(input string) (*TokenId, error)

ParseTokenID parses 'input' into a TokenId

func ParseTokenIDInsensitively

func ParseTokenIDInsensitively(input string) (*TokenId, error)

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

func (*TokenId) FromParseResult

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

func (TokenId) ID

func (id TokenId) ID() string

ID returns the formatted Token ID

func (TokenId) Segments

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

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

func (TokenId) String

func (id TokenId) String() string

String returns a human-readable description of this Token ID

type TokenOperationPredicate

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

func (TokenOperationPredicate) Matches

func (p TokenOperationPredicate) Matches(input Token) bool

type TokenPassword

type TokenPassword struct {
	CreationTime *string            `json:"creationTime,omitempty"`
	Expiry       *string            `json:"expiry,omitempty"`
	Name         *TokenPasswordName `json:"name,omitempty"`
	Value        *string            `json:"value,omitempty"`
}

func (*TokenPassword) GetCreationTimeAsTime

func (o *TokenPassword) GetCreationTimeAsTime() (*time.Time, error)

func (*TokenPassword) GetExpiryAsTime

func (o *TokenPassword) GetExpiryAsTime() (*time.Time, error)

func (*TokenPassword) SetCreationTimeAsTime

func (o *TokenPassword) SetCreationTimeAsTime(input time.Time)

func (*TokenPassword) SetExpiryAsTime

func (o *TokenPassword) SetExpiryAsTime(input time.Time)

type TokenPasswordName

type TokenPasswordName string
const (
	TokenPasswordNamePasswordOne TokenPasswordName = "password1"
	TokenPasswordNamePasswordTwo TokenPasswordName = "password2"
)

func (*TokenPasswordName) UnmarshalJSON

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

type TokenProperties

type TokenProperties struct {
	CreationDate      *string                     `json:"creationDate,omitempty"`
	Credentials       *TokenCredentialsProperties `json:"credentials,omitempty"`
	ProvisioningState *ProvisioningState          `json:"provisioningState,omitempty"`
	ScopeMapId        *string                     `json:"scopeMapId,omitempty"`
	Status            *TokenStatus                `json:"status,omitempty"`
}

func (*TokenProperties) GetCreationDateAsTime

func (o *TokenProperties) GetCreationDateAsTime() (*time.Time, error)

func (*TokenProperties) SetCreationDateAsTime

func (o *TokenProperties) SetCreationDateAsTime(input time.Time)

type TokenStatus

type TokenStatus string
const (
	TokenStatusDisabled TokenStatus = "disabled"
	TokenStatusEnabled  TokenStatus = "enabled"
)

func (*TokenStatus) UnmarshalJSON

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

type TokenUpdateParameters

type TokenUpdateParameters struct {
	Properties *TokenUpdateProperties `json:"properties,omitempty"`
}

type TokenUpdateProperties

type TokenUpdateProperties struct {
	Credentials *TokenCredentialsProperties `json:"credentials,omitempty"`
	ScopeMapId  *string                     `json:"scopeMapId,omitempty"`
	Status      *TokenStatus                `json:"status,omitempty"`
}

type TokensClient

type TokensClient struct {
	Client *resourcemanager.Client
}

func NewTokensClientWithBaseURI

func NewTokensClientWithBaseURI(sdkApi sdkEnv.Api) (*TokensClient, error)

func (TokensClient) Create

func (c TokensClient) Create(ctx context.Context, id TokenId, input Token) (result CreateOperationResponse, err error)

Create ...

func (TokensClient) CreateThenPoll

func (c TokensClient) CreateThenPoll(ctx context.Context, id TokenId, input Token) error

CreateThenPoll performs Create then polls until it's completed

func (TokensClient) Delete

func (c TokensClient) Delete(ctx context.Context, id TokenId) (result DeleteOperationResponse, err error)

Delete ...

func (TokensClient) DeleteThenPoll

func (c TokensClient) DeleteThenPoll(ctx context.Context, id TokenId) error

DeleteThenPoll performs Delete then polls until it's completed

func (TokensClient) Get

func (c TokensClient) Get(ctx context.Context, id TokenId) (result GetOperationResponse, err error)

Get ...

func (TokensClient) List

func (c TokensClient) List(ctx context.Context, id RegistryId) (result ListOperationResponse, err error)

List ...

func (TokensClient) ListComplete

func (c TokensClient) ListComplete(ctx context.Context, id RegistryId) (ListCompleteResult, error)

ListComplete retrieves all the results into a single object

func (TokensClient) ListCompleteMatchingPredicate

func (c TokensClient) ListCompleteMatchingPredicate(ctx context.Context, id RegistryId, predicate TokenOperationPredicate) (result ListCompleteResult, err error)

ListCompleteMatchingPredicate retrieves all the results and then applies the predicate

func (TokensClient) Update

Update ...

func (TokensClient) UpdateThenPoll

func (c TokensClient) UpdateThenPoll(ctx context.Context, id TokenId, input TokenUpdateParameters) error

UpdateThenPoll performs Update then polls until it's completed

type UpdateOperationResponse

type UpdateOperationResponse struct {
	Poller       pollers.Poller
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *Token
}

Jump to

Keyboard shortcuts

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