lots

package
v0.20231213.1191308 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2023 License: MPL-2.0 Imports: 12 Imported by: 1

README

github.com/hashicorp/go-azure-sdk/resource-manager/consumption/2021-10-01/lots Documentation

The lots SDK allows for interaction with the Azure Resource Manager Service consumption (API Version 2021-10-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/consumption/2021-10-01/lots"

Client Initialization

client := lots.NewLotsClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: LotsClient.ListByBillingAccount

ctx := context.TODO()
id := lots.NewBillingAccountID("billingAccountIdValue")

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

Example Usage: LotsClient.ListByBillingProfile

ctx := context.TODO()
id := lots.NewBillingProfileID("billingAccountIdValue", "billingProfileIdValue")

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

Example Usage: LotsClient.ListByCustomer

ctx := context.TODO()
id := lots.NewCustomerID("billingAccountIdValue", "customerIdValue")

// alternatively `client.ListByCustomer(ctx, id, lots.DefaultListByCustomerOperationOptions())` can be used to do batched pagination
items, err := client.ListByCustomerComplete(ctx, id, lots.DefaultListByCustomerOperationOptions())
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 PossibleValuesForLotSource

func PossibleValuesForLotSource() []string

func PossibleValuesForStatus

func PossibleValuesForStatus() []string

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

func ValidateCustomerID

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

ValidateCustomerID checks that 'input' can be parsed as a Customer ID

Types

type Amount

type Amount struct {
	Currency *string  `json:"currency,omitempty"`
	Value    *float64 `json:"value,omitempty"`
}

type AmountWithExchangeRate

type AmountWithExchangeRate struct {
	Currency          *string  `json:"currency,omitempty"`
	ExchangeRate      *float64 `json:"exchangeRate,omitempty"`
	ExchangeRateMonth *int64   `json:"exchangeRateMonth,omitempty"`
	Value             *float64 `json:"value,omitempty"`
}

type BillingAccountId

type BillingAccountId struct {
	BillingAccountId string
}

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

func NewBillingAccountID

func NewBillingAccountID(billingAccountId 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 added in v0.20231127.1171502

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 {
	BillingAccountId string
	BillingProfileId string
}

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

func NewBillingProfileID

func NewBillingProfileID(billingAccountId string, billingProfileId 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 added in v0.20231127.1171502

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 CustomerId

type CustomerId struct {
	BillingAccountId string
	CustomerId       string
}

CustomerId is a struct representing the Resource ID for a Customer

func NewCustomerID

func NewCustomerID(billingAccountId string, customerId string) CustomerId

NewCustomerID returns a new CustomerId struct

func ParseCustomerID

func ParseCustomerID(input string) (*CustomerId, error)

ParseCustomerID parses 'input' into a CustomerId

func ParseCustomerIDInsensitively

func ParseCustomerIDInsensitively(input string) (*CustomerId, error)

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

func (*CustomerId) FromParseResult added in v0.20231127.1171502

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

func (CustomerId) ID

func (id CustomerId) ID() string

ID returns the formatted Customer ID

func (CustomerId) Segments

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

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

func (CustomerId) String

func (id CustomerId) String() string

String returns a human-readable description of this Customer ID

type ListByBillingAccountCompleteResult

type ListByBillingAccountCompleteResult struct {
	Items []LotSummary
}

type ListByBillingAccountOperationOptions

type ListByBillingAccountOperationOptions struct {
	Filter *string
}

func DefaultListByBillingAccountOperationOptions

func DefaultListByBillingAccountOperationOptions() ListByBillingAccountOperationOptions

func (ListByBillingAccountOperationOptions) ToHeaders added in v0.20230411.1183115

func (ListByBillingAccountOperationOptions) ToOData added in v0.20230411.1183115

func (ListByBillingAccountOperationOptions) ToQuery added in v0.20230411.1183115

type ListByBillingAccountOperationResponse

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

type ListByBillingProfileCompleteResult

type ListByBillingProfileCompleteResult struct {
	Items []LotSummary
}

type ListByBillingProfileOperationResponse

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

type ListByCustomerCompleteResult

type ListByCustomerCompleteResult struct {
	Items []LotSummary
}

type ListByCustomerOperationOptions

type ListByCustomerOperationOptions struct {
	Filter *string
}

func DefaultListByCustomerOperationOptions

func DefaultListByCustomerOperationOptions() ListByCustomerOperationOptions

func (ListByCustomerOperationOptions) ToHeaders added in v0.20230411.1183115

func (ListByCustomerOperationOptions) ToOData added in v0.20230411.1183115

func (ListByCustomerOperationOptions) ToQuery added in v0.20230411.1183115

type ListByCustomerOperationResponse

type ListByCustomerOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *[]LotSummary
}

type LotProperties

type LotProperties struct {
	BillingCurrency                 *string                 `json:"billingCurrency,omitempty"`
	ClosedBalance                   *Amount                 `json:"closedBalance,omitempty"`
	ClosedBalanceInBillingCurrency  *AmountWithExchangeRate `json:"closedBalanceInBillingCurrency,omitempty"`
	CreditCurrency                  *string                 `json:"creditCurrency,omitempty"`
	ETag                            *string                 `json:"eTag,omitempty"`
	ExpirationDate                  *string                 `json:"expirationDate,omitempty"`
	OriginalAmount                  *Amount                 `json:"originalAmount,omitempty"`
	OriginalAmountInBillingCurrency *AmountWithExchangeRate `json:"originalAmountInBillingCurrency,omitempty"`
	PoNumber                        *string                 `json:"poNumber,omitempty"`
	PurchasedDate                   *string                 `json:"purchasedDate,omitempty"`
	Reseller                        *Reseller               `json:"reseller,omitempty"`
	Source                          *LotSource              `json:"source,omitempty"`
	StartDate                       *string                 `json:"startDate,omitempty"`
	Status                          *Status                 `json:"status,omitempty"`
}

func (*LotProperties) GetExpirationDateAsTime

func (o *LotProperties) GetExpirationDateAsTime() (*time.Time, error)

func (*LotProperties) GetPurchasedDateAsTime

func (o *LotProperties) GetPurchasedDateAsTime() (*time.Time, error)

func (*LotProperties) GetStartDateAsTime

func (o *LotProperties) GetStartDateAsTime() (*time.Time, error)

func (*LotProperties) SetExpirationDateAsTime

func (o *LotProperties) SetExpirationDateAsTime(input time.Time)

func (*LotProperties) SetPurchasedDateAsTime

func (o *LotProperties) SetPurchasedDateAsTime(input time.Time)

func (*LotProperties) SetStartDateAsTime

func (o *LotProperties) SetStartDateAsTime(input time.Time)

type LotSource

type LotSource string
const (
	LotSourceConsumptionCommitment LotSource = "ConsumptionCommitment"
	LotSourcePromotionalCredit     LotSource = "PromotionalCredit"
	LotSourcePurchasedCredit       LotSource = "PurchasedCredit"
)

func (*LotSource) UnmarshalJSON added in v0.20230411.1183115

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

type LotSummary

type LotSummary struct {
	ETag       *string        `json:"eTag,omitempty"`
	Id         *string        `json:"id,omitempty"`
	Name       *string        `json:"name,omitempty"`
	Properties *LotProperties `json:"properties,omitempty"`
	Type       *string        `json:"type,omitempty"`
}

type LotSummaryOperationPredicate

type LotSummaryOperationPredicate struct {
	ETag *string
	Id   *string
	Name *string
	Type *string
}

func (LotSummaryOperationPredicate) Matches

func (p LotSummaryOperationPredicate) Matches(input LotSummary) bool

type LotsClient

type LotsClient struct {
	Client *resourcemanager.Client
}

func NewLotsClientWithBaseURI

func NewLotsClientWithBaseURI(sdkApi sdkEnv.Api) (*LotsClient, error)

func (LotsClient) ListByBillingAccount

ListByBillingAccount ...

func (LotsClient) ListByBillingAccountComplete

ListByBillingAccountComplete retrieves all the results into a single object

func (LotsClient) ListByBillingAccountCompleteMatchingPredicate

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

ListByBillingAccountCompleteMatchingPredicate retrieves all the results and then applies the predicate

func (LotsClient) ListByBillingProfile

func (c LotsClient) ListByBillingProfile(ctx context.Context, id BillingProfileId) (result ListByBillingProfileOperationResponse, err error)

ListByBillingProfile ...

func (LotsClient) ListByBillingProfileComplete

func (c LotsClient) ListByBillingProfileComplete(ctx context.Context, id BillingProfileId) (ListByBillingProfileCompleteResult, error)

ListByBillingProfileComplete retrieves all the results into a single object

func (LotsClient) ListByBillingProfileCompleteMatchingPredicate

func (c LotsClient) ListByBillingProfileCompleteMatchingPredicate(ctx context.Context, id BillingProfileId, predicate LotSummaryOperationPredicate) (result ListByBillingProfileCompleteResult, err error)

ListByBillingProfileCompleteMatchingPredicate retrieves all the results and then applies the predicate

func (LotsClient) ListByCustomer

ListByCustomer ...

func (LotsClient) ListByCustomerComplete

ListByCustomerComplete retrieves all the results into a single object

func (LotsClient) ListByCustomerCompleteMatchingPredicate

func (c LotsClient) ListByCustomerCompleteMatchingPredicate(ctx context.Context, id CustomerId, options ListByCustomerOperationOptions, predicate LotSummaryOperationPredicate) (result ListByCustomerCompleteResult, err error)

ListByCustomerCompleteMatchingPredicate retrieves all the results and then applies the predicate

type Reseller

type Reseller struct {
	ResellerDescription *string `json:"resellerDescription,omitempty"`
	ResellerId          *string `json:"resellerId,omitempty"`
}

type Status

type Status string
const (
	StatusActive   Status = "Active"
	StatusCanceled Status = "Canceled"
	StatusComplete Status = "Complete"
	StatusExpired  Status = "Expired"
	StatusInactive Status = "Inactive"
	StatusNone     Status = "None"
)

func (*Status) UnmarshalJSON added in v0.20230411.1183115

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

Jump to

Keyboard shortcuts

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