cache

package
v0.20240522.1080424 Latest Latest
Warning

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

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

README

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

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

Client Initialization

client := cache.NewCacheClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: CacheClient.CreateOrUpdate

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

payload := cache.CacheContract{
	// ...
}


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

Example Usage: CacheClient.Delete

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

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

Example Usage: CacheClient.Get

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

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: CacheClient.GetEntityTag

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

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: CacheClient.ListByService

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

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

Example Usage: CacheClient.Update

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

payload := cache.CacheUpdateParameters{
	// ...
}


read, err := client.Update(ctx, id, payload, cache.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 ValidateCacheID

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

ValidateCacheID checks that 'input' can be parsed as a Cache ID

func ValidateServiceID

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

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

Types

type CacheClient

type CacheClient struct {
	Client *resourcemanager.Client
}

func NewCacheClientWithBaseURI

func NewCacheClientWithBaseURI(sdkApi sdkEnv.Api) (*CacheClient, error)

func (CacheClient) CreateOrUpdate

CreateOrUpdate ...

func (CacheClient) Delete

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

Delete ...

func (CacheClient) Get

func (c CacheClient) Get(ctx context.Context, id CacheId) (result GetOperationResponse, err error)

Get ...

func (CacheClient) GetEntityTag

func (c CacheClient) GetEntityTag(ctx context.Context, id CacheId) (result GetEntityTagOperationResponse, err error)

GetEntityTag ...

func (CacheClient) ListByService

ListByService ...

func (CacheClient) ListByServiceComplete

ListByServiceComplete retrieves all the results into a single object

func (CacheClient) ListByServiceCompleteMatchingPredicate

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

ListByServiceCompleteMatchingPredicate retrieves all the results and then applies the predicate

func (CacheClient) Update

Update ...

type CacheContract

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

type CacheContractOperationPredicate

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

func (CacheContractOperationPredicate) Matches

type CacheContractProperties

type CacheContractProperties struct {
	ConnectionString string  `json:"connectionString"`
	Description      *string `json:"description,omitempty"`
	ResourceId       *string `json:"resourceId,omitempty"`
	UseFromLocation  string  `json:"useFromLocation"`
}

type CacheId

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

CacheId is a struct representing the Resource ID for a Cache

func NewCacheID

func NewCacheID(subscriptionId string, resourceGroupName string, serviceName string, cacheId string) CacheId

NewCacheID returns a new CacheId struct

func ParseCacheID

func ParseCacheID(input string) (*CacheId, error)

ParseCacheID parses 'input' into a CacheId

func ParseCacheIDInsensitively

func ParseCacheIDInsensitively(input string) (*CacheId, error)

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

func (*CacheId) FromParseResult

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

func (CacheId) ID

func (id CacheId) ID() string

ID returns the formatted Cache ID

func (CacheId) Segments

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

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

func (CacheId) String

func (id CacheId) String() string

String returns a human-readable description of this Cache ID

type CacheUpdateParameters

type CacheUpdateParameters struct {
	Properties *CacheUpdateProperties `json:"properties,omitempty"`
}

type CacheUpdateProperties

type CacheUpdateProperties struct {
	ConnectionString *string `json:"connectionString,omitempty"`
	Description      *string `json:"description,omitempty"`
	ResourceId       *string `json:"resourceId,omitempty"`
	UseFromLocation  *string `json:"useFromLocation,omitempty"`
}

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

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 GetOperationResponse

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

type ListByServiceCompleteResult

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

type ListByServiceOperationOptions

type ListByServiceOperationOptions struct {
	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        *[]CacheContract
}

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

Jump to

Keyboard shortcuts

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