armbillingbenefits

package module
v2.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2023 License: MIT Imports: 15 Imported by: 1

README

Azure Billingbenefits Module for Go

PkgGoDev

The armbillingbenefits module provides operations for working with Azure Billingbenefits.

Source code

Getting started

Prerequisites

  • an Azure subscription
  • Go 1.18 or above (You could download and install the latest version of Go from here. It will replace the existing Go on your machine. If you want to install multiple Go versions on the same machine, you could refer this doc.)

Install the package

This project uses Go modules for versioning and dependency management.

Install the Azure Billingbenefits module:

go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/billingbenefits/armbillingbenefits

Authorization

When creating a client, you will need to provide a credential for authenticating with Azure Billingbenefits. The azidentity module provides facilities for various ways of authenticating with Azure including client/secret, certificate, managed identity, and more.

cred, err := azidentity.NewDefaultAzureCredential(nil)

For more information on authentication, please see the documentation for azidentity at pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity.

Client Factory

Azure Billingbenefits module consists of one or more clients. We provide a client factory which could be used to create any client in this module.

clientFactory, err := armbillingbenefits.NewClientFactory(<subscription ID>, cred, nil)

You can use ClientOptions in package github.com/Azure/azure-sdk-for-go/sdk/azcore/arm to set endpoint to connect with public and sovereign clouds as well as Azure Stack. For more information, please see the documentation for azcore at pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azcore.

options := arm.ClientOptions {
    ClientOptions: azcore.ClientOptions {
        Cloud: cloud.AzureChina,
    },
}
clientFactory, err := armbillingbenefits.NewClientFactory(<subscription ID>, cred, &options)

Clients

A client groups a set of related APIs, providing access to its functionality. Create one or more clients to access the APIs you require using client factory.

client := clientFactory.NewRPClient()

Fakes

The fake package contains types used for constructing in-memory fake servers used in unit tests. This allows writing tests to cover various success/error conditions without the need for connecting to a live service.

Please see https://github.com/Azure/azure-sdk-for-go/tree/main/sdk/samples/fakes for details and examples on how to use fakes.

Provide Feedback

If you encounter bugs or have suggestions, please open an issue and assign the Billingbenefits label.

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information, see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActionType

type ActionType string

ActionType - Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs.

const (
	ActionTypeInternal ActionType = "Internal"
)

func PossibleActionTypeValues

func PossibleActionTypeValues() []ActionType

PossibleActionTypeValues returns the possible values for the ActionType const type.

type AppliedScopeProperties

type AppliedScopeProperties struct {
	// Display name
	DisplayName *string

	// Fully-qualified identifier of the management group where the benefit must be applied.
	ManagementGroupID *string

	// Fully-qualified identifier of the resource group.
	ResourceGroupID *string

	// Fully-qualified identifier of the subscription.
	SubscriptionID *string

	// Tenant ID where the benefit is applied.
	TenantID *string
}

AppliedScopeProperties - Properties specific to applied scope type. Not required if not applicable.

func (AppliedScopeProperties) MarshalJSON

