pricesheet

package
v0.20240617.1095803 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2024 License: MPL-2.0 Imports: 15 Imported by: 0

README

github.com/hashicorp/go-azure-sdk/resource-manager/consumption/2023-11-01/pricesheet Documentation

The pricesheet SDK allows for interaction with the Azure Resource Manager Service consumption (API Version 2023-11-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-helpers/resourcemanager/commonids"
import "github.com/hashicorp/go-azure-sdk/resource-manager/consumption/2023-11-01/pricesheet"

Client Initialization

client := pricesheet.NewPriceSheetClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: PriceSheetClient.DownloadByBillingAccountPeriod

ctx := context.TODO()
id := pricesheet.NewBillingAccountBillingPeriodID("billingAccountIdValue", "billingPeriodValue")

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

Example Usage: PriceSheetClient.Get

ctx := context.TODO()
id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012")

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

Example Usage: PriceSheetClient.GetByBillingPeriod

ctx := context.TODO()
id := pricesheet.NewBillingPeriodID("12345678-1234-9876-4563-123456789012", "billingPeriodValue")

read, err := client.GetByBillingPeriod(ctx, id, pricesheet.DefaultGetByBillingPeriodOperationOptions())
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 PossibleValuesForOperationStatusType

func PossibleValuesForOperationStatusType() []string

func ValidateBillingAccountBillingPeriodID

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

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

func ValidateBillingPeriodID

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

ValidateBillingPeriodID checks that 'input' can be parsed as a Billing Period ID

Types

type BillingAccountBillingPeriodId

type BillingAccountBillingPeriodId struct {
	BillingAccountId  string
	BillingPeriodName string
}

BillingAccountBillingPeriodId is a struct representing the Resource ID for a Billing Account Billing Period

func NewBillingAccountBillingPeriodID

func NewBillingAccountBillingPeriodID(billingAccountId string, billingPeriodName string) BillingAccountBillingPeriodId

NewBillingAccountBillingPeriodID returns a new BillingAccountBillingPeriodId struct

func ParseBillingAccountBillingPeriodID

func ParseBillingAccountBillingPeriodID(input string) (*BillingAccountBillingPeriodId, error)

ParseBillingAccountBillingPeriodID parses 'input' into a BillingAccountBillingPeriodId

func ParseBillingAccountBillingPeriodIDInsensitively

func ParseBillingAccountBillingPeriodIDInsensitively(input string) (*BillingAccountBillingPeriodId, error)

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

func (*BillingAccountBillingPeriodId) FromParseResult

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

func (BillingAccountBillingPeriodId) ID

ID returns the formatted Billing Account Billing Period ID

func (BillingAccountBillingPeriodId) Segments

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

func (BillingAccountBillingPeriodId) String

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

type BillingPeriodId

type BillingPeriodId struct {
	SubscriptionId    string
	BillingPeriodName string
}

BillingPeriodId is a struct representing the Resource ID for a Billing Period

func NewBillingPeriodID

func NewBillingPeriodID(subscriptionId string, billingPeriodName string) BillingPeriodId

NewBillingPeriodID returns a new BillingPeriodId struct

func ParseBillingPeriodID

func ParseBillingPeriodID(input string) (*BillingPeriodId, error)

ParseBillingPeriodID parses 'input' into a BillingPeriodId

func ParseBillingPeriodIDInsensitively

func ParseBillingPeriodIDInsensitively(input string) (*BillingPeriodId, error)

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

func (*BillingPeriodId) FromParseResult

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

func (BillingPeriodId) ID

func (id BillingPeriodId) ID() string

ID returns the formatted Billing Period ID

func (BillingPeriodId) Segments

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

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

func (BillingPeriodId) String

func (id BillingPeriodId) String() string

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

type DownloadByBillingAccountPeriodOperationResponse

type DownloadByBillingAccountPeriodOperationResponse struct {
	Poller       pollers.Poller
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *OperationStatus
}

type GetByBillingPeriodOperationOptions

type GetByBillingPeriodOperationOptions struct {
	Expand *string
	Top    *int64
}

func DefaultGetByBillingPeriodOperationOptions

func DefaultGetByBillingPeriodOperationOptions() GetByBillingPeriodOperationOptions

func (GetByBillingPeriodOperationOptions) ToHeaders

func (GetByBillingPeriodOperationOptions) ToOData

func (GetByBillingPeriodOperationOptions) ToQuery

type GetByBillingPeriodOperationResponse

type GetByBillingPeriodOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *PriceSheetResult
}

type GetOperationOptions

type GetOperationOptions struct {
	Expand *string
	Top    *int64
}

func DefaultGetOperationOptions

func DefaultGetOperationOptions() GetOperationOptions

func (GetOperationOptions) ToHeaders

