reservations

package
v0.20240125.1172517 Latest Latest
Warning

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

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

README

github.com/hashicorp/go-azure-sdk/resource-manager/billing/2020-05-01/reservations Documentation

The reservations SDK allows for interaction with the Azure Resource Manager Service billing (API Version 2020-05-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/billing/2020-05-01/reservations"

Client Initialization

client := reservations.NewReservationsClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: ReservationsClient.ListByBillingAccount

ctx := context.TODO()
id := reservations.NewBillingAccountID("billingAccountValue")

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

Example Usage: ReservationsClient.ListByBillingProfile

ctx := context.TODO()
id := reservations.NewBillingProfileID("billingAccountValue", "billingProfileValue")

// alternatively `client.ListByBillingProfile(ctx, id, reservations.DefaultListByBillingProfileOperationOptions())` can be used to do batched pagination
items, err := client.ListByBillingProfileComplete(ctx, id, reservations.DefaultListByBillingProfileOperationOptions())
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 ValidateBillingAccountID

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

ValidateBillingAccountID checks that 'input' can be parsed as a Billing Account ID

func ValidateBillingProfileID

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

ValidateBillingProfileID checks that 'input' can be parsed as a Billing Profile ID

Types

type BillingAccountId

type BillingAccountId struct {
	BillingAccountName string
}

BillingAccountId is a struct representing the Resource ID for a Billing Account

func NewBillingAccountID

func NewBillingAccountID(billingAccountName string) BillingAccountId

NewBillingAccountID returns a new BillingAccountId struct

func ParseBillingAccountID

func ParseBillingAccountID(input string) (*BillingAccountId, error)

ParseBillingAccountID parses 'input' into a BillingAccountId

func ParseBillingAccountIDInsensitively

func ParseBillingAccountIDInsensitively(input string) (*BillingAccountId, error)

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

func (*BillingAccountId) FromParseResult

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

func (BillingAccountId) ID

func (id BillingAccountId) ID() string

ID returns the formatted Billing Account ID

func (BillingAccountId) Segments

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

Segments returns a slice of Resource ID Segments which comprise this Billing Account ID

func (BillingAccountId) String

func (id BillingAccountId) String() string

String returns a human-readable description of this Billing Account ID

type BillingProfileId

type BillingProfileId struct {
	BillingAccountName string
	BillingProfileName string
}

BillingProfileId is a struct representing the Resource ID for a Billing Profile

func NewBillingProfileID

func NewBillingProfileID(billingAccountName string, billingProfileName string) BillingProfileId

NewBillingProfileID returns a new BillingProfileId struct

func ParseBillingProfileID

func ParseBillingProfileID(input string) (*BillingProfileId, error)

ParseBillingProfileID parses 'input' into a BillingProfileId

func ParseBillingProfileIDInsensitively

func ParseBillingProfileIDInsensitively(input string) (*BillingProfileId, error)

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

func (*BillingProfileId) FromParseResult

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

func (BillingProfileId) ID

func (id BillingProfileId) ID() string

ID returns the formatted Billing Profile ID

func (BillingProfileId) Segments

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

Segments returns a slice of Resource ID Segments which comprise this Billing Profile ID

func (BillingProfileId) String

func (id BillingProfileId) String() string

String returns a human-readable description of this Billing Profile ID

type ListByBillingAccountCompleteResult

type ListByBillingAccountCompleteResult struct {
	LatestHttpResponse *http.Response
	Items              []Reservation
}

type ListByBillingAccountOperationOptions

type ListByBillingAccountOperationOptions struct {
	Filter         *string
	Orderby        *string
	RefreshSummary *string
	SelectedState  *string
}

func DefaultListByBillingAccountOperationOptions

func DefaultListByBillingAccountOperationOptions() ListByBillingAccountOperationOptions

func (ListByBillingAccountOperationOptions) ToHeaders

func (ListByBillingAccountOperationOptions) ToOData

func (ListByBillingAccountOperationOptions) ToQuery

type ListByBillingAccountOperationResponse

type ListByBillingAccountOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *[]Reservation
}

type ListByBillingProfileCompleteResult

type ListByBillingProfileCompleteResult struct {
	LatestHttpResponse *http.Response
	Items              []Reservation
}

type ListByBillingProfileOperationOptions

type ListByBillingProfileOperationOptions struct {
	Filter         *string
	Orderby        *string
	RefreshSummary *string
	SelectedState  *string
}

func DefaultListByBillingProfileOperationOptions

func DefaultListByBillingProfileOperationOptions() ListByBillingProfileOperationOptions