func (a AppliedScopeProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type AppliedScopeProperties.

func (*AppliedScopeProperties) UnmarshalJSON

func (a *AppliedScopeProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type AppliedScopeProperties.

type AppliedScopeType

type AppliedScopeType string

AppliedScopeType - Type of the Applied Scope.

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

func PossibleAppliedScopeTypeValues

func PossibleAppliedScopeTypeValues() []AppliedScopeType

PossibleAppliedScopeTypeValues returns the possible values for the AppliedScopeType const type.

type BillingPlan

type BillingPlan string

BillingPlan - Represents the billing plan in ISO 8601 format. Required only for monthly billing plans.

const (
	BillingPlanP1M BillingPlan = "P1M"
)

func PossibleBillingPlanValues

func PossibleBillingPlanValues() []BillingPlan

PossibleBillingPlanValues returns the possible values for the BillingPlan const type.

type BillingPlanInformation

type BillingPlanInformation struct {
	// For recurring billing plans, indicates the date when next payment will be processed. Null when total is paid off.
	NextPaymentDueDate *time.Time

	// Amount of money to be paid for the Order. Tax is not included.
	PricingCurrencyTotal *Price

	// Date when the billing plan has started.
	StartDate    *time.Time
	Transactions []*PaymentDetail
}

BillingPlanInformation - Information describing the type of billing plan for this savings plan.

func (BillingPlanInformation) MarshalJSON

func (b BillingPlanInformation) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type BillingPlanInformation.

func (*BillingPlanInformation) UnmarshalJSON

func (b *BillingPlanInformation) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type BillingPlanInformation.

type ClientFactory

type ClientFactory struct {
	// contains filtered or unexported fields
}

ClientFactory is a client factory used to create any client in this module. Don't use this type directly, use NewClientFactory instead.

func NewClientFactory

func NewClientFactory(credential azcore.TokenCredential, options *arm.ClientOptions) (*ClientFactory, error)

NewClientFactory creates a new instance of ClientFactory with the specified values. The parameter values will be propagated to any client created from this factory.

  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*ClientFactory) NewOperationsClient

func (c *ClientFactory) NewOperationsClient() *OperationsClient

NewOperationsClient creates a new instance of OperationsClient.

func (*ClientFactory) NewRPClient

func (c *ClientFactory) NewRPClient() *RPClient

NewRPClient creates a new instance of RPClient.

func (*ClientFactory) NewReservationOrderAliasClient

func (c *ClientFactory) NewReservationOrderAliasClient() *ReservationOrderAliasClient

NewReservationOrderAliasClient creates a new instance of ReservationOrderAliasClient.

func (*ClientFactory) NewSavingsPlanClient

func (c *ClientFactory) NewSavingsPlanClient() *SavingsPlanClient

NewSavingsPlanClient creates a new instance of SavingsPlanClient.

func (*ClientFactory) NewSavingsPlanOrderAliasClient

func (c *ClientFactory) NewSavingsPlanOrderAliasClient() *SavingsPlanOrderAliasClient

NewSavingsPlanOrderAliasClient creates a new instance of SavingsPlanOrderAliasClient.

func (*ClientFactory) NewSavingsPlanOrderClient

func (c *ClientFactory) NewSavingsPlanOrderClient() *SavingsPlanOrderClient

NewSavingsPlanOrderClient creates a new instance of SavingsPlanOrderClient.

type Commitment

type Commitment struct {
	Amount *float64

	// The ISO 4217 3-letter currency code for the currency used by this purchase record.
	CurrencyCode *string

	// Commitment grain.
	Grain *CommitmentGrain
}

Commitment towards the benefit.

func (Commitment) MarshalJSON

func (c Commitment) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type Commitment.

func (*Commitment) UnmarshalJSON

func (c *Commitment) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type Commitment.

type CommitmentGrain

type CommitmentGrain string

CommitmentGrain - Commitment grain.

const (
	CommitmentGrainHourly CommitmentGrain = "Hourly"
)

func PossibleCommitmentGrainValues

func PossibleCommitmentGrainValues() []CommitmentGrain

PossibleCommitmentGrainValues returns the possible values for the CommitmentGrain const type.

type CreatedByType

type CreatedByType string

CreatedByType - The type of identity that created the resource.

const (
	CreatedByTypeApplication     CreatedByType = "Application"
	CreatedByTypeKey             CreatedByType = "Key"
	CreatedByTypeManagedIdentity CreatedByType = "ManagedIdentity"
	CreatedByTypeUser            CreatedByType = "User"
)

func PossibleCreatedByTypeValues

func PossibleCreatedByTypeValues() []CreatedByType

PossibleCreatedByTypeValues returns the possible values for the CreatedByType const type.

type ExtendedStatusInfo

type ExtendedStatusInfo struct {
	// The message giving detailed information about the status code.
	Message *string

	// Status code providing additional information.
	StatusCode *string
}

func (ExtendedStatusInfo) MarshalJSON

func (e ExtendedStatusInfo) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ExtendedStatusInfo.

func (*ExtendedStatusInfo) UnmarshalJSON

func (e *ExtendedStatusInfo) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ExtendedStatusInfo.

type InstanceFlexibility

type InstanceFlexibility string

InstanceFlexibility - Turning this on will apply the reservation discount to other VMs in the same VM size group.

const (
	InstanceFlexibilityOff InstanceFlexibility = "Off"
	InstanceFlexibilityOn  InstanceFlexibility = "On"
)

func PossibleInstanceFlexibilityValues

func PossibleInstanceFlexibilityValues() []InstanceFlexibility

PossibleInstanceFlexibilityValues returns the possible values for the InstanceFlexibility const type.

type Operation

type Operation struct {
	// Localized display information for this particular operation.
	Display *OperationDisplay

	// READ-ONLY; Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs.
	ActionType *ActionType

	// READ-ONLY; Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for ARM/control-plane
	// operations.
	IsDataAction *bool

	// READ-ONLY; The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write",
	// "Microsoft.Compute/virtualMachines/capture/action"
	Name *string

	// READ-ONLY; The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default
	// value is "user,system"
	Origin *Origin
}

Operation - Details of a REST API operation, returned from the Resource Provider Operations API

func (Operation) MarshalJSON

func (o Operation) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type Operation.

func (*Operation) UnmarshalJSON

func (o *Operation) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type Operation.

type OperationDisplay

type OperationDisplay struct {
	// READ-ONLY; The short, localized friendly description of the operation; suitable for tool tips and detailed views.
	Description *string

	// READ-ONLY; The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual
	// Machine", "Restart Virtual Machine".
	Operation *string

	// READ-ONLY; The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft
	// Compute".
	Provider *string

	// READ-ONLY; The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job
	// Schedule Collections".
	Resource *string
}

OperationDisplay - Localized display information for this particular operation.

func (OperationDisplay) MarshalJSON

func (o OperationDisplay) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type OperationDisplay.

func (*OperationDisplay) UnmarshalJSON

func (o *OperationDisplay) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type OperationDisplay.

type OperationListResult

type OperationListResult struct {
	// READ-ONLY; URL to get the next set of operation list results (if there are any).
	NextLink *string

	// READ-ONLY; List of operations supported by the resource provider
	Value []*Operation
}

OperationListResult - A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results.

func (OperationListResult) MarshalJSON

func (o OperationListResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type OperationListResult.

func (*OperationListResult) UnmarshalJSON

func (o *OperationListResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type OperationListResult.

type OperationsClient

type OperationsClient struct {
	// contains filtered or unexported fields
}

OperationsClient contains the methods for the Operations group. Don't use this type directly, use NewOperationsClient() instead.

func NewOperationsClient

func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*OperationsClient, error)

NewOperationsClient creates a new instance of OperationsClient with the specified values.

  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*OperationsClient) NewListPager

NewListPager - List all the operations.

Generated from API version 2022-11-01

  • options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/OperationsGet.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armbillingbenefits.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewOperationsClient().NewListPager(nil)
for pager.More() {
	page, err := pager.NextPage(ctx)
	if err != nil {
		log.Fatalf("failed to advance page: %v", err)
	}
	for _, v := range page.Value {
		// You could use page here. We use blank identifier for just demo purposes.
		_ = v
	}
	// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// page.OperationListResult = armbillingbenefits.OperationListResult{
	// 	Value: []*armbillingbenefits.Operation{
	// 		{
	// 			Name: to.Ptr("Microsoft.BillingBenefits/savingsPlanOrderAliases/read"),
	// 			Display: &armbillingbenefits.OperationDisplay{
	// 				Description: to.Ptr("Read all savings plan order aliases"),
	// 				Operation: to.Ptr("Get Savings plan order alias"),
	// 				Provider: to.Ptr("Microsoft Benefits"),
	// 				Resource: to.Ptr("SavingsPlanOrderAliases"),
	// 			},
	// 		},
	// 		{
	// 			Name: to.Ptr("Microsoft.BillingBenefits/savingsPlanOrderAliases/write"),
	// 			Display: &armbillingbenefits.OperationDisplay{
	// 				Description: to.Ptr("Create a Savings plan order alias"),
	// 				Operation: to.Ptr("Create SavingsPlanOrderAliases"),
	// 				Provider: to.Ptr("Microsoft Benefits"),
	// 				Resource: to.Ptr("SavingsPlanOrderAliases"),
	// 			},
	// 		},
	// 		{
	// 			Name: to.Ptr("Microsoft.BillingBenefits/savingsPlanOrders/read"),
	// 			Display: &armbillingbenefits.OperationDisplay{
	// 				Description: to.Ptr("Read all savings plan orders"),
	// 				Operation: to.Ptr("Get Savings plan orders"),
	// 				Provider: to.Ptr("Microsoft Benefits"),
	// 				Resource: to.Ptr("SavingsPlanOrders"),
	// 			},
	// 		},
	// 		{
	// 			Name: to.Ptr("Microsoft.BillingBenefits/savingsPlanOrders/write"),
	// 			Display: &armbillingbenefits.OperationDisplay{
	// 				Description: to.Ptr("Patch a Savings plan order"),
	// 				Operation: to.Ptr("Patch SavingsPlanOrders"),
	// 				Provider: to.Ptr("Microsoft Benefits"),
	// 				Resource: to.Ptr("SavingsPlanOrders"),
	// 			},
	// 		},
	// 		{
	// 			Name: to.Ptr("Microsoft.BillingBenefits/savingsPlanOrders/action"),
	// 			Display: &armbillingbenefits.OperationDisplay{
	// 				Description: to.Ptr("Update a Savings plan order"),
	// 				Operation: to.Ptr("Update SavingsPlanOrders"),
	// 				Provider: to.Ptr("Microsoft Benefits"),
	// 				Resource: to.Ptr("SavingsPlanOrders"),
	// 			},
	// 		},
	// 		{
	// 			Name: to.Ptr("Microsoft.BillingBenefits/savingsPlanOrders/savingsPlans/read"),
	// 			Display: &armbillingbenefits.OperationDisplay{
	// 				Description: to.Ptr("Read All SavingsPlans"),
	// 				Operation: to.Ptr("Get SavingsPlans"),
	// 				Provider: to.Ptr("Microsoft Benefits"),
	// 				Resource: to.Ptr("SavingsPlans"),
	// 			},
	// 		},
	// 		{
	// 			Name: to.Ptr("Microsoft.BillingBenefits/savingsPlanOrders/savingsPlans/write"),
	// 			Display: &armbillingbenefits.OperationDisplay{
	// 				Description: to.Ptr("Patch an existing Savings plan"),
	// 				Operation: to.Ptr("Patch SavingsPlans"),
	// 				Provider: to.Ptr("Microsoft Benefits"),
	// 				Resource: to.Ptr("SavingsPlans"),
	// 			},
	// 		},
	// 		{
	// 			Name: to.Ptr("Microsoft.BillingBenefits/register/action"),
	// 			Display: &armbillingbenefits.OperationDisplay{
	// 				Description: to.Ptr("Registers the Benefits resource provider and enables the creation of Benefits resources."),
	// 				Operation: to.Ptr("Registers the Benefits Resource Provider."),
	// 				Provider: to.Ptr("Microsoft Benefits"),
	// 				Resource: to.Ptr("SavingsPlans"),
	// 			},
	// 	}},
	// }
}
Output:

type OperationsClientListOptions

type OperationsClientListOptions struct {
}

OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method.

type OperationsClientListResponse

type OperationsClientListResponse struct {
	// A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results.
	OperationListResult
}

OperationsClientListResponse contains the response from method OperationsClient.NewListPager.

type Origin

type Origin string

Origin - The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system"

const (
	OriginSystem     Origin = "system"
	OriginUser       Origin = "user"
	OriginUserSystem Origin = "user,system"
)

func PossibleOriginValues

func PossibleOriginValues() []Origin

PossibleOriginValues returns the possible values for the Origin const type.

type PaymentDetail

type PaymentDetail struct {
	// Billing account
	BillingAccount *string

	// Amount charged in Billing currency. Tax not included. Is null for future payments
	BillingCurrencyTotal *Price

	// Date when the payment needs to be done.
	DueDate *time.Time

	// Date when the transaction is completed. Is null when it is scheduled.
	PaymentDate *time.Time

	// Amount in pricing currency. Tax not included.
	PricingCurrencyTotal *Price

	// Describes whether the payment is completed, failed, cancelled or scheduled in the future.
	Status *PaymentStatus

	// READ-ONLY
	ExtendedStatusInfo *ExtendedStatusInfo
}

PaymentDetail - Information about payment related to a savings plan order.

func (PaymentDetail) MarshalJSON

func (p PaymentDetail) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type PaymentDetail.

func (*PaymentDetail) UnmarshalJSON

func (p *PaymentDetail) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type PaymentDetail.

type PaymentStatus

type PaymentStatus string

PaymentStatus - Describes whether the payment is completed, failed, cancelled or scheduled in the future.

const (
	PaymentStatusCancelled PaymentStatus = "Cancelled"
	PaymentStatusFailed    PaymentStatus = "Failed"
	PaymentStatusScheduled PaymentStatus = "Scheduled"
	PaymentStatusSucceeded PaymentStatus = "Succeeded"
)

func PossiblePaymentStatusValues

func PossiblePaymentStatusValues() []PaymentStatus

PossiblePaymentStatusValues returns the possible values for the PaymentStatus const type.

type Price

type Price struct {
	Amount *float64

	// The ISO 4217 3-letter currency code for the currency used by this purchase record.
	CurrencyCode *string
}

func (Price) MarshalJSON

func (p Price) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type Price.

func (*Price) UnmarshalJSON

func (p *Price) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type Price.

type ProvisioningState

type ProvisioningState string

ProvisioningState - Provisioning state

const (
	ProvisioningStateCancelled        ProvisioningState = "Cancelled"
	ProvisioningStateConfirmedBilling ProvisioningState = "ConfirmedBilling"
	ProvisioningStateCreated          ProvisioningState = "Created"
	ProvisioningStateCreating         ProvisioningState = "Creating"
	ProvisioningStateExpired          ProvisioningState = "Expired"
	ProvisioningStateFailed           ProvisioningState = "Failed"
	ProvisioningStatePendingBilling   ProvisioningState = "PendingBilling"
	ProvisioningStateSucceeded        ProvisioningState = "Succeeded"
)

func PossibleProvisioningStateValues

func PossibleProvisioningStateValues() []ProvisioningState

PossibleProvisioningStateValues returns the possible values for the ProvisioningState const type.

type PurchaseRequest

type PurchaseRequest struct {
	Properties *PurchaseRequestProperties

	// The SKU to be applied for this resource
	SKU *SKU
}

func (PurchaseRequest) MarshalJSON

func (p PurchaseRequest) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type PurchaseRequest.

func (*PurchaseRequest) UnmarshalJSON

func (p *PurchaseRequest) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type PurchaseRequest.

type PurchaseRequestProperties

type PurchaseRequestProperties struct {
	// Properties specific to applied scope type. Not required if not applicable.
	AppliedScopeProperties *AppliedScopeProperties

	// Type of the Applied Scope.
	AppliedScopeType *AppliedScopeType

	// Represents the billing plan in ISO 8601 format. Required only for monthly billing plans.
	BillingPlan *BillingPlan

	// Subscription that will be charged for purchasing the benefit
	BillingScopeID *string

	// Commitment towards the benefit.
	Commitment *Commitment

	// Friendly name of the savings plan
	DisplayName *string

	// Setting this to true will automatically purchase a new benefit on the expiration date time.
	Renew *bool

	// Represent benefit term in ISO 8601 format.
	Term *Term

	// READ-ONLY; DateTime of the savings plan starts providing benefit from.
	EffectiveDateTime *time.Time
}

func (PurchaseRequestProperties) MarshalJSON

func (p PurchaseRequestProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type PurchaseRequestProperties.

func (*PurchaseRequestProperties) UnmarshalJSON

func (p *PurchaseRequestProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type PurchaseRequestProperties.

type RPClient

type RPClient struct {
	// contains filtered or unexported fields
}

RPClient contains the methods for the BillingBenefitsRP group. Don't use this type directly, use NewRPClient() instead.

func NewRPClient

func NewRPClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*RPClient, error)

NewRPClient creates a new instance of RPClient with the specified values.

  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*RPClient) ValidatePurchase

ValidatePurchase - Validate savings plan purchase. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-11-01

  • body - Request body for validating the purchase of a savings plan
  • options - RPClientValidatePurchaseOptions contains the optional parameters for the RPClient.ValidatePurchase method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/SavingsPlanValidatePurchase.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armbillingbenefits.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewRPClient().ValidatePurchase(ctx, armbillingbenefits.SavingsPlanPurchaseValidateRequest{
	Benefits: []*armbillingbenefits.SavingsPlanOrderAliasModel{
		{
			Properties: &armbillingbenefits.SavingsPlanOrderAliasProperties{
				AppliedScopeProperties: &armbillingbenefits.AppliedScopeProperties{
					ResourceGroupID: to.Ptr("/subscriptions/10000000-0000-0000-0000-000000000000/resourceGroups/testrg"),
				},
				AppliedScopeType: to.Ptr(armbillingbenefits.AppliedScopeTypeSingle),
				BillingScopeID:   to.Ptr("/subscriptions/10000000-0000-0000-0000-000000000000"),
				Commitment: &armbillingbenefits.Commitment{
					Amount:       to.Ptr[float64](15.23),
					CurrencyCode: to.Ptr("USD"),
					Grain:        to.Ptr(armbillingbenefits.CommitmentGrainHourly),
				},
				DisplayName: to.Ptr("ComputeSavingsPlan_2021-07-01"),
				Term:        to.Ptr(armbillingbenefits.TermP1Y),
			},
			SKU: &armbillingbenefits.SKU{
				Name: to.Ptr("Compute_Savings_Plan"),
			},
		},
		{
			Properties: &armbillingbenefits.SavingsPlanOrderAliasProperties{
				AppliedScopeProperties: &armbillingbenefits.AppliedScopeProperties{
					ResourceGroupID: to.Ptr("/subscriptions/10000000-0000-0000-0000-000000000000/resourceGroups/RG"),
				},
				AppliedScopeType: to.Ptr(armbillingbenefits.AppliedScopeTypeSingle),
				BillingScopeID:   to.Ptr("/subscriptions/10000000-0000-0000-0000-000000000000"),
				Commitment: &armbillingbenefits.Commitment{
					Amount:       to.Ptr[float64](20),
					CurrencyCode: to.Ptr("USD"),
					Grain:        to.Ptr(armbillingbenefits.CommitmentGrainHourly),
				},
				DisplayName: to.Ptr("ComputeSavingsPlan_2021-07-01"),
				Term:        to.Ptr(armbillingbenefits.TermP1Y),
			},
			SKU: &armbillingbenefits.SKU{
				Name: to.Ptr("Compute_Savings_Plan"),
			},
		}},
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.SavingsPlanValidateResponse = armbillingbenefits.SavingsPlanValidateResponse{
// 	Benefits: []*armbillingbenefits.SavingsPlanValidResponseProperty{
// 		{
// 			Reason: to.Ptr("Your provider has not enabled Savings Plan purchase on this subscription."),
// 			ReasonCode: to.Ptr("CustomerCannotPurchaseSavingsPlan"),
// 			Valid: to.Ptr(false),
// 		},
// 		{
// 			Valid: to.Ptr(true),
// 	}},
// }
Output:

type RPClientValidatePurchaseOptions

type RPClientValidatePurchaseOptions struct {
}

RPClientValidatePurchaseOptions contains the optional parameters for the RPClient.ValidatePurchase method.

type RPClientValidatePurchaseResponse

type RPClientValidatePurchaseResponse struct {
	SavingsPlanValidateResponse
}

RPClientValidatePurchaseResponse contains the response from method RPClient.ValidatePurchase.

type RenewProperties

type RenewProperties struct {
	PurchaseProperties *PurchaseRequest
}

func (RenewProperties) MarshalJSON

func (r RenewProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type RenewProperties.

func (*RenewProperties) UnmarshalJSON

func (r *RenewProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type RenewProperties.

type ReservationOrderAliasClient

type ReservationOrderAliasClient struct {
	// contains filtered or unexported fields
}

ReservationOrderAliasClient contains the methods for the ReservationOrderAlias group. Don't use this type directly, use NewReservationOrderAliasClient() instead.

func NewReservationOrderAliasClient

func NewReservationOrderAliasClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*ReservationOrderAliasClient, error)

NewReservationOrderAliasClient creates a new instance of ReservationOrderAliasClient with the specified values.

  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*ReservationOrderAliasClient) BeginCreate

BeginCreate - Create a reservation order alias. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-11-01

  • reservationOrderAliasName - Name of the reservation order alias
  • body - Request body for creating a reservation order alias
  • options - ReservationOrderAliasClientBeginCreateOptions contains the optional parameters for the ReservationOrderAliasClient.BeginCreate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/ReservationOrderAliasCreate.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armbillingbenefits.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewReservationOrderAliasClient().BeginCreate(ctx, "reservationOrderAlias123", armbillingbenefits.ReservationOrderAliasRequest{
	Location: to.Ptr("eastus"),
	Properties: &armbillingbenefits.ReservationOrderAliasRequestProperties{
		AppliedScopeProperties: &armbillingbenefits.AppliedScopeProperties{
			ResourceGroupID: to.Ptr("/subscriptions/10000000-0000-0000-0000-000000000000/resourceGroups/testrg"),
		},
		AppliedScopeType: to.Ptr(armbillingbenefits.AppliedScopeTypeSingle),
		BillingPlan:      to.Ptr(armbillingbenefits.BillingPlanP1M),
		BillingScopeID:   to.Ptr("/subscriptions/10000000-0000-0000-0000-000000000000"),
		DisplayName:      to.Ptr("ReservationOrder_2022-06-02"),
		Quantity:         to.Ptr[int32](5),
		Renew:            to.Ptr(true),
		ReservedResourceProperties: &armbillingbenefits.ReservationOrderAliasRequestPropertiesReservedResourceProperties{
			InstanceFlexibility: to.Ptr(armbillingbenefits.InstanceFlexibilityOn),
		},
		ReservedResourceType: to.Ptr(armbillingbenefits.ReservedResourceTypeVirtualMachines),
		Term:                 to.Ptr(armbillingbenefits.TermP1Y),
	},
	SKU: &armbillingbenefits.SKU{
		Name: to.Ptr("Standard_M64s_v2"),
	},
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.ReservationOrderAliasResponse = armbillingbenefits.ReservationOrderAliasResponse{
// 	Name: to.Ptr("reservationOrderAlias123"),
// 	Type: to.Ptr("Microsoft.BillingBenefits/reservationOrderAliases"),
// 	ID: to.Ptr("/providers/microsoft.billingbenefits/reservationOrderAliases/reservationOrderAlias123"),
// 	Properties: &armbillingbenefits.ReservationOrderAliasResponseProperties{
// 		AppliedScopeProperties: &armbillingbenefits.AppliedScopeProperties{
// 			ResourceGroupID: to.Ptr("/subscriptions/10000000-0000-0000-0000-000000000000/resourceGroups/testrg"),
// 		},
// 		AppliedScopeType: to.Ptr(armbillingbenefits.AppliedScopeTypeSingle),
// 		BillingPlan: to.Ptr(armbillingbenefits.BillingPlanP1M),
// 		BillingScopeID: to.Ptr("/subscriptions/10000000-0000-0000-0000-000000000000"),
// 		DisplayName: to.Ptr("ReservationOrder_2022-06-02"),
// 		ProvisioningState: to.Ptr(armbillingbenefits.ProvisioningStateSucceeded),
// 		Quantity: to.Ptr[int32](5),
// 		Renew: to.Ptr(true),
// 		ReservationOrderID: to.Ptr("/providers/Microsoft.Capacity/reservationOrders/30000000-0000-0000-0000-000000000000"),
// 		ReservedResourceProperties: &armbillingbenefits.ReservationOrderAliasResponsePropertiesReservedResourceProperties{
// 			InstanceFlexibility: to.Ptr(armbillingbenefits.InstanceFlexibilityOn),
// 		},
// 		ReservedResourceType: to.Ptr(armbillingbenefits.ReservedResourceTypeVirtualMachines),
// 		Term: to.Ptr(armbillingbenefits.TermP1Y),
// 	},
// 	SKU: &armbillingbenefits.SKU{
// 		Name: to.Ptr("Standard_M64s_v2"),
// 	},
// }
Output:

func (*ReservationOrderAliasClient) Get

Get - Get a reservation order alias. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-11-01

  • reservationOrderAliasName - Name of the reservation order alias
  • options - ReservationOrderAliasClientGetOptions contains the optional parameters for the ReservationOrderAliasClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/ReservationOrderAliasGet.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armbillingbenefits.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewReservationOrderAliasClient().Get(ctx, "reservationOrderAlias123", nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.ReservationOrderAliasResponse = armbillingbenefits.ReservationOrderAliasResponse{
// 	Name: to.Ptr("reservationOrderAlias123"),
// 	Type: to.Ptr("Microsoft.BillingBenefits/reservationOrderAliases"),
// 	ID: to.Ptr("/providers/microsoft.billingbenefits/reservationOrderAliases/reservationOrderAlias123"),
// 	Location: to.Ptr("eastus"),
// 	Properties: &armbillingbenefits.ReservationOrderAliasResponseProperties{
// 		AppliedScopeProperties: &armbillingbenefits.AppliedScopeProperties{
// 			ResourceGroupID: to.Ptr("/subscriptions/10000000-0000-0000-0000-000000000000/resourceGroups/testrg"),
// 		},
// 		AppliedScopeType: to.Ptr(armbillingbenefits.AppliedScopeTypeSingle),
// 		BillingPlan: to.Ptr(armbillingbenefits.BillingPlanP1M),
// 		BillingScopeID: to.Ptr("/subscriptions/10000000-0000-0000-0000-000000000000"),
// 		DisplayName: to.Ptr("ReservationOrder_2022-06-02"),
// 		ProvisioningState: to.Ptr(armbillingbenefits.ProvisioningStateSucceeded),
// 		Quantity: to.Ptr[int32](5),
// 		Renew: to.Ptr(true),
// 		ReservationOrderID: to.Ptr("/providers/Microsoft.Capacity/reservationOrders/30000000-0000-0000-0000-000000000000"),
// 		ReservedResourceProperties: &armbillingbenefits.ReservationOrderAliasResponsePropertiesReservedResourceProperties{
// 			InstanceFlexibility: to.Ptr(armbillingbenefits.InstanceFlexibilityOn),
// 		},
// 		ReservedResourceType: to.Ptr(armbillingbenefits.ReservedResourceTypeVirtualMachines),
// 		Term: to.Ptr(armbillingbenefits.TermP1Y),
// 	},
// 	SKU: &armbillingbenefits.SKU{
// 		Name: to.Ptr("Standard_M64s_v2"),
// 	},
// }
Output:

type ReservationOrderAliasClientBeginCreateOptions

type ReservationOrderAliasClientBeginCreateOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

ReservationOrderAliasClientBeginCreateOptions contains the optional parameters for the ReservationOrderAliasClient.BeginCreate method.

type ReservationOrderAliasClientCreateResponse

type ReservationOrderAliasClientCreateResponse struct {
	// Reservation order alias
	ReservationOrderAliasResponse
}

ReservationOrderAliasClientCreateResponse contains the response from method ReservationOrderAliasClient.BeginCreate.

type ReservationOrderAliasClientGetOptions

type ReservationOrderAliasClientGetOptions struct {
}

ReservationOrderAliasClientGetOptions contains the optional parameters for the ReservationOrderAliasClient.Get method.

type ReservationOrderAliasClientGetResponse

type ReservationOrderAliasClientGetResponse struct {
	// Reservation order alias
	ReservationOrderAliasResponse
}

ReservationOrderAliasClientGetResponse contains the response from method ReservationOrderAliasClient.Get.

type ReservationOrderAliasRequest

type ReservationOrderAliasRequest struct {
	// REQUIRED; Reservation order SKU
	SKU *SKU

	// The Azure Region where the reservation benefits are applied to.
	Location *string

	// Reservation order alias request properties
	Properties *ReservationOrderAliasRequestProperties

	// READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string

	// READ-ONLY; The name of the resource
	Name *string

	// READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information.
	SystemData *SystemData

	// READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string
}

ReservationOrderAliasRequest - Reservation order alias

func (ReservationOrderAliasRequest) MarshalJSON

func (r ReservationOrderAliasRequest) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ReservationOrderAliasRequest.

func (*ReservationOrderAliasRequest) UnmarshalJSON

func (r *ReservationOrderAliasRequest) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ReservationOrderAliasRequest.

type ReservationOrderAliasRequestProperties

type ReservationOrderAliasRequestProperties struct {
	// Properties specific to applied scope type. Not required if not applicable.
	AppliedScopeProperties *AppliedScopeProperties

	// Type of the Applied Scope.
	AppliedScopeType *AppliedScopeType

	// Represents the billing plan in ISO 8601 format. Required only for monthly billing plans.
	BillingPlan *BillingPlan

	// Subscription that will be charged for purchasing the benefit
	BillingScopeID *string

	// Display name
	DisplayName *string

	// Total Quantity of the SKUs purchased in the Reservation.
	Quantity *int32

	// Setting this to true will automatically purchase a new benefit on the expiration date time.
	Renew *bool

	// Properties specific to each reserved resource type. Not required if not applicable.
	ReservedResourceProperties *ReservationOrderAliasRequestPropertiesReservedResourceProperties

	// The type of the resource that is being reserved.
	ReservedResourceType *ReservedResourceType

	// This is the date-time when the Azure Hybrid Benefit needs to be reviewed.
	ReviewDateTime *time.Time

	// Represent benefit term in ISO 8601 format.
	Term *Term
}

ReservationOrderAliasRequestProperties - Reservation properties

func (ReservationOrderAliasRequestProperties) MarshalJSON

func (r ReservationOrderAliasRequestProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ReservationOrderAliasRequestProperties.

func (*ReservationOrderAliasRequestProperties) UnmarshalJSON

func (r *ReservationOrderAliasRequestProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ReservationOrderAliasRequestProperties.

type ReservationOrderAliasRequestPropertiesReservedResourceProperties

type ReservationOrderAliasRequestPropertiesReservedResourceProperties struct {
	// Turning this on will apply the reservation discount to other VMs in the same VM size group.
	InstanceFlexibility *InstanceFlexibility
}

ReservationOrderAliasRequestPropertiesReservedResourceProperties - Properties specific to each reserved resource type. Not required if not applicable.

func (ReservationOrderAliasRequestPropertiesReservedResourceProperties) MarshalJSON

MarshalJSON implements the json.Marshaller interface for type ReservationOrderAliasRequestPropertiesReservedResourceProperties.

func (*ReservationOrderAliasRequestPropertiesReservedResourceProperties) UnmarshalJSON

UnmarshalJSON implements the json.Unmarshaller interface for type ReservationOrderAliasRequestPropertiesReservedResourceProperties.

type ReservationOrderAliasResponse

type ReservationOrderAliasResponse struct {
	// REQUIRED; Reservation order SKU
	SKU *SKU

	// The Azure Region where the reserved resource lives.
	Location *string

	// Reservation order alias response properties
	Properties *ReservationOrderAliasResponseProperties

	// READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string

	// READ-ONLY; The name of the resource
	Name *string

	// READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information.
	SystemData *SystemData

	// READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string
}

ReservationOrderAliasResponse - Reservation order alias

func (ReservationOrderAliasResponse) MarshalJSON

func (r ReservationOrderAliasResponse) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ReservationOrderAliasResponse.

func (*ReservationOrderAliasResponse) UnmarshalJSON

func (r *ReservationOrderAliasResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ReservationOrderAliasResponse.

type ReservationOrderAliasResponseProperties

type ReservationOrderAliasResponseProperties struct {
	// Properties specific to applied scope type. Not required if not applicable.
	AppliedScopeProperties *AppliedScopeProperties

	// Type of the Applied Scope.
	AppliedScopeType *AppliedScopeType

	// Represents the billing plan in ISO 8601 format. Required only for monthly billing plans.
	BillingPlan *BillingPlan

	// Subscription that will be charged for purchasing the benefit
	BillingScopeID *string

	// Display name
	DisplayName *string

	// Total Quantity of the SKUs purchased in the Reservation.
	Quantity *int32

	// Setting this to true will automatically purchase a new benefit on the expiration date time.
	Renew *bool

	// Properties specific to each reserved resource type. Not required if not applicable.
	ReservedResourceProperties *ReservationOrderAliasResponsePropertiesReservedResourceProperties

	// The type of the resource that is being reserved.
	ReservedResourceType *ReservedResourceType

	// This is the date-time when the Reservation needs to be reviewed.
	ReviewDateTime *time.Time

	// Represent benefit term in ISO 8601 format.
	Term *Term

	// READ-ONLY; Provisioning state
	ProvisioningState *ProvisioningState

	// READ-ONLY; Identifier of the reservation order created
	ReservationOrderID *string
}

ReservationOrderAliasResponseProperties - Reservation properties

func (ReservationOrderAliasResponseProperties) MarshalJSON

func (r ReservationOrderAliasResponseProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ReservationOrderAliasResponseProperties.

func (*ReservationOrderAliasResponseProperties) UnmarshalJSON

func (r *ReservationOrderAliasResponseProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ReservationOrderAliasResponseProperties.

type ReservationOrderAliasResponsePropertiesReservedResourceProperties

type ReservationOrderAliasResponsePropertiesReservedResourceProperties struct {
	// Turning this on will apply the reservation discount to other VMs in the same VM size group.
	InstanceFlexibility *InstanceFlexibility
}

ReservationOrderAliasResponsePropertiesReservedResourceProperties - Properties specific to each reserved resource type. Not required if not applicable.

func (ReservationOrderAliasResponsePropertiesReservedResourceProperties) MarshalJSON

MarshalJSON implements the json.Marshaller interface for type ReservationOrderAliasResponsePropertiesReservedResourceProperties.

func (*ReservationOrderAliasResponsePropertiesReservedResourceProperties) UnmarshalJSON

UnmarshalJSON implements the json.Unmarshaller interface for type ReservationOrderAliasResponsePropertiesReservedResourceProperties.

type ReservedResourceType

type ReservedResourceType string

ReservedResourceType - The type of the resource that is being reserved.

const (
	ReservedResourceTypeAVS                    ReservedResourceType = "AVS"
	ReservedResourceTypeAppService             ReservedResourceType = "AppService"
	ReservedResourceTypeAzureDataExplorer      ReservedResourceType = "AzureDataExplorer"
	ReservedResourceTypeAzureFiles             ReservedResourceType = "AzureFiles"
	ReservedResourceTypeBlockBlob              ReservedResourceType = "BlockBlob"
	ReservedResourceTypeCosmosDb               ReservedResourceType = "CosmosDb"
	ReservedResourceTypeDataFactory            ReservedResourceType = "DataFactory"
	ReservedResourceTypeDatabricks             ReservedResourceType = "Databricks"
	ReservedResourceTypeDedicatedHost          ReservedResourceType = "DedicatedHost"
	ReservedResourceTypeManagedDisk            ReservedResourceType = "ManagedDisk"
	ReservedResourceTypeMariaDb                ReservedResourceType = "MariaDb"
	ReservedResourceTypeMySQL                  ReservedResourceType = "MySql"
	ReservedResourceTypeNetAppStorage          ReservedResourceType = "NetAppStorage"
	ReservedResourceTypePostgreSQL             ReservedResourceType = "PostgreSql"
	ReservedResourceTypeRedHat                 ReservedResourceType = "RedHat"
	ReservedResourceTypeRedHatOsa              ReservedResourceType = "RedHatOsa"
	ReservedResourceTypeRedisCache             ReservedResourceType = "RedisCache"
	ReservedResourceTypeSQLAzureHybridBenefit  ReservedResourceType = "SqlAzureHybridBenefit"
	ReservedResourceTypeSQLDataWarehouse       ReservedResourceType = "SqlDataWarehouse"
	ReservedResourceTypeSQLDatabases           ReservedResourceType = "SqlDatabases"
	ReservedResourceTypeSQLEdge                ReservedResourceType = "SqlEdge"
	ReservedResourceTypeSapHana                ReservedResourceType = "SapHana"
	ReservedResourceTypeSuseLinux              ReservedResourceType = "SuseLinux"
	ReservedResourceTypeVMwareCloudSimple      ReservedResourceType = "VMwareCloudSimple"
	ReservedResourceTypeVirtualMachineSoftware ReservedResourceType = "VirtualMachineSoftware"
	ReservedResourceTypeVirtualMachines        ReservedResourceType = "VirtualMachines"
)

func PossibleReservedResourceTypeValues

func PossibleReservedResourceTypeValues() []ReservedResourceType

PossibleReservedResourceTypeValues returns the possible values for the ReservedResourceType const type.

type RoleAssignmentEntity

type RoleAssignmentEntity struct {
	// Role assignment entity id
	ID *string

	// Role assignment entity name
	Name *string

	// Role assignment entity properties
	Properties *RoleAssignmentEntityProperties
}

RoleAssignmentEntity - Role assignment entity

func (RoleAssignmentEntity) MarshalJSON

func (r RoleAssignmentEntity) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type RoleAssignmentEntity.

func (*RoleAssignmentEntity) UnmarshalJSON

func (r *RoleAssignmentEntity) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type RoleAssignmentEntity.

type RoleAssignmentEntityProperties

type RoleAssignmentEntityProperties struct {
	// Principal Id
	PrincipalID *string

	// Role definition id
	RoleDefinitionID *string

	// Scope of the role assignment entity
	Scope *string
}

RoleAssignmentEntityProperties - Role assignment entity properties

func (RoleAssignmentEntityProperties) MarshalJSON

func (r RoleAssignmentEntityProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type RoleAssignmentEntityProperties.

func (*RoleAssignmentEntityProperties) UnmarshalJSON

func (r *RoleAssignmentEntityProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type RoleAssignmentEntityProperties.

type SKU

type SKU struct {
	// Name of the SKU to be applied
	Name *string
}

SKU - The SKU to be applied for this resource

func (SKU) MarshalJSON

func (s SKU) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type SKU.

func (*SKU) UnmarshalJSON

func (s *SKU) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type SKU.

type SavingsPlanClient

type SavingsPlanClient struct {
	// contains filtered or unexported fields
}

SavingsPlanClient contains the methods for the SavingsPlan group. Don't use this type directly, use NewSavingsPlanClient() instead.

func NewSavingsPlanClient

func NewSavingsPlanClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*SavingsPlanClient, error)

NewSavingsPlanClient creates a new instance of SavingsPlanClient with the specified values.

  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*SavingsPlanClient) Get

func (client *SavingsPlanClient) Get(ctx context.Context, savingsPlanOrderID string, savingsPlanID string, options *SavingsPlanClientGetOptions) (SavingsPlanClientGetResponse, error)

Get - Get savings plan. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-11-01

  • savingsPlanOrderID - Order ID of the savings plan
  • savingsPlanID - ID of the savings plan
  • options - SavingsPlanClientGetOptions contains the optional parameters for the SavingsPlanClient.Get method.
Example (SavingsPlanItemGet)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/SavingsPlanItemGet.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armbillingbenefits.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewSavingsPlanClient().Get(ctx, "20000000-0000-0000-0000-000000000000", "30000000-0000-0000-0000-000000000000", &armbillingbenefits.SavingsPlanClientGetOptions{Expand: nil})
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.SavingsPlanModel = armbillingbenefits.SavingsPlanModel{
// 	Name: to.Ptr("20000000-0000-0000-0000-000000000000/30000000-0000-0000-0000-000000000000"),
// 	Type: to.Ptr("Microsoft.BillingBenefits/savingsPlanOrders/savingsPlans"),
// 	ID: to.Ptr("/providers/microsoft.billingbenefits/savingsPlanOrders/20000000-0000-0000-0000-000000000000/savingsPlans/30000000-0000-0000-0000-000000000000"),
// 	Properties: &armbillingbenefits.SavingsPlanModelProperties{
// 		AppliedScopeType: to.Ptr(armbillingbenefits.AppliedScopeTypeShared),
// 		BillingAccountID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/20000000-1000-0000-0000-000000000000:20000000-0000-3000-0000-000000000000_2019-05-31"),
// 		BillingPlan: to.Ptr(armbillingbenefits.BillingPlanP1M),
// 		BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/20000000-1000-0000-0000-000000000000:20000000-0000-3000-0000-000000000000_2019-05-31/billingProfiles/KPSV-DWNE-BG7-TGB"),
// 		BillingScopeID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/20000000-1000-0000-0000-000000000009"),
// 		Commitment: &armbillingbenefits.Commitment{
// 			Amount: to.Ptr[float64](0.001),
// 			CurrencyCode: to.Ptr("USD"),
// 			Grain: to.Ptr(armbillingbenefits.CommitmentGrainHourly),
// 		},
// 		DisplayName: to.Ptr("Compute_SavingsPlan_patch_rename2"),
// 		DisplayProvisioningState: to.Ptr("Succeeded"),
// 		EffectiveDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-10-21T18:15:42.409Z"); return t}()),
// 		ExpiryDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-10-18T21:16:13.185Z"); return t}()),
// 		ProvisioningState: to.Ptr(armbillingbenefits.ProvisioningStateSucceeded),
// 		PurchaseDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-10-18T21:14:26.827Z"); return t}()),
// 		Renew: to.Ptr(true),
// 		Term: to.Ptr(armbillingbenefits.TermP3Y),
// 		UserFriendlyAppliedScopeType: to.Ptr("Shared"),
// 		Utilization: &armbillingbenefits.Utilization{
// 			Aggregates: []*armbillingbenefits.UtilizationAggregates{
// 				{
// 					Grain: to.Ptr[float32](1),
// 					GrainUnit: to.Ptr("days"),
// 					Value: to.Ptr[float32](100),
// 					ValueUnit: to.Ptr("percentage"),
// 				},
// 				{
// 					Grain: to.Ptr[float32](7),
// 					GrainUnit: to.Ptr("days"),
// 					Value: to.Ptr[float32](84),
// 					ValueUnit: to.Ptr("percentage"),
// 				},
// 				{
// 					Grain: to.Ptr[float32](30),
// 					GrainUnit: to.Ptr("days"),
// 					Value: to.Ptr[float32](83.87),
// 					ValueUnit: to.Ptr("percentage"),
// 			}},
// 			Trend: to.Ptr(""),
// 		},
// 	},
// 	SKU: &armbillingbenefits.SKU{
// 		Name: to.Ptr("Compute_Savings_Plan"),
// 	},
// }
Output:

Example (SavingsPlanItemWithExpandedRenewPropertiesGet)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/SavingsPlanItemExpandedGet.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armbillingbenefits.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewSavingsPlanClient().Get(ctx, "20000000-0000-0000-0000-000000000000", "30000000-0000-0000-0000-000000000000", &armbillingbenefits.SavingsPlanClientGetOptions{Expand: to.Ptr("renewProperties")})
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.SavingsPlanModel = armbillingbenefits.SavingsPlanModel{
// 	Name: to.Ptr("20000000-0000-0000-0000-000000000000/30000000-0000-0000-0000-000000000000"),
// 	Type: to.Ptr("Microsoft.BillingBenefits/savingsPlanOrders/savingsPlans"),
// 	ID: to.Ptr("/providers/microsoft.billingbenefits/savingsPlanOrders/20000000-0000-0000-0000-000000000000/savingsPlans/30000000-0000-0000-0000-000000000000"),
// 	Properties: &armbillingbenefits.SavingsPlanModelProperties{
// 		AppliedScopeType: to.Ptr(armbillingbenefits.AppliedScopeTypeShared),
// 		BillingAccountID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/20000000-1000-0000-0000-000000000000:20000000-0000-3000-0000-000000000000_2019-05-31"),
// 		BillingPlan: to.Ptr(armbillingbenefits.BillingPlanP1M),
// 		BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/20000000-1000-0000-0000-000000000000:20000000-0000-3000-0000-000000000000_2019-05-31/billingProfiles/KPSV-DWNE-BG7-TGB"),
// 		BillingScopeID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/20000000-1000-0000-0000-000000000009"),
// 		Commitment: &armbillingbenefits.Commitment{
// 			Amount: to.Ptr[float64](0.001),
// 			CurrencyCode: to.Ptr("USD"),
// 			Grain: to.Ptr(armbillingbenefits.CommitmentGrainHourly),
// 		},
// 		DisplayName: to.Ptr("Compute_SavingsPlan_patch_rename2"),
// 		DisplayProvisioningState: to.Ptr("Succeeded"),
// 		EffectiveDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-10-21T18:15:42.409Z"); return t}()),
// 		ExpiryDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-10-18T21:16:13.185Z"); return t}()),
// 		ProvisioningState: to.Ptr(armbillingbenefits.ProvisioningStateSucceeded),
// 		PurchaseDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-10-18T21:14:26.827Z"); return t}()),
// 		Renew: to.Ptr(true),
// 		RenewProperties: &armbillingbenefits.RenewProperties{
// 			PurchaseProperties: &armbillingbenefits.PurchaseRequest{
// 				Properties: &armbillingbenefits.PurchaseRequestProperties{
// 					AppliedScopeType: to.Ptr(armbillingbenefits.AppliedScopeTypeShared),
// 					BillingPlan: to.Ptr(armbillingbenefits.BillingPlan("Upfront")),
// 					BillingScopeID: to.Ptr("/subscriptions/eef82110-c91b-4395-9420-fcfcbefc5a47"),
// 					Commitment: &armbillingbenefits.Commitment{
// 						Amount: to.Ptr[float64](0.001),
// 						CurrencyCode: to.Ptr("USD"),
// 						Grain: to.Ptr(armbillingbenefits.CommitmentGrainHourly),
// 					},
// 					DisplayName: to.Ptr("Compute_SavingsPlan_patch_rename2_renewed"),
// 					Term: to.Ptr(armbillingbenefits.TermP1Y),
// 				},
// 				SKU: &armbillingbenefits.SKU{
// 					Name: to.Ptr("Compute_Savings_Plan"),
// 				},
// 			},
// 		},
// 		Term: to.Ptr(armbillingbenefits.TermP3Y),
// 		UserFriendlyAppliedScopeType: to.Ptr("Shared"),
// 		Utilization: &armbillingbenefits.Utilization{
// 			Aggregates: []*armbillingbenefits.UtilizationAggregates{
// 				{
// 					Grain: to.Ptr[float32](1),
// 					GrainUnit: to.Ptr("days"),
// 					Value: to.Ptr[float32](100),
// 					ValueUnit: to.Ptr("percentage"),
// 				},
// 				{
// 					Grain: to.Ptr[float32](7),
// 					GrainUnit: to.Ptr("days"),
// 					Value: to.Ptr[float32](84),
// 					ValueUnit: to.Ptr("percentage"),
// 				},
// 				{
// 					Grain: to.Ptr[float32](30),
// 					GrainUnit: to.Ptr("days"),
// 					Value: to.Ptr[float32](83.87),
// 					ValueUnit: to.Ptr("percentage"),
// 			}},
// 			Trend: to.Ptr(""),
// 		},
// 	},
// 	SKU: &armbillingbenefits.SKU{
// 		Name: to.Ptr("Compute_Savings_Plan"),
// 	},
// }
Output:

func (*SavingsPlanClient) NewListAllPager

NewListAllPager - List savings plans.

Generated from API version 2022-11-01

  • options - SavingsPlanClientListAllOptions contains the optional parameters for the SavingsPlanClient.NewListAllPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/SavingsPlansList.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armbillingbenefits.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewSavingsPlanClient().NewListAllPager(&armbillingbenefits.SavingsPlanClientListAllOptions{Filter: to.Ptr("(properties%2farchived+eq+false)"),
	Orderby:        to.Ptr("properties/displayName asc"),
	RefreshSummary: nil,
	Skiptoken:      to.Ptr[float32](50),
	SelectedState:  nil,
	Take:           to.Ptr[float32](1),
})
for pager.More() {
	page, err := pager.NextPage(ctx)
	if err != nil {
		log.Fatalf("failed to advance page: %v", err)
	}
	for _, v := range page.Value {
		// You could use page here. We use blank identifier for just demo purposes.
		_ = v
	}
	// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// page.SavingsPlanModelListResult = armbillingbenefits.SavingsPlanModelListResult{
	// 	AdditionalProperties: []*armbillingbenefits.SavingsPlanSummary{
	// 		{
	// 			Name: to.Ptr("summary"),
	// 			Value: &armbillingbenefits.SavingsPlanSummaryCount{
	// 				CancelledCount: to.Ptr[float32](0),
	// 				ExpiredCount: to.Ptr[float32](0),
	// 				ExpiringCount: to.Ptr[float32](0),
	// 				FailedCount: to.Ptr[float32](0),
	// 				NoBenefitCount: to.Ptr[float32](0),
	// 				PendingCount: to.Ptr[float32](0),
	// 				ProcessingCount: to.Ptr[float32](0),
	// 				SucceededCount: to.Ptr[float32](1),
	// 				WarningCount: to.Ptr[float32](0),
	// 			},
	// 	}},
	// 	Value: []*armbillingbenefits.SavingsPlanModel{
	// 		{
	// 			Name: to.Ptr("20000000-0000-0000-0000-000000000000/30000000-0000-0000-0000-000000000000"),
	// 			Type: to.Ptr("Microsoft.BillingBenefits/savingsPlanOrders/savingsPlans"),
	// 			ID: to.Ptr("/providers/microsoft.billingbenefits/savingsPlanOrders/20000000-0000-0000-0000-000000000000/savingsPlans/30000000-0000-0000-0000-000000000000"),
	// 			Properties: &armbillingbenefits.SavingsPlanModelProperties{
	// 				AppliedScopeProperties: &armbillingbenefits.AppliedScopeProperties{
	// 					DisplayName: to.Ptr("Azure subscription 1"),
	// 					SubscriptionID: to.Ptr("/subscriptions/20000000-0000-0000-0000-000000000005"),
	// 				},
	// 				AppliedScopeType: to.Ptr(armbillingbenefits.AppliedScopeTypeSingle),
	// 				BillingAccountID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/20000000-1000-0000-0000-000000000000:20000000-0000-3000-0000-000000000000_2019-05-31"),
	// 				BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/20000000-1000-0000-0000-000000000000:20000000-0000-3000-0000-000000000000_2019-05-31/billingProfiles/KPSV-DWNE-BG7-TGB"),
	// 				BillingScopeID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/20000000-1000-0000-0000-000000000009"),
	// 				Commitment: &armbillingbenefits.Commitment{
	// 					Amount: to.Ptr[float64](0.001),
	// 					CurrencyCode: to.Ptr("USD"),
	// 					Grain: to.Ptr(armbillingbenefits.CommitmentGrainHourly),
	// 				},
	// 				DisplayName: to.Ptr("Compute_SavingsPlan_10-19-2022_11-03"),
	// 				DisplayProvisioningState: to.Ptr("Succeeded"),
	// 				EffectiveDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-10-19T18:05:37.103Z"); return t}()),
	// 				ExpiryDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-19T18:05:36.525Z"); return t}()),
	// 				ProvisioningState: to.Ptr(armbillingbenefits.ProvisioningStateSucceeded),
	// 				PurchaseDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-10-19T18:03:56.403Z"); return t}()),
	// 				Renew: to.Ptr(false),
	// 				Term: to.Ptr(armbillingbenefits.TermP1Y),
	// 				UserFriendlyAppliedScopeType: to.Ptr("Single"),
	// 				Utilization: &armbillingbenefits.Utilization{
	// 					Aggregates: []*armbillingbenefits.UtilizationAggregates{
	// 						{
	// 							Grain: to.Ptr[float32](1),
	// 							GrainUnit: to.Ptr("days"),
	// 							Value: to.Ptr[float32](100),
	// 							ValueUnit: to.Ptr("percentage"),
	// 						},
	// 						{
	// 							Grain: to.Ptr[float32](7),
	// 							GrainUnit: to.Ptr("days"),
	// 							Value: to.Ptr[float32](78),
	// 							ValueUnit: to.Ptr("percentage"),
	// 						},
	// 						{
	// 							Grain: to.Ptr[float32](30),
	// 							GrainUnit: to.Ptr("days"),
	// 							Value: to.Ptr[float32](78.12),
	// 							ValueUnit: to.Ptr("percentage"),
	// 					}},
	// 					Trend: to.Ptr(""),
	// 				},
	// 			},
	// 			SKU: &armbillingbenefits.SKU{
	// 				Name: to.Ptr("Compute_Savings_Plan"),
	// 			},
	// 	}},
	// }
}
Output:

func (*SavingsPlanClient) NewListPager

func (client *SavingsPlanClient) NewListPager(savingsPlanOrderID string, options *SavingsPlanClientListOptions) *runtime.Pager[SavingsPlanClientListResponse]

NewListPager - List savings plans in an order.

Generated from API version 2022-11-01

  • savingsPlanOrderID - Order ID of the savings plan
  • options - SavingsPlanClientListOptions contains the optional parameters for the SavingsPlanClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/SavingsPlansInOrderList.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armbillingbenefits.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewSavingsPlanClient().NewListPager("20000000-0000-0000-0000-000000000000", nil)
for pager.More() {
	page, err := pager.NextPage(ctx)
	if err != nil {
		log.Fatalf("failed to advance page: %v", err)
	}
	for _, v := range page.Value {
		// You could use page here. We use blank identifier for just demo purposes.
		_ = v
	}
	// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// page.SavingsPlanModelList = armbillingbenefits.SavingsPlanModelList{
	// 	Value: []*armbillingbenefits.SavingsPlanModel{
	// 		{
	// 			Name: to.Ptr("20000000-0000-0000-0000-000000000000/30000000-0000-0000-0000-000000000000"),
	// 			Type: to.Ptr("Microsoft.BillingBenefits/savingsPlanOrders/savingsPlans"),
	// 			ID: to.Ptr("/providers/microsoft.billingbenefits/savingsPlanOrders/20000000-0000-0000-0000-000000000000/savingsPlans/30000000-0000-0000-0000-000000000000"),
	// 			Properties: &armbillingbenefits.SavingsPlanModelProperties{
	// 				AppliedScopeProperties: &armbillingbenefits.AppliedScopeProperties{
	// 					ResourceGroupID: to.Ptr("/subscriptions/eef82110-c91b-4395-9420-fcfcbefc5a47/resourcegroups/3ppRG"),
	// 				},
	// 				AppliedScopeType: to.Ptr(armbillingbenefits.AppliedScopeTypeSingle),
	// 				BillingAccountID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/20000000-1000-0000-0000-000000000000:20000000-0000-3000-0000-000000000000_2019-05-31"),
	// 				BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/20000000-1000-0000-0000-000000000000:20000000-0000-3000-0000-000000000000_2019-05-31/billingProfiles/KPSV-DWNE-BG7-TGB"),
	// 				BillingScopeID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/20000000-1000-0000-0000-000000000009"),
	// 				Commitment: &armbillingbenefits.Commitment{
	// 					Amount: to.Ptr[float64](0.002),
	// 					CurrencyCode: to.Ptr("USD"),
	// 					Grain: to.Ptr(armbillingbenefits.CommitmentGrainHourly),
	// 				},
	// 				DisplayName: to.Ptr("Compute_SavingsPlan_10-24-2022_15-44"),
	// 				DisplayProvisioningState: to.Ptr("Succeeded"),
	// 				EffectiveDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-10-24T22:47:04.853Z"); return t}()),
	// 				ExpiryDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-24T22:47:04.619Z"); return t}()),
	// 				ProvisioningState: to.Ptr(armbillingbenefits.ProvisioningStateSucceeded),
	// 				PurchaseDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-10-24T22:45:13.620Z"); return t}()),
	// 				Renew: to.Ptr(false),
	// 				Term: to.Ptr(armbillingbenefits.TermP1Y),
	// 				UserFriendlyAppliedScopeType: to.Ptr("ResourceGroup"),
	// 				Utilization: &armbillingbenefits.Utilization{
	// 					Aggregates: []*armbillingbenefits.UtilizationAggregates{
	// 						{
	// 							Grain: to.Ptr[float32](1),
	// 							GrainUnit: to.Ptr("days"),
	// 							Value: to.Ptr[float32](0),
	// 							ValueUnit: to.Ptr("percentage"),
	// 						},
	// 						{
	// 							Grain: to.Ptr[float32](7),
	// 							GrainUnit: to.Ptr("days"),
	// 							Value: to.Ptr[float32](0),
	// 							ValueUnit: to.Ptr("percentage"),
	// 						},
	// 						{
	// 							Grain: to.Ptr[float32](30),
	// 							GrainUnit: to.Ptr("days"),
	// 							Value: to.Ptr[float32](0),
	// 							ValueUnit: to.Ptr("percentage"),
	// 					}},
	// 					Trend: to.Ptr(""),
	// 				},
	// 			},
	// 			SKU: &armbillingbenefits.SKU{
	// 				Name: to.Ptr("Compute_Savings_Plan"),
	// 			},
	// 	}},
	// }
}
Output:

func (*SavingsPlanClient) Update

func (client *SavingsPlanClient) Update(ctx context.Context, savingsPlanOrderID string, savingsPlanID string, body SavingsPlanUpdateRequest, options *SavingsPlanClientUpdateOptions) (SavingsPlanClientUpdateResponse, error)

Update - Update savings plan. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-11-01

  • savingsPlanOrderID - Order ID of the savings plan
  • savingsPlanID - ID of the savings plan
  • body - Request body for patching a savings plan order alias
  • options - SavingsPlanClientUpdateOptions contains the optional parameters for the SavingsPlanClient.Update method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/SavingsPlanUpdate.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armbillingbenefits.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewSavingsPlanClient().Update(ctx, "20000000-0000-0000-0000-000000000000", "30000000-0000-0000-0000-000000000000", armbillingbenefits.SavingsPlanUpdateRequest{
	Properties: &armbillingbenefits.SavingsPlanUpdateRequestProperties{
		AppliedScopeProperties: &armbillingbenefits.AppliedScopeProperties{
			ResourceGroupID: to.Ptr("/subscriptions/10000000-0000-0000-0000-000000000000/resourceGroups/testrg"),
		},
		AppliedScopeType: to.Ptr(armbillingbenefits.AppliedScopeTypeSingle),
		DisplayName:      to.Ptr("TestDisplayName"),
		Renew:            to.Ptr(true),
		RenewProperties: &armbillingbenefits.RenewProperties{
			PurchaseProperties: &armbillingbenefits.PurchaseRequest{
				Properties: &armbillingbenefits.PurchaseRequestProperties{
					AppliedScopeProperties: &armbillingbenefits.AppliedScopeProperties{
						ResourceGroupID: to.Ptr("/subscriptions/10000000-0000-0000-0000-000000000000/resourceGroups/testrg"),
					},
					AppliedScopeType: to.Ptr(armbillingbenefits.AppliedScopeTypeSingle),
					BillingPlan:      to.Ptr(armbillingbenefits.BillingPlanP1M),
					BillingScopeID:   to.Ptr("/subscriptions/10000000-0000-0000-0000-000000000000"),
					Commitment: &armbillingbenefits.Commitment{
						Amount:       to.Ptr[float64](15.23),
						CurrencyCode: to.Ptr("USD"),
						Grain:        to.Ptr(armbillingbenefits.CommitmentGrainHourly),
					},
					DisplayName: to.Ptr("TestDisplayName_renewed"),
					Renew:       to.Ptr(false),
					Term:        to.Ptr(armbillingbenefits.TermP1Y),
				},
				SKU: &armbillingbenefits.SKU{
					Name: to.Ptr("Compute_Savings_Plan"),
				},
			},
		},
	},
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.SavingsPlanModel = armbillingbenefits.SavingsPlanModel{
// 	Name: to.Ptr("30000000-0000-0000-0000-000000000000"),
// 	Type: to.Ptr("microsoft.billingbenefits/savingsPlanOrders/savingsPlans"),
// 	ID: to.Ptr("/providers/microsoft.billingbenefits/savingsPlanOrders/20000000-0000-0000-0000-000000000000/savingsPlans/30000000-0000-0000-0000-000000000000"),
// 	Properties: &armbillingbenefits.SavingsPlanModelProperties{
// 		AppliedScopeProperties: &armbillingbenefits.AppliedScopeProperties{
// 			DisplayName: to.Ptr("Azure subscription 1"),
// 			SubscriptionID: to.Ptr("/subscriptions/10000000-0000-0000-0000-000000000000"),
// 		},
// 		AppliedScopeType: to.Ptr(armbillingbenefits.AppliedScopeTypeSingle),
// 		BenefitStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-10-27T00:34:33.669Z"); return t}()),
// 		BillingAccountID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/20000000-1000-0000-0000-000000000000:20000000-0000-3000-0000-000000000000_2019-05-31"),
// 		BillingPlan: to.Ptr(armbillingbenefits.BillingPlanP1M),
// 		BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/20000000-1000-0000-0000-000000000000:20000000-0000-3000-0000-000000000000_2019-05-31/billingProfiles/KPSV-DWNE-BG7-TGB"),
// 		BillingScopeID: to.Ptr("/subscriptions/10000000-0000-0000-0000-000000000000"),
// 		Commitment: &armbillingbenefits.Commitment{
// 			Amount: to.Ptr[float64](0.001),
// 			CurrencyCode: to.Ptr("USD"),
// 			Grain: to.Ptr(armbillingbenefits.CommitmentGrainHourly),
// 		},
// 		DisplayName: to.Ptr("riName"),
// 		DisplayProvisioningState: to.Ptr("Succeeded"),
// 		EffectiveDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-10T00:12:54.549Z"); return t}()),
// 		ExpiryDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-10-27T00:34:33.669Z"); return t}()),
// 		ProvisioningState: to.Ptr(armbillingbenefits.ProvisioningStateSucceeded),
// 		PurchaseDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-10-27T00:32:45.582Z"); return t}()),
// 		Renew: to.Ptr(true),
// 		Term: to.Ptr(armbillingbenefits.TermP3Y),
// 		UserFriendlyAppliedScopeType: to.Ptr("Single"),
// 		Utilization: &armbillingbenefits.Utilization{
// 			Aggregates: []*armbillingbenefits.UtilizationAggregates{
// 				{
// 					Grain: to.Ptr[float32](1),
// 					GrainUnit: to.Ptr("days"),
// 					Value: to.Ptr[float32](100),
// 					ValueUnit: to.Ptr("percentage"),
// 				},
// 				{
// 					Grain: to.Ptr[float32](7),
// 					GrainUnit: to.Ptr("days"),
// 					Value: to.Ptr[float32](37),
// 					ValueUnit: to.Ptr("percentage"),
// 				},
// 				{
// 					Grain: to.Ptr[float32](30),
// 					GrainUnit: to.Ptr("days"),
// 					Value: to.Ptr[float32](53.85),
// 					ValueUnit: to.Ptr("percentage"),
// 			}},
// 			Trend: to.Ptr("DOWN"),
// 		},
// 	},
// 	SKU: &armbillingbenefits.SKU{
// 		Name: to.Ptr("Compute_Savings_Plan"),
// 	},
// }
Output:

func (*SavingsPlanClient) ValidateUpdate

ValidateUpdate - Validate savings plan patch. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-11-01

  • savingsPlanOrderID - Order ID of the savings plan
  • savingsPlanID - ID of the savings plan
  • body - Request body for validating a savings plan patch request
  • options - SavingsPlanClientValidateUpdateOptions contains the optional parameters for the SavingsPlanClient.ValidateUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/SavingsPlanValidateUpdate.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armbillingbenefits.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewSavingsPlanClient().ValidateUpdate(ctx, "20000000-0000-0000-0000-000000000000", "30000000-0000-0000-0000-000000000000", armbillingbenefits.SavingsPlanUpdateValidateRequest{
	Benefits: []*armbillingbenefits.SavingsPlanUpdateRequestProperties{
		{
			AppliedScopeProperties: &armbillingbenefits.AppliedScopeProperties{
				ManagementGroupID: to.Ptr("/providers/Microsoft.Management/managementGroups/30000000-0000-0000-0000-000000000100"),
				TenantID:          to.Ptr("30000000-0000-0000-0000-000000000100"),
			},
			AppliedScopeType: to.Ptr(armbillingbenefits.AppliedScopeTypeManagementGroup),
		},
		{
			AppliedScopeProperties: &armbillingbenefits.AppliedScopeProperties{
				ManagementGroupID: to.Ptr("/providers/Microsoft.Management/managementGroups/MockMG"),
				TenantID:          to.Ptr("30000000-0000-0000-0000-000000000100"),
			},
			AppliedScopeType: to.Ptr(armbillingbenefits.AppliedScopeTypeManagementGroup),
		}},
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.SavingsPlanValidateResponse = armbillingbenefits.SavingsPlanValidateResponse{
// 	Benefits: []*armbillingbenefits.SavingsPlanValidResponseProperty{
// 		{
// 			Valid: to.Ptr(true),
// 		},
// 		{
// 			Valid: to.Ptr(true),
// 	}},
// }
Output:

type SavingsPlanClientGetOptions

type SavingsPlanClientGetOptions struct {
	// May be used to expand the detail information of some properties.
	Expand *string
}

SavingsPlanClientGetOptions contains the optional parameters for the SavingsPlanClient.Get method.

type SavingsPlanClientGetResponse

type SavingsPlanClientGetResponse struct {
	// Savings plan
	SavingsPlanModel
}

SavingsPlanClientGetResponse contains the response from method SavingsPlanClient.Get.

type SavingsPlanClientListAllOptions

type SavingsPlanClientListAllOptions struct {
	// May be used to filter by reservation properties. The filter supports 'eq', 'or', and 'and'. It does not currently support
	// 'ne', 'gt', 'le', 'ge', or 'not'. Reservation properties include sku/name,
	// properties/{appliedScopeType, archived, displayName, displayProvisioningState, effectiveDateTime, expiryDate, provisioningState,
	// quantity, renew, reservedResourceType, term,
	// userFriendlyAppliedScopeType, userFriendlyRenewState}
	Filter *string

	// May be used to sort order by reservation properties.
	Orderby *string

	// To indicate whether to refresh the roll up counts of the savings plans group by provisioning states
	RefreshSummary *string

	// The selected provisioning state
	SelectedState *string

	// The number of savings plans to skip from the list before returning results
	Skiptoken *float32

	// To number of savings plans to return
	Take *float32
}

SavingsPlanClientListAllOptions contains the optional parameters for the SavingsPlanClient.NewListAllPager method.

type SavingsPlanClientListAllResponse

type SavingsPlanClientListAllResponse struct {
	SavingsPlanModelListResult
}

SavingsPlanClientListAllResponse contains the response from method SavingsPlanClient.NewListAllPager.

type SavingsPlanClientListOptions

type SavingsPlanClientListOptions struct {
}

SavingsPlanClientListOptions contains the optional parameters for the SavingsPlanClient.NewListPager method.

type SavingsPlanClientListResponse

type SavingsPlanClientListResponse struct {
	SavingsPlanModelList
}

SavingsPlanClientListResponse contains the response from method SavingsPlanClient.NewListPager.

type SavingsPlanClientUpdateOptions

type SavingsPlanClientUpdateOptions struct {
}

SavingsPlanClientUpdateOptions contains the optional parameters for the SavingsPlanClient.Update method.

type SavingsPlanClientUpdateResponse

type SavingsPlanClientUpdateResponse struct {
	// Savings plan
	SavingsPlanModel

	// Location contains the information returned from the Location header response.
	Location *string
}

SavingsPlanClientUpdateResponse contains the response from method SavingsPlanClient.Update.

type SavingsPlanClientValidateUpdateOptions

type SavingsPlanClientValidateUpdateOptions struct {
}

SavingsPlanClientValidateUpdateOptions contains the optional parameters for the SavingsPlanClient.ValidateUpdate method.

type SavingsPlanClientValidateUpdateResponse

type SavingsPlanClientValidateUpdateResponse struct {
	SavingsPlanValidateResponse
}

SavingsPlanClientValidateUpdateResponse contains the response from method SavingsPlanClient.ValidateUpdate.

type SavingsPlanModel

type SavingsPlanModel struct {
	// REQUIRED; Savings plan SKU
	SKU *SKU

	// Savings plan properties
	Properties *SavingsPlanModelProperties

	// READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string

	// READ-ONLY; The name of the resource
	Name *string

	// READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information.
	SystemData *SystemData

	// READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string
}

SavingsPlanModel - Savings plan

func (SavingsPlanModel) MarshalJSON

func (s SavingsPlanModel) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type SavingsPlanModel.

func (*SavingsPlanModel) UnmarshalJSON

func (s *SavingsPlanModel) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type SavingsPlanModel.

type SavingsPlanModelList

type SavingsPlanModelList struct {
	// Url to get the next page.
	NextLink *string
	Value    []*SavingsPlanModel
}

func (SavingsPlanModelList) MarshalJSON

func (s SavingsPlanModelList) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type SavingsPlanModelList.

func (*SavingsPlanModelList) UnmarshalJSON

func (s *SavingsPlanModelList) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type SavingsPlanModelList.

type SavingsPlanModelListResult

type SavingsPlanModelListResult struct {
	// READ-ONLY; The roll out count summary of the savings plans
	AdditionalProperties []*SavingsPlanSummary

	// READ-ONLY; Url to get the next page.
	NextLink *string

	// READ-ONLY; The list of savings plans.
	Value []*SavingsPlanModel
}

func (SavingsPlanModelListResult) MarshalJSON

func (s SavingsPlanModelListResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type SavingsPlanModelListResult.

func (*SavingsPlanModelListResult) UnmarshalJSON

func (s *SavingsPlanModelListResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type SavingsPlanModelListResult.

type SavingsPlanModelProperties

type SavingsPlanModelProperties struct {
	// Properties specific to applied scope type. Not required if not applicable.
	AppliedScopeProperties *AppliedScopeProperties

	// Type of the Applied Scope.
	AppliedScopeType *AppliedScopeType

	// This is the DateTime when the savings plan benefit started.
	BenefitStartTime *time.Time

	// Represents the billing plan in ISO 8601 format. Required only for monthly billing plans.
	BillingPlan *BillingPlan

	// Subscription that will be charged for purchasing the benefit
	BillingScopeID *string

	// Commitment towards the benefit.
	Commitment *Commitment

	// Display name
	DisplayName *string

	// Setting this to true will automatically purchase a new benefit on the expiration date time.
	Renew *bool

	// SavingsPlan Id of the SavingsPlan which is purchased because of renew.
	RenewDestination *string
	RenewProperties  *RenewProperties

	// SavingsPlan Id of the SavingsPlan from which this SavingsPlan is renewed.
	RenewSource *string

	// Represent benefit term in ISO 8601 format.
	Term *Term

	// READ-ONLY; Fully-qualified identifier of the billing account where the savings plan is applied. Present only for Enterprise
	// Agreement customers.
	BillingAccountID *string

	// READ-ONLY; Fully-qualified identifier of the billing profile where the savings plan is applied. Present only for Field-led
	// or Customer-led customers.
	BillingProfileID *string

	// READ-ONLY; Fully-qualified identifier of the customer where the savings plan is applied. Present only for Partner-led customers.
	CustomerID *string

	// READ-ONLY; The provisioning state of the savings plan for display, e.g. Succeeded
	DisplayProvisioningState *string

	// READ-ONLY; DateTime of the savings plan starts providing benefit from.
	EffectiveDateTime *time.Time

	// READ-ONLY; Expiry date time
	ExpiryDateTime *time.Time

	// READ-ONLY
	ExtendedStatusInfo *ExtendedStatusInfo

	// READ-ONLY; Provisioning state
	ProvisioningState *ProvisioningState

	// READ-ONLY; Date time when the savings plan was purchased
	PurchaseDateTime *time.Time

	// READ-ONLY; The applied scope type of the savings plan for display, e.g. Shared
	UserFriendlyAppliedScopeType *string

	// READ-ONLY; Savings plan utilization
	Utilization *Utilization
}

SavingsPlanModelProperties - Savings plan properties

func (SavingsPlanModelProperties) MarshalJSON

func (s SavingsPlanModelProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type SavingsPlanModelProperties.

func (*SavingsPlanModelProperties) UnmarshalJSON

func (s *SavingsPlanModelProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type SavingsPlanModelProperties.

type SavingsPlanOrderAliasClient

type SavingsPlanOrderAliasClient struct {
	// contains filtered or unexported fields
}

SavingsPlanOrderAliasClient contains the methods for the SavingsPlanOrderAlias group. Don't use this type directly, use NewSavingsPlanOrderAliasClient() instead.

func NewSavingsPlanOrderAliasClient

func NewSavingsPlanOrderAliasClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*SavingsPlanOrderAliasClient, error)

NewSavingsPlanOrderAliasClient creates a new instance of SavingsPlanOrderAliasClient with the specified values.

  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*SavingsPlanOrderAliasClient) BeginCreate

BeginCreate - Create a savings plan. Learn more about permissions needed at https://go.microsoft.com/fwlink/?linkid=2215851 If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-11-01

  • savingsPlanOrderAliasName - Name of the savings plan order alias
  • body - Request body for creating a savings plan order alias
  • options - SavingsPlanOrderAliasClientBeginCreateOptions contains the optional parameters for the SavingsPlanOrderAliasClient.BeginCreate method.
Example (SavingsPlanOrderAliasCreate)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/SavingsPlanOrderAliasCreate.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armbillingbenefits.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewSavingsPlanOrderAliasClient().BeginCreate(ctx, "spAlias123", armbillingbenefits.SavingsPlanOrderAliasModel{
	Properties: &armbillingbenefits.SavingsPlanOrderAliasProperties{
		AppliedScopeType: to.Ptr(armbillingbenefits.AppliedScopeTypeShared),
		BillingPlan:      to.Ptr(armbillingbenefits.BillingPlanP1M),
		BillingScopeID:   to.Ptr("/subscriptions/30000000-0000-0000-0000-000000000000"),
		Commitment: &armbillingbenefits.Commitment{
			Amount:       to.Ptr[float64](0.001),
			CurrencyCode: to.Ptr("USD"),
			Grain:        to.Ptr(armbillingbenefits.CommitmentGrainHourly),
		},
		DisplayName: to.Ptr("Compute_SavingsPlan_10-28-2022_16-38"),
		Term:        to.Ptr(armbillingbenefits.TermP3Y),
	},
	SKU: &armbillingbenefits.SKU{
		Name: to.Ptr("Compute_Savings_Plan"),
	},
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.SavingsPlanOrderAliasModel = armbillingbenefits.SavingsPlanOrderAliasModel{
// 	Name: to.Ptr("SavingsPlan_1667000324595"),
// 	Type: to.Ptr("Microsoft.BillingBenefits/savingsPlanOrderAliases"),
// 	ID: to.Ptr("/providers/microsoft.billingbenefits/savingsPlanOrderAliases/SavingsPlan_1667000324595"),
// 	Properties: &armbillingbenefits.SavingsPlanOrderAliasProperties{
// 		AppliedScopeType: to.Ptr(armbillingbenefits.AppliedScopeTypeShared),
// 		BillingPlan: to.Ptr(armbillingbenefits.BillingPlanP1M),
// 		BillingScopeID: to.Ptr("/subscriptions/30000000-0000-0000-0000-000000000000"),
// 		Commitment: &armbillingbenefits.Commitment{
// 			Amount: to.Ptr[float64](0.001),
// 			CurrencyCode: to.Ptr("USD"),
// 			Grain: to.Ptr(armbillingbenefits.CommitmentGrainHourly),
// 		},
// 		DisplayName: to.Ptr("Compute_SavingsPlan_10-28-2022_16-38"),
// 		ProvisioningState: to.Ptr(armbillingbenefits.ProvisioningStateSucceeded),
// 		SavingsPlanOrderID: to.Ptr("/providers/Microsoft.BillingBenefits/savingsPlanOrders/30000000-0000-0000-0000-000000000023"),
// 		Term: to.Ptr(armbillingbenefits.TermP3Y),
// 	},
// 	SKU: &armbillingbenefits.SKU{
// 		Name: to.Ptr("Compute_Savings_Plan"),
// 	},
// }
Output:

Example (SavingsPlanOrderAliasCreateSingleScope)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/SavingsPlanOrderAliasCreateSingleScope.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armbillingbenefits.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewSavingsPlanOrderAliasClient().BeginCreate(ctx, "spAlias123", armbillingbenefits.SavingsPlanOrderAliasModel{
	Properties: &armbillingbenefits.SavingsPlanOrderAliasProperties{
		AppliedScopeProperties: &armbillingbenefits.AppliedScopeProperties{
			SubscriptionID: to.Ptr("/subscriptions/30000000-0000-0000-0000-000000000000"),
		},
		AppliedScopeType: to.Ptr(armbillingbenefits.AppliedScopeTypeSingle),
		BillingPlan:      to.Ptr(armbillingbenefits.BillingPlanP1M),
		BillingScopeID:   to.Ptr("/providers/Microsoft.Billing/billingAccounts/1234567/billingSubscriptions/30000000-0000-0000-0000-000000000000"),
		Commitment: &armbillingbenefits.Commitment{
			Amount:       to.Ptr[float64](0.001),
			CurrencyCode: to.Ptr("USD"),
			Grain:        to.Ptr(armbillingbenefits.CommitmentGrainHourly),
		},
		DisplayName: to.Ptr("Compute_SavingsPlan_10-28-2022_16-38"),
		Term:        to.Ptr(armbillingbenefits.TermP3Y),
	},
	SKU: &armbillingbenefits.SKU{
		Name: to.Ptr("Compute_Savings_Plan"),
	},
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.SavingsPlanOrderAliasModel = armbillingbenefits.SavingsPlanOrderAliasModel{
// 	Name: to.Ptr("SavingsPlan_1667000324595"),
// 	Type: to.Ptr("Microsoft.BillingBenefits/savingsPlanOrderAliases"),
// 	ID: to.Ptr("/providers/microsoft.billingbenefits/savingsPlanOrderAliases/SavingsPlan_1667000324595"),
// 	Properties: &armbillingbenefits.SavingsPlanOrderAliasProperties{
// 		AppliedScopeProperties: &armbillingbenefits.AppliedScopeProperties{
// 			SubscriptionID: to.Ptr("/subscriptions/30000000-0000-0000-0000-000000000000"),
// 		},
// 		AppliedScopeType: to.Ptr(armbillingbenefits.AppliedScopeTypeSingle),
// 		BillingPlan: to.Ptr(armbillingbenefits.BillingPlanP1M),
// 		BillingScopeID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/1234567/billingSubscriptions/30000000-0000-0000-0000-000000000000"),
// 		Commitment: &armbillingbenefits.Commitment{
// 			Amount: to.Ptr[float64](0.001),
// 			CurrencyCode: to.Ptr("USD"),
// 			Grain: to.Ptr(armbillingbenefits.CommitmentGrainHourly),
// 		},
// 		DisplayName: to.Ptr("Compute_SavingsPlan_10-28-2022_16-38"),
// 		ProvisioningState: to.Ptr(armbillingbenefits.ProvisioningStateSucceeded),
// 		SavingsPlanOrderID: to.Ptr("/providers/Microsoft.BillingBenefits/savingsPlanOrders/30000000-0000-0000-0000-000000000023"),
// 		Term: to.Ptr(armbillingbenefits.TermP3Y),
// 	},
// 	SKU: &armbillingbenefits.SKU{
// 		Name: to.Ptr("Compute_Savings_Plan"),
// 	},
// }
Output:

func (*SavingsPlanOrderAliasClient) Get

Get - Get a savings plan. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-11-01

  • savingsPlanOrderAliasName - Name of the savings plan order alias
  • options - SavingsPlanOrderAliasClientGetOptions contains the optional parameters for the SavingsPlanOrderAliasClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/SavingsPlanOrderAliasGet.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armbillingbenefits.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewSavingsPlanOrderAliasClient().Get(ctx, "spAlias123", nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.SavingsPlanOrderAliasModel = armbillingbenefits.SavingsPlanOrderAliasModel{
// 	Name: to.Ptr("spAlias123"),
// 	Type: to.Ptr("Microsoft.BillingBenefits/savingsPlanOrderAliases"),
// 	ID: to.Ptr("/providers/microsoft.billingbenefits/savingsPlanOrderAliases/spAlias123"),
// 	Properties: &armbillingbenefits.SavingsPlanOrderAliasProperties{
// 		AppliedScopeProperties: &armbillingbenefits.AppliedScopeProperties{
// 			ResourceGroupID: to.Ptr("/subscriptions/10000000-0000-0000-0000-000000000000/resourceGroups/testrg"),
// 		},
// 		AppliedScopeType: to.Ptr(armbillingbenefits.AppliedScopeTypeSingle),
// 		BillingPlan: to.Ptr(armbillingbenefits.BillingPlanP1M),
// 		BillingScopeID: to.Ptr("/subscriptions/10000000-0000-0000-0000-000000000000"),
// 		Commitment: &armbillingbenefits.Commitment{
// 			Amount: to.Ptr[float64](15.23),
// 			CurrencyCode: to.Ptr("USD"),
// 			Grain: to.Ptr(armbillingbenefits.CommitmentGrainHourly),
// 		},
// 		DisplayName: to.Ptr("ComputeSavingsPlan_2021-07-01"),
// 		ProvisioningState: to.Ptr(armbillingbenefits.ProvisioningStateSucceeded),
// 		SavingsPlanOrderID: to.Ptr("/providers/Microsoft.BillingBenefits/savingsPlanOrders/30000000-0000-0000-0000-000000000000"),
// 		Term: to.Ptr(armbillingbenefits.TermP1Y),
// 	},
// 	SKU: &armbillingbenefits.SKU{
// 		Name: to.Ptr("Compute_Savings_Plan"),
// 	},
// }
Output:

type SavingsPlanOrderAliasClientBeginCreateOptions

type SavingsPlanOrderAliasClientBeginCreateOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

SavingsPlanOrderAliasClientBeginCreateOptions contains the optional parameters for the SavingsPlanOrderAliasClient.BeginCreate method.

type SavingsPlanOrderAliasClientCreateResponse

type SavingsPlanOrderAliasClientCreateResponse struct {
	// Savings plan order alias
	SavingsPlanOrderAliasModel
}

SavingsPlanOrderAliasClientCreateResponse contains the response from method SavingsPlanOrderAliasClient.BeginCreate.

type SavingsPlanOrderAliasClientGetOptions

type SavingsPlanOrderAliasClientGetOptions struct {
}

SavingsPlanOrderAliasClientGetOptions contains the optional parameters for the SavingsPlanOrderAliasClient.Get method.

type SavingsPlanOrderAliasClientGetResponse

type SavingsPlanOrderAliasClientGetResponse struct {
	// Savings plan order alias
	SavingsPlanOrderAliasModel
}

SavingsPlanOrderAliasClientGetResponse contains the response from method SavingsPlanOrderAliasClient.Get.

type SavingsPlanOrderAliasModel

type SavingsPlanOrderAliasModel struct {
	// REQUIRED; Savings plan SKU
	SKU *SKU

	// Resource provider kind
	Kind *string

	// Savings plan order alias properties
	Properties *SavingsPlanOrderAliasProperties

	// READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string

	// READ-ONLY; The name of the resource
	Name *string

	// READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information.
	SystemData *SystemData

	// READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string
}

SavingsPlanOrderAliasModel - Savings plan order alias

func (SavingsPlanOrderAliasModel) MarshalJSON

func (s SavingsPlanOrderAliasModel) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type SavingsPlanOrderAliasModel.

func (*SavingsPlanOrderAliasModel) UnmarshalJSON

func (s *SavingsPlanOrderAliasModel) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type SavingsPlanOrderAliasModel.

type SavingsPlanOrderAliasProperties

type SavingsPlanOrderAliasProperties struct {
	// Properties specific to applied scope type. Not required if not applicable.
	AppliedScopeProperties *AppliedScopeProperties

	// Type of the Applied Scope.
	AppliedScopeType *AppliedScopeType

	// Represents the billing plan in ISO 8601 format. Required only for monthly billing plans.
	BillingPlan *BillingPlan

	// Subscription that will be charged for purchasing the benefit
	BillingScopeID *string

	// Commitment towards the benefit.
	Commitment *Commitment

	// Display name
	DisplayName *string

	// Represent benefit term in ISO 8601 format.
	Term *Term

	// READ-ONLY; Provisioning state
	ProvisioningState *ProvisioningState

	// READ-ONLY; Identifier of the savings plan created
	SavingsPlanOrderID *string
}

SavingsPlanOrderAliasProperties - Savings plan properties

func (SavingsPlanOrderAliasProperties) MarshalJSON

func (s SavingsPlanOrderAliasProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type SavingsPlanOrderAliasProperties.

func (*SavingsPlanOrderAliasProperties) UnmarshalJSON

func (s *SavingsPlanOrderAliasProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type SavingsPlanOrderAliasProperties.

type SavingsPlanOrderClient

type SavingsPlanOrderClient struct {
	// contains filtered or unexported fields
}

SavingsPlanOrderClient contains the methods for the SavingsPlanOrder group. Don't use this type directly, use NewSavingsPlanOrderClient() instead.

func NewSavingsPlanOrderClient

func NewSavingsPlanOrderClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*SavingsPlanOrderClient, error)

NewSavingsPlanOrderClient creates a new instance of SavingsPlanOrderClient with the specified values.

  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*SavingsPlanOrderClient) Elevate

Elevate - Elevate as owner on savings plan order based on billing permissions. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-11-01

  • savingsPlanOrderID - Order ID of the savings plan
  • options - SavingsPlanOrderClientElevateOptions contains the optional parameters for the SavingsPlanOrderClient.Elevate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/SavingsPlanOrderElevate.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armbillingbenefits.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewSavingsPlanOrderClient().Elevate(ctx, "20000000-0000-0000-0000-000000000000", nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.RoleAssignmentEntity = armbillingbenefits.RoleAssignmentEntity{
// 	Name: to.Ptr("70000000-0000-0000-0000-000000000005"),
// 	ID: to.Ptr("/providers/Microsoft.BillingBenefits/savingsPlanOrders/20000000-0000-0000-0000-000000000009/providers/Microsoft.Authorization/roleAssignments/70000000-0000-0000-0000-000000000005"),
// 	Properties: &armbillingbenefits.RoleAssignmentEntityProperties{
// 		PrincipalID: to.Ptr("50000000-0000-0000-0000-000000000000"),
// 		RoleDefinitionID: to.Ptr("/providers/Microsoft.BillingBenefits/savingsPlanOrders/20000000-0000-0000-0000-000000000009/providers/Microsoft.Authorization/roleDefinitions/30000000-0000-0000-0000-000000000008"),
// 		Scope: to.Ptr("/providers/Microsoft.BillingBenefits/savingsPlanOrders/20000000-0000-0000-0000-000000000009"),
// 	},
// }
Output:

func (*SavingsPlanOrderClient) Get

Get - Get a savings plan order. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-11-01

  • savingsPlanOrderID - Order ID of the savings plan
  • options - SavingsPlanOrderClientGetOptions contains the optional parameters for the SavingsPlanOrderClient.Get method.
Example (SavingsPlanOrderGet)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/SavingsPlanOrderGet.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armbillingbenefits.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewSavingsPlanOrderClient().Get(ctx, "20000000-0000-0000-0000-000000000000", &armbillingbenefits.SavingsPlanOrderClientGetOptions{Expand: nil})
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.SavingsPlanOrderModel = armbillingbenefits.SavingsPlanOrderModel{
// 	Name: to.Ptr("20000000-0000-0000-0000-000000000000"),
// 	Type: to.Ptr("Microsoft.BillingBenefits/savingsPlanOrders"),
// 	ID: to.Ptr("/providers/microsoft.billingbenefits/savingsPlanOrders/20000000-0000-0000-0000-000000000000"),
// 	Properties: &armbillingbenefits.SavingsPlanOrderModelProperties{
// 		BillingAccountID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/20000000-1000-0000-0000-000000000000:20000000-0000-3000-0000-000000000000_2019-05-31"),
// 		BillingPlan: to.Ptr(armbillingbenefits.BillingPlanP1M),
// 		BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/20000000-1000-0000-0000-000000000000:20000000-0000-3000-0000-000000000000_2019-05-31/billingProfiles/KPSV-DWNE-BG7-TGB"),
// 		BillingScopeID: to.Ptr("20000000-0000-0000-0000-000000000005"),
// 		DisplayName: to.Ptr("Compute_SavingsPlan_10-19-2022_11-01"),
// 		ExpiryDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-10-19T18:03:55.251Z"); return t}()),
// 		ProvisioningState: to.Ptr(armbillingbenefits.ProvisioningStateSucceeded),
// 		SavingsPlans: []*string{
// 			to.Ptr("/providers/Microsoft.BillingBenefits/savingsPlanOrders/20000000-0000-0000-0000-000000000000/savingsPlans/30000000-0000-0000-0000-000000000000")},
// 			Term: to.Ptr(armbillingbenefits.TermP3Y),
// 		},
// 		SKU: &armbillingbenefits.SKU{
// 			Name: to.Ptr("Compute_Savings_Plan"),
// 		},
// 	}
Output:

Example (SavingsPlanOrderWithExpandedPaymentsGet)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/SavingsPlanOrderExpandedGet.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armbillingbenefits.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewSavingsPlanOrderClient().Get(ctx, "20000000-0000-0000-0000-000000000000", &armbillingbenefits.SavingsPlanOrderClientGetOptions{Expand: to.Ptr("schedule")})
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.SavingsPlanOrderModel = armbillingbenefits.SavingsPlanOrderModel{
// 	Name: to.Ptr("20000000-0000-0000-0000-000000000000"),
// 	Type: to.Ptr("Microsoft.BillingBenefits/savingsPlanOrders"),
// 	ID: to.Ptr("/providers/microsoft.billingbenefits/savingsPlanOrders/20000000-0000-0000-0000-000000000000"),
// 	Properties: &armbillingbenefits.SavingsPlanOrderModelProperties{
// 		BillingAccountID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/20000000-1000-0000-0000-000000000000:20000000-0000-3000-0000-000000000000_2019-05-31"),
// 		BillingPlan: to.Ptr(armbillingbenefits.BillingPlanP1M),
// 		BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/20000000-1000-0000-0000-000000000000:20000000-0000-3000-0000-000000000000_2019-05-31/billingProfiles/KPSV-DWNE-BG7-TGB"),
// 		BillingScopeID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/1234567/billingSubscriptions/30000000-0000-0000-0000-000000000003"),
// 		DisplayName: to.Ptr("Compute_SavingsPlan_10-19-2022_11-01"),
// 		ExpiryDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-10-19T18:03:55.251Z"); return t}()),
// 		PlanInformation: &armbillingbenefits.BillingPlanInformation{
// 			NextPaymentDueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2022-11-19"); return t}()),
// 			PricingCurrencyTotal: &armbillingbenefits.Price{
// 				Amount: to.Ptr[float64](26.28),
// 				CurrencyCode: to.Ptr("USD"),
// 			},
// 			StartDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2022-10-19"); return t}()),
// 			Transactions: []*armbillingbenefits.PaymentDetail{
// 				{
// 					BillingCurrencyTotal: &armbillingbenefits.Price{
// 						Amount: to.Ptr[float64](0.73),
// 						CurrencyCode: to.Ptr("USD"),
// 					},
// 					DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2022-10-19"); return t}()),
// 					PaymentDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2022-10-19"); return t}()),
// 					PricingCurrencyTotal: &armbillingbenefits.Price{
// 						Amount: to.Ptr[float64](0.73),
// 						CurrencyCode: to.Ptr("USD"),
// 					},
// 					Status: to.Ptr(armbillingbenefits.PaymentStatus("Completed")),
// 				},
// 				{
// 					DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2022-11-19"); return t}()),
// 					PricingCurrencyTotal: &armbillingbenefits.Price{
// 						Amount: to.Ptr[float64](0.73),
// 						CurrencyCode: to.Ptr("USD"),
// 					},
// 					Status: to.Ptr(armbillingbenefits.PaymentStatusScheduled),
// 				},
// 				{
// 					DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2022-12-19"); return t}()),
// 					PricingCurrencyTotal: &armbillingbenefits.Price{
// 						Amount: to.Ptr[float64](0.73),
// 						CurrencyCode: to.Ptr("USD"),
// 					},
// 					Status: to.Ptr(armbillingbenefits.PaymentStatusScheduled),
// 				},
// 				{
// 					DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2023-01-19"); return t}()),
// 					PricingCurrencyTotal: &armbillingbenefits.Price{
// 						Amount: to.Ptr[float64](0.73),
// 						CurrencyCode: to.Ptr("USD"),
// 					},
// 					Status: to.Ptr(armbillingbenefits.PaymentStatusScheduled),
// 				},
// 				{
// 					DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2023-02-19"); return t}()),
// 					PricingCurrencyTotal: &armbillingbenefits.Price{
// 						Amount: to.Ptr[float64](0.73),
// 						CurrencyCode: to.Ptr("USD"),
// 					},
// 					Status: to.Ptr(armbillingbenefits.PaymentStatusScheduled),
// 				},
// 				{
// 					DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2023-03-19"); return t}()),
// 					PricingCurrencyTotal: &armbillingbenefits.Price{
// 						Amount: to.Ptr[float64](0.73),
// 						CurrencyCode: to.Ptr("USD"),
// 					},
// 					Status: to.Ptr(armbillingbenefits.PaymentStatusScheduled),
// 				},
// 				{
// 					DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2023-04-19"); return t}()),
// 					PricingCurrencyTotal: &armbillingbenefits.Price{
// 						Amount: to.Ptr[float64](0.73),
// 						CurrencyCode: to.Ptr("USD"),
// 					},
// 					Status: to.Ptr(armbillingbenefits.PaymentStatusScheduled),
// 				},
// 				{
// 					DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2023-05-19"); return t}()),
// 					PricingCurrencyTotal: &armbillingbenefits.Price{
// 						Amount: to.Ptr[float64](0.73),
// 						CurrencyCode: to.Ptr("USD"),
// 					},
// 					Status: to.Ptr(armbillingbenefits.PaymentStatusScheduled),
// 				},
// 				{
// 					DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2023-06-19"); return t}()),
// 					PricingCurrencyTotal: &armbillingbenefits.Price{
// 						Amount: to.Ptr[float64](0.73),
// 						CurrencyCode: to.Ptr("USD"),
// 					},
// 					Status: to.Ptr(armbillingbenefits.PaymentStatusScheduled),
// 				},
// 				{
// 					DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2023-07-19"); return t}()),
// 					PricingCurrencyTotal: &armbillingbenefits.Price{
// 						Amount: to.Ptr[float64](0.73),
// 						CurrencyCode: to.Ptr("USD"),
// 					},
// 					Status: to.Ptr(armbillingbenefits.PaymentStatusScheduled),
// 				},
// 				{
// 					DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2023-08-19"); return t}()),
// 					PricingCurrencyTotal: &armbillingbenefits.Price{
// 						Amount: to.Ptr[float64](0.73),
// 						CurrencyCode: to.Ptr("USD"),
// 					},
// 					Status: to.Ptr(armbillingbenefits.PaymentStatusScheduled),
// 				},
// 				{
// 					DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2023-09-19"); return t}()),
// 					PricingCurrencyTotal: &armbillingbenefits.Price{
// 						Amount: to.Ptr[float64](0.73),
// 						CurrencyCode: to.Ptr("USD"),
// 					},
// 					Status: to.Ptr(armbillingbenefits.PaymentStatusScheduled),
// 				},
// 				{
// 					DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2023-10-19"); return t}()),
// 					PricingCurrencyTotal: &armbillingbenefits.Price{
// 						Amount: to.Ptr[float64](0.73),
// 						CurrencyCode: to.Ptr("USD"),
// 					},
// 					Status: to.Ptr(armbillingbenefits.PaymentStatusScheduled),
// 				},
// 				{
// 					DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2023-11-19"); return t}()),
// 					PricingCurrencyTotal: &armbillingbenefits.Price{
// 						Amount: to.Ptr[float64](0.73),
// 						CurrencyCode: to.Ptr("USD"),
// 					},
// 					Status: to.Ptr(armbillingbenefits.PaymentStatusScheduled),
// 				},
// 				{
// 					DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2023-12-19"); return t}()),
// 					PricingCurrencyTotal: &armbillingbenefits.Price{
// 						Amount: to.Ptr[float64](0.73),
// 						CurrencyCode: to.Ptr("USD"),
// 					},
// 					Status: to.Ptr(armbillingbenefits.PaymentStatusScheduled),
// 				},
// 				{
// 					DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2024-01-19"); return t}()),
// 					PricingCurrencyTotal: &armbillingbenefits.Price{
// 						Amount: to.Ptr[float64](0.73),
// 						CurrencyCode: to.Ptr("USD"),
// 					},
// 					Status: to.Ptr(armbillingbenefits.PaymentStatusScheduled),
// 				},
// 				{
// 					DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2024-02-19"); return t}()),
// 					PricingCurrencyTotal: &armbillingbenefits.Price{
// 						Amount: to.Ptr[float64](0.73),
// 						CurrencyCode: to.Ptr("USD"),
// 					},
// 					Status: to.Ptr(armbillingbenefits.PaymentStatusScheduled),
// 				},
// 				{
// 					DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2024-03-19"); return t}()),
// 					PricingCurrencyTotal: &armbillingbenefits.Price{
// 						Amount: to.Ptr[float64](0.73),
// 						CurrencyCode: to.Ptr("USD"),
// 					},
// 					Status: to.Ptr(armbillingbenefits.PaymentStatusScheduled),
// 				},
// 				{
// 					DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2024-04-19"); return t}()),
// 					PricingCurrencyTotal: &armbillingbenefits.Price{
// 						Amount: to.Ptr[float64](0.73),
// 						CurrencyCode: to.Ptr("USD"),
// 					},
// 					Status: to.Ptr(armbillingbenefits.PaymentStatusScheduled),
// 				},
// 				{
// 					DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2024-05-19"); return t}()),
// 					PricingCurrencyTotal: &armbillingbenefits.Price{
// 						Amount: to.Ptr[float64](0.73),
// 						CurrencyCode: to.Ptr("USD"),
// 					},
// 					Status: to.Ptr(armbillingbenefits.PaymentStatusScheduled),
// 				},
// 				{
// 					DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2024-06-19"); return t}()),
// 					PricingCurrencyTotal: &armbillingbenefits.Price{
// 						Amount: to.Ptr[float64](0.73),
// 						CurrencyCode: to.Ptr("USD"),
// 					},
// 					Status: to.Ptr(armbillingbenefits.PaymentStatusScheduled),
// 				},
// 				{
// 					DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2024-07-19"); return t}()),
// 					PricingCurrencyTotal: &armbillingbenefits.Price{
// 						Amount: to.Ptr[float64](0.73),
// 						CurrencyCode: to.Ptr("USD"),
// 					},
// 					Status: to.Ptr(armbillingbenefits.PaymentStatusScheduled),
// 				},
// 				{
// 					DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2024-08-19"); return t}()),
// 					PricingCurrencyTotal: &armbillingbenefits.Price{
// 						Amount: to.Ptr[float64](0.73),
// 						CurrencyCode: to.Ptr("USD"),
// 					},
// 					Status: to.Ptr(armbillingbenefits.PaymentStatusScheduled),
// 				},
// 				{
// 					DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2024-09-19"); return t}()),
// 					PricingCurrencyTotal: &armbillingbenefits.Price{
// 						Amount: to.Ptr[float64](0.73),
// 						CurrencyCode: to.Ptr("USD"),
// 					},
// 					Status: to.Ptr(armbillingbenefits.PaymentStatusScheduled),
// 				},
// 				{
// 					DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2024-10-19"); return t}()),
// 					PricingCurrencyTotal: &armbillingbenefits.Price{
// 						Amount: to.Ptr[float64](0.73),
// 						CurrencyCode: to.Ptr("USD"),
// 					},
// 					Status: to.Ptr(armbillingbenefits.PaymentStatusScheduled),
// 				},
// 				{
// 					DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2024-11-19"); return t}()),
// 					PricingCurrencyTotal: &armbillingbenefits.Price{
// 						Amount: to.Ptr[float64](0.73),
// 						CurrencyCode: to.Ptr("USD"),
// 					},
// 					Status: to.Ptr(armbillingbenefits.PaymentStatusScheduled),
// 				},
// 				{
// 					DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2024-12-19"); return t}()),
// 					PricingCurrencyTotal: &armbillingbenefits.Price{
// 						Amount: to.Ptr[float64](0.73),
// 						CurrencyCode: to.Ptr("USD"),
// 					},
// 					Status: to.Ptr(armbillingbenefits.PaymentStatusScheduled),
// 				},
// 				{
// 					DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2025-01-19"); return t}()),
// 					PricingCurrencyTotal: &armbillingbenefits.Price{
// 						Amount: to.Ptr[float64](0.73),
// 						CurrencyCode: to.Ptr("USD"),
// 					},
// 					Status: to.Ptr(armbillingbenefits.PaymentStatusScheduled),
// 				},
// 				{
// 					DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2025-02-19"); return t}()),
// 					PricingCurrencyTotal: &armbillingbenefits.Price{
// 						Amount: to.Ptr[float64](0.73),
// 						CurrencyCode: to.Ptr("USD"),
// 					},
// 					Status: to.Ptr(armbillingbenefits.PaymentStatusScheduled),
// 				},
// 				{
// 					DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2025-03-19"); return t}()),
// 					PricingCurrencyTotal: &armbillingbenefits.Price{
// 						Amount: to.Ptr[float64](0.73),
// 						CurrencyCode: to.Ptr("USD"),
// 					},
// 					Status: to.Ptr(armbillingbenefits.PaymentStatusScheduled),
// 				},
// 				{
// 					DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2025-04-19"); return t}()),
// 					PricingCurrencyTotal: &armbillingbenefits.Price{
// 						Amount: to.Ptr[float64](0.73),
// 						CurrencyCode: to.Ptr("USD"),
// 					},
// 					Status: to.Ptr(armbillingbenefits.PaymentStatusScheduled),
// 				},
// 				{
// 					DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2025-05-19"); return t}()),
// 					PricingCurrencyTotal: &armbillingbenefits.Price{
// 						Amount: to.Ptr[float64](0.73),
// 						CurrencyCode: to.Ptr("USD"),
// 					},
// 					Status: to.Ptr(armbillingbenefits.PaymentStatusScheduled),
// 				},
// 				{
// 					DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2025-06-19"); return t}()),
// 					PricingCurrencyTotal: &armbillingbenefits.Price{
// 						Amount: to.Ptr[float64](0.73),
// 						CurrencyCode: to.Ptr("USD"),
// 					},
// 					Status: to.Ptr(armbillingbenefits.PaymentStatusScheduled),
// 				},
// 				{
// 					DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2025-07-19"); return t}()),
// 					PricingCurrencyTotal: &armbillingbenefits.Price{
// 						Amount: to.Ptr[float64](0.73),
// 						CurrencyCode: to.Ptr("USD"),
// 					},
// 					Status: to.Ptr(armbillingbenefits.PaymentStatusScheduled),
// 				},
// 				{
// 					DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2025-08-19"); return t}()),
// 					PricingCurrencyTotal: &armbillingbenefits.Price{
// 						Amount: to.Ptr[float64](0.73),
// 						CurrencyCode: to.Ptr("USD"),
// 					},
// 					Status: to.Ptr(armbillingbenefits.PaymentStatusScheduled),
// 				},
// 				{
// 					DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2025-09-19"); return t}()),
// 					PricingCurrencyTotal: &armbillingbenefits.Price{
// 						Amount: to.Ptr[float64](0.73),
// 						CurrencyCode: to.Ptr("USD"),
// 					},
// 					Status: to.Ptr(armbillingbenefits.PaymentStatusScheduled),
// 			}},
// 		},
// 		ProvisioningState: to.Ptr(armbillingbenefits.ProvisioningStateSucceeded),
// 		SavingsPlans: []*string{
// 			to.Ptr("/providers/Microsoft.BillingBenefits/savingsPlanOrders/20000000-0000-0000-0000-000000000000/savingsPlans/30000000-0000-0000-0000-000000000000")},
// 			Term: to.Ptr(armbillingbenefits.TermP3Y),
// 		},
// 		SKU: &armbillingbenefits.SKU{
// 			Name: to.Ptr("Compute_Savings_Plan"),
// 		},
// 	}
Output:

func (*SavingsPlanOrderClient) NewListPager

NewListPager - List all Savings plan orders.

Generated from API version 2022-11-01

  • options - SavingsPlanOrderClientListOptions contains the optional parameters for the SavingsPlanOrderClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/SavingsPlanOrderList.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armbillingbenefits.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewSavingsPlanOrderClient().NewListPager(nil)
for pager.More() {
	page, err := pager.NextPage(ctx)
	if err != nil {
		log.Fatalf("failed to advance page: %v", err)
	}
	for _, v := range page.Value {
		// You could use page here. We use blank identifier for just demo purposes.
		_ = v
	}
	// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// page.SavingsPlanOrderModelList = armbillingbenefits.SavingsPlanOrderModelList{
	// 	Value: []*armbillingbenefits.SavingsPlanOrderModel{
	// 		{
	// 			Name: to.Ptr("20000000-0000-0000-0000-000000000000"),
	// 			Type: to.Ptr("Microsoft.BillingBenefits/savingsPlanOrders"),
	// 			ID: to.Ptr("/providers/microsoft.billingbenefits/savingsPlanOrders/20000000-0000-0000-0000-000000000000"),
	// 			Properties: &armbillingbenefits.SavingsPlanOrderModelProperties{
	// 				BillingAccountID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/20000000-1000-0000-0000-000000000004:20000000-0000-3000-0000-000000000000_2019-05-31"),
	// 				BillingPlan: to.Ptr(armbillingbenefits.BillingPlanP1M),
	// 				BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/20000000-1000-0000-0000-000000000004:20000000-0000-3000-0000-000000000000_2019-05-31/billingProfiles/KPSV-DWNE-BG7-TGB"),
	// 				BillingScopeID: to.Ptr("20000000-0000-0000-0000-000000000005"),
	// 				DisplayName: to.Ptr("Compute_SavingsPlan_10-28-2022_16-38"),
	// 				ExpiryDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-10-28T23:40:30.602Z"); return t}()),
	// 				ProvisioningState: to.Ptr(armbillingbenefits.ProvisioningStateSucceeded),
	// 				SavingsPlans: []*string{
	// 					to.Ptr("/providers/Microsoft.BillingBenefits/savingsPlanOrders/20000000-0000-0000-0000-000000000000/savingsPlans/20000000-0000-0000-0000-000000000001")},
	// 					Term: to.Ptr(armbillingbenefits.TermP3Y),
	// 				},
	// 				SKU: &armbillingbenefits.SKU{
	// 					Name: to.Ptr("Compute_Savings_Plan"),
	// 				},
	// 		}},
	// 	}
}
Output:

type SavingsPlanOrderClientElevateOptions

type SavingsPlanOrderClientElevateOptions struct {
}

SavingsPlanOrderClientElevateOptions contains the optional parameters for the SavingsPlanOrderClient.Elevate method.

type SavingsPlanOrderClientElevateResponse

type SavingsPlanOrderClientElevateResponse struct {
	// Role assignment entity
	RoleAssignmentEntity
}

SavingsPlanOrderClientElevateResponse contains the response from method SavingsPlanOrderClient.Elevate.

type SavingsPlanOrderClientGetOptions

type SavingsPlanOrderClientGetOptions struct {
	// May be used to expand the detail information of some properties.
	Expand *string
}

SavingsPlanOrderClientGetOptions contains the optional parameters for the SavingsPlanOrderClient.Get method.

type SavingsPlanOrderClientGetResponse

type SavingsPlanOrderClientGetResponse struct {
	// Savings plan order
	SavingsPlanOrderModel
}

SavingsPlanOrderClientGetResponse contains the response from method SavingsPlanOrderClient.Get.

type SavingsPlanOrderClientListOptions

type SavingsPlanOrderClientListOptions struct {
}

SavingsPlanOrderClientListOptions contains the optional parameters for the SavingsPlanOrderClient.NewListPager method.

type SavingsPlanOrderClientListResponse

type SavingsPlanOrderClientListResponse struct {
	SavingsPlanOrderModelList
}

SavingsPlanOrderClientListResponse contains the response from method SavingsPlanOrderClient.NewListPager.

type SavingsPlanOrderModel

type SavingsPlanOrderModel struct {
	// REQUIRED; Savings plan SKU
	SKU *SKU

	// Savings plan order properties
	Properties *SavingsPlanOrderModelProperties

	// READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string

	// READ-ONLY; The name of the resource
	Name *string

	// READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information.
	SystemData *SystemData

	// READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string
}

SavingsPlanOrderModel - Savings plan order

func (SavingsPlanOrderModel) MarshalJSON

func (s SavingsPlanOrderModel) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type SavingsPlanOrderModel.

func (*SavingsPlanOrderModel) UnmarshalJSON

func (s *SavingsPlanOrderModel) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type SavingsPlanOrderModel.

type SavingsPlanOrderModelList

type SavingsPlanOrderModelList struct {
	// Url to get the next page.
	NextLink *string
	Value    []*SavingsPlanOrderModel
}

func (SavingsPlanOrderModelList) MarshalJSON

func (s SavingsPlanOrderModelList) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type SavingsPlanOrderModelList.

func (*SavingsPlanOrderModelList) UnmarshalJSON

func (s *SavingsPlanOrderModelList) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type SavingsPlanOrderModelList.

type SavingsPlanOrderModelProperties

type SavingsPlanOrderModelProperties struct {
	// This is the DateTime when the savings plan benefit started.
	BenefitStartTime *time.Time

	// Represents the billing plan in ISO 8601 format. Required only for monthly billing plans.
	BillingPlan *BillingPlan

	// Subscription that will be charged for purchasing the benefit
	BillingScopeID *string

	// Display name
	DisplayName *string

	// Information describing the type of billing plan for this savings plan.
	PlanInformation *BillingPlanInformation
	SavingsPlans    []*string

	// Represent benefit term in ISO 8601 format.
	Term *Term

	// READ-ONLY; Fully-qualified identifier of the billing account where the savings plan is applied. Present only for Enterprise
	// Agreement customers.
	BillingAccountID *string

	// READ-ONLY; Fully-qualified identifier of the billing profile where the savings plan is applied. Present only for Field-led
	// or Customer-led customers.
	BillingProfileID *string

	// READ-ONLY; Fully-qualified identifier of the customer where the savings plan is applied. Present only for Partner-led customers.
	CustomerID *string

	// READ-ONLY; Expiry date time
	ExpiryDateTime *time.Time

	// READ-ONLY
	ExtendedStatusInfo *ExtendedStatusInfo

	// READ-ONLY; Provisioning state
	ProvisioningState *ProvisioningState
}

SavingsPlanOrderModelProperties - Savings plan order properties

func (SavingsPlanOrderModelProperties) MarshalJSON

func (s SavingsPlanOrderModelProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type SavingsPlanOrderModelProperties.

func (*SavingsPlanOrderModelProperties) UnmarshalJSON

func (s *SavingsPlanOrderModelProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type SavingsPlanOrderModelProperties.

type SavingsPlanPurchaseValidateRequest

type SavingsPlanPurchaseValidateRequest struct {
	Benefits []*SavingsPlanOrderAliasModel
}

func (SavingsPlanPurchaseValidateRequest) MarshalJSON

func (s SavingsPlanPurchaseValidateRequest) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type SavingsPlanPurchaseValidateRequest.

func (*SavingsPlanPurchaseValidateRequest) UnmarshalJSON

func (s *SavingsPlanPurchaseValidateRequest) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type SavingsPlanPurchaseValidateRequest.

type SavingsPlanSummary

type SavingsPlanSummary struct {
	// The roll up count summary of savings plans in each state
	Value *SavingsPlanSummaryCount

	// READ-ONLY; This property has value 'summary'
	Name *string
}

SavingsPlanSummary - Savings plans list summary

func (SavingsPlanSummary) MarshalJSON

func (s SavingsPlanSummary) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type SavingsPlanSummary.

func (*SavingsPlanSummary) UnmarshalJSON

func (s *SavingsPlanSummary) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type SavingsPlanSummary.

type SavingsPlanSummaryCount

type SavingsPlanSummaryCount struct {
	// READ-ONLY; The number of savings plans in Cancelled state
	CancelledCount *float32

	// READ-ONLY; The number of savings plans in Expired state
	ExpiredCount *float32

	// READ-ONLY; The number of savings plans in Expiring state
	ExpiringCount *float32

	// READ-ONLY; The number of savings plans in Failed state
	FailedCount *float32

	// READ-ONLY; The number of savings plans in No Benefit state
	NoBenefitCount *float32

	// READ-ONLY; The number of savings plans in Pending state
	PendingCount *float32

	// READ-ONLY; The number of savings plans in Processing state
	ProcessingCount *float32

	// READ-ONLY; The number of savings plans in Succeeded state
	SucceededCount *float32

	// READ-ONLY; The number of savings plans in Warning state
	WarningCount *float32
}

SavingsPlanSummaryCount - The roll up count summary of savings plans in each state

func (SavingsPlanSummaryCount) MarshalJSON

func (s SavingsPlanSummaryCount) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type SavingsPlanSummaryCount.

func (*SavingsPlanSummaryCount) UnmarshalJSON

func (s *SavingsPlanSummaryCount) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type SavingsPlanSummaryCount.

type SavingsPlanUpdateRequest

type SavingsPlanUpdateRequest struct {
	// Savings plan patch request
	Properties *SavingsPlanUpdateRequestProperties
}

SavingsPlanUpdateRequest - Savings plan patch request

func (SavingsPlanUpdateRequest) MarshalJSON

func (s SavingsPlanUpdateRequest) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type SavingsPlanUpdateRequest.

func (*SavingsPlanUpdateRequest) UnmarshalJSON

func (s *SavingsPlanUpdateRequest) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type SavingsPlanUpdateRequest.

type SavingsPlanUpdateRequestProperties

type SavingsPlanUpdateRequestProperties struct {
	// Properties specific to applied scope type. Not required if not applicable.
	AppliedScopeProperties *AppliedScopeProperties

	// Type of the Applied Scope.
	AppliedScopeType *AppliedScopeType

	// Display name
	DisplayName *string

	// Setting this to true will automatically purchase a new benefit on the expiration date time.
	Renew           *bool
	RenewProperties *RenewProperties
}

SavingsPlanUpdateRequestProperties - Savings plan patch request

func (SavingsPlanUpdateRequestProperties) MarshalJSON

func (s SavingsPlanUpdateRequestProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type SavingsPlanUpdateRequestProperties.

func (*SavingsPlanUpdateRequestProperties) UnmarshalJSON

func (s *SavingsPlanUpdateRequestProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type SavingsPlanUpdateRequestProperties.

type SavingsPlanUpdateValidateRequest

type SavingsPlanUpdateValidateRequest struct {
	Benefits []*SavingsPlanUpdateRequestProperties
}

func (SavingsPlanUpdateValidateRequest) MarshalJSON

func (s SavingsPlanUpdateValidateRequest) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type SavingsPlanUpdateValidateRequest.

func (*SavingsPlanUpdateValidateRequest) UnmarshalJSON

func (s *SavingsPlanUpdateValidateRequest) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type SavingsPlanUpdateValidateRequest.

type SavingsPlanValidResponseProperty

type SavingsPlanValidResponseProperty struct {
	// Failure reason if the provided input was invalid
	Reason *string

	// Failure reason code if the provided input was invalid
	ReasonCode *string

	// Indicates if the provided input was valid
	Valid *bool
}

SavingsPlanValidResponseProperty - Benefit scope response property

func (SavingsPlanValidResponseProperty) MarshalJSON

func (s SavingsPlanValidResponseProperty) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type SavingsPlanValidResponseProperty.

func (*SavingsPlanValidResponseProperty) UnmarshalJSON

func (s *SavingsPlanValidResponseProperty) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type SavingsPlanValidResponseProperty.

type SavingsPlanValidateResponse

type SavingsPlanValidateResponse struct {
	Benefits []*SavingsPlanValidResponseProperty

	// Url to get the next page.
	NextLink *string
}

func (SavingsPlanValidateResponse) MarshalJSON

func (s SavingsPlanValidateResponse) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type SavingsPlanValidateResponse.

func (*SavingsPlanValidateResponse) UnmarshalJSON

func (s *SavingsPlanValidateResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type SavingsPlanValidateResponse.

type SystemData

type SystemData struct {
	// The timestamp of resource creation (UTC).
	CreatedAt *time.Time

	// The identity that created the resource.
	CreatedBy *string

	// The type of identity that created the resource.
	CreatedByType *CreatedByType

	// The timestamp of resource last modification (UTC)
	LastModifiedAt *time.Time

	// The identity that last modified the resource.
	LastModifiedBy *string

	// The type of identity that last modified the resource.
	LastModifiedByType *CreatedByType
}

SystemData - Metadata pertaining to creation and last modification of the resource.

func (SystemData) MarshalJSON

func (s SystemData) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type SystemData.

func (*SystemData) UnmarshalJSON

func (s *SystemData) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type SystemData.

type Term

type Term string

Term - Represent benefit term in ISO 8601 format.

const (
	TermP1Y Term = "P1Y"
	TermP3Y Term = "P3Y"
	TermP5Y Term = "P5Y"
)

func PossibleTermValues

func PossibleTermValues() []Term

PossibleTermValues returns the possible values for the Term const type.

type Utilization

type Utilization struct {
	// The array of aggregates of a savings plan's utilization
	Aggregates []*UtilizationAggregates

	// READ-ONLY; The number of days trend for a savings plan
	Trend *string
}

Utilization - Savings plan utilization

func (Utilization) MarshalJSON

func (u Utilization) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type Utilization.

func (*Utilization) UnmarshalJSON

func (u *Utilization) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type Utilization.

type UtilizationAggregates

type UtilizationAggregates struct {
	// READ-ONLY; The grain of the aggregate
	Grain *float32

	// READ-ONLY; The grain unit of the aggregate
	GrainUnit *string

	// READ-ONLY; The aggregate value
	Value *float32

	// READ-ONLY; The aggregate value unit
	ValueUnit *string
}

UtilizationAggregates - The aggregate values of savings plan utilization

func (UtilizationAggregates) MarshalJSON

func (u UtilizationAggregates) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type UtilizationAggregates.

func (*UtilizationAggregates) UnmarshalJSON

func (u *UtilizationAggregates) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type UtilizationAggregates.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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