savingsplan

package
v0.20241016.1080325 Latest Latest
Warning

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

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

README

github.com/hashicorp/go-azure-sdk/resource-manager/billing/2024-04-01/savingsplan Documentation

The savingsplan SDK allows for interaction with Azure Resource Manager billing (API Version 2024-04-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/2024-04-01/savingsplan"

Client Initialization

client := savingsplan.NewSavingsPlanClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: SavingsPlanClient.GetByBillingAccount

ctx := context.TODO()
id := savingsplan.NewSavingsPlanID("billingAccountName", "savingsPlanOrderId", "savingsPlanId")

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

Example Usage: SavingsPlanClient.ListByBillingAccount

ctx := context.TODO()
id := savingsplan.NewBillingAccountID("billingAccountName")

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

Example Usage: SavingsPlanClient.ListBySavingsPlanOrder

ctx := context.TODO()
id := savingsplan.NewSavingsPlanOrderID("billingAccountName", "savingsPlanOrderId")

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

Example Usage: SavingsPlanClient.UpdateByBillingAccount

ctx := context.TODO()
id := savingsplan.NewSavingsPlanID("billingAccountName", "savingsPlanOrderId", "savingsPlanId")

payload := savingsplan.SavingsPlanUpdateRequest{
	// ...
}


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

Example Usage: SavingsPlanClient.ValidateUpdateByBillingAccount

ctx := context.TODO()
id := savingsplan.NewSavingsPlanID("billingAccountName", "savingsPlanOrderId", "savingsPlanId")

payload := savingsplan.SavingsPlanUpdateValidateRequest{
	// ...
}


read, err := client.ValidateUpdateByBillingAccount(ctx, id, payload)
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 PossibleValuesForAppliedScopeType

func PossibleValuesForAppliedScopeType() []string

func PossibleValuesForBillingPlan

func PossibleValuesForBillingPlan() []string

func PossibleValuesForCommitmentGrain

func PossibleValuesForCommitmentGrain() []string

func PossibleValuesForProvisioningState

func PossibleValuesForProvisioningState() []string

func PossibleValuesForSavingsPlanTerm

func PossibleValuesForSavingsPlanTerm() []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 ValidateSavingsPlanID

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

ValidateSavingsPlanID checks that 'input' can be parsed as a Savings Plan ID

func ValidateSavingsPlanOrderID

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

ValidateSavingsPlanOrderID checks that 'input' can be parsed as a Savings Plan Order ID

Types

type AppliedScopeProperties

type AppliedScopeProperties struct {
	DisplayName       *string `json:"displayName,omitempty"`
	ManagementGroupId *string `json:"managementGroupId,omitempty"`
	ResourceGroupId   *string `json:"resourceGroupId,omitempty"`
	SubscriptionId    *string `json:"subscriptionId,omitempty"`
	TenantId          *string `json:"tenantId,omitempty"`
}

type AppliedScopeType

type AppliedScopeType string
const (
	AppliedScopeTypeManagementGroup AppliedScopeType = "ManagementGroup"
	AppliedScopeTypeShared          AppliedScopeType = "Shared"
	AppliedScopeTypeSingle          AppliedScopeType = "Single"
)

func (*AppliedScopeType) UnmarshalJSON

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

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 BillingPlan

type BillingPlan string
const (
	BillingPlanPOneM BillingPlan = "P1M"
)

func (*BillingPlan) UnmarshalJSON

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

type Commitment

type Commitment struct {
	Amount       *float64         `json:"amount,omitempty"`
	CurrencyCode *string          `json:"currencyCode,omitempty"`
	Grain        *CommitmentGrain `json:"grain,omitempty"`
}

type CommitmentGrain

type CommitmentGrain string
const (
	CommitmentGrainHourly CommitmentGrain = "Hourly"
)

func (*CommitmentGrain) UnmarshalJSON

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

type ExtendedStatusInfo

type ExtendedStatusInfo struct {
	Message    *string                       `json:"message,omitempty"`
	Properties *ExtendedStatusInfoProperties `json:"properties,omitempty"`
	StatusCode *string                       `json:"statusCode,omitempty"`
}

type ExtendedStatusInfoProperties

type ExtendedStatusInfoProperties struct {
	SubscriptionId *string `json:"subscriptionId,omitempty"`
}

type GetByBillingAccountOperationOptions

type GetByBillingAccountOperationOptions struct {
	Expand *string
}

func DefaultGetByBillingAccountOperationOptions

func DefaultGetByBillingAccountOperationOptions() GetByBillingAccountOperationOptions

func (GetByBillingAccountOperationOptions) ToHeaders

func (GetByBillingAccountOperationOptions) ToOData

func (GetByBillingAccountOperationOptions) ToQuery

type GetByBillingAccountOperationResponse

type GetByBillingAccountOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *SavingsPlanModel
}

