subscriptionusages

package
v0.20240227.1165506 Latest Latest
Warning

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

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

README

github.com/hashicorp/go-azure-sdk/resource-manager/sql/2023-05-01-preview/subscriptionusages Documentation

The subscriptionusages SDK allows for interaction with the Azure Resource Manager Service sql (API Version 2023-05-01-preview).

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/sql/2023-05-01-preview/subscriptionusages"

Client Initialization

client := subscriptionusages.NewSubscriptionUsagesClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: SubscriptionUsagesClient.Get

ctx := context.TODO()
id := subscriptionusages.NewUsageID("12345678-1234-9876-4563-123456789012", "locationValue", "usageValue")

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: SubscriptionUsagesClient.ListByLocation

ctx := context.TODO()
id := subscriptionusages.NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue")

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateLocationID

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

ValidateLocationID checks that 'input' can be parsed as a Location ID

func ValidateUsageID

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

ValidateUsageID checks that 'input' can be parsed as a Usage ID

Types

type GetOperationResponse

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

type ListByLocationCompleteResult

type ListByLocationCompleteResult struct {
	LatestHttpResponse *http.Response
	Items              []SubscriptionUsage
}

type ListByLocationOperationResponse

type ListByLocationOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *[]SubscriptionUsage
}

type LocationId

type LocationId struct {
	SubscriptionId string
	LocationName   string
}

LocationId is a struct representing the Resource ID for a Location

func NewLocationID

func NewLocationID(subscriptionId string, locationName string) LocationId

NewLocationID returns a new LocationId struct

func ParseLocationID

func ParseLocationID(input string) (*LocationId, error)

ParseLocationID parses 'input' into a LocationId

func ParseLocationIDInsensitively

func ParseLocationIDInsensitively(input string) (*LocationId, error)

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

func (*LocationId) FromParseResult

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

func (LocationId) ID

func (id LocationId) ID() string

ID returns the formatted Location ID

func (LocationId) Segments

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

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

func (LocationId) String

func (id LocationId) String() string

String returns a human-readable description of this Location ID

type SubscriptionUsage

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

type SubscriptionUsageOperationPredicate

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

func (SubscriptionUsageOperationPredicate) Matches

type SubscriptionUsageProperties

type SubscriptionUsageProperties struct {
	CurrentValue *float64 `json:"currentValue,omitempty"`
	DisplayName  *string  `json:"displayName,omitempty"`
	Limit        *float64 `json:"limit,omitempty"`
	Unit         *string  `json:"unit,omitempty"`
}

type SubscriptionUsagesClient

type SubscriptionUsagesClient struct {
	Client *resourcemanager.Client
}

func NewSubscriptionUsagesClientWithBaseURI

func NewSubscriptionUsagesClientWithBaseURI(sdkApi sdkEnv.Api) (*SubscriptionUsagesClient, error)

func (SubscriptionUsagesClient) Get

Get ...

func (SubscriptionUsagesClient) ListByLocation

ListByLocation ...

func (SubscriptionUsagesClient) ListByLocationComplete

ListByLocationComplete retrieves all the results into a single object

func (SubscriptionUsagesClient) ListByLocationCompleteMatchingPredicate

func (c SubscriptionUsagesClient) ListByLocationCompleteMatchingPredicate(ctx context.Context, id LocationId, predicate SubscriptionUsageOperationPredicate) (result ListByLocationCompleteResult, err error)

ListByLocationCompleteMatchingPredicate retrieves all the results and then applies the predicate

type UsageId

type UsageId struct {
	SubscriptionId string
	LocationName   string
	UsageName      string
}

UsageId is a struct representing the Resource ID for a Usage

func NewUsageID

func NewUsageID(subscriptionId string, locationName string, usageName string) UsageId

NewUsageID returns a new UsageId struct

func ParseUsageID

func ParseUsageID(input string) (*UsageId, error)

ParseUsageID parses 'input' into a UsageId

func ParseUsageIDInsensitively

func ParseUsageIDInsensitively(input string) (*UsageId, error)

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

func (*UsageId) FromParseResult

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

func (UsageId) ID

func (id UsageId) ID() string

ID returns the formatted Usage ID

func (UsageId) Segments

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

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

func (UsageId) String

func (id UsageId) String() string

String returns a human-readable description of this Usage ID

Jump to

Keyboard shortcuts

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