cacherules

package
v0.20231214.1160726 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2023 License: MPL-2.0 Imports: 14 Imported by: 0

README

github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules Documentation

The cacherules SDK allows for interaction with the Azure Resource Manager Service containerregistry (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-sdk/resource-manager/containerregistry/2023-07-01/cacherules"

Client Initialization

client := cacherules.NewCacheRulesClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: CacheRulesClient.Create

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

payload := cacherules.CacheRule{
	// ...
}


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

Example Usage: CacheRulesClient.Delete

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

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

Example Usage: CacheRulesClient.Get

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

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

ctx := context.TODO()
id := cacherules.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: CacheRulesClient.Update

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

payload := cacherules.CacheRuleUpdateParameters{
	// ...
}


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 ValidateCacheRuleID

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

ValidateCacheRuleID checks that 'input' can be parsed as a Cache Rule ID

func ValidateRegistryID

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

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

Types

type CacheRule

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

type CacheRuleId

type CacheRuleId struct {
	SubscriptionId    string
	ResourceGroupName string
	RegistryName      string
	CacheRuleName     string
}

CacheRuleId is a struct representing the Resource ID for a Cache Rule

func NewCacheRuleID

func NewCacheRuleID(subscriptionId string, resourceGroupName string, registryName string, cacheRuleName string) CacheRuleId

NewCacheRuleID returns a new CacheRuleId struct

func ParseCacheRuleID

func ParseCacheRuleID(input string) (*CacheRuleId, error)

ParseCacheRuleID parses 'input' into a CacheRuleId

func ParseCacheRuleIDInsensitively

func ParseCacheRuleIDInsensitively(input string) (*CacheRuleId, error)

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

func (*CacheRuleId) FromParseResult added in v0.20231127.1171502

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

func (CacheRuleId) ID

func (id CacheRuleId) ID() string

ID returns the formatted Cache Rule ID

func (CacheRuleId) Segments

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

Segments returns a slice of Resource ID Segments which comprise this Cache Rule ID

func (CacheRuleId) String

func (id CacheRuleId) String() string

String returns a human-readable description of this Cache Rule ID

type CacheRuleOperationPredicate

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

func (CacheRuleOperationPredicate) Matches

func (p CacheRuleOperationPredicate) Matches(input CacheRule) bool

type CacheRuleProperties

type CacheRuleProperties struct {
	CreationDate            *string            `json:"creationDate,omitempty"`
	CredentialSetResourceId *string            `json:"credentialSetResourceId,omitempty"`
	ProvisioningState       *ProvisioningState `json:"provisioningState,omitempty"`
	SourceRepository        *string            `json:"sourceRepository,omitempty"`
	TargetRepository        *string            `json:"targetRepository,omitempty"`
}

func (*CacheRuleProperties) GetCreationDateAsTime

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

func (*CacheRuleProperties) SetCreationDateAsTime

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

type CacheRuleUpdateParameters

type CacheRuleUpdateParameters struct {
	Properties *CacheRuleUpdateProperties `json:"properties,omitempty"`
}

type CacheRuleUpdateProperties

type CacheRuleUpdateProperties struct {
	CredentialSetResourceId *string `json:"credentialSetResourceId,omitempty"`
}

type CacheRulesClient

type CacheRulesClient struct {
	Client *resourcemanager.Client
}

func NewCacheRulesClientWithBaseURI

func NewCacheRulesClientWithBaseURI(sdkApi sdkEnv.Api) (*CacheRulesClient, error)

func (CacheRulesClient) Create

func (c CacheRulesClient) Create(ctx context.Context, id CacheRuleId, input CacheRule) (result CreateOperationResponse, err error)

Create ...

func (CacheRulesClient) CreateThenPoll

func (c CacheRulesClient) CreateThenPoll(ctx context.Context, id CacheRuleId, input CacheRule) error

CreateThenPoll performs Create then polls until it's completed

func (CacheRulesClient) Delete

func (c CacheRulesClient) Delete(ctx context.Context, id CacheRuleId) (result DeleteOperationResponse, err error)

Delete ...

func (CacheRulesClient) DeleteThenPoll

func (c CacheRulesClient) DeleteThenPoll(ctx context.Context, id CacheRuleId) error

DeleteThenPoll performs Delete then polls until it's completed

func (CacheRulesClient) Get

Get ...

func (CacheRulesClient) List

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

List ...

func (CacheRulesClient) ListComplete

ListComplete retrieves all the results into a single object

func (CacheRulesClient) ListCompleteMatchingPredicate

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

ListCompleteMatchingPredicate retrieves all the results and then applies the predicate

func (CacheRulesClient) Update

Update ...

func (CacheRulesClient) UpdateThenPoll

UpdateThenPoll performs Update then polls until it's completed

type CreateOperationResponse

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

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        *CacheRule
}

type ListCompleteResult

type ListCompleteResult struct {
	Items []CacheRule
}

type ListOperationResponse

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

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 added in v0.20231127.1171502

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 UpdateOperationResponse

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

Jump to

Keyboard shortcuts

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