func (ListByBillingProfileOperationOptions) ToHeaders

func (ListByBillingProfileOperationOptions) ToOData

func (ListByBillingProfileOperationOptions) ToQuery

type ListByBillingProfileOperationResponse

type ListByBillingProfileOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *[]Reservation
}

type Reservation

type Reservation struct {
	Id         *string                 `json:"id,omitempty"`
	Location   *string                 `json:"location,omitempty"`
	Name       *string                 `json:"name,omitempty"`
	Properties *ReservationProperty    `json:"properties,omitempty"`
	Sku        *ReservationSkuProperty `json:"sku,omitempty"`
	Type       *string                 `json:"type,omitempty"`
}

type ReservationOperationPredicate

type ReservationOperationPredicate struct {
	Id       *string
	Location *string
	Name     *string
	Type     *string
}

func (ReservationOperationPredicate) Matches

type ReservationProperty

type ReservationProperty struct {
	AppliedScopeType             *string                         `json:"appliedScopeType,omitempty"`
	AppliedScopes                *[]string                       `json:"appliedScopes,omitempty"`
	DisplayName                  *string                         `json:"displayName,omitempty"`
	DisplayProvisioningState     *string                         `json:"displayProvisioningState,omitempty"`
	EffectiveDateTime            *string                         `json:"effectiveDateTime,omitempty"`
	ExpiryDate                   *string                         `json:"expiryDate,omitempty"`
	ProvisioningState            *string                         `json:"provisioningState,omitempty"`
	ProvisioningSubState         *string                         `json:"provisioningSubState,omitempty"`
	Quantity                     *float64                        `json:"quantity,omitempty"`
	Renew                        *bool                           `json:"renew,omitempty"`
	RenewSource                  *string                         `json:"renewSource,omitempty"`
	ReservedResourceType         *string                         `json:"reservedResourceType,omitempty"`
	SkuDescription               *string                         `json:"skuDescription,omitempty"`
	Term                         *string                         `json:"term,omitempty"`
	UserFriendlyAppliedScopeType *string                         `json:"userFriendlyAppliedScopeType,omitempty"`
	UserFriendlyRenewState       *string                         `json:"userFriendlyRenewState,omitempty"`
	Utilization                  *ReservationPropertyUtilization `json:"utilization,omitempty"`
}

type ReservationPropertyUtilization

type ReservationPropertyUtilization struct {
	Aggregates *[]ReservationUtilizationAggregates `json:"aggregates,omitempty"`
	Trend      *string                             `json:"trend,omitempty"`
}

type ReservationSkuProperty

type ReservationSkuProperty struct {
	Name *string `json:"name,omitempty"`
}

type ReservationUtilizationAggregates

type ReservationUtilizationAggregates struct {
	Grain     *float64 `json:"grain,omitempty"`
	GrainUnit *string  `json:"grainUnit,omitempty"`
	Value     *float64 `json:"value,omitempty"`
	ValueUnit *string  `json:"valueUnit,omitempty"`
}

type ReservationsClient

type ReservationsClient struct {
	Client *resourcemanager.Client
}

func NewReservationsClientWithBaseURI

func NewReservationsClientWithBaseURI(sdkApi sdkEnv.Api) (*ReservationsClient, error)

func (ReservationsClient) ListByBillingAccount

ListByBillingAccount ...

func (ReservationsClient) ListByBillingAccountComplete

ListByBillingAccountComplete retrieves all the results into a single object

func (ReservationsClient) ListByBillingAccountCompleteMatchingPredicate

func (c ReservationsClient) ListByBillingAccountCompleteMatchingPredicate(ctx context.Context, id BillingAccountId, options ListByBillingAccountOperationOptions, predicate ReservationOperationPredicate) (result ListByBillingAccountCompleteResult, err error)

ListByBillingAccountCompleteMatchingPredicate retrieves all the results and then applies the predicate

func (ReservationsClient) ListByBillingProfile

ListByBillingProfile ...

func (ReservationsClient) ListByBillingProfileComplete

ListByBillingProfileComplete retrieves all the results into a single object

func (ReservationsClient) ListByBillingProfileCompleteMatchingPredicate

func (c ReservationsClient) ListByBillingProfileCompleteMatchingPredicate(ctx context.Context, id BillingProfileId, options ListByBillingProfileOperationOptions, predicate ReservationOperationPredicate) (result ListByBillingProfileCompleteResult, err error)

ListByBillingProfileCompleteMatchingPredicate retrieves all the results and then applies the predicate

Jump to

Keyboard shortcuts

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