type ListByBillingAccountCompleteResult

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

type ListByBillingAccountCustomPager added in v0.20240628.1153531

type ListByBillingAccountCustomPager struct {
	NextLink *odata.Link `json:"nextLink"`
}
func (p *ListByBillingAccountCustomPager) NextPageLink() *odata.Link

type ListByBillingAccountOperationOptions

type ListByBillingAccountOperationOptions struct {
	Filter         *string
	OrderBy        *string
	RefreshSummary *string
	SelectedState  *string
	Skiptoken      *int64
	Take           *int64
}

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        *[]SavingsPlanModel
}

type ListBySavingsPlanOrderCompleteResult

type ListBySavingsPlanOrderCompleteResult struct {
	LatestHttpResponse *http.Response
	Items              []SavingsPlanModel
}

type ListBySavingsPlanOrderCustomPager added in v0.20240628.1153531

type ListBySavingsPlanOrderCustomPager struct {
	NextLink *odata.Link `json:"nextLink"`
}
func (p *ListBySavingsPlanOrderCustomPager) NextPageLink() *odata.Link

type ListBySavingsPlanOrderOperationResponse

type ListBySavingsPlanOrderOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *[]SavingsPlanModel
}

type ProvisioningState

type ProvisioningState string
const (
	ProvisioningStateCanceled         ProvisioningState = "Canceled"
	ProvisioningStateConfirmedBilling ProvisioningState = "ConfirmedBilling"
	ProvisioningStateCreated          ProvisioningState = "Created"
	ProvisioningStateCreating         ProvisioningState = "Creating"
	ProvisioningStateExpired          ProvisioningState = "Expired"
	ProvisioningStateFailed           ProvisioningState = "Failed"
	ProvisioningStatePendingBilling   ProvisioningState = "PendingBilling"
	ProvisioningStateSucceeded        ProvisioningState = "Succeeded"
)

func (*ProvisioningState) UnmarshalJSON

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

type PurchaseRequest

type PurchaseRequest struct {
	Properties *PurchaseRequestProperties `json:"properties,omitempty"`
	Sku        *Sku                       `json:"sku,omitempty"`
}

type PurchaseRequestProperties

type PurchaseRequestProperties struct {
	AppliedScopeProperties *AppliedScopeProperties `json:"appliedScopeProperties,omitempty"`
	AppliedScopeType       *AppliedScopeType       `json:"appliedScopeType,omitempty"`
	BillingPlan            *BillingPlan            `json:"billingPlan,omitempty"`
	BillingScopeId         *string                 `json:"billingScopeId,omitempty"`
	Commitment             *Commitment             `json:"commitment,omitempty"`
	DisplayName            *string                 `json:"displayName,omitempty"`
	Renew                  *bool                   `json:"renew,omitempty"`
	Term                   *SavingsPlanTerm        `json:"term,omitempty"`
}

type RenewProperties

type RenewProperties struct {
	PurchaseProperties *PurchaseRequest `json:"purchaseProperties,omitempty"`
}

type SavingsPlanClient

type SavingsPlanClient struct {
	Client *resourcemanager.Client
}

func NewSavingsPlanClientWithBaseURI

func NewSavingsPlanClientWithBaseURI(sdkApi sdkEnv.Api) (*SavingsPlanClient, error)

func (SavingsPlanClient) GetByBillingAccount

GetByBillingAccount ...

func (SavingsPlanClient) ListByBillingAccount

ListByBillingAccount ...

func (SavingsPlanClient) ListByBillingAccountComplete

ListByBillingAccountComplete retrieves all the results into a single object

func (SavingsPlanClient) ListByBillingAccountCompleteMatchingPredicate

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

ListByBillingAccountCompleteMatchingPredicate retrieves all the results and then applies the predicate

func (SavingsPlanClient) ListBySavingsPlanOrder

func (c SavingsPlanClient) ListBySavingsPlanOrder(ctx context.Context, id SavingsPlanOrderId) (result ListBySavingsPlanOrderOperationResponse, err error)

ListBySavingsPlanOrder ...

func (SavingsPlanClient) ListBySavingsPlanOrderComplete

ListBySavingsPlanOrderComplete retrieves all the results into a single object

func (SavingsPlanClient) ListBySavingsPlanOrderCompleteMatchingPredicate

func (c SavingsPlanClient) ListBySavingsPlanOrderCompleteMatchingPredicate(ctx context.Context, id SavingsPlanOrderId, predicate SavingsPlanModelOperationPredicate) (result ListBySavingsPlanOrderCompleteResult, err error)

ListBySavingsPlanOrderCompleteMatchingPredicate retrieves all the results and then applies the predicate

func (SavingsPlanClient) UpdateByBillingAccount