func (o GetOperationOptions) ToHeaders() *client.Headers

func (GetOperationOptions) ToOData

func (o GetOperationOptions) ToOData() *odata.Query

func (GetOperationOptions) ToQuery

func (o GetOperationOptions) ToQuery() *client.QueryParams

type GetOperationResponse

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

type MeterDetails

type MeterDetails struct {
	MeterCategory         *string  `json:"meterCategory,omitempty"`
	MeterLocation         *string  `json:"meterLocation,omitempty"`
	MeterName             *string  `json:"meterName,omitempty"`
	MeterSubCategory      *string  `json:"meterSubCategory,omitempty"`
	PretaxStandardRate    *float64 `json:"pretaxStandardRate,omitempty"`
	ServiceName           *string  `json:"serviceName,omitempty"`
	ServiceTier           *string  `json:"serviceTier,omitempty"`
	TotalIncludedQuantity *float64 `json:"totalIncludedQuantity,omitempty"`
	Unit                  *string  `json:"unit,omitempty"`
}

type OperationStatus

type OperationStatus struct {
	Properties *PricesheetDownloadProperties `json:"properties,omitempty"`
	Status     *OperationStatusType          `json:"status,omitempty"`
}

type OperationStatusType

type OperationStatusType string
const (
	OperationStatusTypeCompleted OperationStatusType = "Completed"
	OperationStatusTypeFailed    OperationStatusType = "Failed"
	OperationStatusTypeRunning   OperationStatusType = "Running"
)

func (*OperationStatusType) UnmarshalJSON

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

type PriceSheetClient

type PriceSheetClient struct {
	Client *resourcemanager.Client
}

func NewPriceSheetClientWithBaseURI

func NewPriceSheetClientWithBaseURI(sdkApi sdkEnv.Api) (*PriceSheetClient, error)

func (PriceSheetClient) DownloadByBillingAccountPeriod

DownloadByBillingAccountPeriod ...

func (PriceSheetClient) DownloadByBillingAccountPeriodThenPoll

func (c PriceSheetClient) DownloadByBillingAccountPeriodThenPoll(ctx context.Context, id BillingAccountBillingPeriodId) error

DownloadByBillingAccountPeriodThenPoll performs DownloadByBillingAccountPeriod then polls until it's completed

func (PriceSheetClient) Get

Get ...

func (PriceSheetClient) GetByBillingPeriod

GetByBillingPeriod ...

type PriceSheetModel

type PriceSheetModel struct {
	Download    *MeterDetails           `json:"download,omitempty"`
	NextLink    *string                 `json:"nextLink,omitempty"`
	Pricesheets *[]PriceSheetProperties `json:"pricesheets,omitempty"`
}

type PriceSheetProperties

type PriceSheetProperties struct {
	BillingPeriodId  *string       `json:"billingPeriodId,omitempty"`
	CurrencyCode     *string       `json:"currencyCode,omitempty"`
	IncludedQuantity *float64      `json:"includedQuantity,omitempty"`
	MeterDetails     *MeterDetails `json:"meterDetails,omitempty"`
	MeterId          *string       `json:"meterId,omitempty"`
	OfferId          *string       `json:"offerId,omitempty"`
	PartNumber       *string       `json:"partNumber,omitempty"`
	SavingsPlan      *SavingsPlan  `json:"savingsPlan,omitempty"`
	UnitOfMeasure    *string       `json:"unitOfMeasure,omitempty"`
	UnitPrice        *float64      `json:"unitPrice,omitempty"`
}

type PriceSheetResult

type PriceSheetResult struct {
	Etag       *string            `json:"etag,omitempty"`
	Id         *string            `json:"id,omitempty"`
	Name       *string            `json:"name,omitempty"`
	Properties *PriceSheetModel   `json:"properties,omitempty"`
	Tags       *map[string]string `json:"tags,omitempty"`
	Type       *string            `json:"type,omitempty"`
}

type PricesheetDownloadProperties

type PricesheetDownloadProperties struct {
	DownloadUrl *string `json:"downloadUrl,omitempty"`
	ValidTill   *string `json:"validTill,omitempty"`
}

func (*PricesheetDownloadProperties) GetValidTillAsTime

func (o *PricesheetDownloadProperties) GetValidTillAsTime() (*time.Time, error)

func (*PricesheetDownloadProperties) SetValidTillAsTime

func (o *PricesheetDownloadProperties) SetValidTillAsTime(input time.Time)

type SavingsPlan

type SavingsPlan struct {
	EffectivePrice *float64 `json:"effectivePrice,omitempty"`
	MarketPrice    *float64 `json:"marketPrice,omitempty"`
	Term           *string  `json:"term,omitempty"`
}

Jump to

Keyboard shortcuts

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