UpdateByBillingAccount ...

func (SavingsPlanClient) UpdateByBillingAccountThenPoll

func (c SavingsPlanClient) UpdateByBillingAccountThenPoll(ctx context.Context, id SavingsPlanId, input SavingsPlanUpdateRequest) error

UpdateByBillingAccountThenPoll performs UpdateByBillingAccount then polls until it's completed

func (SavingsPlanClient) ValidateUpdateByBillingAccount

ValidateUpdateByBillingAccount ...

type SavingsPlanId

type SavingsPlanId struct {
	BillingAccountName string
	SavingsPlanOrderId string
	SavingsPlanId      string
}

SavingsPlanId is a struct representing the Resource ID for a Savings Plan

func NewSavingsPlanID

func NewSavingsPlanID(billingAccountName string, savingsPlanOrderId string, savingsPlanId string) SavingsPlanId

NewSavingsPlanID returns a new SavingsPlanId struct

func ParseSavingsPlanID

func ParseSavingsPlanID(input string) (*SavingsPlanId, error)

ParseSavingsPlanID parses 'input' into a SavingsPlanId

func ParseSavingsPlanIDInsensitively

func ParseSavingsPlanIDInsensitively(input string) (*SavingsPlanId, error)

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

func (*SavingsPlanId) FromParseResult

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

func (SavingsPlanId) ID

func (id SavingsPlanId) ID() string

ID returns the formatted Savings Plan ID

func (SavingsPlanId) Segments

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

Segments returns a slice of Resource ID Segments which comprise this Savings Plan ID

func (SavingsPlanId) String

func (id SavingsPlanId) String() string

String returns a human-readable description of this Savings Plan ID

type SavingsPlanModel

type SavingsPlanModel struct {
	Id         *string                     `json:"id,omitempty"`
	Name       *string                     `json:"name,omitempty"`
	Properties *SavingsPlanModelProperties `json:"properties,omitempty"`
	Sku        Sku                         `json:"sku"`
	SystemData *systemdata.SystemData      `json:"systemData,omitempty"`
	Tags       *map[string]string          `json:"tags,omitempty"`
	Type       *string                     `json:"type,omitempty"`
}

type SavingsPlanModelOperationPredicate

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

func (SavingsPlanModelOperationPredicate) Matches

type SavingsPlanModelProperties

type SavingsPlanModelProperties struct {
	AppliedScopeProperties       *AppliedScopeProperties `json:"appliedScopeProperties,omitempty"`
	AppliedScopeType             *AppliedScopeType       `json:"appliedScopeType,omitempty"`
	BenefitStartTime             *string                 `json:"benefitStartTime,omitempty"`
	BillingAccountId             *string                 `json:"billingAccountId,omitempty"`
	BillingPlan                  *BillingPlan            `json:"billingPlan,omitempty"`
	BillingProfileId             *string                 `json:"billingProfileId,omitempty"`
	BillingScopeId               *string                 `json:"billingScopeId,omitempty"`
	Commitment                   *Commitment             `json:"commitment,omitempty"`
	CustomerId                   *string                 `json:"customerId,omitempty"`
	DisplayName                  *string                 `json:"displayName,omitempty"`
	DisplayProvisioningState     *string                 `json:"displayProvisioningState,omitempty"`
	EffectiveDateTime            *string                 `json:"effectiveDateTime,omitempty"`
	ExpiryDateTime               *string                 `json:"expiryDateTime,omitempty"`
	ExtendedStatusInfo           *ExtendedStatusInfo     `json:"extendedStatusInfo,omitempty"`
	ProductCode                  *string                 `json:"productCode,omitempty"`
	ProvisioningState            *ProvisioningState      `json:"provisioningState,omitempty"`
	PurchaseDateTime             *string                 `json:"purchaseDateTime,omitempty"`
	Renew                        *bool                   `json:"renew,omitempty"`
	RenewDestination             *string                 `json:"renewDestination,omitempty"`
	RenewProperties              *RenewProperties        `json:"renewProperties,omitempty"`
	RenewSource                  *string                 `json:"renewSource,omitempty"`
	Term                         *SavingsPlanTerm        `json:"term,omitempty"`
	UserFriendlyAppliedScopeType *string                 `json:"userFriendlyAppliedScopeType,omitempty"`
	Utilization                  *Utilization            `json:"utilization,omitempty"`
}

func (*SavingsPlanModelProperties) GetBenefitStartTimeAsTime

func (o *SavingsPlanModelProperties) GetBenefitStartTimeAsTime() (*time.Time, error)

func (*SavingsPlanModelProperties) GetEffectiveDateTimeAsTime

func (o *SavingsPlanModelProperties) GetEffectiveDateTimeAsTime() (*time.Time, error)

func (*SavingsPlanModelProperties) GetExpiryDateTimeAsTime

func (o *SavingsPlanModelProperties) GetExpiryDateTimeAsTime() (*time.Time, error)

func (*SavingsPlanModelProperties) GetPurchaseDateTimeAsTime

func (o *SavingsPlanModelProperties) GetPurchaseDateTimeAsTime() (*time.Time, error)

func (*SavingsPlanModelProperties) SetBenefitStartTimeAsTime

func (o *SavingsPlanModelProperties) SetBenefitStartTimeAsTime(input time.Time)

func (*SavingsPlanModelProperties) SetEffectiveDateTimeAsTime

func (o *SavingsPlanModelProperties) SetEffectiveDateTimeAsTime(input time.Time)

func (*SavingsPlanModelProperties) SetExpiryDateTimeAsTime

func (o *SavingsPlanModelProperties) SetExpiryDateTimeAsTime(input time.Time)

func (*SavingsPlanModelProperties) SetPurchaseDateTimeAsTime

func (o *SavingsPlanModelProperties) SetPurchaseDateTimeAsTime(input time.Time)

type SavingsPlanOrderId

type SavingsPlanOrderId struct {
	BillingAccountName string
	SavingsPlanOrderId string
}

SavingsPlanOrderId is a struct representing the Resource ID for a Savings Plan Order

func NewSavingsPlanOrderID

func NewSavingsPlanOrderID(billingAccountName string, savingsPlanOrderId string) SavingsPlanOrderId

NewSavingsPlanOrderID returns a new SavingsPlanOrderId struct

func ParseSavingsPlanOrderID

func ParseSavingsPlanOrderID(input string) (*SavingsPlanOrderId, error)

ParseSavingsPlanOrderID parses 'input' into a SavingsPlanOrderId

func ParseSavingsPlanOrderIDInsensitively

func ParseSavingsPlanOrderIDInsensitively(input string) (*SavingsPlanOrderId, error)

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

func (*SavingsPlanOrderId) FromParseResult

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

func (SavingsPlanOrderId) ID

func (id SavingsPlanOrderId) ID() string

ID returns the formatted Savings Plan Order ID

func (SavingsPlanOrderId) Segments

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

Segments returns a slice of Resource ID Segments which comprise this Savings Plan Order ID

func (SavingsPlanOrderId) String

func (id SavingsPlanOrderId) String() string

String returns a human-readable description of this Savings Plan Order ID

type SavingsPlanTerm

type SavingsPlanTerm string
const (
	SavingsPlanTermPFiveY  SavingsPlanTerm = "P5Y"
	SavingsPlanTermPOneY   SavingsPlanTerm = "P1Y"
	SavingsPlanTermPThreeY SavingsPlanTerm = "P3Y"
)

func (*SavingsPlanTerm) UnmarshalJSON

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

type SavingsPlanUpdateRequest

type SavingsPlanUpdateRequest struct {
	Properties *SavingsPlanUpdateRequestProperties `json:"properties,omitempty"`
	Sku        *Sku                                `json:"sku,omitempty"`
	Tags       *map[string]string                  `json:"tags,omitempty"`
}

type SavingsPlanUpdateRequestProperties

type SavingsPlanUpdateRequestProperties struct {
	AppliedScopeProperties *AppliedScopeProperties `json:"appliedScopeProperties,omitempty"`
	AppliedScopeType       *AppliedScopeType       `json:"appliedScopeType,omitempty"`
	DisplayName            *string                 `json:"displayName,omitempty"`
	Renew                  *bool                   `json:"renew,omitempty"`
	RenewProperties        *RenewProperties        `json:"renewProperties,omitempty"`
}

type SavingsPlanUpdateValidateRequest

type SavingsPlanUpdateValidateRequest struct {
	Benefits *[]SavingsPlanUpdateRequestProperties `json:"benefits,omitempty"`
}

type SavingsPlanValidResponseProperty

type SavingsPlanValidResponseProperty struct {
	Reason     *string `json:"reason,omitempty"`
	ReasonCode *string `json:"reasonCode,omitempty"`
	Valid      *bool   `json:"valid,omitempty"`
}

type SavingsPlanValidateResponse

type SavingsPlanValidateResponse struct {
	Benefits *[]SavingsPlanValidResponseProperty `json:"benefits,omitempty"`
	NextLink *string                             `json:"nextLink,omitempty"`
}

type Sku

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

type UpdateByBillingAccountOperationResponse

type UpdateByBillingAccountOperationResponse struct {
	Poller       pollers.Poller
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *SavingsPlanModel
}

type Utilization

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

type UtilizationAggregates

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

type ValidateUpdateByBillingAccountOperationResponse

type ValidateUpdateByBillingAccountOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *SavingsPlanValidateResponse
}

Jump to

Keyboard shortcuts

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