armreservations

package module
v3.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2023 License: MIT Imports: 15 Imported by: 2

README

Azure Servations Module for Go

PkgGoDev

The armreservations module provides operations for working with Azure Servations.

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 Servations module:

go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/reservations/armreservations

Authorization

When creating a client, you will need to provide a credential for authenticating with Azure Servations. 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 Servations 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 := armreservations.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 := armreservations.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.NewReservationClient()

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 Servations 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 AppliedReservationList

type AppliedReservationList struct {
	// Url to get the next page of reservations
	NextLink *string
	Value    []*string
}

AppliedReservationList - Paginated list of applied reservations

func (AppliedReservationList) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type AppliedReservationList.

func (*AppliedReservationList) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type AppliedReservationList.

type AppliedReservations

type AppliedReservations struct {
	// Properties for applied reservations returned
	Properties *AppliedReservationsProperties

	// READ-ONLY; Identifier of the applied reservations
	ID *string

	// READ-ONLY; Name of resource
	Name *string

	// READ-ONLY; Type of resource. "Microsoft.Capacity/AppliedReservations"
	Type *string
}

AppliedReservations - The response for applied reservations api

func (AppliedReservations) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type AppliedReservations.

func (*AppliedReservations) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type AppliedReservations.

type AppliedReservationsProperties

type AppliedReservationsProperties struct {
	// Paginated list of applied reservations
	ReservationOrderIDs *AppliedReservationList
}

AppliedReservationsProperties - Properties for applied reservations returned

func (AppliedReservationsProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type AppliedReservationsProperties.

func (*AppliedReservationsProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type AppliedReservationsProperties.

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 savings plan should apply benefit.
	TenantID *string
}

AppliedScopeProperties - Properties specific to applied scope type. Not required if not applicable. Required and need to provide tenantId and managementGroupId if AppliedScopeType is ManagementGroup

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 AvailableScopeProperties

type AvailableScopeProperties struct {
	// The scopes checked by the available scope api.
	Properties *SubscriptionScopeProperties
}

AvailableScopeProperties - The response of available scope api containing scopes and their eligibilities.

func (AvailableScopeProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type AvailableScopeProperties.

func (*AvailableScopeProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type AvailableScopeProperties.

type AvailableScopeRequest

type AvailableScopeRequest struct {
	// Available scope request properties
	Properties *AvailableScopeRequestProperties
}

AvailableScopeRequest - Available scope

func (AvailableScopeRequest) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type AvailableScopeRequest.

func (*AvailableScopeRequest) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type AvailableScopeRequest.

type AvailableScopeRequestProperties

type AvailableScopeRequestProperties struct {
	Scopes []*string
}

AvailableScopeRequestProperties - Available scope request properties

func (AvailableScopeRequestProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type AvailableScopeRequestProperties.

func (*AvailableScopeRequestProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type AvailableScopeRequestProperties.

type AzureReservationAPIClient

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

AzureReservationAPIClient contains the methods for the AzureReservationAPI group. Don't use this type directly, use NewAzureReservationAPIClient() instead.

func NewAzureReservationAPIClient

func NewAzureReservationAPIClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*AzureReservationAPIClient, error)

NewAzureReservationAPIClient creates a new instance of AzureReservationAPIClient with the specified values.

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

func (*AzureReservationAPIClient) GetAppliedReservationList

GetAppliedReservationList - Get applicable Reservations that are applied to this subscription or a resource group under this subscription. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-11-01

  • subscriptionID - Id of the subscription
  • options - AzureReservationAPIClientGetAppliedReservationListOptions contains the optional parameters for the AzureReservationAPIClient.GetAppliedReservationList method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-11-01/examples/GetAppliedReservations.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armreservations.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewAzureReservationAPIClient().GetAppliedReservationList(ctx, "23bc208b-083f-4901-ae85-4f98c0c3b4b6", 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.AppliedReservations = armreservations.AppliedReservations{
// 	Name: to.Ptr("default"),
// 	Type: to.Ptr("Microsoft.Capacity/AppliedReservations"),
// 	ID: to.Ptr("/subscriptions/23bc208b-083f-4901-ae85-4f98c0c3b4b6/providers/microsoft.capacity/AppliedReservations/default"),
// 	Properties: &armreservations.AppliedReservationsProperties{
// 		ReservationOrderIDs: &armreservations.AppliedReservationList{
// 			Value: []*string{
// 				to.Ptr("/providers/Microsoft.Capacity/reservationorders/e1eccf0b-2db4-4e84-97e7-98b50e9d46f7"),
// 				to.Ptr("/providers/Microsoft.Capacity/reservationorders/741a32eb-6158-4cee-9642-a0243ae79fac"),
// 				to.Ptr("/providers/Microsoft.Capacity/reservationorders/e061223d-fcff-4d10-bd49-56a740cfb96a"),
// 				to.Ptr("/providers/Microsoft.Capacity/reservationorders/2eeb7234-970e-4663-b60b-85241b515901"),
// 				to.Ptr("/providers/Microsoft.Capacity/reservationorders/9db2f4c5-b1c5-42a8-bd79-ee56cdde2c7f"),
// 				to.Ptr("/providers/Microsoft.Capacity/reservationorders/5da7a877-6d6e-44af-8880-ed3f533bf928"),
// 				to.Ptr("/providers/Microsoft.Capacity/reservationorders/f65b0d0a-f945-4105-821c-d00bc8bacde8"),
// 				to.Ptr("/providers/Microsoft.Capacity/reservationorders/51304124-e477-4b07-b9fa-03b05c8b924b"),
// 				to.Ptr("/providers/Microsoft.Capacity/reservationorders/f5409b98-8a42-4dc6-be0a-cc59bef4d0db"),
// 				to.Ptr("/providers/Microsoft.Capacity/reservationorders/a495550a-80a4-46f8-8843-34d4df46f9a6"),
// 				to.Ptr("/providers/Microsoft.Capacity/reservationorders/1a966e18-c272-4ce1-a0c2-d4e1039023c3"),
// 				to.Ptr("/providers/Microsoft.Capacity/reservationorders/939310b4-f9de-4645-9569-ab5b6cfe958e"),
// 				to.Ptr("/providers/Microsoft.Capacity/reservationorders/4193a889-7c3b-44dc-8b7b-bfd7aad6c723")},
// 			},
// 		},
// 	}
Output:

func (*AzureReservationAPIClient) NewGetCatalogPager

NewGetCatalogPager - Get the regions and skus that are available for RI purchase for the specified Azure subscription.

Generated from API version 2022-11-01

  • subscriptionID - Id of the subscription
  • options - AzureReservationAPIClientGetCatalogOptions contains the optional parameters for the AzureReservationAPIClient.NewGetCatalogPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-11-01/examples/GetCatalog.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armreservations.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewAzureReservationAPIClient().NewGetCatalogPager("23bc208b-083f-4901-ae85-4f98c0c3b4b6", &armreservations.AzureReservationAPIClientGetCatalogOptions{ReservedResourceType: to.Ptr("VirtualMachines"),
	Location:    to.Ptr("eastus"),
	PublisherID: nil,
	OfferID:     nil,
	PlanID:      nil,
	Filter:      nil,
	Skip:        nil,
	Take:        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.CatalogsResult = armreservations.CatalogsResult{
	// 	TotalItems: to.Ptr[int64](1000),
	// 	Value: []*armreservations.Catalog{
	// 		{
	// 			Name: to.Ptr("Standard_DS5_v2"),
	// 			BillingPlans: map[string][]*armreservations.ReservationBillingPlan{
	// 				"P1Y": []*armreservations.ReservationBillingPlan{
	// 					to.Ptr(armreservations.ReservationBillingPlanUpfront),
	// 					to.Ptr(armreservations.ReservationBillingPlanMonthly)},
	// 					"P3Y": []*armreservations.ReservationBillingPlan{
	// 						to.Ptr(armreservations.ReservationBillingPlanUpfront),
	// 						to.Ptr(armreservations.ReservationBillingPlanMonthly)},
	// 					},
	// 					Locations: []*string{
	// 						to.Ptr("eastus")},
	// 						ResourceType: to.Ptr("VirtualMachines"),
	// 						Restrictions: []*armreservations.SKURestriction{
	// 						},
	// 						SKUProperties: []*armreservations.SKUProperty{
	// 							{
	// 								Name: to.Ptr("Cores"),
	// 								Value: to.Ptr("16"),
	// 							},
	// 							{
	// 								Name: to.Ptr("ProductTitle"),
	// 								Value: to.Ptr("DSv2 Series, DS5"),
	// 							},
	// 							{
	// 								Name: to.Ptr("ProductShortName"),
	// 								Value: to.Ptr("DSv2 Series"),
	// 							},
	// 							{
	// 								Name: to.Ptr("SKUName"),
	// 								Value: to.Ptr("DS5 v2"),
	// 							},
	// 							{
	// 								Name: to.Ptr("MeterId"),
	// 								Value: to.Ptr("12bc208b-083f-4901-ae85-4f98c0c3b4b8"),
	// 						}},
	// 						Terms: []*armreservations.ReservationTerm{
	// 							to.Ptr(armreservations.ReservationTermP1Y),
	// 							to.Ptr(armreservations.ReservationTermP3Y)},
	// 						},
	// 						{
	// 							Name: to.Ptr("Standard_D1"),
	// 							BillingPlans: map[string][]*armreservations.ReservationBillingPlan{
	// 								"P1Y": []*armreservations.ReservationBillingPlan{
	// 									to.Ptr(armreservations.ReservationBillingPlanUpfront),
	// 									to.Ptr(armreservations.ReservationBillingPlanMonthly)},
	// 									"P3Y": []*armreservations.ReservationBillingPlan{
	// 										to.Ptr(armreservations.ReservationBillingPlanUpfront),
	// 										to.Ptr(armreservations.ReservationBillingPlanMonthly)},
	// 									},
	// 									Locations: []*string{
	// 										to.Ptr("eastus")},
	// 										ResourceType: to.Ptr("VirtualMachines"),
	// 										Restrictions: []*armreservations.SKURestriction{
	// 											{
	// 												Type: to.Ptr("Term"),
	// 												ReasonCode: to.Ptr("NotAvailableForSubscription"),
	// 												Values: []*string{
	// 													to.Ptr("P1Y")},
	// 												},
	// 												{
	// 													Type: to.Ptr("Term"),
	// 													ReasonCode: to.Ptr("NotAvailableForSubscription"),
	// 													Values: []*string{
	// 														to.Ptr("P3Y")},
	// 												}},
	// 												SKUProperties: []*armreservations.SKUProperty{
	// 													{
	// 														Name: to.Ptr("Cores"),
	// 														Value: to.Ptr("1"),
	// 													},
	// 													{
	// 														Name: to.Ptr("ProductTitle"),
	// 														Value: to.Ptr("D Series, D1"),
	// 													},
	// 													{
	// 														Name: to.Ptr("ProductShortName"),
	// 														Value: to.Ptr("D Series"),
	// 													},
	// 													{
	// 														Name: to.Ptr("SKUName"),
	// 														Value: to.Ptr("D1"),
	// 													},
	// 													{
	// 														Name: to.Ptr("MeterId"),
	// 														Value: to.Ptr("12bc208b-083f-4901-ae85-4f98c0c3b4b8"),
	// 												}},
	// 												Terms: []*armreservations.ReservationTerm{
	// 													to.Ptr(armreservations.ReservationTermP1Y),
	// 													to.Ptr(armreservations.ReservationTermP3Y)},
	// 												},
	// 												{
	// 													Name: to.Ptr("Standard_F2"),
	// 													BillingPlans: map[string][]*armreservations.ReservationBillingPlan{
	// 														"P1Y": []*armreservations.ReservationBillingPlan{
	// 															to.Ptr(armreservations.ReservationBillingPlanUpfront),
	// 															to.Ptr(armreservations.ReservationBillingPlanMonthly)},
	// 															"P3Y": []*armreservations.ReservationBillingPlan{
	// 																to.Ptr(armreservations.ReservationBillingPlanUpfront),
	// 																to.Ptr(armreservations.ReservationBillingPlanMonthly)},
	// 															},
	// 															Locations: []*string{
	// 																to.Ptr("eastus")},
	// 																ResourceType: to.Ptr("VirtualMachines"),
	// 																Restrictions: []*armreservations.SKURestriction{
	// 																	{
	// 																		Type: to.Ptr("Location"),
	// 																		ReasonCode: to.Ptr("NotAvailableForSubscription"),
	// 																		Values: []*string{
	// 																			to.Ptr("eastus")},
	// 																	}},
	// 																	SKUProperties: []*armreservations.SKUProperty{
	// 																		{
	// 																			Name: to.Ptr("Cores"),
	// 																			Value: to.Ptr("2"),
	// 																		},
	// 																		{
	// 																			Name: to.Ptr("ProductTitle"),
	// 																			Value: to.Ptr("F Series, F2"),
	// 																		},
	// 																		{
	// 																			Name: to.Ptr("ProductShortName"),
	// 																			Value: to.Ptr("F Series"),
	// 																		},
	// 																		{
	// 																			Name: to.Ptr("SKUName"),
	// 																			Value: to.Ptr("F2"),
	// 																		},
	// 																		{
	// 																			Name: to.Ptr("MeterId"),
	// 																			Value: to.Ptr("12bc208b-083f-4901-ae85-4f98c0c3b4b8"),
	// 																	}},
	// 																	Terms: []*armreservations.ReservationTerm{
	// 																		to.Ptr(armreservations.ReservationTermP1Y),
	// 																		to.Ptr(armreservations.ReservationTermP3Y)},
	// 																}},
	// 															}
}
Output:

type AzureReservationAPIClientGetAppliedReservationListOptions

type AzureReservationAPIClientGetAppliedReservationListOptions struct {
}

AzureReservationAPIClientGetAppliedReservationListOptions contains the optional parameters for the AzureReservationAPIClient.GetAppliedReservationList method.

type AzureReservationAPIClientGetAppliedReservationListResponse

type AzureReservationAPIClientGetAppliedReservationListResponse struct {
	// The response for applied reservations api
	AppliedReservations
}

AzureReservationAPIClientGetAppliedReservationListResponse contains the response from method AzureReservationAPIClient.GetAppliedReservationList.

type AzureReservationAPIClientGetCatalogOptions

type AzureReservationAPIClientGetCatalogOptions struct {
	// May be used to filter by Catalog properties. The filter supports 'eq', 'or', and 'and'.
	Filter *string

	// Filters the skus based on the location specified in this parameter. This can be an Azure region or global
	Location *string

	// Offer id used to get the third party products
	OfferID *string

	// Plan id used to get the third party products
	PlanID *string

	// Publisher id used to get the third party products
	PublisherID *string

	// The type of the resource for which the skus should be provided.
	ReservedResourceType *string

	// The number of reservations to skip from the list before returning results
	Skip *float32

	// To number of reservations to return
	Take *float32
}

AzureReservationAPIClientGetCatalogOptions contains the optional parameters for the AzureReservationAPIClient.NewGetCatalogPager method.

type AzureReservationAPIClientGetCatalogResponse

type AzureReservationAPIClientGetCatalogResponse struct {
	// The list of catalogs and pagination information.
	CatalogsResult
}

AzureReservationAPIClientGetCatalogResponse contains the response from method AzureReservationAPIClient.NewGetCatalogPager.

type BillingInformation

type BillingInformation struct {
	// Pricing information containing the amount and the currency code
	BillingCurrencyProratedAmount *Price

	// Pricing information containing the amount and the currency code
	BillingCurrencyRemainingCommitmentAmount *Price

	// Pricing information containing the amount and the currency code
	BillingCurrencyTotalPaidAmount *Price
}

BillingInformation - billing information

func (BillingInformation) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type BillingInformation.

func (*BillingInformation) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type BillingInformation.

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 CalculateExchangeClient

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

CalculateExchangeClient contains the methods for the CalculateExchange group. Don't use this type directly, use NewCalculateExchangeClient() instead.

func NewCalculateExchangeClient

func NewCalculateExchangeClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*CalculateExchangeClient, error)

NewCalculateExchangeClient creates a new instance of CalculateExchangeClient with the specified values.

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

func (*CalculateExchangeClient) BeginPost

BeginPost - Calculates price for exchanging Reservations if there are no policy errors. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-11-01

  • body - Request containing purchases and refunds that need to be executed.
  • options - CalculateExchangeClientBeginPostOptions contains the optional parameters for the CalculateExchangeClient.BeginPost method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-11-01/examples/CalculateExchange.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armreservations.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewCalculateExchangeClient().BeginPost(ctx, armreservations.CalculateExchangeRequest{
	Properties: &armreservations.CalculateExchangeRequestProperties{
		ReservationsToExchange: []*armreservations.ReservationToReturn{
			{
				Quantity:      to.Ptr[int32](1),
				ReservationID: to.Ptr("/providers/microsoft.capacity/reservationOrders/1f14354c-dc12-4c8d-8090-6f295a3a34aa/reservations/c8c926bd-fc5d-4e29-9d43-b68340ac23a6"),
			}},
		ReservationsToPurchase: []*armreservations.PurchaseRequest{
			{
				Location: to.Ptr("westus"),
				Properties: &armreservations.PurchaseRequestProperties{
					AppliedScopeType: to.Ptr(armreservations.AppliedScopeTypeShared),
					BillingPlan:      to.Ptr(armreservations.ReservationBillingPlanUpfront),
					BillingScopeID:   to.Ptr("/subscriptions/ed3a1871-612d-abcd-a849-c2542a68be83"),
					DisplayName:      to.Ptr("testDisplayName"),
					Quantity:         to.Ptr[int32](1),
					Renew:            to.Ptr(false),
					ReservedResourceProperties: &armreservations.PurchaseRequestPropertiesReservedResourceProperties{
						InstanceFlexibility: to.Ptr(armreservations.InstanceFlexibilityOn),
					},
					ReservedResourceType: to.Ptr(armreservations.ReservedResourceTypeVirtualMachines),
					Term:                 to.Ptr(armreservations.ReservationTermP1Y),
				},
				SKU: &armreservations.SKUName{
					Name: to.Ptr("Standard_B1ls"),
				},
			}},
		SavingsPlansToPurchase: []*armreservations.SavingsPlanPurchaseRequest{
			{
				Properties: &armreservations.SavingsPlanPurchaseRequestProperties{
					AppliedScopeProperties: &armreservations.AppliedScopeProperties{
						ResourceGroupID: to.Ptr("/subscriptions/10000000-0000-0000-0000-000000000000/resourceGroups/testrg"),
					},
					AppliedScopeType: to.Ptr(armreservations.AppliedScopeTypeSingle),
					BillingScopeID:   to.Ptr("/subscriptions/10000000-0000-0000-0000-000000000000"),
					Commitment: &armreservations.Commitment{
						Amount:       to.Ptr[float64](15.23),
						CurrencyCode: to.Ptr("USD"),
						Grain:        to.Ptr(armreservations.CommitmentGrainHourly),
					},
					DisplayName: to.Ptr("ComputeSavingsPlan"),
					Term:        to.Ptr(armreservations.SavingsPlanTermP1Y),
				},
				SKU: &armreservations.SKUName{
					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.CalculateExchangeOperationResultResponse = armreservations.CalculateExchangeOperationResultResponse{
// 	Name: to.Ptr("4e2ffff7-b331-4fcb-ab11-b5fa49368188"),
// 	ID: to.Ptr("/providers/microsoft.capacity/operationResults/4e2ffff7-b331-4fcb-ab11-b5fa49368188"),
// 	Properties: &armreservations.CalculateExchangeResponseProperties{
// 		NetPayable: &armreservations.Price{
// 			Amount: to.Ptr[float64](149254.8),
// 			CurrencyCode: to.Ptr("USD"),
// 		},
// 		PolicyResult: &armreservations.ExchangePolicyErrors{
// 		},
// 		PurchasesTotal: &armreservations.Price{
// 			Amount: to.Ptr[float64](153214.8),
// 			CurrencyCode: to.Ptr("USD"),
// 		},
// 		RefundsTotal: &armreservations.Price{
// 			Amount: to.Ptr[float64](3960),
// 			CurrencyCode: to.Ptr("USD"),
// 		},
// 		ReservationsToExchange: []*armreservations.ReservationToExchange{
// 			{
// 				BillingInformation: &armreservations.BillingInformation{
// 					BillingCurrencyProratedAmount: &armreservations.Price{
// 						Amount: to.Ptr[float64](149254.8),
// 						CurrencyCode: to.Ptr("USD"),
// 					},
// 					BillingCurrencyRemainingCommitmentAmount: &armreservations.Price{
// 						Amount: to.Ptr[float64](0),
// 						CurrencyCode: to.Ptr("USD"),
// 					},
// 					BillingCurrencyTotalPaidAmount: &armreservations.Price{
// 						Amount: to.Ptr[float64](153214.8),
// 						CurrencyCode: to.Ptr("USD"),
// 					},
// 				},
// 				BillingRefundAmount: &armreservations.Price{
// 					Amount: to.Ptr[float64](3960),
// 					CurrencyCode: to.Ptr("USD"),
// 				},
// 				Quantity: to.Ptr[int32](1),
// 				ReservationID: to.Ptr("/providers/microsoft.capacity/reservationOrders/1f14354c-dc12-4c8d-8090-6f295a3a34aa/reservations/c8c926bd-fc5d-4e29-9d43-b68340ac23a6"),
// 		}},
// 		ReservationsToPurchase: []*armreservations.ReservationToPurchaseCalculateExchange{
// 			{
// 				BillingCurrencyTotal: &armreservations.Price{
// 					Amount: to.Ptr[float64](19800),
// 					CurrencyCode: to.Ptr("USD"),
// 				},
// 				Properties: &armreservations.PurchaseRequest{
// 					Location: to.Ptr("westus"),
// 					Properties: &armreservations.PurchaseRequestProperties{
// 						AppliedScopeType: to.Ptr(armreservations.AppliedScopeTypeShared),
// 						BillingPlan: to.Ptr(armreservations.ReservationBillingPlanUpfront),
// 						BillingScopeID: to.Ptr("/subscriptions/ed3a1871-612d-abcd-a849-c2542a68be83"),
// 						DisplayName: to.Ptr("testDisplayName"),
// 						Quantity: to.Ptr[int32](1),
// 						Renew: to.Ptr(false),
// 						ReservedResourceProperties: &armreservations.PurchaseRequestPropertiesReservedResourceProperties{
// 							InstanceFlexibility: to.Ptr(armreservations.InstanceFlexibilityOn),
// 						},
// 						ReservedResourceType: to.Ptr(armreservations.ReservedResourceTypeVirtualMachines),
// 						Term: to.Ptr(armreservations.ReservationTermP1Y),
// 					},
// 					SKU: &armreservations.SKUName{
// 						Name: to.Ptr("Standard_B1ls"),
// 					},
// 				},
// 		}},
// 		SavingsPlansToPurchase: []*armreservations.SavingsPlanToPurchaseCalculateExchange{
// 			{
// 				BillingCurrencyTotal: &armreservations.Price{
// 					Amount: to.Ptr[float64](133414.8),
// 					CurrencyCode: to.Ptr("USD"),
// 				},
// 				Properties: &armreservations.SavingsPlanPurchaseRequest{
// 					Properties: &armreservations.SavingsPlanPurchaseRequestProperties{
// 						AppliedScopeProperties: &armreservations.AppliedScopeProperties{
// 							ResourceGroupID: to.Ptr("/subscriptions/10000000-0000-0000-0000-000000000000/resourceGroups/testrg"),
// 						},
// 						AppliedScopeType: to.Ptr(armreservations.AppliedScopeTypeSingle),
// 						BillingScopeID: to.Ptr("/subscriptions/10000000-0000-0000-0000-000000000000"),
// 						Commitment: &armreservations.Commitment{
// 							Amount: to.Ptr[float64](15.23),
// 							CurrencyCode: to.Ptr("USD"),
// 							Grain: to.Ptr(armreservations.CommitmentGrainHourly),
// 						},
// 						DisplayName: to.Ptr("ComputeSavingsPlan"),
// 						Term: to.Ptr(armreservations.SavingsPlanTermP1Y),
// 					},
// 					SKU: &armreservations.SKUName{
// 						Name: to.Ptr("Compute_Savings_Plan"),
// 					},
// 				},
// 		}},
// 		SessionID: to.Ptr("66e2ac8f-439e-4345-8235-6fef07608081"),
// 	},
// 	Status: to.Ptr(armreservations.CalculateExchangeOperationResultStatusSucceeded),
// }
Output:

type CalculateExchangeClientBeginPostOptions

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

CalculateExchangeClientBeginPostOptions contains the optional parameters for the CalculateExchangeClient.BeginPost method.

type CalculateExchangeClientPostResponse

type CalculateExchangeClientPostResponse struct {
	// CalculateExchange operation result
	CalculateExchangeOperationResultResponse
}

CalculateExchangeClientPostResponse contains the response from method CalculateExchangeClient.BeginPost.

type CalculateExchangeOperationResultResponse

type CalculateExchangeOperationResultResponse struct {
	// Required if status == failed or status == canceled.
	Error *OperationResultError

	// It should match what is used to GET the operation result.
	ID *string

	// It must match the last segment of the id field, and will typically be a GUID / system generated value.
	Name *string

	// CalculateExchange response properties
	Properties *CalculateExchangeResponseProperties

	// Status of the operation.
	Status *CalculateExchangeOperationResultStatus
}

CalculateExchangeOperationResultResponse - CalculateExchange operation result

func (CalculateExchangeOperationResultResponse) MarshalJSON

MarshalJSON implements the json.Marshaller interface for type CalculateExchangeOperationResultResponse.

func (*CalculateExchangeOperationResultResponse) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type CalculateExchangeOperationResultResponse.

type CalculateExchangeOperationResultStatus

type CalculateExchangeOperationResultStatus string

CalculateExchangeOperationResultStatus - Status of the operation.

const (
	CalculateExchangeOperationResultStatusCancelled CalculateExchangeOperationResultStatus = "Cancelled"
	CalculateExchangeOperationResultStatusFailed    CalculateExchangeOperationResultStatus = "Failed"
	CalculateExchangeOperationResultStatusPending   CalculateExchangeOperationResultStatus = "Pending"
	CalculateExchangeOperationResultStatusSucceeded CalculateExchangeOperationResultStatus = "Succeeded"
)

func PossibleCalculateExchangeOperationResultStatusValues

func PossibleCalculateExchangeOperationResultStatusValues() []CalculateExchangeOperationResultStatus

PossibleCalculateExchangeOperationResultStatusValues returns the possible values for the CalculateExchangeOperationResultStatus const type.

type CalculateExchangeRequest

type CalculateExchangeRequest struct {
	// Calculate exchange request properties
	Properties *CalculateExchangeRequestProperties
}

CalculateExchangeRequest - Calculate exchange request

func (CalculateExchangeRequest) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type CalculateExchangeRequest.

func (*CalculateExchangeRequest) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type CalculateExchangeRequest.

type CalculateExchangeRequestProperties

type CalculateExchangeRequestProperties struct {
	// List of reservations that are being returned in this exchange.
	ReservationsToExchange []*ReservationToReturn

	// List of reservations that are being purchased in this exchange.
	ReservationsToPurchase []*PurchaseRequest

	// List of savings plans that are being purchased in this exchange.
	SavingsPlansToPurchase []*SavingsPlanPurchaseRequest
}

CalculateExchangeRequestProperties - Calculate exchange request properties

func (CalculateExchangeRequestProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type CalculateExchangeRequestProperties.

func (*CalculateExchangeRequestProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type CalculateExchangeRequestProperties.

type CalculateExchangeResponseProperties

type CalculateExchangeResponseProperties struct {
	// Pricing information containing the amount and the currency code
	NetPayable *Price

	// Exchange policy errors
	PolicyResult *ExchangePolicyErrors

	// Pricing information containing the amount and the currency code
	PurchasesTotal *Price

	// Pricing information containing the amount and the currency code
	RefundsTotal *Price

	// Details of the reservations being returned
	ReservationsToExchange []*ReservationToExchange

	// Details of the reservations being purchased
	ReservationsToPurchase []*ReservationToPurchaseCalculateExchange

	// Details of the savings plans being purchased
	SavingsPlansToPurchase []*SavingsPlanToPurchaseCalculateExchange

	// Exchange session identifier
	SessionID *string
}

CalculateExchangeResponseProperties - CalculateExchange response properties

func (CalculateExchangeResponseProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type CalculateExchangeResponseProperties.

func (*CalculateExchangeResponseProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type CalculateExchangeResponseProperties.

type CalculatePriceResponse

type CalculatePriceResponse struct {
	// Properties for calculate price response
	Properties *CalculatePriceResponseProperties
}

CalculatePriceResponse - The response of calculate price for reservation.

func (CalculatePriceResponse) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type CalculatePriceResponse.

func (*CalculatePriceResponse) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type CalculatePriceResponse.

type CalculatePriceResponseProperties

type CalculatePriceResponseProperties struct {
	// Currency and amount that customer will be charged in customer's local currency. Tax is not included.
	BillingCurrencyTotal *CalculatePriceResponsePropertiesBillingCurrencyTotal

	// Total amount in pricing currency.
	GrandTotal *float64

	// True if billing is managed by Microsoft Partner. Used only for CSP accounts.
	IsBillingPartnerManaged *bool

	// Whether or not tax is included in grand total
	IsTaxIncluded *bool

	// Net total amount in pricing currency.
	NetTotal        *float64
	PaymentSchedule []*PaymentDetail

	// Amount that Microsoft uses for record. Used during refund for calculating refund limit. Tax is not included.
	PricingCurrencyTotal *CalculatePriceResponsePropertiesPricingCurrencyTotal

	// GUID that represents reservation order that can be placed after calculating price.
	ReservationOrderID *string

	// Description of sku that is being purchased.
	SKUDescription *string

	// Title of sku that is being purchased.
	SKUTitle *string

	// Tax amount in pricing currency.
	TaxTotal *float64
}

CalculatePriceResponseProperties - Properties for calculate price response

func (CalculatePriceResponseProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type CalculatePriceResponseProperties.

func (*CalculatePriceResponseProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type CalculatePriceResponseProperties.

type CalculatePriceResponsePropertiesBillingCurrencyTotal

type CalculatePriceResponsePropertiesBillingCurrencyTotal struct {
	// Amount in pricing currency. Tax is not included.
	Amount *float64

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

CalculatePriceResponsePropertiesBillingCurrencyTotal - Currency and amount that customer will be charged in customer's local currency. Tax is not included.

func (CalculatePriceResponsePropertiesBillingCurrencyTotal) MarshalJSON

MarshalJSON implements the json.Marshaller interface for type CalculatePriceResponsePropertiesBillingCurrencyTotal.

func (*CalculatePriceResponsePropertiesBillingCurrencyTotal) UnmarshalJSON

UnmarshalJSON implements the json.Unmarshaller interface for type CalculatePriceResponsePropertiesBillingCurrencyTotal.

type CalculatePriceResponsePropertiesPricingCurrencyTotal

type CalculatePriceResponsePropertiesPricingCurrencyTotal struct {
	Amount *float32

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

CalculatePriceResponsePropertiesPricingCurrencyTotal - Amount that Microsoft uses for record. Used during refund for calculating refund limit. Tax is not included.

func (CalculatePriceResponsePropertiesPricingCurrencyTotal) MarshalJSON

MarshalJSON implements the json.Marshaller interface for type CalculatePriceResponsePropertiesPricingCurrencyTotal.

func (*CalculatePriceResponsePropertiesPricingCurrencyTotal) UnmarshalJSON

UnmarshalJSON implements the json.Unmarshaller interface for type CalculatePriceResponsePropertiesPricingCurrencyTotal.

type CalculateRefundClient

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

CalculateRefundClient contains the methods for the CalculateRefund group. Don't use this type directly, use NewCalculateRefundClient() instead.

func NewCalculateRefundClient

func NewCalculateRefundClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*CalculateRefundClient, error)

NewCalculateRefundClient creates a new instance of CalculateRefundClient with the specified values.

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

func (*CalculateRefundClient) Post

Post - Calculate price for returning Reservations if there are no policy errors. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-11-01

  • reservationOrderID - Order Id of the reservation
  • body - Information needed for calculating refund of a reservation.
  • options - CalculateRefundClientPostOptions contains the optional parameters for the CalculateRefundClient.Post method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-11-01/examples/CalculateRefund.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armreservations.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewCalculateRefundClient().Post(ctx, "276e7ae4-84d0-4da6-ab4b-d6b94f3557da", armreservations.CalculateRefundRequest{
	ID: to.Ptr("/providers/microsoft.capacity/reservationOrders/50000000-aaaa-bbbb-cccc-100000000004"),
	Properties: &armreservations.CalculateRefundRequestProperties{
		ReservationToReturn: &armreservations.ReservationToReturn{
			Quantity:      to.Ptr[int32](1),
			ReservationID: to.Ptr("/providers/microsoft.capacity/reservationOrders/50000000-aaaa-bbbb-cccc-100000000004/reservations/40000000-aaaa-bbbb-cccc-100000000000"),
		},
		Scope: to.Ptr("Reservation"),
	},
}, 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.CalculateRefundResponse = armreservations.CalculateRefundResponse{
// 	ID: to.Ptr("/providers/Microsoft.Capacity/reservationOrders/50000000-aaaa-bbbb-cccc-100000000004/reservations/40000000-aaaa-bbbb-cccc-100000000000"),
// 	Properties: &armreservations.RefundResponseProperties{
// 		BillingInformation: &armreservations.RefundBillingInformation{
// 			BillingCurrencyProratedAmount: &armreservations.Price{
// 				Amount: to.Ptr[float64](3.28),
// 				CurrencyCode: to.Ptr("GBP"),
// 			},
// 			BillingCurrencyRemainingCommitmentAmount: &armreservations.Price{
// 				Amount: to.Ptr[float64](0),
// 				CurrencyCode: to.Ptr("GBP"),
// 			},
// 			BillingCurrencyTotalPaidAmount: &armreservations.Price{
// 				Amount: to.Ptr[float64](24),
// 				CurrencyCode: to.Ptr("GBP"),
// 			},
// 			BillingPlan: to.Ptr(armreservations.ReservationBillingPlanUpfront),
// 			CompletedTransactions: to.Ptr[int32](1),
// 			TotalTransactions: to.Ptr[int32](1),
// 		},
// 		BillingRefundAmount: &armreservations.Price{
// 			Amount: to.Ptr[float64](20.72),
// 			CurrencyCode: to.Ptr("GBP"),
// 		},
// 		PolicyResult: &armreservations.RefundPolicyResult{
// 			Properties: &armreservations.RefundPolicyResultProperty{
// 				ConsumedRefundsTotal: &armreservations.Price{
// 					Amount: to.Ptr[float64](83.69),
// 					CurrencyCode: to.Ptr("USD"),
// 				},
// 				MaxRefundLimit: &armreservations.Price{
// 					Amount: to.Ptr[float64](50000),
// 					CurrencyCode: to.Ptr("USD"),
// 				},
// 				PolicyErrors: []*armreservations.RefundPolicyError{
// 					{
// 						Code: to.Ptr(armreservations.ErrorResponseCodeSelfServiceRefundNotSupported),
// 						Message: to.Ptr("Self Service refunds are currently not supported for this resource, please contact support."),
// 				}},
// 			},
// 		},
// 		PricingRefundAmount: &armreservations.Price{
// 			Amount: to.Ptr[float64](24.92),
// 			CurrencyCode: to.Ptr("USD"),
// 		},
// 		Quantity: to.Ptr[int32](1),
// 		SessionID: to.Ptr("10000000-aaaa-bbbb-cccc-200000000000"),
// 	},
// }
Output:

type CalculateRefundClientPostOptions

type CalculateRefundClientPostOptions struct {
}

CalculateRefundClientPostOptions contains the optional parameters for the CalculateRefundClient.Post method.

type CalculateRefundClientPostResponse

type CalculateRefundClientPostResponse struct {
	// The response of calculate refund containing refund information of reservation
	CalculateRefundResponse
}

CalculateRefundClientPostResponse contains the response from method CalculateRefundClient.Post.

type CalculateRefundRequest

type CalculateRefundRequest struct {
	// Fully qualified identifier of the reservation order being returned
	ID *string

	// Properties needed for calculate refund including the scope and the reservation to be returned.
	Properties *CalculateRefundRequestProperties
}

CalculateRefundRequest - Request containing information needed for calculating refund.

func (CalculateRefundRequest) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type CalculateRefundRequest.

func (*CalculateRefundRequest) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type CalculateRefundRequest.

type CalculateRefundRequestProperties

type CalculateRefundRequestProperties struct {
	// Reservation to return
	ReservationToReturn *ReservationToReturn

	// The scope of the refund, e.g. Reservation
	Scope *string
}

CalculateRefundRequestProperties - Properties needed for calculate refund including the scope and the reservation to be returned.

func (CalculateRefundRequestProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type CalculateRefundRequestProperties.

func (*CalculateRefundRequestProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type CalculateRefundRequestProperties.

type CalculateRefundResponse

type CalculateRefundResponse struct {
	// Fully qualified identifier of the reservation being returned
	ID *string

	// The refund properties of reservation
	Properties *RefundResponseProperties
}

CalculateRefundResponse - The response of calculate refund containing refund information of reservation

func (CalculateRefundResponse) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type CalculateRefundResponse.

func (*CalculateRefundResponse) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type CalculateRefundResponse.

type Catalog

type Catalog struct {
	// The billing plan options available for this sku.
	BillingPlans map[string][]*ReservationBillingPlan

	// READ-ONLY
	Capabilities []*SKUCapability

	// READ-ONLY
	Locations []*string

	// READ-ONLY; Pricing information about the sku
	Msrp *CatalogMsrp

	// READ-ONLY; The name of sku
	Name *string

	// READ-ONLY; The type of resource the sku applies to.
	ResourceType *string

	// READ-ONLY
	Restrictions []*SKURestriction

	// READ-ONLY
	SKUProperties []*SKUProperty

	// READ-ONLY; The size of this sku
	Size *string

	// READ-ONLY; Available reservation terms for this resource
	Terms []*ReservationTerm

	// READ-ONLY; The tier of this sku
	Tier *string
}

Catalog - Product details of a type of resource.

func (Catalog) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type Catalog.

func (*Catalog) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type Catalog.

type CatalogMsrp

type CatalogMsrp struct {
	// Amount in pricing currency. Tax not included.
	P1Y *Price

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

	// Amount in pricing currency. Tax not included.
	P5Y *Price
}

CatalogMsrp - Pricing information about the sku

func (CatalogMsrp) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type CatalogMsrp.

func (*CatalogMsrp) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type CatalogMsrp.

type CatalogsResult

type CatalogsResult struct {
	// The total amount of catalog items.
	TotalItems *int64

	// READ-ONLY; The link (url) to the next page of results.
	NextLink *string

	// READ-ONLY; The list of catalogs.
	Value []*Catalog
}

CatalogsResult - The list of catalogs and pagination information.

func (CatalogsResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type CatalogsResult.

func (*CatalogsResult) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type CatalogsResult.

type ChangeDirectoryRequest

type ChangeDirectoryRequest struct {
	// Tenant id GUID that reservation order is to be transferred to
	DestinationTenantID *string
}

ChangeDirectoryRequest - Request body for change directory of a reservation.

func (ChangeDirectoryRequest) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ChangeDirectoryRequest.

func (*ChangeDirectoryRequest) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ChangeDirectoryRequest.

type ChangeDirectoryResponse

type ChangeDirectoryResponse struct {
	// Change directory result for reservation order or reservation
	ReservationOrder *ChangeDirectoryResult
	Reservations     []*ChangeDirectoryResult
}

ChangeDirectoryResponse - Change directory response

func (ChangeDirectoryResponse) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ChangeDirectoryResponse.

func (*ChangeDirectoryResponse) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ChangeDirectoryResponse.

type ChangeDirectoryResult

type ChangeDirectoryResult struct {
	// Error reason if operation failed. Null otherwise
	Error *string

	// Identifier of the reservation order or reservation
	ID *string

	// True if change directory operation succeeded on this reservation order or reservation
	IsSucceeded *bool

	// Name of the reservation order or reservation
	Name *string
}

ChangeDirectoryResult - Change directory result for reservation order or reservation

func (ChangeDirectoryResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ChangeDirectoryResult.

func (*ChangeDirectoryResult) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ChangeDirectoryResult.

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) NewAzureReservationAPIClient

func (c *ClientFactory) NewAzureReservationAPIClient() *AzureReservationAPIClient

NewAzureReservationAPIClient creates a new instance of AzureReservationAPIClient.

func (*ClientFactory) NewCalculateExchangeClient

func (c *ClientFactory) NewCalculateExchangeClient() *CalculateExchangeClient

NewCalculateExchangeClient creates a new instance of CalculateExchangeClient.

func (*ClientFactory) NewCalculateRefundClient

func (c *ClientFactory) NewCalculateRefundClient() *CalculateRefundClient

NewCalculateRefundClient creates a new instance of CalculateRefundClient.

func (*ClientFactory) NewExchangeClient

func (c *ClientFactory) NewExchangeClient() *ExchangeClient

NewExchangeClient creates a new instance of ExchangeClient.

func (*ClientFactory) NewOperationClient

func (c *ClientFactory) NewOperationClient() *OperationClient

NewOperationClient creates a new instance of OperationClient.

func (*ClientFactory) NewQuotaClient

func (c *ClientFactory) NewQuotaClient() *QuotaClient

NewQuotaClient creates a new instance of QuotaClient.

func (*ClientFactory) NewQuotaRequestStatusClient

func (c *ClientFactory) NewQuotaRequestStatusClient() *QuotaRequestStatusClient

NewQuotaRequestStatusClient creates a new instance of QuotaRequestStatusClient.

func (*ClientFactory) NewReservationClient

func (c *ClientFactory) NewReservationClient() *ReservationClient

NewReservationClient creates a new instance of ReservationClient.

func (*ClientFactory) NewReservationOrderClient

func (c *ClientFactory) NewReservationOrderClient() *ReservationOrderClient

NewReservationOrderClient creates a new instance of ReservationOrderClient.

func (*ClientFactory) NewReturnClient

func (c *ClientFactory) NewReturnClient() *ReturnClient

NewReturnClient creates a new instance of ReturnClient.

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 CreateGenericQuotaRequestParameters

type CreateGenericQuotaRequestParameters struct {
	// Quota change requests.
	Value []*CurrentQuotaLimitBase
}

CreateGenericQuotaRequestParameters - Quota change requests information.

func (CreateGenericQuotaRequestParameters) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type CreateGenericQuotaRequestParameters.

func (*CreateGenericQuotaRequestParameters) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type CreateGenericQuotaRequestParameters.

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 CurrentQuotaLimit

type CurrentQuotaLimit struct {
	// Additional properties for the quota status for the resource.
	Properties *QuotaRequestStatusDetails

	// Quota details.
	QuotaInformation *CurrentQuotaLimitBase
}

CurrentQuotaLimit - Current quota limits.

func (CurrentQuotaLimit) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type CurrentQuotaLimit.

func (*CurrentQuotaLimit) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type CurrentQuotaLimit.

type CurrentQuotaLimitBase

type CurrentQuotaLimitBase struct {
	// Quota properties for the resource.
	Properties *QuotaProperties

	// READ-ONLY; The quota request ID.
	ID *string

	// READ-ONLY; The name of the quota request.
	Name *string

	// READ-ONLY; Type of resource. "Microsoft.Capacity/ServiceLimits"
	Type *string
}

CurrentQuotaLimitBase - Quota properties.

func (CurrentQuotaLimitBase) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type CurrentQuotaLimitBase.

func (*CurrentQuotaLimitBase) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type CurrentQuotaLimitBase.

type DisplayProvisioningState

type DisplayProvisioningState string

DisplayProvisioningState - Represent the current display state of the reservation.

const (
	DisplayProvisioningStateCancelled  DisplayProvisioningState = "Cancelled"
	DisplayProvisioningStateExpired    DisplayProvisioningState = "Expired"
	DisplayProvisioningStateExpiring   DisplayProvisioningState = "Expiring"
	DisplayProvisioningStateFailed     DisplayProvisioningState = "Failed"
	DisplayProvisioningStateNoBenefit  DisplayProvisioningState = "NoBenefit"
	DisplayProvisioningStatePending    DisplayProvisioningState = "Pending"
	DisplayProvisioningStateProcessing DisplayProvisioningState = "Processing"
	DisplayProvisioningStateSucceeded  DisplayProvisioningState = "Succeeded"
	DisplayProvisioningStateWarning    DisplayProvisioningState = "Warning"
)

func PossibleDisplayProvisioningStateValues

func PossibleDisplayProvisioningStateValues() []DisplayProvisioningState

PossibleDisplayProvisioningStateValues returns the possible values for the DisplayProvisioningState const type.

type Error

type Error struct {
	// Extended error information including error code and error message
	Error *ExtendedErrorInfo
}

Error information

func (Error) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type Error.

func (*Error) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type Error.

type ErrorDetails

type ErrorDetails struct {
	// READ-ONLY; Error code.
	Code *string

	// READ-ONLY; Error message indicating why the operation failed.
	Message *string

	// READ-ONLY; The target of the particular error.
	Target *string
}

ErrorDetails - The details of the error.

func (ErrorDetails) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ErrorDetails.

func (*ErrorDetails) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ErrorDetails.

type ErrorResponse

type ErrorResponse struct {
	// The details of the error.
	Error *ErrorDetails
}

ErrorResponse - Error response indicates that the service is not able to process the incoming request. The reason is provided in the error message.

func (ErrorResponse) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ErrorResponse.

func (*ErrorResponse) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ErrorResponse.

type ErrorResponseCode

type ErrorResponseCode string

ErrorResponseCode - Error code describing the reason that service is not able to process the incoming request

const (
	ErrorResponseCodeActivateQuoteFailed                           ErrorResponseCode = "ActivateQuoteFailed"
	ErrorResponseCodeAppliedScopesNotAssociatedWithCommerceAccount ErrorResponseCode = "AppliedScopesNotAssociatedWithCommerceAccount"
	ErrorResponseCodeAppliedScopesSameAsExisting                   ErrorResponseCode = "AppliedScopesSameAsExisting"
	ErrorResponseCodeAuthorizationFailed                           ErrorResponseCode = "AuthorizationFailed"
	ErrorResponseCodeBadRequest                                    ErrorResponseCode = "BadRequest"
	ErrorResponseCodeBillingCustomerInputError                     ErrorResponseCode = "BillingCustomerInputError"
	ErrorResponseCodeBillingError                                  ErrorResponseCode = "BillingError"
	ErrorResponseCodeBillingPaymentInstrumentHardError             ErrorResponseCode = "BillingPaymentInstrumentHardError"
	ErrorResponseCodeBillingPaymentInstrumentSoftError             ErrorResponseCode = "BillingPaymentInstrumentSoftError"
	ErrorResponseCodeBillingScopeIDCannotBeChanged                 ErrorResponseCode = "BillingScopeIdCannotBeChanged"
	ErrorResponseCodeBillingTransientError                         ErrorResponseCode = "BillingTransientError"
	ErrorResponseCodeCalculatePriceFailed                          ErrorResponseCode = "CalculatePriceFailed"
	ErrorResponseCodeCapacityUpdateScopesFailed                    ErrorResponseCode = "CapacityUpdateScopesFailed"
	ErrorResponseCodeClientCertificateThumbprintNotSet             ErrorResponseCode = "ClientCertificateThumbprintNotSet"
	ErrorResponseCodeCreateQuoteFailed                             ErrorResponseCode = "CreateQuoteFailed"
	ErrorResponseCodeForbidden                                     ErrorResponseCode = "Forbidden"
	ErrorResponseCodeFulfillmentConfigurationError                 ErrorResponseCode = "FulfillmentConfigurationError"
	ErrorResponseCodeFulfillmentError                              ErrorResponseCode = "FulfillmentError"
	ErrorResponseCodeFulfillmentOutOfStockError                    ErrorResponseCode = "FulfillmentOutOfStockError"
	ErrorResponseCodeFulfillmentTransientError                     ErrorResponseCode = "FulfillmentTransientError"
	ErrorResponseCodeHTTPMethodNotSupported                        ErrorResponseCode = "HttpMethodNotSupported"
	ErrorResponseCodeInternalServerError                           ErrorResponseCode = "InternalServerError"
	ErrorResponseCodeInvalidAccessToken                            ErrorResponseCode = "InvalidAccessToken"
	ErrorResponseCodeInvalidFulfillmentRequestParameters           ErrorResponseCode = "InvalidFulfillmentRequestParameters"
	ErrorResponseCodeInvalidHealthCheckType                        ErrorResponseCode = "InvalidHealthCheckType"
	ErrorResponseCodeInvalidLocationID                             ErrorResponseCode = "InvalidLocationId"
	ErrorResponseCodeInvalidRefundQuantity                         ErrorResponseCode = "InvalidRefundQuantity"
	ErrorResponseCodeInvalidRequestContent                         ErrorResponseCode = "InvalidRequestContent"
	ErrorResponseCodeInvalidRequestURI                             ErrorResponseCode = "InvalidRequestUri"
	ErrorResponseCodeInvalidReservationID                          ErrorResponseCode = "InvalidReservationId"
	ErrorResponseCodeInvalidReservationOrderID                     ErrorResponseCode = "InvalidReservationOrderId"
	ErrorResponseCodeInvalidSingleAppliedScopesCount               ErrorResponseCode = "InvalidSingleAppliedScopesCount"
	ErrorResponseCodeInvalidSubscriptionID                         ErrorResponseCode = "InvalidSubscriptionId"
	ErrorResponseCodeInvalidTenantID                               ErrorResponseCode = "InvalidTenantId"
	ErrorResponseCodeMissingAppliedScopesForSingle                 ErrorResponseCode = "MissingAppliedScopesForSingle"
	ErrorResponseCodeMissingTenantID                               ErrorResponseCode = "MissingTenantId"
	ErrorResponseCodeNoValidReservationsToReRate                   ErrorResponseCode = "NoValidReservationsToReRate"
	ErrorResponseCodeNonsupportedAccountID                         ErrorResponseCode = "NonsupportedAccountId"
	ErrorResponseCodeNotSpecified                                  ErrorResponseCode = "NotSpecified"
	ErrorResponseCodeNotSupportedCountry                           ErrorResponseCode = "NotSupportedCountry"
	ErrorResponseCodeOperationCannotBePerformedInCurrentState      ErrorResponseCode = "OperationCannotBePerformedInCurrentState"
	ErrorResponseCodeOperationFailed                               ErrorResponseCode = "OperationFailed"
	ErrorResponseCodePatchValuesSameAsExisting                     ErrorResponseCode = "PatchValuesSameAsExisting"
	ErrorResponseCodePaymentInstrumentNotFound                     ErrorResponseCode = "PaymentInstrumentNotFound"
	ErrorResponseCodePurchaseError                                 ErrorResponseCode = "PurchaseError"
	ErrorResponseCodeReRateOnlyAllowedForEA                        ErrorResponseCode = "ReRateOnlyAllowedForEA"
	ErrorResponseCodeRefundLimitExceeded                           ErrorResponseCode = "RefundLimitExceeded"
	ErrorResponseCodeReservationIDNotInReservationOrder            ErrorResponseCode = "ReservationIdNotInReservationOrder"
	ErrorResponseCodeReservationOrderCreationFailed                ErrorResponseCode = "ReservationOrderCreationFailed"
	ErrorResponseCodeReservationOrderIDAlreadyExists               ErrorResponseCode = "ReservationOrderIdAlreadyExists"
	ErrorResponseCodeReservationOrderNotEnabled                    ErrorResponseCode = "ReservationOrderNotEnabled"
	ErrorResponseCodeReservationOrderNotFound                      ErrorResponseCode = "ReservationOrderNotFound"
	ErrorResponseCodeRiskCheckFailed                               ErrorResponseCode = "RiskCheckFailed"
	ErrorResponseCodeRoleAssignmentCreationFailed                  ErrorResponseCode = "RoleAssignmentCreationFailed"
	ErrorResponseCodeSelfServiceRefundNotSupported                 ErrorResponseCode = "SelfServiceRefundNotSupported"
	ErrorResponseCodeServerTimeout                                 ErrorResponseCode = "ServerTimeout"
	ErrorResponseCodeUnauthenticatedRequestsThrottled              ErrorResponseCode = "UnauthenticatedRequestsThrottled"
	ErrorResponseCodeUnsupportedReservationTerm                    ErrorResponseCode = "UnsupportedReservationTerm"
)

func PossibleErrorResponseCodeValues

func PossibleErrorResponseCodeValues() []ErrorResponseCode

PossibleErrorResponseCodeValues returns the possible values for the ErrorResponseCode const type.

type ExceptionResponse

type ExceptionResponse struct {
	// The API error details.
	Error *ServiceError
}

ExceptionResponse - The API error.

func (ExceptionResponse) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ExceptionResponse.

func (*ExceptionResponse) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ExceptionResponse.

type ExchangeClient

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

ExchangeClient contains the methods for the Exchange group. Don't use this type directly, use NewExchangeClient() instead.

func NewExchangeClient

func NewExchangeClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*ExchangeClient, error)

NewExchangeClient creates a new instance of ExchangeClient with the specified values.

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

func (*ExchangeClient) BeginPost

BeginPost - Returns one or more Reservations in exchange for one or more Reservation purchases. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-11-01

  • body - Request containing the refunds and purchases that need to be executed.
  • options - ExchangeClientBeginPostOptions contains the optional parameters for the ExchangeClient.BeginPost method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-11-01/examples/Exchange.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armreservations.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewExchangeClient().BeginPost(ctx, armreservations.ExchangeRequest{
	Properties: &armreservations.ExchangeRequestProperties{
		SessionID: to.Ptr("66e2ac8f-439e-4345-8235-6fef07608081"),
	},
}, 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.ExchangeOperationResultResponse = armreservations.ExchangeOperationResultResponse{
// 	Name: to.Ptr("4e2ffff7-b331-4fcb-ab11-b5fa49368188"),
// 	ID: to.Ptr("/providers/microsoft.capacity/operationResults/4e2ffff7-b331-4fcb-ab11-b5fa49368188"),
// 	Properties: &armreservations.ExchangeResponseProperties{
// 		NetPayable: &armreservations.Price{
// 			Amount: to.Ptr[float64](149254.8),
// 			CurrencyCode: to.Ptr("USD"),
// 		},
// 		PolicyResult: &armreservations.ExchangePolicyErrors{
// 		},
// 		PurchasesTotal: &armreservations.Price{
// 			Amount: to.Ptr[float64](153214.8),
// 			CurrencyCode: to.Ptr("USD"),
// 		},
// 		RefundsTotal: &armreservations.Price{
// 			Amount: to.Ptr[float64](3960),
// 			CurrencyCode: to.Ptr("USD"),
// 		},
// 		ReservationsToExchange: []*armreservations.ReservationToReturnForExchange{
// 			{
// 				BillingInformation: &armreservations.BillingInformation{
// 					BillingCurrencyProratedAmount: &armreservations.Price{
// 						Amount: to.Ptr[float64](149254.8),
// 						CurrencyCode: to.Ptr("USD"),
// 					},
// 					BillingCurrencyRemainingCommitmentAmount: &armreservations.Price{
// 						Amount: to.Ptr[float64](0),
// 						CurrencyCode: to.Ptr("USD"),
// 					},
// 					BillingCurrencyTotalPaidAmount: &armreservations.Price{
// 						Amount: to.Ptr[float64](153214.8),
// 						CurrencyCode: to.Ptr("USD"),
// 					},
// 				},
// 				BillingRefundAmount: &armreservations.Price{
// 					Amount: to.Ptr[float64](3960),
// 					CurrencyCode: to.Ptr("USD"),
// 				},
// 				Quantity: to.Ptr[int32](1),
// 				ReservationID: to.Ptr("/providers/microsoft.capacity/reservationOrders/1f14354c-dc12-4c8d-8090-6f295a3a34aa/reservations/c8c926bd-fc5d-4e29-9d43-b68340ac23a6"),
// 				Status: to.Ptr(armreservations.OperationStatusSucceeded),
// 		}},
// 		ReservationsToPurchase: []*armreservations.ReservationToPurchaseExchange{
// 			{
// 				BillingCurrencyTotal: &armreservations.Price{
// 					Amount: to.Ptr[float64](19800),
// 					CurrencyCode: to.Ptr("USD"),
// 				},
// 				Properties: &armreservations.PurchaseRequest{
// 					Location: to.Ptr("westus"),
// 					Properties: &armreservations.PurchaseRequestProperties{
// 						AppliedScopeType: to.Ptr(armreservations.AppliedScopeTypeShared),
// 						BillingPlan: to.Ptr(armreservations.ReservationBillingPlanUpfront),
// 						BillingScopeID: to.Ptr("/subscriptions/ed3a1871-612d-abcd-a849-c2542a68be83"),
// 						DisplayName: to.Ptr("testDisplayName"),
// 						Quantity: to.Ptr[int32](1),
// 						Renew: to.Ptr(false),
// 						ReservedResourceProperties: &armreservations.PurchaseRequestPropertiesReservedResourceProperties{
// 							InstanceFlexibility: to.Ptr(armreservations.InstanceFlexibilityOn),
// 						},
// 						ReservedResourceType: to.Ptr(armreservations.ReservedResourceTypeVirtualMachines),
// 						Term: to.Ptr(armreservations.ReservationTermP1Y),
// 					},
// 					SKU: &armreservations.SKUName{
// 						Name: to.Ptr("Standard_B1ls"),
// 					},
// 				},
// 				ReservationID: to.Ptr("/providers/microsoft.capacity/reservationOrders/1e85c519-b815-4169-8d79-62fc460c608f/reservations/0c80fceb-305c-40a8-b5a6-11445807bbb3"),
// 				ReservationOrderID: to.Ptr("/providers/microsoft.capacity/reservationOrders/1e85c519-b815-4169-8d79-62fc460c608f"),
// 				Status: to.Ptr(armreservations.OperationStatusSucceeded),
// 		}},
// 		SavingsPlansToPurchase: []*armreservations.SavingsPlanToPurchaseExchange{
// 			{
// 				BillingCurrencyTotal: &armreservations.Price{
// 					Amount: to.Ptr[float64](133414.8),
// 					CurrencyCode: to.Ptr("USD"),
// 				},
// 				Properties: &armreservations.SavingsPlanPurchaseRequest{
// 					Properties: &armreservations.SavingsPlanPurchaseRequestProperties{
// 						AppliedScopeProperties: &armreservations.AppliedScopeProperties{
// 							ResourceGroupID: to.Ptr("/subscriptions/10000000-0000-0000-0000-000000000000/resourceGroups/testrg"),
// 						},
// 						AppliedScopeType: to.Ptr(armreservations.AppliedScopeTypeSingle),
// 						BillingScopeID: to.Ptr("/subscriptions/10000000-0000-0000-0000-000000000000"),
// 						Commitment: &armreservations.Commitment{
// 							Amount: to.Ptr[float64](15.23),
// 							CurrencyCode: to.Ptr("USD"),
// 							Grain: to.Ptr(armreservations.CommitmentGrainHourly),
// 						},
// 						DisplayName: to.Ptr("ComputeSavingsPlan"),
// 						Term: to.Ptr(armreservations.SavingsPlanTermP1Y),
// 					},
// 					SKU: &armreservations.SKUName{
// 						Name: to.Ptr("Compute_Savings_Plan"),
// 					},
// 				},
// 				SavingsPlanID: to.Ptr("/providers/Microsoft.BillingBenefits/savingsPlanOrders/20000000-0000-0000-0000-000000000000/savingsPlans/30000000-0000-0000-0000-000000000000"),
// 				SavingsPlanOrderID: to.Ptr("/providers/Microsoft.BillingBenefits/savingsPlanOrders/20000000-0000-0000-0000-000000000000"),
// 				Status: to.Ptr(armreservations.OperationStatusSucceeded),
// 		}},
// 		SessionID: to.Ptr("66e2ac8f-439e-4345-8235-6fef07608081"),
// 	},
// 	Status: to.Ptr(armreservations.ExchangeOperationResultStatusSucceeded),
// }
Output:

type ExchangeClientBeginPostOptions

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

ExchangeClientBeginPostOptions contains the optional parameters for the ExchangeClient.BeginPost method.

type ExchangeClientPostResponse

type ExchangeClientPostResponse struct {
	// Exchange operation result
	ExchangeOperationResultResponse
}

ExchangeClientPostResponse contains the response from method ExchangeClient.BeginPost.

type ExchangeOperationResultResponse

type ExchangeOperationResultResponse struct {
	// Required if status == failed or status == canceled.
	Error *OperationResultError

	// It should match what is used to GET the operation result.
	ID *string

	// It must match the last segment of the id field, and will typically be a GUID / system generated value.
	Name *string

	// Exchange response properties
	Properties *ExchangeResponseProperties

	// Status of the operation.
	Status *ExchangeOperationResultStatus
}

ExchangeOperationResultResponse - Exchange operation result

func (ExchangeOperationResultResponse) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ExchangeOperationResultResponse.

func (*ExchangeOperationResultResponse) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ExchangeOperationResultResponse.

type ExchangeOperationResultStatus

type ExchangeOperationResultStatus string

ExchangeOperationResultStatus - Status of the operation.

const (
	ExchangeOperationResultStatusCancelled        ExchangeOperationResultStatus = "Cancelled"
	ExchangeOperationResultStatusFailed           ExchangeOperationResultStatus = "Failed"
	ExchangeOperationResultStatusPendingPurchases ExchangeOperationResultStatus = "PendingPurchases"
	ExchangeOperationResultStatusPendingRefunds   ExchangeOperationResultStatus = "PendingRefunds"
	ExchangeOperationResultStatusSucceeded        ExchangeOperationResultStatus = "Succeeded"
)

func PossibleExchangeOperationResultStatusValues

func PossibleExchangeOperationResultStatusValues() []ExchangeOperationResultStatus

PossibleExchangeOperationResultStatusValues returns the possible values for the ExchangeOperationResultStatus const type.

type ExchangePolicyError

type ExchangePolicyError struct {
	Code    *string
	Message *string
}

ExchangePolicyError - error details

func (ExchangePolicyError) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ExchangePolicyError.

func (*ExchangePolicyError) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ExchangePolicyError.

type ExchangePolicyErrors

type ExchangePolicyErrors struct {
	// Exchange Policy errors
	PolicyErrors []*ExchangePolicyError
}

ExchangePolicyErrors - Exchange policy errors

func (ExchangePolicyErrors) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ExchangePolicyErrors.

func (*ExchangePolicyErrors) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ExchangePolicyErrors.

type ExchangeRequest

type ExchangeRequest struct {
	// Exchange request properties
	Properties *ExchangeRequestProperties
}

ExchangeRequest - Exchange request

func (ExchangeRequest) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ExchangeRequest.

func (*ExchangeRequest) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ExchangeRequest.

type ExchangeRequestProperties

type ExchangeRequestProperties struct {
	// SessionId that was returned by CalculateExchange API.
	SessionID *string
}

ExchangeRequestProperties - Exchange request properties

func (ExchangeRequestProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ExchangeRequestProperties.

func (*ExchangeRequestProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ExchangeRequestProperties.

type ExchangeResponseProperties

type ExchangeResponseProperties struct {
	// Pricing information containing the amount and the currency code
	NetPayable *Price

	// Exchange policy errors
	PolicyResult *ExchangePolicyErrors

	// Pricing information containing the amount and the currency code
	PurchasesTotal *Price

	// Pricing information containing the amount and the currency code
	RefundsTotal *Price

	// Details of the reservations being returned
	ReservationsToExchange []*ReservationToReturnForExchange

	// Details of the reservations being purchased
	ReservationsToPurchase []*ReservationToPurchaseExchange

	// Details of the savings plans being purchased
	SavingsPlansToPurchase []*SavingsPlanToPurchaseExchange

	// Exchange session identifier
	SessionID *string
}

ExchangeResponseProperties - Exchange response properties

func (ExchangeResponseProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ExchangeResponseProperties.

func (*ExchangeResponseProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ExchangeResponseProperties.

type ExtendedErrorInfo

type ExtendedErrorInfo struct {
	// Error code describing the reason that service is not able to process the incoming request
	Code    *ErrorResponseCode
	Message *string
}

ExtendedErrorInfo - Extended error information including error code and error message

func (ExtendedErrorInfo) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ExtendedErrorInfo.

func (*ExtendedErrorInfo) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ExtendedErrorInfo.

type ExtendedStatusInfo

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

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. Only specify for VirtualMachines reserved resource type.

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

func PossibleInstanceFlexibilityValues

func PossibleInstanceFlexibilityValues() []InstanceFlexibility

PossibleInstanceFlexibilityValues returns the possible values for the InstanceFlexibility const type.

type ListResult

type ListResult struct {
	// The roll out count summary of the reservations
	Summary *ReservationSummary

	// READ-ONLY; The link (url) to the next page of results.
	NextLink *string

	// READ-ONLY; The list of reservations.
	Value []*ReservationResponse
}

ListResult - The list of reservations and summary of roll out count of reservations in each state.

func (ListResult) MarshalJSON

func (l ListResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ListResult.

func (*ListResult) UnmarshalJSON

func (l *ListResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ListResult.

type Location

type Location string

Location - Location in which the Resources needs to be reserved. It cannot be changed after the resource has been created.

const (
	LocationAustraliaeast      Location = "australiaeast"
	LocationAustraliasoutheast Location = "australiasoutheast"
	LocationBrazilsouth        Location = "brazilsouth"
	LocationCanadacentral      Location = "canadacentral"
	LocationCanadaeast         Location = "canadaeast"
	LocationCentralindia       Location = "centralindia"
	LocationCentralus          Location = "centralus"
	LocationEastasia           Location = "eastasia"
	LocationEastus             Location = "eastus"
	LocationEastus2            Location = "eastus2"
	LocationJapaneast          Location = "japaneast"
	LocationJapanwest          Location = "japanwest"
	LocationNorthcentralus     Location = "northcentralus"
	LocationNortheurope        Location = "northeurope"
	LocationSouthcentralus     Location = "southcentralus"
	LocationSoutheastasia      Location = "southeastasia"
	LocationSouthindia         Location = "southindia"
	LocationUksouth            Location = "uksouth"
	LocationUkwest             Location = "ukwest"
	LocationWestcentralus      Location = "westcentralus"
	LocationWesteurope         Location = "westeurope"
	LocationWestindia          Location = "westindia"
	LocationWestus             Location = "westus"
	LocationWestus2            Location = "westus2"
)

func PossibleLocationValues

func PossibleLocationValues() []Location

PossibleLocationValues returns the possible values for the Location const type.

type MergeProperties

type MergeProperties struct {
	// Format of the resource id should be /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}
	Sources []*string
}

MergeProperties - Properties for reservation merge

func (MergeProperties) MarshalJSON

func (m MergeProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type MergeProperties.

func (*MergeProperties) UnmarshalJSON

func (m *MergeProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type MergeProperties.

type MergeRequest

type MergeRequest struct {
	// Properties for reservation merge
	Properties *MergeProperties
}

MergeRequest - The request for reservation merge

func (MergeRequest) MarshalJSON

func (m MergeRequest) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type MergeRequest.

func (*MergeRequest) UnmarshalJSON

func (m *MergeRequest) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type MergeRequest.

type OperationClient

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

OperationClient contains the methods for the Operation group. Don't use this type directly, use NewOperationClient() instead.

func NewOperationClient

func NewOperationClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*OperationClient, error)

NewOperationClient creates a new instance of OperationClient with the specified values.

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

func (*OperationClient) NewListPager

NewListPager - List all the operations.

Generated from API version 2022-11-01

  • options - OperationClientListOptions contains the optional parameters for the OperationClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-11-01/examples/GetOperations.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armreservations.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewOperationClient().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.OperationList = armreservations.OperationList{
	// 	Value: []*armreservations.OperationResponse{
	// 		{
	// 			Name: to.Ptr("Microsoft.Capacity/reservationorders/read"),
	// 			Display: &armreservations.OperationDisplay{
	// 				Description: to.Ptr("Read All Reservations"),
	// 				Operation: to.Ptr("Get Reservations"),
	// 				Provider: to.Ptr("Microsoft Capacity"),
	// 				Resource: to.Ptr("Reservations"),
	// 			},
	// 		},
	// 		{
	// 			Name: to.Ptr("Microsoft.Capacity/reservationorders/write"),
	// 			Display: &armreservations.OperationDisplay{
	// 				Description: to.Ptr("Create any Reservation"),
	// 				Operation: to.Ptr("Create Reservations"),
	// 				Provider: to.Ptr("Microsoft Capacity"),
	// 				Resource: to.Ptr("Reservations"),
	// 			},
	// 		},
	// 		{
	// 			Name: to.Ptr("Microsoft.Capacity/reservationorders/action"),
	// 			Display: &armreservations.OperationDisplay{
	// 				Description: to.Ptr("Update any Reservation"),
	// 				Operation: to.Ptr("Update Reservations"),
	// 				Provider: to.Ptr("Microsoft Capacity"),
	// 				Resource: to.Ptr("Reservations"),
	// 			},
	// 		},
	// 		{
	// 			Name: to.Ptr("Microsoft.Capacity/reservationorders/delete"),
	// 			Display: &armreservations.OperationDisplay{
	// 				Description: to.Ptr("Delete any Reservation"),
	// 				Operation: to.Ptr("Delete Reservations"),
	// 				Provider: to.Ptr("Microsoft Capacity"),
	// 				Resource: to.Ptr("Reservations"),
	// 			},
	// 		},
	// 		{
	// 			Name: to.Ptr("Microsoft.Capacity/reservationorders/reservations/read"),
	// 			Display: &armreservations.OperationDisplay{
	// 				Description: to.Ptr("Read All Reservations"),
	// 				Operation: to.Ptr("Get Reservations"),
	// 				Provider: to.Ptr("Microsoft Capacity"),
	// 				Resource: to.Ptr("Reservations"),
	// 			},
	// 		},
	// 		{
	// 			Name: to.Ptr("Microsoft.Capacity/reservationorders/reservations/write"),
	// 			Display: &armreservations.OperationDisplay{
	// 				Description: to.Ptr("Create any Reservation"),
	// 				Operation: to.Ptr("Create Reservations"),
	// 				Provider: to.Ptr("Microsoft Capacity"),
	// 				Resource: to.Ptr("Reservations"),
	// 			},
	// 		},
	// 		{
	// 			Name: to.Ptr("Microsoft.Capacity/reservationorders/reservations/action"),
	// 			Display: &armreservations.OperationDisplay{
	// 				Description: to.Ptr("Update any Reservation"),
	// 				Operation: to.Ptr("Update Reservations"),
	// 				Provider: to.Ptr("Microsoft Capacity"),
	// 				Resource: to.Ptr("Reservations"),
	// 			},
	// 		},
	// 		{
	// 			Name: to.Ptr("Microsoft.Capacity/reservationorders/reservations/delete"),
	// 			Display: &armreservations.OperationDisplay{
	// 				Description: to.Ptr("Delete any Reservation"),
	// 				Operation: to.Ptr("Delete Reservations"),
	// 				Provider: to.Ptr("Microsoft Capacity"),
	// 				Resource: to.Ptr("Reservations"),
	// 			},
	// 		},
	// 		{
	// 			Name: to.Ptr("Microsoft.Capacity/reservationorders/reservations/revisions/read"),
	// 			Display: &armreservations.OperationDisplay{
	// 				Description: to.Ptr("Read All Reservations"),
	// 				Operation: to.Ptr("Get Reservations"),
	// 				Provider: to.Ptr("Microsoft Capacity"),
	// 				Resource: to.Ptr("Reservations"),
	// 			},
	// 		},
	// 		{
	// 			Name: to.Ptr("Microsoft.Capacity/register/action"),
	// 			Display: &armreservations.OperationDisplay{
	// 				Description: to.Ptr("Registers the Capacity resource provider and enables the creation of Capacity resources."),
	// 				Operation: to.Ptr("Registers the Capacity Resource Provider."),
	// 				Provider: to.Ptr("Microsoft Capacity"),
	// 				Resource: to.Ptr("Reservations"),
	// 			},
	// 	}},
	// }
}
Output:

type OperationClientListOptions

type OperationClientListOptions struct {
}

OperationClientListOptions contains the optional parameters for the OperationClient.NewListPager method.

type OperationClientListResponse

type OperationClientListResponse struct {
	// Paginated list of operations
	OperationList
}

OperationClientListResponse contains the response from method OperationClient.NewListPager.

type OperationDisplay

type OperationDisplay struct {
	Description *string
	Operation   *string
	Provider    *string
	Resource    *string
}

OperationDisplay - Information about an 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 OperationList

type OperationList struct {
	// Url to get the next page of items.
	NextLink *string
	Value    []*OperationResponse
}

OperationList - Paginated list of operations

func (OperationList) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type OperationList.

func (*OperationList) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type OperationList.

type OperationResponse

type OperationResponse struct {
	// Display of the operation
	Display *OperationDisplay

	// Indicates whether the operation is a data action
	IsDataAction *bool

	// Name of the operation
	Name *string

	// Origin of the operation
	Origin *string

	// Properties of the operation
	Properties any
}

OperationResponse - The response containing operation information

func (OperationResponse) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type OperationResponse.

func (*OperationResponse) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type OperationResponse.

type OperationResultError

type OperationResultError struct {
	// Required if status == failed or status == cancelled. If status == failed, provide an invariant error code used for error
	// troubleshooting, aggregation, and analysis.
	Code *string

	// Required if status == failed. Localized. If status == failed, provide an actionable error message indicating what error
	// occurred, and what the user can do to address the issue.
	Message *string
}

OperationResultError - Required if status == failed or status == canceled.

func (OperationResultError) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type OperationResultError.

func (*OperationResultError) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type OperationResultError.

type OperationStatus

type OperationStatus string

OperationStatus - Status of the individual operation.

const (
	OperationStatusCancelled OperationStatus = "Cancelled"
	OperationStatusFailed    OperationStatus = "Failed"
	OperationStatusPending   OperationStatus = "Pending"
	OperationStatusSucceeded OperationStatus = "Succeeded"
)

func PossibleOperationStatusValues

func PossibleOperationStatusValues() []OperationStatus

PossibleOperationStatusValues returns the possible values for the OperationStatus const type.

type Patch

type Patch struct {
	// Properties for reservation patch
	Properties *PatchProperties
}

Patch - The request for reservation patch

func (Patch) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type Patch.

func (*Patch) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type Patch.

type PatchProperties

type PatchProperties struct {
	// Properties specific to applied scope type. Not required if not applicable. Required and need to provide tenantId and managementGroupId
	// if AppliedScopeType is ManagementGroup
	AppliedScopeProperties *AppliedScopeProperties

	// Type of the Applied Scope.
	AppliedScopeType *AppliedScopeType

	// List of the subscriptions that the benefit will be applied. Do not specify if AppliedScopeType is Shared. This property
	// will be deprecated and replaced by appliedScopeProperties instead for Single
	// AppliedScopeType.
	AppliedScopes []*string

	// Turning this on will apply the reservation discount to other VMs in the same VM size group. Only specify for VirtualMachines
	// reserved resource type.
	InstanceFlexibility *InstanceFlexibility

	// Display name of the reservation
	Name *string

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

	// This is the date-time when the Azure hybrid benefit needs to be reviewed.
	ReviewDateTime *time.Time
}

PatchProperties - Properties for reservation patch

func (PatchProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type PatchProperties.

func (*PatchProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type PatchProperties.

type PatchPropertiesRenewProperties

type PatchPropertiesRenewProperties struct {
	// The request for reservation purchase
	PurchaseProperties *PurchaseRequest
}

func (PatchPropertiesRenewProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type PatchPropertiesRenewProperties.

func (*PatchPropertiesRenewProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type PatchPropertiesRenewProperties.

type PaymentDetail

type PaymentDetail struct {
	// Shows the Account that is charged for this payment.
	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
	ExtendedStatusInfo *ExtendedStatusInfo

	// 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
}

PaymentDetail - Information about payment related to a reservation 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
}

Price - Pricing information containing the amount and the currency code

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 Properties

type Properties struct {
	// Properties specific to applied scope type. Not required if not applicable. Required and need to provide tenantId and managementGroupId
	// if AppliedScopeType is ManagementGroup
	AppliedScopeProperties *AppliedScopeProperties

	// The applied scope type
	AppliedScopeType *AppliedScopeType

	// The list of applied scopes
	AppliedScopes []*string

	// Indicates if the reservation is archived
	Archived *bool

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

	// The billing plan options available for this sku.
	BillingPlan *ReservationBillingPlan

	// Subscription that will be charged for purchasing reservation or savings plan
	BillingScopeID *string

	// Capabilities of the reservation
	Capabilities *string

	// Friendly name for user to easily identify the reservation
	DisplayName *string

	// DateTime of the reservation starting when this version is effective from.
	EffectiveDateTime *time.Time

	// This is the date when the reservation will expire.
	ExpiryDate *time.Time

	// This is the date-time when the reservation will expire.
	ExpiryDateTime *time.Time

	// The message giving detailed information about the status code.
	ExtendedStatusInfo *ExtendedStatusInfo

	// Allows reservation discount to be applied across skus within the same auto fit group. Not all skus support instance size
	// flexibility.
	InstanceFlexibility *InstanceFlexibility

	// Properties of reservation merge
	MergeProperties *ReservationMergeProperties

	// Current state of the reservation.
	ProvisioningState *ProvisioningState

	// This is the date when the reservation was purchased.
	PurchaseDate *time.Time

	// This is the date-time when the reservation was purchased.
	PurchaseDateTime *time.Time

	// Quantity of the skus that are part of the reservation.
	Quantity *int32

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

	// Reservation Id of the reservation which is purchased because of renew. Format of the resource Id is /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}.
	RenewDestination *string

	// The renew properties for a reservation.
	RenewProperties *RenewPropertiesResponse

	// Reservation Id of the reservation from which this reservation is renewed. Format of the resource Id is
	// /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}.
	RenewSource *string

	// 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

	// Description of the sku in english.
	SKUDescription *string

	// Properties of reservation split
	SplitProperties *ReservationSplitProperties

	// Properties of reservation swap
	SwapProperties *ReservationSwapProperties

	// Represent the term of reservation.
	Term *ReservationTerm

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

	// READ-ONLY; DateTime of the last time the reservation was updated.
	LastUpdatedDateTime *time.Time

	// READ-ONLY; The provisioning sub-state of the reservation, e.g. Succeeded
	ProvisioningSubState *string

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

	// READ-ONLY; The renew state of the reservation for display, e.g. On
	UserFriendlyRenewState *string

	// READ-ONLY; Reservation utilization
	Utilization *PropertiesUtilization
}

Properties - The properties of the reservations

func (Properties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type Properties.

func (*Properties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type Properties.

type PropertiesUtilization

type PropertiesUtilization struct {
	// The array of aggregates of a reservation's utilization
	Aggregates []*ReservationUtilizationAggregates

	// READ-ONLY; last 7 day utilization trend for a reservation
	Trend *string
}

PropertiesUtilization - Reservation utilization

func (PropertiesUtilization) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type PropertiesUtilization.

func (*PropertiesUtilization) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type PropertiesUtilization.

type ProvisioningState

type ProvisioningState string

ProvisioningState - Represent the current state of the Reservation.

const (
	ProvisioningStateBillingFailed         ProvisioningState = "BillingFailed"
	ProvisioningStateCancelled             ProvisioningState = "Cancelled"
	ProvisioningStateConfirmedBilling      ProvisioningState = "ConfirmedBilling"
	ProvisioningStateConfirmedResourceHold ProvisioningState = "ConfirmedResourceHold"
	ProvisioningStateCreated               ProvisioningState = "Created"
	ProvisioningStateCreating              ProvisioningState = "Creating"
	ProvisioningStateExpired               ProvisioningState = "Expired"
	ProvisioningStateFailed                ProvisioningState = "Failed"
	ProvisioningStateMerged                ProvisioningState = "Merged"
	ProvisioningStatePendingBilling        ProvisioningState = "PendingBilling"
	ProvisioningStatePendingResourceHold   ProvisioningState = "PendingResourceHold"
	ProvisioningStateSplit                 ProvisioningState = "Split"
	ProvisioningStateSucceeded             ProvisioningState = "Succeeded"
)

func PossibleProvisioningStateValues

func PossibleProvisioningStateValues() []ProvisioningState

PossibleProvisioningStateValues returns the possible values for the ProvisioningState const type.

type ProxyResource

type ProxyResource struct {
	// READ-ONLY; Fully qualified resource ID for the resource. E.g. "/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
}

ProxyResource - The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location

func (ProxyResource) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ProxyResource.

func (*ProxyResource) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ProxyResource.

type PurchaseRequest

type PurchaseRequest struct {
	// The Azure region where the reserved resource lives.
	Location *string

	// Properties of reservation purchase request
	Properties *PurchaseRequestProperties

	// The name of sku
	SKU *SKUName
}

PurchaseRequest - The request for reservation purchase

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. Required and need to provide tenantId and managementGroupId
	// if AppliedScopeType is ManagementGroup
	AppliedScopeProperties *AppliedScopeProperties

	// Type of the Applied Scope.
	AppliedScopeType *AppliedScopeType

	// List of the subscriptions that the benefit will be applied. Do not specify if AppliedScopeType is Shared. This property
	// will be deprecated and replaced by appliedScopeProperties instead for Single
	// AppliedScopeType.
	AppliedScopes []*string

	// Represent the billing plans.
	BillingPlan *ReservationBillingPlan

	// Subscription that will be charged for purchasing reservation or savings plan
	BillingScopeID *string

	// Friendly name of the reservation
	DisplayName *string

	// Quantity of the skus that are part of the reservation.
	Quantity *int32

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

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

	// 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 the term of reservation.
	Term *ReservationTerm
}

PurchaseRequestProperties - Properties of reservation purchase request

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 PurchaseRequestPropertiesReservedResourceProperties

type PurchaseRequestPropertiesReservedResourceProperties struct {
	// Turning this on will apply the reservation discount to other VMs in the same VM size group. Only specify for VirtualMachines
	// reserved resource type.
	InstanceFlexibility *InstanceFlexibility
}

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

func (PurchaseRequestPropertiesReservedResourceProperties) MarshalJSON

MarshalJSON implements the json.Marshaller interface for type PurchaseRequestPropertiesReservedResourceProperties.

func (*PurchaseRequestPropertiesReservedResourceProperties) UnmarshalJSON

UnmarshalJSON implements the json.Unmarshaller interface for type PurchaseRequestPropertiesReservedResourceProperties.

type QuotaClient

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

QuotaClient contains the methods for the Quota group. Don't use this type directly, use NewQuotaClient() instead.

func NewQuotaClient

func NewQuotaClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*QuotaClient, error)

NewQuotaClient creates a new instance of QuotaClient with the specified values.

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

func (*QuotaClient) BeginCreateOrUpdate

func (client *QuotaClient) BeginCreateOrUpdate(ctx context.Context, subscriptionID string, providerID string, location string, resourceName string, createQuotaRequest CurrentQuotaLimitBase, options *QuotaClientBeginCreateOrUpdateOptions) (*runtime.Poller[QuotaClientCreateOrUpdateResponse], error)

BeginCreateOrUpdate - Create or update the quota (service limits) of a resource to the requested value. Steps: 1. Make the Get request to get the quota information for specific resource. 2. To increase the quota, update the limit field in the response from Get request to new value. 3. Submit the JSON to the quota request API to update the quota. The Create quota request may be constructed as follows. The PUT operation can be used to update the quota. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2020-10-25

  • subscriptionID - Azure subscription ID.
  • providerID - Azure resource provider ID.
  • location - Azure region.
  • resourceName - The resource name for a resource provider, such as SKU name for Microsoft.Compute, Sku or TotalLowPriorityCores for Microsoft.MachineLearningServices
  • createQuotaRequest - Quota requests payload.
  • options - QuotaClientBeginCreateOrUpdateOptions contains the optional parameters for the QuotaClient.BeginCreateOrUpdate method.
Example (QuotasRequestPutForCompute)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/reservations/resource-manager/Microsoft.Capacity/stable/2020-10-25/examples/putComputeOneSkuQuotaRequest.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armreservations.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewQuotaClient().BeginCreateOrUpdate(ctx, "D7EC67B3-7657-4966-BFFC-41EFD36BAAB3", "Microsoft.Compute", "eastus", "standardFSv2Family", armreservations.CurrentQuotaLimitBase{
	Properties: &armreservations.QuotaProperties{
		Name: &armreservations.ResourceName{
			Value: to.Ptr("standardFSv2Family"),
		},
		Limit: to.Ptr[int32](200),
		Unit:  to.Ptr("Count"),
	},
}, 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.CurrentQuotaLimitBase = armreservations.CurrentQuotaLimitBase{
// 	Name: to.Ptr("2B5C8515-37D8-4B6A-879B-CD641A2CF605"),
// 	Type: to.Ptr("Microsoft.Capacity/serviceLimits"),
// 	ID: to.Ptr("/subscriptions/D7EC67B3-7657-4966-BFFC-41EFD36BAAB3/providers/Microsoft.Capacity/resourceProviders/Microsoft.Compute/locations/eastus/serviceLimitsRequests/2B5C8515-37D8-4B6A-879B-CD641A2CF605"),
// 	Properties: &armreservations.QuotaProperties{
// 		Name: &armreservations.ResourceName{
// 			LocalizedValue: to.Ptr("Standard FSv2 Family vCPUs"),
// 			Value: to.Ptr("standardFSv2Family"),
// 		},
// 		CurrentValue: to.Ptr[int32](160),
// 		Limit: to.Ptr[int32](200),
// 		Properties: map[string]any{
// 		},
// 		QuotaPeriod: to.Ptr(""),
// 		Unit: to.Ptr("Count"),
// 	},
// }
Output:

Example (QuotasRequestPutForMachineLearningServicesDedicatedResource)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/reservations/resource-manager/Microsoft.Capacity/stable/2020-10-25/examples/putMachineLearningServicesQuotaRequestDedicated.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armreservations.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewQuotaClient().BeginCreateOrUpdate(ctx, "D7EC67B3-7657-4966-BFFC-41EFD36BAAB3", "Microsoft.MachineLearningServices", "eastus", "StandardDv2Family", armreservations.CurrentQuotaLimitBase{
	Properties: &armreservations.QuotaProperties{
		Name: &armreservations.ResourceName{
			Value: to.Ptr("StandardDv2Family"),
		},
		Limit:        to.Ptr[int32](200),
		ResourceType: to.Ptr(armreservations.ResourceTypeDedicated),
		Unit:         to.Ptr("Count"),
	},
}, 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.CurrentQuotaLimitBase = armreservations.CurrentQuotaLimitBase{
// 	Name: to.Ptr("2B5C8515-37D8-4B6A-879B-CD641A2CF605"),
// 	Type: to.Ptr("Microsoft.Capacity/serviceLimits"),
// 	ID: to.Ptr("/subscriptions/D7EC67B3-7657-4966-BFFC-41EFD36BAAB3/providers/Microsoft.Capacity/resourceProviders/Microsoft.MachineLearningServices/locations/eastus/serviceLimitsRequests/2B5C8515-37D8-4B6A-879B-CD641A2CF605"),
// 	Properties: &armreservations.QuotaProperties{
// 		Name: &armreservations.ResourceName{
// 			LocalizedValue: to.Ptr("Standard Dv2 Family Cluster Dedicated vCPUs"),
// 			Value: to.Ptr("StandardDv2Family"),
// 		},
// 		CurrentValue: to.Ptr[int32](160),
// 		Limit: to.Ptr[int32](200),
// 		Properties: map[string]any{
// 		},
// 		QuotaPeriod: to.Ptr(""),
// 		ResourceType: to.Ptr(armreservations.ResourceTypeDedicated),
// 		Unit: to.Ptr("Count"),
// 	},
// }
Output:

Example (QuotasRequestPutForMachineLearningServicesLowPriorityResource)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/reservations/resource-manager/Microsoft.Capacity/stable/2020-10-25/examples/putMachineLearningServicesQuotaRequestLowPriority.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armreservations.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewQuotaClient().BeginCreateOrUpdate(ctx, "D7EC67B3-7657-4966-BFFC-41EFD36BAAB3", "Microsoft.MachineLearningServices", "eastus", "TotalLowPriorityCores", armreservations.CurrentQuotaLimitBase{
	Properties: &armreservations.QuotaProperties{
		Name: &armreservations.ResourceName{
			Value: to.Ptr("TotalLowPriorityCores"),
		},
		Limit:        to.Ptr[int32](200),
		ResourceType: to.Ptr(armreservations.ResourceTypeLowPriority),
		Unit:         to.Ptr("Count"),
	},
}, 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.CurrentQuotaLimitBase = armreservations.CurrentQuotaLimitBase{
// 	Name: to.Ptr("2B5C8515-37D8-4B6A-879B-CD641A2CF605"),
// 	Type: to.Ptr("Microsoft.Capacity/serviceLimits"),
// 	ID: to.Ptr("/subscriptions/D7EC67B3-7657-4966-BFFC-41EFD36BAAB3/providers/Microsoft.Capacity/resourceProviders/Microsoft.MachineLearningServices/locations/eastus/serviceLimitsRequests/2B5C8515-37D8-4B6A-879B-CD641A2CF605"),
// 	Properties: &armreservations.QuotaProperties{
// 		Name: &armreservations.ResourceName{
// 			LocalizedValue: to.Ptr("Total Cluster Low Priority Regional vCPUs"),
// 			Value: to.Ptr("TotalLowPriorityCores"),
// 		},
// 		CurrentValue: to.Ptr[int32](160),
// 		Limit: to.Ptr[int32](200),
// 		Properties: map[string]any{
// 		},
// 		QuotaPeriod: to.Ptr(""),
// 		ResourceType: to.Ptr(armreservations.ResourceTypeLowPriority),
// 		Unit: to.Ptr("Count"),
// 	},
// }
Output:

func (*QuotaClient) BeginUpdate

func (client *QuotaClient) BeginUpdate(ctx context.Context, subscriptionID string, providerID string, location string, resourceName string, createQuotaRequest CurrentQuotaLimitBase, options *QuotaClientBeginUpdateOptions) (*runtime.Poller[QuotaClientUpdateResponse], error)

BeginUpdate - Update the quota (service limits) of this resource to the requested value. • To get the quota information for specific resource, send a GET request. • To increase the quota, update the limit field from the GET response to a new value. • To update the quota value, submit the JSON response to the quota request API to update the quota. • To update the quota. use the PATCH operation. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2020-10-25

  • subscriptionID - Azure subscription ID.
  • providerID - Azure resource provider ID.
  • location - Azure region.
  • resourceName - The resource name for a resource provider, such as SKU name for Microsoft.Compute, Sku or TotalLowPriorityCores for Microsoft.MachineLearningServices
  • createQuotaRequest - Payload for the quota request.
  • options - QuotaClientBeginUpdateOptions contains the optional parameters for the QuotaClient.BeginUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/reservations/resource-manager/Microsoft.Capacity/stable/2020-10-25/examples/patchComputeQuotaRequest.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armreservations.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewQuotaClient().BeginUpdate(ctx, "D7EC67B3-7657-4966-BFFC-41EFD36BAAB3", "Microsoft.Compute", "eastus", "standardFSv2Family", armreservations.CurrentQuotaLimitBase{
	Properties: &armreservations.QuotaProperties{
		Name: &armreservations.ResourceName{
			Value: to.Ptr("standardFSv2Family"),
		},
		Limit: to.Ptr[int32](200),
		Unit:  to.Ptr("Count"),
	},
}, 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.CurrentQuotaLimitBase = armreservations.CurrentQuotaLimitBase{
// 	Name: to.Ptr("2B5C8515-37D8-4B6A-879B-CD641A2CF605"),
// 	Type: to.Ptr("Microsoft.Capacity/serviceLimits"),
// 	ID: to.Ptr("/subscriptions/D7EC67B3-7657-4966-BFFC-41EFD36BAAB3/providers/Microsoft.Capacity/resourceProviders/Microsoft.Compute/locations/eastus/serviceLimitsRequests/2B5C8515-37D8-4B6A-879B-CD641A2CF605"),
// 	Properties: &armreservations.QuotaProperties{
// 		Name: &armreservations.ResourceName{
// 			LocalizedValue: to.Ptr("Standard FSv2 Family vCPUs"),
// 			Value: to.Ptr("standardFSv2Family"),
// 		},
// 		CurrentValue: to.Ptr[int32](160),
// 		Limit: to.Ptr[int32](200),
// 		Properties: map[string]any{
// 		},
// 		QuotaPeriod: to.Ptr(""),
// 		Unit: to.Ptr("Count"),
// 	},
// }
Output:

func (*QuotaClient) Get

func (client *QuotaClient) Get(ctx context.Context, subscriptionID string, providerID string, location string, resourceName string, options *QuotaClientGetOptions) (QuotaClientGetResponse, error)

Get - Get the current quota (service limit) and usage of a resource. You can use the response from the GET operation to submit quota update request. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2020-10-25

  • subscriptionID - Azure subscription ID.
  • providerID - Azure resource provider ID.
  • location - Azure region.
  • resourceName - The resource name for a resource provider, such as SKU name for Microsoft.Compute, Sku or TotalLowPriorityCores for Microsoft.MachineLearningServices
  • options - QuotaClientGetOptions contains the optional parameters for the QuotaClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/reservations/resource-manager/Microsoft.Capacity/stable/2020-10-25/examples/getComputeOneSkuUsages.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armreservations.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewQuotaClient().Get(ctx, "00000000-0000-0000-0000-000000000000", "Microsoft.Compute", "eastus", "standardNDSFamily", 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.CurrentQuotaLimitBase = armreservations.CurrentQuotaLimitBase{
// 	Properties: &armreservations.QuotaProperties{
// 		Name: &armreservations.ResourceName{
// 			LocalizedValue: to.Ptr("Standard NDS Family vCPUs"),
// 			Value: to.Ptr("standardNDSFamily"),
// 		},
// 		CurrentValue: to.Ptr[int32](0),
// 		Limit: to.Ptr[int32](10),
// 		Unit: to.Ptr("Count"),
// 	},
// }
Output:

func (*QuotaClient) NewListPager

func (client *QuotaClient) NewListPager(subscriptionID string, providerID string, location string, options *QuotaClientListOptions) *runtime.Pager[QuotaClientListResponse]

NewListPager - Gets a list of current quotas (service limits) and usage for all resources. The response from the list quota operation can be leveraged to request quota updates.

Generated from API version 2020-10-25

  • subscriptionID - Azure subscription ID.
  • providerID - Azure resource provider ID.
  • location - Azure region.
  • options - QuotaClientListOptions contains the optional parameters for the QuotaClient.NewListPager method.
Example (QuotasListUsagesForCompute)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/reservations/resource-manager/Microsoft.Capacity/stable/2020-10-25/examples/getComputeUsages.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armreservations.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewQuotaClient().NewListPager("00000000-0000-0000-0000-000000000000", "Microsoft.Compute", "eastus", 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.QuotaLimits = armreservations.QuotaLimits{
	// 	Value: []*armreservations.CurrentQuotaLimitBase{
	// 		{
	// 			Properties: &armreservations.QuotaProperties{
	// 				Name: &armreservations.ResourceName{
	// 					LocalizedValue: to.Ptr("Standard FSv2 Family vCPUs"),
	// 					Value: to.Ptr("standardFSv2Family"),
	// 				},
	// 				CurrentValue: to.Ptr[int32](0),
	// 				Limit: to.Ptr[int32](100),
	// 				Unit: to.Ptr("Count"),
	// 			},
	// 		},
	// 		{
	// 			Properties: &armreservations.QuotaProperties{
	// 				Name: &armreservations.ResourceName{
	// 					LocalizedValue: to.Ptr("Standard NDS Family vCPUs"),
	// 					Value: to.Ptr("standardNDSFamily"),
	// 				},
	// 				CurrentValue: to.Ptr[int32](0),
	// 				Limit: to.Ptr[int32](0),
	// 				Unit: to.Ptr("Count"),
	// 			},
	// 		},
	// 		{
	// 			Properties: &armreservations.QuotaProperties{
	// 				Name: &armreservations.ResourceName{
	// 					LocalizedValue: to.Ptr("Standard NCSv2 Family vCPUs"),
	// 					Value: to.Ptr("standardNCSv2Family"),
	// 				},
	// 				CurrentValue: to.Ptr[int32](0),
	// 				Limit: to.Ptr[int32](0),
	// 				Unit: to.Ptr("Count"),
	// 			},
	// 		},
	// 		{
	// 			Properties: &armreservations.QuotaProperties{
	// 				Name: &armreservations.ResourceName{
	// 					LocalizedValue: to.Ptr("Standard NCSv3 Family vCPUs"),
	// 					Value: to.Ptr("standardNCSv3Family"),
	// 				},
	// 				CurrentValue: to.Ptr[int32](0),
	// 				Limit: to.Ptr[int32](0),
	// 				Unit: to.Ptr("Count"),
	// 			},
	// 		},
	// 		{
	// 			Properties: &armreservations.QuotaProperties{
	// 				Name: &armreservations.ResourceName{
	// 					LocalizedValue: to.Ptr("Standard LSv2 Family vCPUs"),
	// 					Value: to.Ptr("standardLSv2Family"),
	// 				},
	// 				CurrentValue: to.Ptr[int32](0),
	// 				Limit: to.Ptr[int32](100),
	// 				Unit: to.Ptr("Count"),
	// 			},
	// 		},
	// 		{
	// 			Properties: &armreservations.QuotaProperties{
	// 				Name: &armreservations.ResourceName{
	// 					LocalizedValue: to.Ptr("Standard PBS Family vCPUs"),
	// 					Value: to.Ptr("standardPBSFamily"),
	// 				},
	// 				CurrentValue: to.Ptr[int32](0),
	// 				Limit: to.Ptr[int32](6),
	// 				Unit: to.Ptr("Count"),
	// 			},
	// 		},
	// 		{
	// 			Properties: &armreservations.QuotaProperties{
	// 				Name: &armreservations.ResourceName{
	// 					LocalizedValue: to.Ptr("Standard EIv3 Family vCPUs"),
	// 					Value: to.Ptr("standardEIv3Family"),
	// 				},
	// 				CurrentValue: to.Ptr[int32](0),
	// 				Limit: to.Ptr[int32](100),
	// 				Unit: to.Ptr("Count"),
	// 			},
	// 		},
	// 		{
	// 			Properties: &armreservations.QuotaProperties{
	// 				Name: &armreservations.ResourceName{
	// 					LocalizedValue: to.Ptr("Standard EISv3 Family vCPUs"),
	// 					Value: to.Ptr("standardEISv3Family"),
	// 				},
	// 				CurrentValue: to.Ptr[int32](0),
	// 				Limit: to.Ptr[int32](100),
	// 				Unit: to.Ptr("Count"),
	// 			},
	// 		},
	// 		{
	// 			Properties: &armreservations.QuotaProperties{
	// 				Name: &armreservations.ResourceName{
	// 					LocalizedValue: to.Ptr("Standard DCS Family vCPUs"),
	// 					Value: to.Ptr("standardDCSFamily"),
	// 				},
	// 				CurrentValue: to.Ptr[int32](0),
	// 				Limit: to.Ptr[int32](8),
	// 				Unit: to.Ptr("Count"),
	// 			},
	// 		},
	// 		{
	// 			Properties: &armreservations.QuotaProperties{
	// 				Name: &armreservations.ResourceName{
	// 					LocalizedValue: to.Ptr("Standard NVSv2 Family vCPUs"),
	// 					Value: to.Ptr("standardNVSv2Family"),
	// 				},
	// 				CurrentValue: to.Ptr[int32](0),
	// 				Limit: to.Ptr[int32](0),
	// 				Unit: to.Ptr("Count"),
	// 			},
	// 		},
	// 		{
	// 			Properties: &armreservations.QuotaProperties{
	// 				Name: &armreservations.ResourceName{
	// 					LocalizedValue: to.Ptr("Standard MSv2 Family vCPUs"),
	// 					Value: to.Ptr("standardMSv2Family"),
	// 				},
	// 				CurrentValue: to.Ptr[int32](0),
	// 				Limit: to.Ptr[int32](0),
	// 				Unit: to.Ptr("Count"),
	// 			},
	// 	}},
	// }
}
Output:

Example (QuotasListUsagesMachineLearningServices)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/reservations/resource-manager/Microsoft.Capacity/stable/2020-10-25/examples/getMachineLearningServicesUsages.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armreservations.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewQuotaClient().NewListPager("00000000-0000-0000-0000-000000000000", "Microsoft.MachineLearningServices", "eastus", 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.QuotaLimits = armreservations.QuotaLimits{
	// 	Value: []*armreservations.CurrentQuotaLimitBase{
	// 		{
	// 			Properties: &armreservations.QuotaProperties{
	// 				Name: &armreservations.ResourceName{
	// 					LocalizedValue: to.Ptr("Standard Dv2 Family vCPUs"),
	// 					Value: to.Ptr("standardDv2Family"),
	// 				},
	// 				CurrentValue: to.Ptr[int32](15),
	// 				Limit: to.Ptr[int32](20),
	// 				ResourceType: to.Ptr(armreservations.ResourceTypeDedicated),
	// 			},
	// 		},
	// 		{
	// 			Properties: &armreservations.QuotaProperties{
	// 				Name: &armreservations.ResourceName{
	// 					LocalizedValue: to.Ptr("Total Regional Low-priority vCPUs"),
	// 					Value: to.Ptr("totalLowPriorityCores"),
	// 				},
	// 				CurrentValue: to.Ptr[int32](49),
	// 				Limit: to.Ptr[int32](600),
	// 				ResourceType: to.Ptr(armreservations.ResourceTypeLowPriority),
	// 			},
	// 	}},
	// }
}
Output:

type QuotaClientBeginCreateOrUpdateOptions

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

QuotaClientBeginCreateOrUpdateOptions contains the optional parameters for the QuotaClient.BeginCreateOrUpdate method.

type QuotaClientBeginUpdateOptions

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

QuotaClientBeginUpdateOptions contains the optional parameters for the QuotaClient.BeginUpdate method.

type QuotaClientCreateOrUpdateResponse

type QuotaClientCreateOrUpdateResponse struct {
	// Quota properties.
	CurrentQuotaLimitBase
}

QuotaClientCreateOrUpdateResponse contains the response from method QuotaClient.BeginCreateOrUpdate.

type QuotaClientGetOptions

type QuotaClientGetOptions struct {
}

QuotaClientGetOptions contains the optional parameters for the QuotaClient.Get method.

type QuotaClientGetResponse

type QuotaClientGetResponse struct {
	// Quota properties.
	CurrentQuotaLimitBase

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

QuotaClientGetResponse contains the response from method QuotaClient.Get.

type QuotaClientListOptions

type QuotaClientListOptions struct {
}

QuotaClientListOptions contains the optional parameters for the QuotaClient.NewListPager method.

type QuotaClientListResponse

type QuotaClientListResponse struct {
	// Quota limits.
	QuotaLimits

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

QuotaClientListResponse contains the response from method QuotaClient.NewListPager.

type QuotaClientUpdateResponse

type QuotaClientUpdateResponse struct {
	// Quota properties.
	CurrentQuotaLimitBase
}

QuotaClientUpdateResponse contains the response from method QuotaClient.BeginUpdate.

type QuotaLimits

type QuotaLimits struct {
	// The URI for fetching the next page of quotas (service limits). When no more pages exist, the value is null.
	NextLink *string

	// List of quotas (service limits).
	Value []*CurrentQuotaLimitBase
}

QuotaLimits - Quota limits.

func (QuotaLimits) MarshalJSON

func (q QuotaLimits) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type QuotaLimits.

func (*QuotaLimits) UnmarshalJSON

func (q *QuotaLimits) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type QuotaLimits.

type QuotaLimitsResponse

type QuotaLimitsResponse struct {
	// The URI for fetching the next page of quota limits. When no more pages exist, the value is null.
	NextLink *string

	// List of quotas with the quota request status.
	Value []*CurrentQuotaLimit
}

QuotaLimitsResponse - Quotas (service limits) in the request response.

func (QuotaLimitsResponse) MarshalJSON

func (q QuotaLimitsResponse) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type QuotaLimitsResponse.

func (*QuotaLimitsResponse) UnmarshalJSON

func (q *QuotaLimitsResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type QuotaLimitsResponse.

type QuotaProperties

type QuotaProperties struct {
	// Quota properties.
	Limit *int32

	// Name of the resource provide by the resource provider. Use this property for quotaRequests resource operations.
	Name *ResourceName

	// Additional properties for the specified resource provider.
	Properties any

	// The name of the resource type.
	ResourceType *ResourceType

	// The limit units, such as count and bytes. Use the unit field provided in the response of the GET quota operation.
	Unit *string

	// READ-ONLY; Current usage value for the resource.
	CurrentValue *int32

	// READ-ONLY; The time period over which the quota usage values are summarized. For example, P1D (per one day), PT1M (per
	// one minute), and PT1S (per one second). This parameter is optional because, for some
	// resources such as compute, the time period is irrelevant.
	QuotaPeriod *string
}

QuotaProperties - Quota properties for the resource.

func (QuotaProperties) MarshalJSON

func (q QuotaProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type QuotaProperties.

func (*QuotaProperties) UnmarshalJSON

func (q *QuotaProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type QuotaProperties.

type QuotaRequestDetails

type QuotaRequestDetails struct {
	// Quota request details.
	Properties *QuotaRequestProperties

	// READ-ONLY; Quota request ID.
	ID *string

	// READ-ONLY; Quota request name.
	Name *string

	// READ-ONLY; Resource type
	Type *string
}

QuotaRequestDetails - Quota request details.

func (QuotaRequestDetails) MarshalJSON

func (q QuotaRequestDetails) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type QuotaRequestDetails.

func (*QuotaRequestDetails) UnmarshalJSON

func (q *QuotaRequestDetails) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type QuotaRequestDetails.

type QuotaRequestDetailsList

type QuotaRequestDetailsList struct {
	// The URI to fetch the next page of quota limits. When there are no more pages, this is null.
	NextLink *string

	// The quota requests.
	Value []*QuotaRequestDetails
}

QuotaRequestDetailsList - Quota request details.

func (QuotaRequestDetailsList) MarshalJSON

func (q QuotaRequestDetailsList) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type QuotaRequestDetailsList.

func (*QuotaRequestDetailsList) UnmarshalJSON

func (q *QuotaRequestDetailsList) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type QuotaRequestDetailsList.

type QuotaRequestOneResourceProperties

type QuotaRequestOneResourceProperties struct {
	// The quota request addition properties.
	Properties *CurrentQuotaLimitBase

	// READ-ONLY; User friendly status message.
	Message *string

	// READ-ONLY; The quota request status.
	ProvisioningState *QuotaRequestState

	// READ-ONLY; The time when the quota request was submitted using format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601
	// standard.
	RequestSubmitTime *time.Time
}

QuotaRequestOneResourceProperties - The details of quota request.

func (QuotaRequestOneResourceProperties) MarshalJSON

func (q QuotaRequestOneResourceProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type QuotaRequestOneResourceProperties.

func (*QuotaRequestOneResourceProperties) UnmarshalJSON

func (q *QuotaRequestOneResourceProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type QuotaRequestOneResourceProperties.

type QuotaRequestOneResourceSubmitResponse

type QuotaRequestOneResourceSubmitResponse struct {
	// The details for quota request.
	Properties *QuotaRequestOneResourceProperties

	// READ-ONLY; The quota request ID.
	ID *string

	// READ-ONLY; The name of the quota request.
	Name *string

	// READ-ONLY; Type of resource. "Microsoft.Capacity/ServiceLimits"
	Type *string
}

QuotaRequestOneResourceSubmitResponse - Response for the quota submission request.

func (QuotaRequestOneResourceSubmitResponse) MarshalJSON

func (q QuotaRequestOneResourceSubmitResponse) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type QuotaRequestOneResourceSubmitResponse.

func (*QuotaRequestOneResourceSubmitResponse) UnmarshalJSON

func (q *QuotaRequestOneResourceSubmitResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type QuotaRequestOneResourceSubmitResponse.

type QuotaRequestProperties

type QuotaRequestProperties struct {
	// The quota request status.
	ProvisioningState *QuotaRequestState

	// The quotaRequests.
	Value []*SubRequest

	// READ-ONLY; User friendly status message.
	Message *string

	// READ-ONLY; The time when the quota request was submitted using format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601
	// standard.
	RequestSubmitTime *time.Time
}

QuotaRequestProperties - The details of quota request.

func (QuotaRequestProperties) MarshalJSON

func (q QuotaRequestProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type QuotaRequestProperties.

func (*QuotaRequestProperties) UnmarshalJSON

func (q *QuotaRequestProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type QuotaRequestProperties.

type QuotaRequestState

type QuotaRequestState string

QuotaRequestState - The quota request status.

const (
	QuotaRequestStateAccepted   QuotaRequestState = "Accepted"
	QuotaRequestStateFailed     QuotaRequestState = "Failed"
	QuotaRequestStateInProgress QuotaRequestState = "InProgress"
	QuotaRequestStateInvalid    QuotaRequestState = "Invalid"
	QuotaRequestStateSucceeded  QuotaRequestState = "Succeeded"
)

func PossibleQuotaRequestStateValues

func PossibleQuotaRequestStateValues() []QuotaRequestState

PossibleQuotaRequestStateValues returns the possible values for the QuotaRequestState const type.

type QuotaRequestStatusClient

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

QuotaRequestStatusClient contains the methods for the QuotaRequestStatus group. Don't use this type directly, use NewQuotaRequestStatusClient() instead.

func NewQuotaRequestStatusClient

func NewQuotaRequestStatusClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*QuotaRequestStatusClient, error)

NewQuotaRequestStatusClient creates a new instance of QuotaRequestStatusClient with the specified values.

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

func (*QuotaRequestStatusClient) Get

Get - For the specified Azure region (location), get the details and status of the quota request by the quota request ID for the resources of the resource provider. The PUT request for the quota (service limit) returns a response with the requestId parameter. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2020-10-25

  • subscriptionID - Azure subscription ID.
  • providerID - Azure resource provider ID.
  • location - Azure region.
  • id - Quota Request ID.
  • options - QuotaRequestStatusClientGetOptions contains the optional parameters for the QuotaRequestStatusClient.Get method.
Example (QuotaRequestFailed)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/reservations/resource-manager/Microsoft.Capacity/stable/2020-10-25/examples/getQuotaRequestStatusFailed.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armreservations.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewQuotaRequestStatusClient().Get(ctx, "00000000-0000-0000-0000-000000000000", "Microsoft.Compute", "eastus", "2B5C8515-37D8-4B6A-879B-CD641A2CF605", 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.QuotaRequestDetails = armreservations.QuotaRequestDetails{
// 	Name: to.Ptr("00000000-0000-0000-0000-000000000000/2B5C8515-37D8-4B6A-879B-CD641A2CF605"),
// 	Type: to.Ptr("Microsoft.Capacity/serviceLimitsRequests"),
// 	ID: to.Ptr("2B5C8515-37D8-4B6A-879B-CD641A2CF605"),
// 	Properties: &armreservations.QuotaRequestProperties{
// 		Message: to.Ptr("Request failed, please contatct support."),
// 		ProvisioningState: to.Ptr(armreservations.QuotaRequestStateSucceeded),
// 		RequestSubmitTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-08-19T19:23:17.904Z"); return t}()),
// 		Value: []*armreservations.SubRequest{
// 			{
// 				Name: &armreservations.ResourceName{
// 					LocalizedValue: to.Ptr("Standard HCS Family vCPUs"),
// 					Value: to.Ptr("standardHCSFamily"),
// 				},
// 				Limit: to.Ptr[int32](200),
// 				Message: to.Ptr("Request completed"),
// 				ProvisioningState: to.Ptr(armreservations.QuotaRequestStateSucceeded),
// 				SubRequestID: to.Ptr("AD07450A-DE86-4FD3-859B-107BEF218C4C"),
// 			},
// 			{
// 				Name: &armreservations.ResourceName{
// 					LocalizedValue: to.Ptr("Standard NC Promo Family vCPUs"),
// 					Value: to.Ptr("standardNCPromoFamily"),
// 				},
// 				Limit: to.Ptr[int32](50),
// 				Message: to.Ptr("RRequest failed, please contatct support."),
// 				ProvisioningState: to.Ptr(armreservations.QuotaRequestStateSucceeded),
// 				SubRequestID: to.Ptr("AD07450A-DE86-4FD3-859B-107BEF218C4C"),
// 		}},
// 	},
// }
Output:

Example (QuotaRequestInProgress)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/reservations/resource-manager/Microsoft.Capacity/stable/2020-10-25/examples/getQuotaRequestStatusInProgress.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armreservations.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewQuotaRequestStatusClient().Get(ctx, "00000000-0000-0000-0000-000000000000", "Microsoft.Compute", "eastus", "2B5C8515-37D8-4B6A-879B-CD641A2CF605", 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.QuotaRequestDetails = armreservations.QuotaRequestDetails{
// 	Name: to.Ptr("00000000-0000-0000-0000-000000000000/2B5C8515-37D8-4B6A-879B-CD641A2CF605"),
// 	Type: to.Ptr("Microsoft.Capacity/serviceLimitsRequests"),
// 	ID: to.Ptr("2B5C8515-37D8-4B6A-879B-CD641A2CF605"),
// 	Properties: &armreservations.QuotaRequestProperties{
// 		Message: to.Ptr("Request processing"),
// 		ProvisioningState: to.Ptr(armreservations.QuotaRequestStateSucceeded),
// 		RequestSubmitTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-08-19T19:23:17.904Z"); return t}()),
// 		Value: []*armreservations.SubRequest{
// 			{
// 				Name: &armreservations.ResourceName{
// 					LocalizedValue: to.Ptr("Standard NC Promo Family vCPUs"),
// 					Value: to.Ptr("standardNCPromoFamily"),
// 				},
// 				Limit: to.Ptr[int32](50),
// 				Message: to.Ptr("Request processing"),
// 				ProvisioningState: to.Ptr(armreservations.QuotaRequestStateSucceeded),
// 				SubRequestID: to.Ptr("AD07450A-DE86-4FD3-859B-107BEF218C4C"),
// 		}},
// 	},
// }
Output:

Example (QuotaRequestStatus)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/reservations/resource-manager/Microsoft.Capacity/stable/2020-10-25/examples/getQuotaRequestStatusById.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armreservations.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewQuotaRequestStatusClient().Get(ctx, "00000000-0000-0000-0000-000000000000", "Microsoft.Compute", "eastus", "2B5C8515-37D8-4B6A-879B-CD641A2CF605", 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.QuotaRequestDetails = armreservations.QuotaRequestDetails{
// 	Name: to.Ptr("00000000-0000-0000-0000-000000000000/2B5C8515-37D8-4B6A-879B-CD641A2CF605"),
// 	Type: to.Ptr("Microsoft.Capacity/serviceLimitsRequests"),
// 	ID: to.Ptr("2B5C8515-37D8-4B6A-879B-CD641A2CF605"),
// 	Properties: &armreservations.QuotaRequestProperties{
// 		Message: to.Ptr("Request completed"),
// 		ProvisioningState: to.Ptr(armreservations.QuotaRequestStateSucceeded),
// 		RequestSubmitTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-08-19T19:23:17.904Z"); return t}()),
// 		Value: []*armreservations.SubRequest{
// 			{
// 				Name: &armreservations.ResourceName{
// 					LocalizedValue: to.Ptr("Standard HCS Family vCPUs"),
// 					Value: to.Ptr("standardHCSFamily"),
// 				},
// 				Limit: to.Ptr[int32](200),
// 				Message: to.Ptr("Request completed"),
// 				ProvisioningState: to.Ptr(armreservations.QuotaRequestStateSucceeded),
// 				SubRequestID: to.Ptr("AD07450A-DE86-4FD3-859B-107BEF218C4C"),
// 			},
// 			{
// 				Name: &armreservations.ResourceName{
// 					LocalizedValue: to.Ptr("Standard NC Promo Family vCPUs"),
// 					Value: to.Ptr("standardNCPromoFamily"),
// 				},
// 				Limit: to.Ptr[int32](50),
// 				Message: to.Ptr("Request completed"),
// 				ProvisioningState: to.Ptr(armreservations.QuotaRequestStateSucceeded),
// 		}},
// 	},
// }
Output:

func (*QuotaRequestStatusClient) NewListPager

func (client *QuotaRequestStatusClient) NewListPager(subscriptionID string, providerID string, location string, options *QuotaRequestStatusClientListOptions) *runtime.Pager[QuotaRequestStatusClientListResponse]

NewListPager - For the specified Azure region (location), subscription, and resource provider, get the history of the quota requests for the past year. To select specific quota requests, use the oData filter.

Generated from API version 2020-10-25

  • subscriptionID - Azure subscription ID.
  • providerID - Azure resource provider ID.
  • location - Azure region.
  • options - QuotaRequestStatusClientListOptions contains the optional parameters for the QuotaRequestStatusClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/reservations/resource-manager/Microsoft.Capacity/stable/2020-10-25/examples/getQuotaRequestsHistory.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armreservations.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewQuotaRequestStatusClient().NewListPager("3f75fdf7-977e-44ad-990d-99f14f0f299f", "Microsoft.Compute", "eastus", &armreservations.QuotaRequestStatusClientListOptions{Filter: nil,
	Top:       nil,
	Skiptoken: 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.QuotaRequestDetailsList = armreservations.QuotaRequestDetailsList{
	// 	Value: []*armreservations.QuotaRequestDetails{
	// 		{
	// 			Name: to.Ptr("00000000-0000-0000-0000-000000000000/2B5C8515-37D8-4B6A-879B-CD641A2CF605"),
	// 			Type: to.Ptr("Microsoft.Capacity/serviceLimitsRequests"),
	// 			ID: to.Ptr("2B5C8515-37D8-4B6A-879B-CD641A2CF605"),
	// 			Properties: &armreservations.QuotaRequestProperties{
	// 				Message: to.Ptr("Request completed"),
	// 				ProvisioningState: to.Ptr(armreservations.QuotaRequestStateSucceeded),
	// 				RequestSubmitTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-08-19T19:23:17.904Z"); return t}()),
	// 				Value: []*armreservations.SubRequest{
	// 					{
	// 						Name: &armreservations.ResourceName{
	// 							LocalizedValue: to.Ptr("Standard HCS Family vCPUs"),
	// 							Value: to.Ptr("standardHCSFamily"),
	// 						},
	// 						Limit: to.Ptr[int32](200),
	// 						Message: to.Ptr("Request completed"),
	// 						ProvisioningState: to.Ptr(armreservations.QuotaRequestStateSucceeded),
	// 						SubRequestID: to.Ptr("AD07450A-DE86-4FD3-859B-107BEF218C4C"),
	// 					},
	// 					{
	// 						Name: &armreservations.ResourceName{
	// 							LocalizedValue: to.Ptr("Standard NC Promo Family vCPUs"),
	// 							Value: to.Ptr("standardNCPromoFamily"),
	// 						},
	// 						Limit: to.Ptr[int32](50),
	// 						Message: to.Ptr("Request completed"),
	// 						ProvisioningState: to.Ptr(armreservations.QuotaRequestStateSucceeded),
	// 						SubRequestID: to.Ptr("AD07450A-DE86-4FD3-859B-107BEF218C4C"),
	// 				}},
	// 			},
	// 		},
	// 		{
	// 			Name: to.Ptr("00000000-0000-0000-0000-000000000000/7E73A85C-83BB-4DE4-903F-076F1A2B91D6"),
	// 			Type: to.Ptr("Microsoft.Capacity/serviceLimitsRequests"),
	// 			ID: to.Ptr("7E73A85C-83BB-4DE4-903F-076F1A2B91D6"),
	// 			Properties: &armreservations.QuotaRequestProperties{
	// 				Message: to.Ptr("Request completed"),
	// 				ProvisioningState: to.Ptr(armreservations.QuotaRequestStateSucceeded),
	// 				RequestSubmitTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-08-18T19:23:17.904Z"); return t}()),
	// 				Value: []*armreservations.SubRequest{
	// 					{
	// 						Name: &armreservations.ResourceName{
	// 							LocalizedValue: to.Ptr("Standard NVSv3 Family vCPUs"),
	// 							Value: to.Ptr("standardNVSv3Family"),
	// 						},
	// 						Limit: to.Ptr[int32](100),
	// 						Message: to.Ptr("Request completed"),
	// 						ProvisioningState: to.Ptr(armreservations.QuotaRequestStateSucceeded),
	// 						SubRequestID: to.Ptr("AD07450A-DE86-4FD3-859B-107BEF218C4C"),
	// 					},
	// 					{
	// 						Name: &armreservations.ResourceName{
	// 							LocalizedValue: to.Ptr("Standard NV Promo Family vCPUs"),
	// 							Value: to.Ptr("standardNVPromoFamily"),
	// 						},
	// 						Limit: to.Ptr[int32](150),
	// 						Message: to.Ptr("Request completed"),
	// 						ProvisioningState: to.Ptr(armreservations.QuotaRequestStateSucceeded),
	// 						SubRequestID: to.Ptr("AD07450A-DE86-4FD3-859B-107BEF218C4C"),
	// 				}},
	// 			},
	// 		},
	// 		{
	// 			Name: to.Ptr("00000000-0000-0000-0000-000000000000/5E460077-AB53-4802-8997-A6940E0B7649"),
	// 			Type: to.Ptr("Microsoft.Capacity/serviceLimitsRequests"),
	// 			ID: to.Ptr("5E460077-AB53-4802-8997-A6940E0B7649"),
	// 			Properties: &armreservations.QuotaRequestProperties{
	// 				Message: to.Ptr("Request completed"),
	// 				ProvisioningState: to.Ptr(armreservations.QuotaRequestStateSucceeded),
	// 				RequestSubmitTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-08-17T19:23:17.904Z"); return t}()),
	// 				Value: []*armreservations.SubRequest{
	// 					{
	// 						Name: &armreservations.ResourceName{
	// 							LocalizedValue: to.Ptr("Standard NC Promo Family vCPUs"),
	// 							Value: to.Ptr("standardNCPromoFamily"),
	// 						},
	// 						Limit: to.Ptr[int32](70),
	// 						Message: to.Ptr("Request completed"),
	// 						ProvisioningState: to.Ptr(armreservations.QuotaRequestStateSucceeded),
	// 						SubRequestID: to.Ptr("AD07450A-DE86-4FD3-859B-107BEF218C4C"),
	// 					},
	// 					{
	// 						Name: &armreservations.ResourceName{
	// 							LocalizedValue: to.Ptr("Standard HBS Family vCPUs"),
	// 							Value: to.Ptr("standardHBSFamily"),
	// 						},
	// 						Limit: to.Ptr[int32](52),
	// 						Message: to.Ptr("Request completed"),
	// 						ProvisioningState: to.Ptr(armreservations.QuotaRequestStateSucceeded),
	// 						SubRequestID: to.Ptr("AD07450A-DE86-4FD3-859B-107BEF218C4C"),
	// 				}},
	// 			},
	// 	}},
	// }
}
Output:

type QuotaRequestStatusClientGetOptions

type QuotaRequestStatusClientGetOptions struct {
}

QuotaRequestStatusClientGetOptions contains the optional parameters for the QuotaRequestStatusClient.Get method.

type QuotaRequestStatusClientGetResponse

type QuotaRequestStatusClientGetResponse struct {
	// Quota request details.
	QuotaRequestDetails
}

QuotaRequestStatusClientGetResponse contains the response from method QuotaRequestStatusClient.Get.

type QuotaRequestStatusClientListOptions

type QuotaRequestStatusClientListOptions struct {
	// FIELD SUPPORTED OPERATORS
	// requestSubmitTime ge, le, eq, gt, lt
	Filter *string

	// Skiptoken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element,
	// the value of the nextLink element includes a skiptoken parameter that
	// specifies a starting point to use for subsequent calls.
	Skiptoken *string

	// Number of records to return.
	Top *int32
}

QuotaRequestStatusClientListOptions contains the optional parameters for the QuotaRequestStatusClient.NewListPager method.

type QuotaRequestStatusClientListResponse

type QuotaRequestStatusClientListResponse struct {
	// Quota request details.
	QuotaRequestDetailsList
}

QuotaRequestStatusClientListResponse contains the response from method QuotaRequestStatusClient.NewListPager.

type QuotaRequestStatusDetails

type QuotaRequestStatusDetails struct {
	// READ-ONLY; A user friendly message.
	Message *string

	// READ-ONLY; The details of the quota request status.
	ProvisioningState *QuotaRequestState
}

QuotaRequestStatusDetails - Quota request status details.

func (QuotaRequestStatusDetails) MarshalJSON

func (q QuotaRequestStatusDetails) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type QuotaRequestStatusDetails.

func (*QuotaRequestStatusDetails) UnmarshalJSON

func (q *QuotaRequestStatusDetails) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type QuotaRequestStatusDetails.

type QuotaRequestSubmitResponse

type QuotaRequestSubmitResponse struct {
	// The quota request details.
	Properties *QuotaRequestProperties

	// READ-ONLY; The quota request ID.
	ID *string

	// READ-ONLY; The name of the quota request.
	Name *string

	// READ-ONLY; Type of resource. "Microsoft.Capacity/serviceLimits"
	Type *string
}

QuotaRequestSubmitResponse - Response for the quota submission request.

func (QuotaRequestSubmitResponse) MarshalJSON

func (q QuotaRequestSubmitResponse) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type QuotaRequestSubmitResponse.

func (*QuotaRequestSubmitResponse) UnmarshalJSON

func (q *QuotaRequestSubmitResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type QuotaRequestSubmitResponse.

type QuotaRequestSubmitResponse201

type QuotaRequestSubmitResponse201 struct {
	// Quota request status.
	Properties *QuotaRequestStatusDetails

	// READ-ONLY; The quota request ID. Use the requestId parameter to check the request status.
	ID *string

	// READ-ONLY; Operation ID
	Name *string

	// READ-ONLY; Resource type
	Type *string
}

QuotaRequestSubmitResponse201 - Response with request ID that the quota request was accepted.

func (QuotaRequestSubmitResponse201) MarshalJSON

func (q QuotaRequestSubmitResponse201) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type QuotaRequestSubmitResponse201.

func (*QuotaRequestSubmitResponse201) UnmarshalJSON

func (q *QuotaRequestSubmitResponse201) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type QuotaRequestSubmitResponse201.

type RefundBillingInformation

type RefundBillingInformation struct {
	// Pricing information containing the amount and the currency code
	BillingCurrencyProratedAmount *Price

	// Pricing information containing the amount and the currency code
	BillingCurrencyRemainingCommitmentAmount *Price

	// Pricing information containing the amount and the currency code
	BillingCurrencyTotalPaidAmount *Price

	// Represent the billing plans.
	BillingPlan *ReservationBillingPlan

	// The number of completed transactions in this reservation's payment
	CompletedTransactions *int32

	// The number of total transactions in this reservation's payment
	TotalTransactions *int32
}

RefundBillingInformation - billing information

func (RefundBillingInformation) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type RefundBillingInformation.

func (*RefundBillingInformation) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type RefundBillingInformation.

type RefundPolicyError

type RefundPolicyError struct {
	// Error code describing the reason that service is not able to process the incoming request
	Code    *ErrorResponseCode
	Message *string
}

RefundPolicyError - error details

func (RefundPolicyError) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type RefundPolicyError.

func (*RefundPolicyError) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type RefundPolicyError.

type RefundPolicyResult

type RefundPolicyResult struct {
	// Refund policy result property
	Properties *RefundPolicyResultProperty
}

RefundPolicyResult - Refund policy result

func (RefundPolicyResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type RefundPolicyResult.

func (*RefundPolicyResult) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type RefundPolicyResult.

type RefundPolicyResultProperty

type RefundPolicyResultProperty struct {
	// Pricing information containing the amount and the currency code
	ConsumedRefundsTotal *Price

	// Pricing information containing the amount and the currency code
	MaxRefundLimit *Price

	// Refund Policy errors
	PolicyErrors []*RefundPolicyError
}

RefundPolicyResultProperty - Refund policy result property

func (RefundPolicyResultProperty) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type RefundPolicyResultProperty.

func (*RefundPolicyResultProperty) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type RefundPolicyResultProperty.

type RefundRequest

type RefundRequest struct {
	// Properties needed for refund request including the session id from calculate refund, the scope, the reservation to be returned
	// and the return reason.
	Properties *RefundRequestProperties
}

RefundRequest - Request containing information needed for returning reservation.

func (RefundRequest) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type RefundRequest.

func (*RefundRequest) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type RefundRequest.

type RefundRequestProperties

type RefundRequestProperties struct {
	// Reservation to return
	ReservationToReturn *ReservationToReturn

	// The reason of returning the reservation
	ReturnReason *string

	// The scope of the refund, e.g. Reservation
	Scope *string

	// SessionId that was returned by CalculateRefund API.
	SessionID *string
}

RefundRequestProperties - Properties needed for refund request including the session id from calculate refund, the scope, the reservation to be returned and the return reason.

func (RefundRequestProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type RefundRequestProperties.

func (*RefundRequestProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type RefundRequestProperties.

type RefundResponse

type RefundResponse struct {
	// Fully qualified identifier of the reservation being returned
	ID *string

	// The refund properties of reservation
	Properties *RefundResponseProperties
}

RefundResponse - The response of refund request containing refund information of reservation

func (RefundResponse) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type RefundResponse.

func (*RefundResponse) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type RefundResponse.

type RefundResponseProperties

type RefundResponseProperties struct {
	// billing information
	BillingInformation *RefundBillingInformation

	// Pricing information containing the amount and the currency code
	BillingRefundAmount *Price

	// Refund policy result
	PolicyResult *RefundPolicyResult

	// Pricing information containing the amount and the currency code
	PricingRefundAmount *Price

	// Quantity to be returned
	Quantity *int32

	// Refund session identifier
	SessionID *string
}

RefundResponseProperties - The refund properties of reservation

func (RefundResponseProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type RefundResponseProperties.

func (*RefundResponseProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type RefundResponseProperties.

type RenewPropertiesResponse

type RenewPropertiesResponse struct {
	// Currency and amount that customer will be charged in customer's local currency for renewal purchase. Tax is not included.
	BillingCurrencyTotal *RenewPropertiesResponseBillingCurrencyTotal

	// Amount that Microsoft uses for record. Used during refund for calculating refund limit. Tax is not included. This is locked
	// price 30 days before expiry.
	PricingCurrencyTotal *RenewPropertiesResponsePricingCurrencyTotal

	// The request for reservation purchase
	PurchaseProperties *PurchaseRequest
}

RenewPropertiesResponse - The renew properties for a reservation.

func (RenewPropertiesResponse) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type RenewPropertiesResponse.

func (*RenewPropertiesResponse) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type RenewPropertiesResponse.

type RenewPropertiesResponseBillingCurrencyTotal

type RenewPropertiesResponseBillingCurrencyTotal struct {
	Amount *float32

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

RenewPropertiesResponseBillingCurrencyTotal - Currency and amount that customer will be charged in customer's local currency for renewal purchase. Tax is not included.

func (RenewPropertiesResponseBillingCurrencyTotal) MarshalJSON

MarshalJSON implements the json.Marshaller interface for type RenewPropertiesResponseBillingCurrencyTotal.

func (*RenewPropertiesResponseBillingCurrencyTotal) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type RenewPropertiesResponseBillingCurrencyTotal.

type RenewPropertiesResponsePricingCurrencyTotal

type RenewPropertiesResponsePricingCurrencyTotal struct {
	Amount *float32

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

RenewPropertiesResponsePricingCurrencyTotal - Amount that Microsoft uses for record. Used during refund for calculating refund limit. Tax is not included. This is locked price 30 days before expiry.

func (RenewPropertiesResponsePricingCurrencyTotal) MarshalJSON

MarshalJSON implements the json.Marshaller interface for type RenewPropertiesResponsePricingCurrencyTotal.

func (*RenewPropertiesResponsePricingCurrencyTotal) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type RenewPropertiesResponsePricingCurrencyTotal.

type ReservationBillingPlan

type ReservationBillingPlan string

ReservationBillingPlan - Represent the billing plans.

const (
	ReservationBillingPlanMonthly ReservationBillingPlan = "Monthly"
	ReservationBillingPlanUpfront ReservationBillingPlan = "Upfront"
)

func PossibleReservationBillingPlanValues

func PossibleReservationBillingPlanValues() []ReservationBillingPlan

PossibleReservationBillingPlanValues returns the possible values for the ReservationBillingPlan const type.

type ReservationClient

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

ReservationClient contains the methods for the Reservation group. Don't use this type directly, use NewReservationClient() instead.

func NewReservationClient

func NewReservationClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*ReservationClient, error)

NewReservationClient creates a new instance of ReservationClient with the specified values.

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

func (*ReservationClient) Archive

func (client *ReservationClient) Archive(ctx context.Context, reservationOrderID string, reservationID string, options *ReservationClientArchiveOptions) (ReservationClientArchiveResponse, error)

Archive - Archiving a Reservation moves it to Archived state. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-11-01

  • reservationOrderID - Order Id of the reservation
  • reservationID - Id of the reservation item
  • options - ReservationClientArchiveOptions contains the optional parameters for the ReservationClient.Archive method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-11-01/examples/Archive.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armreservations.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
_, err = clientFactory.NewReservationClient().Archive(ctx, "276e7ae4-84d0-4da6-ab4b-d6b94f3557da", "356e7ae4-84d0-4da6-ab4b-d6b94f3557da", nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
Output:

func (*ReservationClient) BeginAvailableScopes

BeginAvailableScopes - Check whether the scopes from request is valid for Reservation. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-11-01

  • reservationOrderID - Order Id of the reservation
  • reservationID - Id of the reservation item
  • body - Scopes to be checked for eligibility.
  • options - ReservationClientBeginAvailableScopesOptions contains the optional parameters for the ReservationClient.BeginAvailableScopes method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-11-01/examples/GetAvailableScope.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armreservations.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewReservationClient().BeginAvailableScopes(ctx, "276e7ae4-84d0-4da6-ab4b-d6b94f3557da", "356e7ae4-84d0-4da6-ab4b-d6b94f3557da", armreservations.AvailableScopeRequest{
	Properties: &armreservations.AvailableScopeRequestProperties{
		Scopes: []*string{
			to.Ptr("/subscriptions/efc7c997-7700-4a74-b731-55aec16c15e9")},
	},
}, 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.AvailableScopeProperties = armreservations.AvailableScopeProperties{
// 	Properties: &armreservations.SubscriptionScopeProperties{
// 		Scopes: []*armreservations.ScopeProperties{
// 			{
// 				Scope: to.Ptr("/subscriptions/efc7c997-7700-4a74-b731-55aec16c15e9"),
// 				Valid: to.Ptr(true),
// 		}},
// 	},
// }
Output:

func (*ReservationClient) BeginMerge

BeginMerge - Merge the specified Reservations into a new Reservation. The two Reservations being merged must have same properties. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-11-01

  • reservationOrderID - Order Id of the reservation
  • body - Information needed for commercial request for a reservation
  • options - ReservationClientBeginMergeOptions contains the optional parameters for the ReservationClient.BeginMerge method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-11-01/examples/MergeReservations.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armreservations.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewReservationClient().BeginMerge(ctx, "276e7ae4-84d0-4da6-ab4b-d6b94f3557da", armreservations.MergeRequest{
	Properties: &armreservations.MergeProperties{
		Sources: []*string{
			to.Ptr("/providers/Microsoft.Capacity/reservationOrders/c0565a8a-4491-4e77-b07b-5e6d66718e1c/reservations/cea04232-932e-47db-acb5-e29a945ecc73"),
			to.Ptr("/providers/Microsoft.Capacity/reservationOrders/c0565a8a-4491-4e77-b07b-5e6d66718e1c/reservations/5bf54dc7-dacd-4f46-a16b-7b78f4a59799")},
	},
}, 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.ReservationResponseArray = []*armreservations.ReservationResponse{
// 	{
// 		Name: to.Ptr("00238563-7312-4c20-a134-8c030bf938a7"),
// 		Type: to.Ptr("Microsoft.Capacity/reservationOrders/reservations"),
// 		ID: to.Ptr("/providers/microsoft.capacity/reservationOrders/276e7ae4-84d0-4da6-ab4b-d6b94f3557da/reservations/00238563-7312-4c20-a134-8c030bf938a7"),
// 		Etag: to.Ptr[int32](5),
// 		Location: to.Ptr("eastus"),
// 		Properties: &armreservations.Properties{
// 			AppliedScopeProperties: &armreservations.AppliedScopeProperties{
// 				DisplayName: to.Ptr("Azure subscription 1"),
// 				SubscriptionID: to.Ptr("/subscriptions/98df3792-7962-4f18-8be2-d5576f122de3"),
// 			},
// 			AppliedScopeType: to.Ptr(armreservations.AppliedScopeTypeSingle),
// 			BillingPlan: to.Ptr(armreservations.ReservationBillingPlanMonthly),
// 			BillingScopeID: to.Ptr("/subscriptions/19376483-64b8-49e4-a931-d5248828720a"),
// 			DisplayName: to.Ptr("cabri_test"),
// 			EffectiveDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-09-22T22:46:32.763Z"); return t}()),
// 			ExpiryDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2018-09-22"); return t}()),
// 			ExpiryDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-09-22T22:46:32.763Z"); return t}()),
// 			ExtendedStatusInfo: &armreservations.ExtendedStatusInfo{
// 				Message: to.Ptr("This reservation was merged and is no longer active."),
// 				StatusCode: to.Ptr(armreservations.ReservationStatusCodeMerged),
// 			},
// 			InstanceFlexibility: to.Ptr(armreservations.InstanceFlexibilityOff),
// 			LastUpdatedDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-09-22T22:46:32.763Z"); return t}()),
// 			MergeProperties: &armreservations.ReservationMergeProperties{
// 				MergeDestination: to.Ptr("/providers/microsoft.capacity/reservationOrders/276e7ae4-84d0-4da6-ab4b-d6b94f3557da/reservations/6ef59113-3482-40da-8d79-787f823e34bc"),
// 			},
// 			ProvisioningState: to.Ptr(armreservations.ProvisioningStateSucceeded),
// 			Quantity: to.Ptr[int32](1),
// 			Renew: to.Ptr(false),
// 			ReservedResourceType: to.Ptr(armreservations.ReservedResourceTypeVirtualMachines),
// 			SKUDescription: to.Ptr("D1 v2"),
// 			SplitProperties: &armreservations.ReservationSplitProperties{
// 				SplitSource: to.Ptr("/providers/microsoft.capacity/reservationOrders/276e7ae4-84d0-4da6-ab4b-d6b94f3557da/reservations/bcae77cd-3119-4766-919f-b50d36c75c7a"),
// 			},
// 		},
// 		SKU: &armreservations.SKUName{
// 			Name: to.Ptr("Standard_DS1_v2"),
// 		},
// 	},
// 	{
// 		Name: to.Ptr("e0e4b4f5-77ea-4984-9ee4-6bf9850ee6de"),
// 		Type: to.Ptr("Microsoft.Capacity/reservationOrders/reservations"),
// 		ID: to.Ptr("/providers/microsoft.capacity/reservationOrders/276e7ae4-84d0-4da6-ab4b-d6b94f3557da/reservations/e0e4b4f5-77ea-4984-9ee4-6bf9850ee6de"),
// 		Etag: to.Ptr[int32](4),
// 		Location: to.Ptr("eastus"),
// 		Properties: &armreservations.Properties{
// 			AppliedScopeProperties: &armreservations.AppliedScopeProperties{
// 				DisplayName: to.Ptr("Azure subscription 1"),
// 				SubscriptionID: to.Ptr("/subscriptions/98df3792-7962-4f18-8be2-d5576f122de3"),
// 			},
// 			AppliedScopeType: to.Ptr(armreservations.AppliedScopeTypeSingle),
// 			BillingPlan: to.Ptr(armreservations.ReservationBillingPlanMonthly),
// 			BillingScopeID: to.Ptr("/subscriptions/19376483-64b8-49e4-a931-d5248828720a"),
// 			DisplayName: to.Ptr("cabri_test"),
// 			EffectiveDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-09-22T22:46:32.763Z"); return t}()),
// 			ExpiryDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2018-09-22"); return t}()),
// 			ExpiryDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-09-22T22:46:32.763Z"); return t}()),
// 			ExtendedStatusInfo: &armreservations.ExtendedStatusInfo{
// 				Message: to.Ptr("This reservation was merged and is no longer active."),
// 				StatusCode: to.Ptr(armreservations.ReservationStatusCodeMerged),
// 			},
// 			InstanceFlexibility: to.Ptr(armreservations.InstanceFlexibilityOff),
// 			LastUpdatedDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-09-22T22:46:32.763Z"); return t}()),
// 			MergeProperties: &armreservations.ReservationMergeProperties{
// 				MergeDestination: to.Ptr("/providers/microsoft.capacity/reservationOrders/276e7ae4-84d0-4da6-ab4b-d6b94f3557da/reservations/6ef59113-3482-40da-8d79-787f823e34bc"),
// 			},
// 			ProvisioningState: to.Ptr(armreservations.ProvisioningStateSucceeded),
// 			Quantity: to.Ptr[int32](2),
// 			Renew: to.Ptr(false),
// 			ReservedResourceType: to.Ptr(armreservations.ReservedResourceTypeVirtualMachines),
// 			SKUDescription: to.Ptr("D1 v2"),
// 			SplitProperties: &armreservations.ReservationSplitProperties{
// 				SplitSource: to.Ptr("/providers/microsoft.capacity/reservationOrders/276e7ae4-84d0-4da6-ab4b-d6b94f3557da/reservations/bcae77cd-3119-4766-919f-b50d36c75c7a"),
// 			},
// 		},
// 		SKU: &armreservations.SKUName{
// 			Name: to.Ptr("Standard_DS1_v2"),
// 		},
// 	},
// 	{
// 		Name: to.Ptr("6ef59113-3482-40da-8d79-787f823e34bc"),
// 		Type: to.Ptr("Microsoft.Capacity/reservationOrders/reservations"),
// 		ID: to.Ptr("/providers/microsoft.capacity/reservationOrders/276e7ae4-84d0-4da6-ab4b-d6b94f3557da/reservations/6ef59113-3482-40da-8d79-787f823e34bc"),
// 		Etag: to.Ptr[int32](2),
// 		Location: to.Ptr("eastus"),
// 		Properties: &armreservations.Properties{
// 			AppliedScopeProperties: &armreservations.AppliedScopeProperties{
// 				DisplayName: to.Ptr("Azure subscription 1"),
// 				SubscriptionID: to.Ptr("/subscriptions/98df3792-7962-4f18-8be2-d5576f122de3"),
// 			},
// 			AppliedScopeType: to.Ptr(armreservations.AppliedScopeTypeSingle),
// 			BillingPlan: to.Ptr(armreservations.ReservationBillingPlanMonthly),
// 			BillingScopeID: to.Ptr("/subscriptions/19376483-64b8-49e4-a931-d5248828720a"),
// 			DisplayName: to.Ptr("cabri_test"),
// 			EffectiveDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-09-22T22:46:32.763Z"); return t}()),
// 			ExpiryDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2018-09-22"); return t}()),
// 			ExpiryDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-09-22T22:46:32.763Z"); return t}()),
// 			InstanceFlexibility: to.Ptr(armreservations.InstanceFlexibilityOff),
// 			LastUpdatedDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-09-22T22:46:32.763Z"); return t}()),
// 			MergeProperties: &armreservations.ReservationMergeProperties{
// 				MergeSources: []*string{
// 					to.Ptr("/providers/microsoft.capacity/reservationOrders/276e7ae4-84d0-4da6-ab4b-d6b94f3557da/reservations/00238563-7312-4c20-a134-8c030bf938a7"),
// 					to.Ptr("/providers/microsoft.capacity/reservationOrders/276e7ae4-84d0-4da6-ab4b-d6b94f3557da/reservations/e0e4b4f5-77ea-4984-9ee4-6bf9850ee6de")},
// 				},
// 				ProvisioningState: to.Ptr(armreservations.ProvisioningStateSucceeded),
// 				Quantity: to.Ptr[int32](3),
// 				Renew: to.Ptr(false),
// 				ReservedResourceType: to.Ptr(armreservations.ReservedResourceTypeVirtualMachines),
// 				SKUDescription: to.Ptr("D1 v2"),
// 			},
// 			SKU: &armreservations.SKUName{
// 				Name: to.Ptr("Standard_DS1_v2"),
// 			},
// 	}}
Output:

func (*ReservationClient) BeginSplit

BeginSplit - Split a Reservation into two Reservations with specified quantity distribution. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-11-01

  • reservationOrderID - Order Id of the reservation
  • body - Information needed to Split a reservation item
  • options - ReservationClientBeginSplitOptions contains the optional parameters for the ReservationClient.BeginSplit method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-11-01/examples/SplitReservation.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armreservations.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewReservationClient().BeginSplit(ctx, "276e7ae4-84d0-4da6-ab4b-d6b94f3557da", armreservations.SplitRequest{
	Properties: &armreservations.SplitProperties{
		Quantities: []*int32{
			to.Ptr[int32](1),
			to.Ptr[int32](2)},
		ReservationID: to.Ptr("/providers/Microsoft.Capacity/reservationOrders/276e7ae4-84d0-4da6-ab4b-d6b94f3557da/reservations/bcae77cd-3119-4766-919f-b50d36c75c7a"),
	},
}, 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.ReservationResponseArray = []*armreservations.ReservationResponse{
// 	{
// 		Name: to.Ptr("00238563-7312-4c20-a134-8c030bf938a7"),
// 		Type: to.Ptr("Microsoft.Capacity/reservationOrders/reservations"),
// 		ID: to.Ptr("/providers/microsoft.capacity/reservationOrders/276e7ae4-84d0-4da6-ab4b-d6b94f3557da/reservations/00238563-7312-4c20-a134-8c030bf938a7"),
// 		Etag: to.Ptr[int32](2),
// 		Location: to.Ptr("eastus"),
// 		Properties: &armreservations.Properties{
// 			AppliedScopeProperties: &armreservations.AppliedScopeProperties{
// 				DisplayName: to.Ptr("Azure subscription 1"),
// 				SubscriptionID: to.Ptr("/subscriptions/98df3792-7962-4f18-8be2-d5576f122de3"),
// 			},
// 			AppliedScopeType: to.Ptr(armreservations.AppliedScopeTypeSingle),
// 			BillingPlan: to.Ptr(armreservations.ReservationBillingPlanMonthly),
// 			BillingScopeID: to.Ptr("/subscriptions/19376483-64b8-49e4-a931-d5248828720a"),
// 			DisplayName: to.Ptr("cabri_test"),
// 			EffectiveDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-09-22T01:00:30.925Z"); return t}()),
// 			ExpiryDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2018-09-22"); return t}()),
// 			ExpiryDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-09-22T01:00:30.925Z"); return t}()),
// 			InstanceFlexibility: to.Ptr(armreservations.InstanceFlexibilityOff),
// 			LastUpdatedDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-09-22T01:00:36.319Z"); return t}()),
// 			ProvisioningState: to.Ptr(armreservations.ProvisioningStateSucceeded),
// 			Quantity: to.Ptr[int32](1),
// 			Renew: to.Ptr(false),
// 			ReservedResourceType: to.Ptr(armreservations.ReservedResourceTypeVirtualMachines),
// 			SKUDescription: to.Ptr("D1 v2"),
// 			SplitProperties: &armreservations.ReservationSplitProperties{
// 				SplitSource: to.Ptr("/providers/microsoft.capacity/reservationOrders/276e7ae4-84d0-4da6-ab4b-d6b94f3557da/reservations/bcae77cd-3119-4766-919f-b50d36c75c7a"),
// 			},
// 		},
// 		SKU: &armreservations.SKUName{
// 			Name: to.Ptr("Standard_DS1_v2"),
// 		},
// 	},
// 	{
// 		Name: to.Ptr("e0e4b4f5-77ea-4984-9ee4-6bf9850ee6de"),
// 		Type: to.Ptr("Microsoft.Capacity/reservationOrders/reservations"),
// 		ID: to.Ptr("/providers/microsoft.capacity/reservationOrders/276e7ae4-84d0-4da6-ab4b-d6b94f3557da/reservations/e0e4b4f5-77ea-4984-9ee4-6bf9850ee6de"),
// 		Etag: to.Ptr[int32](2),
// 		Location: to.Ptr("eastus"),
// 		Properties: &armreservations.Properties{
// 			AppliedScopeProperties: &armreservations.AppliedScopeProperties{
// 				DisplayName: to.Ptr("Azure subscription 1"),
// 				SubscriptionID: to.Ptr("/subscriptions/98df3792-7962-4f18-8be2-d5576f122de3"),
// 			},
// 			AppliedScopeType: to.Ptr(armreservations.AppliedScopeTypeSingle),
// 			BillingPlan: to.Ptr(armreservations.ReservationBillingPlanMonthly),
// 			BillingScopeID: to.Ptr("/subscriptions/19376483-64b8-49e4-a931-d5248828720a"),
// 			DisplayName: to.Ptr("cabri_test"),
// 			EffectiveDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-09-22T01:00:30.925Z"); return t}()),
// 			ExpiryDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2018-09-22"); return t}()),
// 			ExpiryDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-09-22T01:00:30.925Z"); return t}()),
// 			InstanceFlexibility: to.Ptr(armreservations.InstanceFlexibilityOff),
// 			LastUpdatedDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-09-22T01:00:36.319Z"); return t}()),
// 			ProvisioningState: to.Ptr(armreservations.ProvisioningStateSucceeded),
// 			Quantity: to.Ptr[int32](2),
// 			Renew: to.Ptr(false),
// 			ReservedResourceType: to.Ptr(armreservations.ReservedResourceTypeVirtualMachines),
// 			SKUDescription: to.Ptr("D1 v2"),
// 			SplitProperties: &armreservations.ReservationSplitProperties{
// 				SplitSource: to.Ptr("/providers/microsoft.capacity/reservationOrders/276e7ae4-84d0-4da6-ab4b-d6b94f3557da/reservations/bcae77cd-3119-4766-919f-b50d36c75c7a"),
// 			},
// 		},
// 		SKU: &armreservations.SKUName{
// 			Name: to.Ptr("Standard_DS1_v2"),
// 		},
// 	},
// 	{
// 		Name: to.Ptr("bcae77cd-3119-4766-919f-b50d36c75c7a"),
// 		Type: to.Ptr("Microsoft.Capacity/reservationOrders/reservations"),
// 		ID: to.Ptr("/providers/microsoft.capacity/reservationOrders/276e7ae4-84d0-4da6-ab4b-d6b94f3557da/reservations/bcae77cd-3119-4766-919f-b50d36c75c7a"),
// 		Etag: to.Ptr[int32](10),
// 		Location: to.Ptr("eastus"),
// 		Properties: &armreservations.Properties{
// 			AppliedScopeProperties: &armreservations.AppliedScopeProperties{
// 				DisplayName: to.Ptr("Azure subscription 1"),
// 				SubscriptionID: to.Ptr("/subscriptions/98df3792-7962-4f18-8be2-d5576f122de3"),
// 			},
// 			AppliedScopeType: to.Ptr(armreservations.AppliedScopeTypeSingle),
// 			BillingPlan: to.Ptr(armreservations.ReservationBillingPlanMonthly),
// 			BillingScopeID: to.Ptr("/subscriptions/19376483-64b8-49e4-a931-d5248828720a"),
// 			DisplayName: to.Ptr("cabri_test"),
// 			EffectiveDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-09-22T01:00:30.925Z"); return t}()),
// 			ExpiryDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2018-09-22"); return t}()),
// 			ExpiryDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-09-22T01:00:30.925Z"); return t}()),
// 			ExtendedStatusInfo: &armreservations.ExtendedStatusInfo{
// 				Message: to.Ptr("This reservation was split and is no longer active."),
// 				StatusCode: to.Ptr(armreservations.ReservationStatusCodeSplit),
// 			},
// 			InstanceFlexibility: to.Ptr(armreservations.InstanceFlexibilityOff),
// 			LastUpdatedDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-09-22T01:00:36.319Z"); return t}()),
// 			ProvisioningState: to.Ptr(armreservations.ProvisioningStateSucceeded),
// 			Quantity: to.Ptr[int32](3),
// 			Renew: to.Ptr(false),
// 			ReservedResourceType: to.Ptr(armreservations.ReservedResourceTypeVirtualMachines),
// 			SKUDescription: to.Ptr("D1 v2"),
// 			SplitProperties: &armreservations.ReservationSplitProperties{
// 				SplitDestinations: []*string{
// 					to.Ptr("/providers/microsoft.capacity/reservationOrders/276e7ae4-84d0-4da6-ab4b-d6b94f3557da/reservations/00238563-7312-4c20-a134-8c030bf938a7"),
// 					to.Ptr("/providers/microsoft.capacity/reservationOrders/276e7ae4-84d0-4da6-ab4b-d6b94f3557da/reservations/e0e4b4f5-77ea-4984-9ee4-6bf9850ee6de")},
// 				},
// 			},
// 			SKU: &armreservations.SKUName{
// 				Name: to.Ptr("Standard_DS1_v2"),
// 			},
// 	}}
Output:

func (*ReservationClient) BeginUpdate

func (client *ReservationClient) BeginUpdate(ctx context.Context, reservationOrderID string, reservationID string, parameters Patch, options *ReservationClientBeginUpdateOptions) (*runtime.Poller[ReservationClientUpdateResponse], error)

BeginUpdate - Updates the applied scopes of the Reservation. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-11-01

  • reservationOrderID - Order Id of the reservation
  • reservationID - Id of the reservation item
  • parameters - Information needed to patch a reservation item
  • options - ReservationClientBeginUpdateOptions contains the optional parameters for the ReservationClient.BeginUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-11-01/examples/UpdateReservation.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armreservations.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewReservationClient().BeginUpdate(ctx, "276e7ae4-84d0-4da6-ab4b-d6b94f3557da", "6ef59113-3482-40da-8d79-787f823e34bc", armreservations.Patch{
	Properties: &armreservations.PatchProperties{
		AppliedScopeType:    to.Ptr(armreservations.AppliedScopeTypeShared),
		InstanceFlexibility: to.Ptr(armreservations.InstanceFlexibilityOff),
	},
}, 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.ReservationResponse = armreservations.ReservationResponse{
// 	Name: to.Ptr("6ef59113-3482-40da-8d79-787f823e34bc"),
// 	Type: to.Ptr("Microsoft.Capacity/reservationOrders/reservations"),
// 	ID: to.Ptr("/providers/microsoft.capacity/reservationOrders/276e7ae4-84d0-4da6-ab4b-d6b94f3557da/reservations/6ef59113-3482-40da-8d79-787f823e34bc"),
// 	Etag: to.Ptr[int32](4),
// 	Location: to.Ptr("eastus"),
// 	Properties: &armreservations.Properties{
// 		AppliedScopeType: to.Ptr(armreservations.AppliedScopeTypeShared),
// 		BillingPlan: to.Ptr(armreservations.ReservationBillingPlanMonthly),
// 		BillingScopeID: to.Ptr("/subscriptions/19376483-64b8-49e4-a931-d5248828720a"),
// 		DisplayName: to.Ptr("cabri_test"),
// 		EffectiveDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-09-22T23:57:48.189Z"); return t}()),
// 		ExpiryDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2018-09-22"); return t}()),
// 		ExpiryDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-09-22T23:57:48.189Z"); return t}()),
// 		InstanceFlexibility: to.Ptr(armreservations.InstanceFlexibilityOff),
// 		LastUpdatedDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-09-22T23:57:54.376Z"); return t}()),
// 		MergeProperties: &armreservations.ReservationMergeProperties{
// 			MergeSources: []*string{
// 				to.Ptr("/providers/microsoft.capacity/reservationOrders/276e7ae4-84d0-4da6-ab4b-d6b94f3557da/reservations/00238563-7312-4c20-a134-8c030bf938a7"),
// 				to.Ptr("/providers/microsoft.capacity/reservationOrders/276e7ae4-84d0-4da6-ab4b-d6b94f3557da/reservations/e0e4b4f5-77ea-4984-9ee4-6bf9850ee6de")},
// 			},
// 			ProvisioningState: to.Ptr(armreservations.ProvisioningStateSucceeded),
// 			Quantity: to.Ptr[int32](3),
// 			Renew: to.Ptr(false),
// 			ReservedResourceType: to.Ptr(armreservations.ReservedResourceTypeVirtualMachines),
// 			SKUDescription: to.Ptr("D1 v2"),
// 		},
// 		SKU: &armreservations.SKUName{
// 			Name: to.Ptr("Standard_DS1_v2"),
// 		},
// 	}
Output:

func (*ReservationClient) Get

func (client *ReservationClient) Get(ctx context.Context, reservationOrderID string, reservationID string, options *ReservationClientGetOptions) (ReservationClientGetResponse, error)

Get - Get specific Reservation details. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-11-01

  • reservationOrderID - Order Id of the reservation
  • reservationID - Id of the reservation item
  • options - ReservationClientGetOptions contains the optional parameters for the ReservationClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-11-01/examples/GetReservationDetails.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armreservations.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewReservationClient().Get(ctx, "276e7ae4-84d0-4da6-ab4b-d6b94f3557da", "6ef59113-3482-40da-8d79-787f823e34bc", &armreservations.ReservationClientGetOptions{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.ReservationResponse = armreservations.ReservationResponse{
// 	Name: to.Ptr("6ef59113-3482-40da-8d79-787f823e34bc"),
// 	Type: to.Ptr("Microsoft.Capacity/reservationOrders/reservations"),
// 	ID: to.Ptr("/providers/microsoft.capacity/reservationOrders/276e7ae4-84d0-4da6-ab4b-d6b94f3557da/reservations/6ef59113-3482-40da-8d79-787f823e34bc"),
// 	Etag: to.Ptr[int32](2),
// 	Location: to.Ptr("eastus"),
// 	Properties: &armreservations.Properties{
// 		AppliedScopeProperties: &armreservations.AppliedScopeProperties{
// 			DisplayName: to.Ptr("Azure subscription 1"),
// 			SubscriptionID: to.Ptr("/subscriptions/98df3792-7962-4f18-8be2-d5576f122de3"),
// 		},
// 		AppliedScopeType: to.Ptr(armreservations.AppliedScopeTypeSingle),
// 		BenefitStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-09-22T22:46:32.763Z"); return t}()),
// 		BillingPlan: to.Ptr(armreservations.ReservationBillingPlanMonthly),
// 		BillingScopeID: to.Ptr("/subscriptions/19376483-64b8-49e4-a931-d5248828720a"),
// 		DisplayName: to.Ptr("cabri_test"),
// 		EffectiveDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-09-22T22:46:32.763Z"); return t}()),
// 		ExpiryDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2018-09-22"); return t}()),
// 		ExpiryDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-09-22T22:46:32.763Z"); return t}()),
// 		InstanceFlexibility: to.Ptr(armreservations.InstanceFlexibilityOff),
// 		LastUpdatedDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-09-22T22:46:32.763Z"); return t}()),
// 		MergeProperties: &armreservations.ReservationMergeProperties{
// 			MergeSources: []*string{
// 				to.Ptr("/providers/microsoft.capacity/reservationOrders/276e7ae4-84d0-4da6-ab4b-d6b94f3557da/reservations/00238563-7312-4c20-a134-8c030bf938a7"),
// 				to.Ptr("/providers/microsoft.capacity/reservationOrders/276e7ae4-84d0-4da6-ab4b-d6b94f3557da/reservations/e0e4b4f5-77ea-4984-9ee4-6bf9850ee6de")},
// 			},
// 			ProvisioningState: to.Ptr(armreservations.ProvisioningStateSucceeded),
// 			Quantity: to.Ptr[int32](3),
// 			Renew: to.Ptr(false),
// 			RenewDestination: to.Ptr("/providers/microsoft.capacity/reservationOrders/276e7ae4-84d0-4da6-ab4b-d6b94f3557da/reservations/00238563-7312-4c20-a134-8c030bf938a7"),
// 			RenewProperties: &armreservations.RenewPropertiesResponse{
// 				BillingCurrencyTotal: &armreservations.RenewPropertiesResponseBillingCurrencyTotal{
// 					Amount: to.Ptr[float32](466),
// 					CurrencyCode: to.Ptr("USD"),
// 				},
// 				PricingCurrencyTotal: &armreservations.RenewPropertiesResponsePricingCurrencyTotal{
// 					Amount: to.Ptr[float32](466),
// 					CurrencyCode: to.Ptr("USD"),
// 				},
// 				PurchaseProperties: &armreservations.PurchaseRequest{
// 					Location: to.Ptr("westus"),
// 					Properties: &armreservations.PurchaseRequestProperties{
// 						AppliedScopeType: to.Ptr(armreservations.AppliedScopeTypeShared),
// 						BillingScopeID: to.Ptr("/subscriptions/19376483-64b8-49e4-a931-d5248828720a"),
// 						DisplayName: to.Ptr("Renew_Test_0618"),
// 						Quantity: to.Ptr[int32](2),
// 						Renew: to.Ptr(false),
// 						ReservedResourceProperties: &armreservations.PurchaseRequestPropertiesReservedResourceProperties{
// 							InstanceFlexibility: to.Ptr(armreservations.InstanceFlexibilityOn),
// 						},
// 						ReservedResourceType: to.Ptr(armreservations.ReservedResourceTypeVirtualMachines),
// 						Term: to.Ptr(armreservations.ReservationTermP1Y),
// 					},
// 					SKU: &armreservations.SKUName{
// 						Name: to.Ptr("Standard_D1"),
// 					},
// 				},
// 			},
// 			RenewSource: to.Ptr("/providers/microsoft.capacity/reservationOrders/276e7ae4-84d0-4da6-ab4b-d6b94f3557da/reservations/00238563-7312-4c20-a134-8c030bf938a7"),
// 			ReservedResourceType: to.Ptr(armreservations.ReservedResourceTypeVirtualMachines),
// 			SKUDescription: to.Ptr("D1 v2"),
// 			SwapProperties: &armreservations.ReservationSwapProperties{
// 				SwapSource: to.Ptr("/providers/microsoft.capacity/reservationOrders/63037ae3-385a-4716-ad77-02f42ce93c06/reservations/5c6383f5-3f2c-4159-ae74-j72i1c1a49bc"),
// 			},
// 			Term: to.Ptr(armreservations.ReservationTermP1Y),
// 		},
// 		SKU: &armreservations.SKUName{
// 			Name: to.Ptr("Standard_DS1_v2"),
// 		},
// 	}
Output:

func (*ReservationClient) NewListAllPager

NewListAllPager - List the reservations and the roll up counts of reservations group by provisioning states that the user has access to in the current tenant.

Generated from API version 2022-11-01

  • options - ReservationClientListAllOptions contains the optional parameters for the ReservationClient.NewListAllPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-11-01/examples/GetReservations.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armreservations.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewReservationClient().NewListAllPager(&armreservations.ReservationClientListAllOptions{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.ListResult = armreservations.ListResult{
	// 	Summary: &armreservations.ReservationSummary{
	// 		CancelledCount: to.Ptr[float32](0),
	// 		ExpiredCount: to.Ptr[float32](0),
	// 		ExpiringCount: to.Ptr[float32](0),
	// 		FailedCount: to.Ptr[float32](0),
	// 		PendingCount: to.Ptr[float32](0),
	// 		SucceededCount: to.Ptr[float32](1),
	// 	},
	// 	Value: []*armreservations.ReservationResponse{
	// 		{
	// 			Name: to.Ptr("00000000-0000-0000-0000-000000000001/00000000-0000-0000-0000-000000000000"),
	// 			Type: to.Ptr("Microsoft.Capacity/reservationOrders/reservations"),
	// 			ID: to.Ptr("/providers/microsoft.capacity/reservationOrders/00000000-0000-0000-0000-000000000001/reservations/00000000-0000-0000-0000-000000000000"),
	// 			Location: to.Ptr("westus"),
	// 			Properties: &armreservations.Properties{
	// 				AppliedScopeType: to.Ptr(armreservations.AppliedScopeTypeShared),
	// 				DisplayName: to.Ptr("VM_RI_07-21-2020_12-06"),
	// 				DisplayProvisioningState: to.Ptr("Succeeded"),
	// 				EffectiveDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-09-22T22:46:32.763Z"); return t}()),
	// 				ExpiryDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2023-07-21"); return t}()),
	// 				ExpiryDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-21T22:46:32.763Z"); return t}()),
	// 				ProvisioningState: to.Ptr(armreservations.ProvisioningStateSucceeded),
	// 				PurchaseDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2021-04-22"); return t}()),
	// 				PurchaseDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-22T22:46:32.763Z"); return t}()),
	// 				Quantity: to.Ptr[int32](2),
	// 				Renew: to.Ptr(false),
	// 				RenewSource: to.Ptr("/providers/Microsoft.Capacity/reservationorders/00000000-0000-0000-0000-000000000002/reservations/00000000-0000-0000-0000-000000000003"),
	// 				ReservedResourceType: to.Ptr(armreservations.ReservedResourceTypeVirtualMachines),
	// 				Term: to.Ptr(armreservations.ReservationTermP3Y),
	// 				UserFriendlyAppliedScopeType: to.Ptr("Shared"),
	// 				UserFriendlyRenewState: to.Ptr("Off"),
	// 				Utilization: &armreservations.PropertiesUtilization{
	// 					Aggregates: []*armreservations.ReservationUtilizationAggregates{
	// 						{
	// 							Grain: to.Ptr[float32](1),
	// 							GrainUnit: to.Ptr("days"),
	// 							Value: to.Ptr[float32](0.05),
	// 							ValueUnit: to.Ptr("percentage"),
	// 						},
	// 						{
	// 							Grain: to.Ptr[float32](7),
	// 							GrainUnit: to.Ptr("days"),
	// 							Value: to.Ptr[float32](0.05),
	// 							ValueUnit: to.Ptr("percentage"),
	// 						},
	// 						{
	// 							Grain: to.Ptr[float32](30),
	// 							GrainUnit: to.Ptr("days"),
	// 							Value: to.Ptr[float32](0.05),
	// 							ValueUnit: to.Ptr("percentage"),
	// 					}},
	// 					Trend: to.Ptr("UP"),
	// 				},
	// 			},
	// 			SKU: &armreservations.SKUName{
	// 				Name: to.Ptr("Standard_D1"),
	// 			},
	// 	}},
	// }
}
Output:

func (*ReservationClient) NewListPager

func (client *ReservationClient) NewListPager(reservationOrderID string, options *ReservationClientListOptions) *runtime.Pager[ReservationClientListResponse]

NewListPager - List Reservations within a single ReservationOrder.

Generated from API version 2022-11-01

  • reservationOrderID - Order Id of the reservation
  • options - ReservationClientListOptions contains the optional parameters for the ReservationClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-11-01/examples/GetReservationsFromOrder.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armreservations.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewReservationClient().NewListPager("276e7ae4-84d0-4da6-ab4b-d6b94f3557da", 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.ReservationList = armreservations.ReservationList{
	// 	Value: []*armreservations.ReservationResponse{
	// 		{
	// 			Name: to.Ptr("bcae77cd-3119-4766-919f-b50d36c75c7a"),
	// 			Type: to.Ptr("Microsoft.Capacity/reservationOrders/reservations"),
	// 			ID: to.Ptr("/providers/microsoft.capacity/reservationOrders/276e7ae4-84d0-4da6-ab4b-d6b94f3557da/reservations/bcae77cd-3119-4766-919f-b50d36c75c7a"),
	// 			Etag: to.Ptr[int32](10),
	// 			Location: to.Ptr("eastus"),
	// 			Properties: &armreservations.Properties{
	// 				AppliedScopeProperties: &armreservations.AppliedScopeProperties{
	// 					DisplayName: to.Ptr("Azure subscription 1"),
	// 					SubscriptionID: to.Ptr("/subscriptions/98df3792-7962-4f18-8be2-d5576f122de3"),
	// 				},
	// 				AppliedScopeType: to.Ptr(armreservations.AppliedScopeTypeSingle),
	// 				BenefitStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-09-22T01:00:30.925Z"); return t}()),
	// 				BillingPlan: to.Ptr(armreservations.ReservationBillingPlanMonthly),
	// 				BillingScopeID: to.Ptr("/subscriptions/19376483-64b8-49e4-a931-d5248828720a"),
	// 				DisplayName: to.Ptr("cabri_test"),
	// 				EffectiveDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-09-22T01:00:30.925Z"); return t}()),
	// 				ExpiryDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2018-09-22"); return t}()),
	// 				ExpiryDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-09-22T01:00:30.925Z"); return t}()),
	// 				ExtendedStatusInfo: &armreservations.ExtendedStatusInfo{
	// 					Message: to.Ptr("This reservation was split and is no longer active."),
	// 					StatusCode: to.Ptr(armreservations.ReservationStatusCodeSplit),
	// 				},
	// 				InstanceFlexibility: to.Ptr(armreservations.InstanceFlexibilityOn),
	// 				LastUpdatedDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-09-22T01:00:36.319Z"); return t}()),
	// 				ProvisioningState: to.Ptr(armreservations.ProvisioningStateSucceeded),
	// 				Quantity: to.Ptr[int32](3),
	// 				Renew: to.Ptr(false),
	// 				ReservedResourceType: to.Ptr(armreservations.ReservedResourceTypeVirtualMachines),
	// 				SKUDescription: to.Ptr("D1 v2"),
	// 				SplitProperties: &armreservations.ReservationSplitProperties{
	// 					SplitDestinations: []*string{
	// 						to.Ptr("/providers/microsoft.capacity/reservationOrders/276e7ae4-84d0-4da6-ab4b-d6b94f3557da/reservations/00238563-7312-4c20-a134-8c030bf938a7"),
	// 						to.Ptr("/providers/microsoft.capacity/reservationOrders/276e7ae4-84d0-4da6-ab4b-d6b94f3557da/reservations/e0e4b4f5-77ea-4984-9ee4-6bf9850ee6de")},
	// 					},
	// 				},
	// 				SKU: &armreservations.SKUName{
	// 					Name: to.Ptr("Standard_DS1_v2"),
	// 				},
	// 			},
	// 			{
	// 				Name: to.Ptr("00238563-7312-4c20-a134-8c030bf938a7"),
	// 				Type: to.Ptr("Microsoft.Capacity/reservationOrders/reservations"),
	// 				ID: to.Ptr("/providers/microsoft.capacity/reservationOrders/276e7ae4-84d0-4da6-ab4b-d6b94f3557da/reservations/00238563-7312-4c20-a134-8c030bf938a7"),
	// 				Etag: to.Ptr[int32](5),
	// 				Location: to.Ptr("eastus"),
	// 				Properties: &armreservations.Properties{
	// 					AppliedScopeProperties: &armreservations.AppliedScopeProperties{
	// 						DisplayName: to.Ptr("Azure subscription 1"),
	// 						SubscriptionID: to.Ptr("/subscriptions/98df3792-7962-4f18-8be2-d5576f122de3"),
	// 					},
	// 					AppliedScopeType: to.Ptr(armreservations.AppliedScopeTypeSingle),
	// 					BenefitStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-09-22T22:46:32.763Z"); return t}()),
	// 					BillingPlan: to.Ptr(armreservations.ReservationBillingPlanMonthly),
	// 					BillingScopeID: to.Ptr("/subscriptions/19376483-64b8-49e4-a931-d5248828720a"),
	// 					DisplayName: to.Ptr("cabri_test"),
	// 					EffectiveDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-09-22T22:46:32.763Z"); return t}()),
	// 					ExpiryDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2018-09-22"); return t}()),
	// 					ExpiryDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-09-22T22:46:32.763Z"); return t}()),
	// 					ExtendedStatusInfo: &armreservations.ExtendedStatusInfo{
	// 						Message: to.Ptr("This reservation was merged and is no longer active."),
	// 						StatusCode: to.Ptr(armreservations.ReservationStatusCodeMerged),
	// 					},
	// 					InstanceFlexibility: to.Ptr(armreservations.InstanceFlexibilityOn),
	// 					LastUpdatedDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-09-22T22:46:32.763Z"); return t}()),
	// 					MergeProperties: &armreservations.ReservationMergeProperties{
	// 						MergeDestination: to.Ptr("/providers/microsoft.capacity/reservationOrders/276e7ae4-84d0-4da6-ab4b-d6b94f3557da/reservations/6ef59113-3482-40da-8d79-787f823e34bc"),
	// 					},
	// 					ProvisioningState: to.Ptr(armreservations.ProvisioningStateSucceeded),
	// 					Quantity: to.Ptr[int32](1),
	// 					Renew: to.Ptr(false),
	// 					ReservedResourceType: to.Ptr(armreservations.ReservedResourceTypeVirtualMachines),
	// 					SKUDescription: to.Ptr("D1 v2"),
	// 					SplitProperties: &armreservations.ReservationSplitProperties{
	// 						SplitSource: to.Ptr("/providers/microsoft.capacity/reservationOrders/276e7ae4-84d0-4da6-ab4b-d6b94f3557da/reservations/bcae77cd-3119-4766-919f-b50d36c75c7a"),
	// 					},
	// 				},
	// 				SKU: &armreservations.SKUName{
	// 					Name: to.Ptr("Standard_DS1_v2"),
	// 				},
	// 			},
	// 			{
	// 				Name: to.Ptr("e0e4b4f5-77ea-4984-9ee4-6bf9850ee6de"),
	// 				Type: to.Ptr("Microsoft.Capacity/reservationOrders/reservations"),
	// 				ID: to.Ptr("/providers/microsoft.capacity/reservationOrders/276e7ae4-84d0-4da6-ab4b-d6b94f3557da/reservations/e0e4b4f5-77ea-4984-9ee4-6bf9850ee6de"),
	// 				Etag: to.Ptr[int32](4),
	// 				Location: to.Ptr("eastus"),
	// 				Properties: &armreservations.Properties{
	// 					AppliedScopeProperties: &armreservations.AppliedScopeProperties{
	// 						DisplayName: to.Ptr("Azure subscription 1"),
	// 						SubscriptionID: to.Ptr("/subscriptions/98df3792-7962-4f18-8be2-d5576f122de3"),
	// 					},
	// 					AppliedScopeType: to.Ptr(armreservations.AppliedScopeTypeSingle),
	// 					BenefitStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-09-22T22:46:32.763Z"); return t}()),
	// 					BillingPlan: to.Ptr(armreservations.ReservationBillingPlanMonthly),
	// 					BillingScopeID: to.Ptr("/subscriptions/19376483-64b8-49e4-a931-d5248828720a"),
	// 					DisplayName: to.Ptr("cabri_test"),
	// 					EffectiveDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-09-22T22:46:32.763Z"); return t}()),
	// 					ExpiryDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2018-09-22"); return t}()),
	// 					ExpiryDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-09-22T22:46:32.763Z"); return t}()),
	// 					ExtendedStatusInfo: &armreservations.ExtendedStatusInfo{
	// 						Message: to.Ptr("This reservation was merged and is no longer active."),
	// 						StatusCode: to.Ptr(armreservations.ReservationStatusCodeMerged),
	// 					},
	// 					InstanceFlexibility: to.Ptr(armreservations.InstanceFlexibilityOn),
	// 					LastUpdatedDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-09-22T22:46:32.763Z"); return t}()),
	// 					MergeProperties: &armreservations.ReservationMergeProperties{
	// 						MergeDestination: to.Ptr("/providers/microsoft.capacity/reservationOrders/276e7ae4-84d0-4da6-ab4b-d6b94f3557da/reservations/6ef59113-3482-40da-8d79-787f823e34bc"),
	// 					},
	// 					ProvisioningState: to.Ptr(armreservations.ProvisioningStateSucceeded),
	// 					Quantity: to.Ptr[int32](2),
	// 					Renew: to.Ptr(false),
	// 					ReservedResourceType: to.Ptr(armreservations.ReservedResourceTypeVirtualMachines),
	// 					SKUDescription: to.Ptr("D1 v2"),
	// 					SplitProperties: &armreservations.ReservationSplitProperties{
	// 						SplitSource: to.Ptr("/providers/microsoft.capacity/reservationOrders/276e7ae4-84d0-4da6-ab4b-d6b94f3557da/reservations/bcae77cd-3119-4766-919f-b50d36c75c7a"),
	// 					},
	// 				},
	// 				SKU: &armreservations.SKUName{
	// 					Name: to.Ptr("Standard_DS1_v2"),
	// 				},
	// 			},
	// 			{
	// 				Name: to.Ptr("6ef59113-3482-40da-8d79-787f823e34bc"),
	// 				Type: to.Ptr("Microsoft.Capacity/reservationOrders/reservations"),
	// 				ID: to.Ptr("/providers/microsoft.capacity/reservationOrders/276e7ae4-84d0-4da6-ab4b-d6b94f3557da/reservations/6ef59113-3482-40da-8d79-787f823e34bc"),
	// 				Etag: to.Ptr[int32](2),
	// 				Location: to.Ptr("eastus"),
	// 				Properties: &armreservations.Properties{
	// 					AppliedScopeProperties: &armreservations.AppliedScopeProperties{
	// 						DisplayName: to.Ptr("Azure subscription 1"),
	// 						SubscriptionID: to.Ptr("/subscriptions/98df3792-7962-4f18-8be2-d5576f122de3"),
	// 					},
	// 					AppliedScopeType: to.Ptr(armreservations.AppliedScopeTypeSingle),
	// 					BenefitStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-09-22T22:46:32.763Z"); return t}()),
	// 					BillingPlan: to.Ptr(armreservations.ReservationBillingPlanMonthly),
	// 					BillingScopeID: to.Ptr("/subscriptions/19376483-64b8-49e4-a931-d5248828720a"),
	// 					DisplayName: to.Ptr("cabri_test"),
	// 					EffectiveDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-09-22T22:46:32.763Z"); return t}()),
	// 					ExpiryDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2018-09-22"); return t}()),
	// 					ExpiryDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-09-22T22:46:32.763Z"); return t}()),
	// 					InstanceFlexibility: to.Ptr(armreservations.InstanceFlexibilityOn),
	// 					LastUpdatedDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-09-22T22:46:32.763Z"); return t}()),
	// 					MergeProperties: &armreservations.ReservationMergeProperties{
	// 						MergeSources: []*string{
	// 							to.Ptr("/providers/microsoft.capacity/reservationOrders/276e7ae4-84d0-4da6-ab4b-d6b94f3557da/reservations/00238563-7312-4c20-a134-8c030bf938a7"),
	// 							to.Ptr("/providers/microsoft.capacity/reservationOrders/276e7ae4-84d0-4da6-ab4b-d6b94f3557da/reservations/e0e4b4f5-77ea-4984-9ee4-6bf9850ee6de")},
	// 						},
	// 						ProvisioningState: to.Ptr(armreservations.ProvisioningStateSucceeded),
	// 						Quantity: to.Ptr[int32](3),
	// 						Renew: to.Ptr(false),
	// 						ReservedResourceType: to.Ptr(armreservations.ReservedResourceTypeVirtualMachines),
	// 						SKUDescription: to.Ptr("D1 v2"),
	// 					},
	// 					SKU: &armreservations.SKUName{
	// 						Name: to.Ptr("Standard_DS1_v2"),
	// 					},
	// 				},
	// 				{
	// 					Name: to.Ptr("5se63214-3382-40da-ed79-787f823e34bc"),
	// 					Type: to.Ptr("Microsoft.Capacity/reservationOrders/reservations"),
	// 					ID: to.Ptr("/providers/microsoft.capacity/reservationOrders/276e7ae4-84d0-4da6-ab4b-d6b94f3557da/reservations/5se63214-3382-40da-ed79-787f823e34bc"),
	// 					Etag: to.Ptr[int32](2),
	// 					Location: to.Ptr("eastus"),
	// 					Properties: &armreservations.Properties{
	// 						AppliedScopeProperties: &armreservations.AppliedScopeProperties{
	// 							DisplayName: to.Ptr("Azure subscription 1"),
	// 							SubscriptionID: to.Ptr("/subscriptions/98df3792-7962-4f18-8be2-d5576f122de3"),
	// 						},
	// 						AppliedScopeType: to.Ptr(armreservations.AppliedScopeTypeSingle),
	// 						BenefitStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-09-22T22:40:32.763Z"); return t}()),
	// 						BillingPlan: to.Ptr(armreservations.ReservationBillingPlanMonthly),
	// 						BillingScopeID: to.Ptr("/subscriptions/19376483-64b8-49e4-a931-d5248828720a"),
	// 						DisplayName: to.Ptr("cabri_test"),
	// 						EffectiveDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-09-22T22:46:32.763Z"); return t}()),
	// 						ExpiryDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2018-09-22"); return t}()),
	// 						ExpiryDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-09-22T22:46:32.763Z"); return t}()),
	// 						InstanceFlexibility: to.Ptr(armreservations.InstanceFlexibilityOn),
	// 						LastUpdatedDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-09-22T22:46:32.763Z"); return t}()),
	// 						ProvisioningState: to.Ptr(armreservations.ProvisioningStateSucceeded),
	// 						Quantity: to.Ptr[int32](3),
	// 						Renew: to.Ptr(false),
	// 						ReservedResourceType: to.Ptr(armreservations.ReservedResourceTypeVirtualMachines),
	// 						SKUDescription: to.Ptr("D1 v2"),
	// 						SwapProperties: &armreservations.ReservationSwapProperties{
	// 							SwapDestination: to.Ptr("/providers/microsoft.capacity/reservationOrders/63027ae3-389a-4716-ad77-04f42ce93c06/reservations/4jf50113-3382-40da-ed79-787f823e34bc"),
	// 						},
	// 					},
	// 					SKU: &armreservations.SKUName{
	// 						Name: to.Ptr("Standard_D1_v2"),
	// 					},
	// 			}},
	// 		}
}
Output:

func (*ReservationClient) NewListRevisionsPager

func (client *ReservationClient) NewListRevisionsPager(reservationOrderID string, reservationID string, options *ReservationClientListRevisionsOptions) *runtime.Pager[ReservationClientListRevisionsResponse]

NewListRevisionsPager - List of all the revisions for the Reservation.

Generated from API version 2022-11-01

  • reservationOrderID - Order Id of the reservation
  • reservationID - Id of the reservation item
  • options - ReservationClientListRevisionsOptions contains the optional parameters for the ReservationClient.NewListRevisionsPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-11-01/examples/GetReservationRevisions.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armreservations.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewReservationClient().NewListRevisionsPager("276e7ae4-84d0-4da6-ab4b-d6b94f3557da", "6ef59113-3482-40da-8d79-787f823e34bc", 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.ReservationList = armreservations.ReservationList{
	// 	Value: []*armreservations.ReservationResponse{
	// 		{
	// 			Name: to.Ptr("4"),
	// 			Type: to.Ptr("Microsoft.Capacity/reservationOrders/reservations/revisions"),
	// 			ID: to.Ptr("/providers/microsoft.capacity/reservationOrders/276e7ae4-84d0-4da6-ab4b-d6b94f3557da/reservations/6ef59113-3482-40da-8d79-787f823e34bc/revisions/4"),
	// 			Etag: to.Ptr[int32](4),
	// 			Location: to.Ptr("eastus"),
	// 			Properties: &armreservations.Properties{
	// 				AppliedScopeType: to.Ptr(armreservations.AppliedScopeTypeShared),
	// 				BillingPlan: to.Ptr(armreservations.ReservationBillingPlanMonthly),
	// 				DisplayName: to.Ptr("cabri_test"),
	// 				EffectiveDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-09-22T23:57:48.189Z"); return t}()),
	// 				ExpiryDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2018-09-22"); return t}()),
	// 				ExpiryDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-09-22T23:57:48.189Z"); return t}()),
	// 				InstanceFlexibility: to.Ptr(armreservations.InstanceFlexibilityOn),
	// 				LastUpdatedDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-09-22T23:57:54.376Z"); return t}()),
	// 				MergeProperties: &armreservations.ReservationMergeProperties{
	// 					MergeSources: []*string{
	// 						to.Ptr("/providers/microsoft.capacity/reservationOrders/276e7ae4-84d0-4da6-ab4b-d6b94f3557da/reservations/00238563-7312-4c20-a134-8c030bf938a7"),
	// 						to.Ptr("/providers/microsoft.capacity/reservationOrders/276e7ae4-84d0-4da6-ab4b-d6b94f3557da/reservations/e0e4b4f5-77ea-4984-9ee4-6bf9850ee6de")},
	// 					},
	// 					ProvisioningState: to.Ptr(armreservations.ProvisioningStateSucceeded),
	// 					Quantity: to.Ptr[int32](3),
	// 					ReservedResourceType: to.Ptr(armreservations.ReservedResourceTypeVirtualMachines),
	// 					SKUDescription: to.Ptr("D1 v2"),
	// 				},
	// 				SKU: &armreservations.SKUName{
	// 					Name: to.Ptr("Standard_DS1_v2"),
	// 				},
	// 			},
	// 			{
	// 				Name: to.Ptr("3"),
	// 				Type: to.Ptr("Microsoft.Capacity/reservationOrders/reservations/revisions"),
	// 				ID: to.Ptr("/providers/microsoft.capacity/reservationOrders/276e7ae4-84d0-4da6-ab4b-d6b94f3557da/reservations/6ef59113-3482-40da-8d79-787f823e34bc/revisions/3"),
	// 				Etag: to.Ptr[int32](3),
	// 				Location: to.Ptr("eastus"),
	// 				Properties: &armreservations.Properties{
	// 					AppliedScopeProperties: &armreservations.AppliedScopeProperties{
	// 						DisplayName: to.Ptr("Azure subscription 1"),
	// 						SubscriptionID: to.Ptr("/subscriptions/98df3792-7962-4f18-8be2-d5576f122de3"),
	// 					},
	// 					AppliedScopeType: to.Ptr(armreservations.AppliedScopeTypeSingle),
	// 					BillingPlan: to.Ptr(armreservations.ReservationBillingPlanMonthly),
	// 					DisplayName: to.Ptr("cabri_test"),
	// 					EffectiveDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-09-22T22:46:32.763Z"); return t}()),
	// 					ExpiryDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2018-09-22"); return t}()),
	// 					ExpiryDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-09-22T22:46:32.763Z"); return t}()),
	// 					ExtendedStatusInfo: &armreservations.ExtendedStatusInfo{
	// 						Message: to.Ptr("An operation is in progress on your reservation. Please wait for operation to complete before taking further action"),
	// 						StatusCode: to.Ptr(armreservations.ReservationStatusCodePending),
	// 					},
	// 					InstanceFlexibility: to.Ptr(armreservations.InstanceFlexibilityOn),
	// 					LastUpdatedDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-09-22T23:57:47.488Z"); return t}()),
	// 					MergeProperties: &armreservations.ReservationMergeProperties{
	// 						MergeSources: []*string{
	// 							to.Ptr("/providers/microsoft.capacity/reservationOrders/276e7ae4-84d0-4da6-ab4b-d6b94f3557da/reservations/00238563-7312-4c20-a134-8c030bf938a7"),
	// 							to.Ptr("/providers/microsoft.capacity/reservationOrders/276e7ae4-84d0-4da6-ab4b-d6b94f3557da/reservations/e0e4b4f5-77ea-4984-9ee4-6bf9850ee6de")},
	// 						},
	// 						ProvisioningState: to.Ptr(armreservations.ProvisioningStateSucceeded),
	// 						Quantity: to.Ptr[int32](3),
	// 						ReservedResourceType: to.Ptr(armreservations.ReservedResourceTypeVirtualMachines),
	// 						SKUDescription: to.Ptr("D1 v2"),
	// 					},
	// 					SKU: &armreservations.SKUName{
	// 						Name: to.Ptr("Standard_DS1_v2"),
	// 					},
	// 				},
	// 				{
	// 					Name: to.Ptr("2"),
	// 					Type: to.Ptr("Microsoft.Capacity/reservationOrders/reservations/revisions"),
	// 					ID: to.Ptr("/providers/microsoft.capacity/reservationOrders/276e7ae4-84d0-4da6-ab4b-d6b94f3557da/reservations/6ef59113-3482-40da-8d79-787f823e34bc/revisions/2"),
	// 					Etag: to.Ptr[int32](2),
	// 					Location: to.Ptr("eastus"),
	// 					Properties: &armreservations.Properties{
	// 						AppliedScopeProperties: &armreservations.AppliedScopeProperties{
	// 							DisplayName: to.Ptr("Azure subscription 1"),
	// 							SubscriptionID: to.Ptr("/subscriptions/98df3792-7962-4f18-8be2-d5576f122de3"),
	// 						},
	// 						AppliedScopeType: to.Ptr(armreservations.AppliedScopeTypeSingle),
	// 						BillingPlan: to.Ptr(armreservations.ReservationBillingPlanMonthly),
	// 						DisplayName: to.Ptr("cabri_test"),
	// 						EffectiveDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-09-22T22:46:32.763Z"); return t}()),
	// 						ExpiryDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2018-09-22"); return t}()),
	// 						ExpiryDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-09-22T22:46:32.763Z"); return t}()),
	// 						InstanceFlexibility: to.Ptr(armreservations.InstanceFlexibilityOn),
	// 						LastUpdatedDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-09-22T22:46:32.763Z"); return t}()),
	// 						MergeProperties: &armreservations.ReservationMergeProperties{
	// 							MergeSources: []*string{
	// 								to.Ptr("/providers/microsoft.capacity/reservationOrders/276e7ae4-84d0-4da6-ab4b-d6b94f3557da/reservations/00238563-7312-4c20-a134-8c030bf938a7"),
	// 								to.Ptr("/providers/microsoft.capacity/reservationOrders/276e7ae4-84d0-4da6-ab4b-d6b94f3557da/reservations/e0e4b4f5-77ea-4984-9ee4-6bf9850ee6de")},
	// 							},
	// 							ProvisioningState: to.Ptr(armreservations.ProvisioningStateSucceeded),
	// 							Quantity: to.Ptr[int32](3),
	// 							ReservedResourceType: to.Ptr(armreservations.ReservedResourceTypeVirtualMachines),
	// 							SKUDescription: to.Ptr("D1 v2"),
	// 							SwapProperties: &armreservations.ReservationSwapProperties{
	// 								SwapDestination: to.Ptr("/providers/microsoft.capacity/reservationOrders/afadf486-3432-4254-b297-4db8ef055f38/reservations/317efb41-b3ef-3706-8447-c2c045ab3ef5"),
	// 							},
	// 						},
	// 						SKU: &armreservations.SKUName{
	// 							Name: to.Ptr("Standard_DS1_v2"),
	// 						},
	// 					},
	// 					{
	// 						Name: to.Ptr("1"),
	// 						Type: to.Ptr("Microsoft.Capacity/reservationOrders/reservations/revisions"),
	// 						ID: to.Ptr("/providers/microsoft.capacity/reservationOrders/276e7ae4-84d0-4da6-ab4b-d6b94f3557da/reservations/6ef59113-3482-40da-8d79-787f823e34bc/revisions/1"),
	// 						Etag: to.Ptr[int32](1),
	// 						Location: to.Ptr("eastus"),
	// 						Properties: &armreservations.Properties{
	// 							AppliedScopeProperties: &armreservations.AppliedScopeProperties{
	// 								DisplayName: to.Ptr("Azure subscription 1"),
	// 								SubscriptionID: to.Ptr("/subscriptions/98df3792-7962-4f18-8be2-d5576f122de3"),
	// 							},
	// 							AppliedScopeType: to.Ptr(armreservations.AppliedScopeTypeSingle),
	// 							DisplayName: to.Ptr("cabri_test"),
	// 							EffectiveDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-09-22T22:46:27.331Z"); return t}()),
	// 							ExpiryDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2018-09-22"); return t}()),
	// 							ExpiryDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-09-22T22:46:27.331Z"); return t}()),
	// 							InstanceFlexibility: to.Ptr(armreservations.InstanceFlexibilityOn),
	// 							LastUpdatedDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-09-22T22:46:27.331Z"); return t}()),
	// 							MergeProperties: &armreservations.ReservationMergeProperties{
	// 								MergeSources: []*string{
	// 									to.Ptr("/providers/microsoft.capacity/reservationOrders/276e7ae4-84d0-4da6-ab4b-d6b94f3557da/reservations/00238563-7312-4c20-a134-8c030bf938a7"),
	// 									to.Ptr("/providers/microsoft.capacity/reservationOrders/276e7ae4-84d0-4da6-ab4b-d6b94f3557da/reservations/e0e4b4f5-77ea-4984-9ee4-6bf9850ee6de")},
	// 								},
	// 								ProvisioningState: to.Ptr(armreservations.ProvisioningStateSucceeded),
	// 								Quantity: to.Ptr[int32](3),
	// 								ReservedResourceType: to.Ptr(armreservations.ReservedResourceTypeVirtualMachines),
	// 								SKUDescription: to.Ptr("D1 v2"),
	// 							},
	// 							SKU: &armreservations.SKUName{
	// 								Name: to.Ptr("Standard_DS1_v2"),
	// 							},
	// 					}},
	// 				}
}
Output:

func (*ReservationClient) Unarchive

func (client *ReservationClient) Unarchive(ctx context.Context, reservationOrderID string, reservationID string, options *ReservationClientUnarchiveOptions) (ReservationClientUnarchiveResponse, error)

Unarchive - Restores a Reservation to the state it was before archiving. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-11-01

  • reservationOrderID - Order Id of the reservation
  • reservationID - Id of the reservation item
  • options - ReservationClientUnarchiveOptions contains the optional parameters for the ReservationClient.Unarchive method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-11-01/examples/Unarchive.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armreservations.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
_, err = clientFactory.NewReservationClient().Unarchive(ctx, "276e7ae4-84d0-4da6-ab4b-d6b94f3557da", "356e7ae4-84d0-4da6-ab4b-d6b94f3557da", nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
Output:

type ReservationClientArchiveOptions

type ReservationClientArchiveOptions struct {
}

ReservationClientArchiveOptions contains the optional parameters for the ReservationClient.Archive method.

type ReservationClientArchiveResponse

type ReservationClientArchiveResponse struct {
}

ReservationClientArchiveResponse contains the response from method ReservationClient.Archive.

type ReservationClientAvailableScopesResponse

type ReservationClientAvailableScopesResponse struct {
	// The response of available scope api containing scopes and their eligibilities.
	AvailableScopeProperties
}

ReservationClientAvailableScopesResponse contains the response from method ReservationClient.BeginAvailableScopes.

type ReservationClientBeginAvailableScopesOptions

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

ReservationClientBeginAvailableScopesOptions contains the optional parameters for the ReservationClient.BeginAvailableScopes method.

type ReservationClientBeginMergeOptions

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

ReservationClientBeginMergeOptions contains the optional parameters for the ReservationClient.BeginMerge method.

type ReservationClientBeginSplitOptions

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

ReservationClientBeginSplitOptions contains the optional parameters for the ReservationClient.BeginSplit method.

type ReservationClientBeginUpdateOptions

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

ReservationClientBeginUpdateOptions contains the optional parameters for the ReservationClient.BeginUpdate method.

type ReservationClientGetOptions

type ReservationClientGetOptions struct {
	// Supported value of this query is renewProperties
	Expand *string
}

ReservationClientGetOptions contains the optional parameters for the ReservationClient.Get method.

type ReservationClientGetResponse

type ReservationClientGetResponse struct {
	// The definition of the reservation.
	ReservationResponse
}

ReservationClientGetResponse contains the response from method ReservationClient.Get.

type ReservationClientListAllOptions

type ReservationClientListAllOptions 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, expiryDateTime,
	// 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 reservations group by provisioning states
	RefreshSummary *string

	// The selected provisioning state
	SelectedState *string

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

	// To number of reservations to return
	Take *float32
}

ReservationClientListAllOptions contains the optional parameters for the ReservationClient.NewListAllPager method.

type ReservationClientListAllResponse

type ReservationClientListAllResponse struct {
	// The list of reservations and summary of roll out count of reservations in each state.
	ListResult
}

ReservationClientListAllResponse contains the response from method ReservationClient.NewListAllPager.

type ReservationClientListOptions

type ReservationClientListOptions struct {
}

ReservationClientListOptions contains the optional parameters for the ReservationClient.NewListPager method.

type ReservationClientListResponse

type ReservationClientListResponse struct {
	// List of `Reservation`s
	ReservationList
}

ReservationClientListResponse contains the response from method ReservationClient.NewListPager.

type ReservationClientListRevisionsOptions

type ReservationClientListRevisionsOptions struct {
}

ReservationClientListRevisionsOptions contains the optional parameters for the ReservationClient.NewListRevisionsPager method.

type ReservationClientListRevisionsResponse

type ReservationClientListRevisionsResponse struct {
	// List of `Reservation`s
	ReservationList
}

ReservationClientListRevisionsResponse contains the response from method ReservationClient.NewListRevisionsPager.

type ReservationClientMergeResponse

type ReservationClientMergeResponse struct {
	// Array of ReservationResponse
	ReservationResponseArray []*ReservationResponse
}

ReservationClientMergeResponse contains the response from method ReservationClient.BeginMerge.

func (*ReservationClientMergeResponse) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ReservationClientMergeResponse.

type ReservationClientSplitResponse

type ReservationClientSplitResponse struct {
	// Array of ReservationResponse
	ReservationResponseArray []*ReservationResponse
}

ReservationClientSplitResponse contains the response from method ReservationClient.BeginSplit.

func (*ReservationClientSplitResponse) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ReservationClientSplitResponse.

type ReservationClientUnarchiveOptions

type ReservationClientUnarchiveOptions struct {
}

ReservationClientUnarchiveOptions contains the optional parameters for the ReservationClient.Unarchive method.

type ReservationClientUnarchiveResponse

type ReservationClientUnarchiveResponse struct {
}

ReservationClientUnarchiveResponse contains the response from method ReservationClient.Unarchive.

type ReservationClientUpdateResponse

type ReservationClientUpdateResponse struct {
	// The definition of the reservation.
	ReservationResponse
}

ReservationClientUpdateResponse contains the response from method ReservationClient.BeginUpdate.

type ReservationList

type ReservationList struct {
	// Url to get the next page of reservations.
	NextLink *string
	Value    []*ReservationResponse
}

ReservationList - List of Reservations

func (ReservationList) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ReservationList.

func (*ReservationList) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ReservationList.

type ReservationMergeProperties

type ReservationMergeProperties struct {
	// Reservation resource id Created due to the merge. Format of the resource id is /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}
	MergeDestination *string

	// Resource ids of the source reservation's merged to form this reservation. Format of the resource id is /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}
	MergeSources []*string
}

ReservationMergeProperties - Properties of reservation merge

func (ReservationMergeProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ReservationMergeProperties.

func (*ReservationMergeProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ReservationMergeProperties.

type ReservationOrderBillingPlanInformation

type ReservationOrderBillingPlanInformation 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
}

ReservationOrderBillingPlanInformation - Information describing the type of billing plan for this reservation.

func (ReservationOrderBillingPlanInformation) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ReservationOrderBillingPlanInformation.

func (*ReservationOrderBillingPlanInformation) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ReservationOrderBillingPlanInformation.

type ReservationOrderClient

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

ReservationOrderClient contains the methods for the ReservationOrder group. Don't use this type directly, use NewReservationOrderClient() instead.

func NewReservationOrderClient

func NewReservationOrderClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*ReservationOrderClient, error)

NewReservationOrderClient creates a new instance of ReservationOrderClient with the specified values.

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

func (*ReservationOrderClient) BeginPurchase

BeginPurchase - Purchase ReservationOrder and create resource under the specified URI. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-11-01

  • reservationOrderID - Order Id of the reservation
  • body - Information needed for calculate or purchase reservation
  • options - ReservationOrderClientBeginPurchaseOptions contains the optional parameters for the ReservationOrderClient.BeginPurchase method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-11-01/examples/PurchaseReservationOrder.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armreservations.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewReservationOrderClient().BeginPurchase(ctx, "a075419f-44cc-497f-b68a-14ee811d48b9", armreservations.PurchaseRequest{
	Location: to.Ptr("westus"),
	Properties: &armreservations.PurchaseRequestProperties{
		AppliedScopeType: to.Ptr(armreservations.AppliedScopeTypeShared),
		BillingPlan:      to.Ptr(armreservations.ReservationBillingPlanMonthly),
		BillingScopeID:   to.Ptr("/subscriptions/ed3a1871-612d-abcd-a849-c2542a68be83"),
		DisplayName:      to.Ptr("TestReservationOrder"),
		Quantity:         to.Ptr[int32](1),
		Renew:            to.Ptr(false),
		ReservedResourceProperties: &armreservations.PurchaseRequestPropertiesReservedResourceProperties{
			InstanceFlexibility: to.Ptr(armreservations.InstanceFlexibilityOn),
		},
		ReservedResourceType: to.Ptr(armreservations.ReservedResourceTypeVirtualMachines),
		Term:                 to.Ptr(armreservations.ReservationTermP1Y),
	},
	SKU: &armreservations.SKUName{
		Name: to.Ptr("standard_D1"),
	},
}, 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.ReservationOrderResponse = armreservations.ReservationOrderResponse{
// 	Name: to.Ptr("1f14354c-dc12-4c8d-8090-6f295a3a34aa"),
// 	Type: to.Ptr("Microsoft.Capacity/reservationOrders"),
// 	Etag: to.Ptr[int32](7),
// 	ID: to.Ptr("/providers/microsoft.capacity/reservationOrders/1f14354c-dc12-4c8d-8090-6f295a3a34aa"),
// 	Properties: &armreservations.ReservationOrderProperties{
// 		BillingPlan: to.Ptr(armreservations.ReservationBillingPlanMonthly),
// 		CreatedDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-30T03:51:49.808Z"); return t}()),
// 		DisplayName: to.Ptr("cabri"),
// 		ExpiryDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2018-08-30"); return t}()),
// 		ExpiryDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-08-30T03:51:49.808Z"); return t}()),
// 		OriginalQuantity: to.Ptr[int32](7),
// 		ProvisioningState: to.Ptr(armreservations.ProvisioningStateSucceeded),
// 		RequestDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-30T03:49:19.025Z"); return t}()),
// 		Reservations: []*armreservations.ReservationResponse{
// 			{
// 				ID: to.Ptr("/providers/microsoft.capacity/reservationOrders/1f14354c-dc12-4c8d-8090-6f295a3a34aa/reservations/c8c926bd-fc5d-4e29-9d43-b68340ac23a6"),
// 		}},
// 		Term: to.Ptr(armreservations.ReservationTermP1Y),
// 	},
// }
Output:

func (*ReservationOrderClient) Calculate

Calculate - Calculate price for placing a ReservationOrder. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-11-01

  • body - Information needed for calculate or purchase reservation
  • options - ReservationOrderClientCalculateOptions contains the optional parameters for the ReservationOrderClient.Calculate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-11-01/examples/CalculateReservationOrder.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armreservations.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewReservationOrderClient().Calculate(ctx, armreservations.PurchaseRequest{
	Location: to.Ptr("westus"),
	Properties: &armreservations.PurchaseRequestProperties{
		AppliedScopeType: to.Ptr(armreservations.AppliedScopeTypeShared),
		BillingPlan:      to.Ptr(armreservations.ReservationBillingPlanMonthly),
		BillingScopeID:   to.Ptr("/subscriptions/ed3a1871-612d-abcd-a849-c2542a68be83"),
		DisplayName:      to.Ptr("TestReservationOrder"),
		Quantity:         to.Ptr[int32](1),
		ReservedResourceProperties: &armreservations.PurchaseRequestPropertiesReservedResourceProperties{
			InstanceFlexibility: to.Ptr(armreservations.InstanceFlexibilityOn),
		},
		ReservedResourceType: to.Ptr(armreservations.ReservedResourceTypeVirtualMachines),
		Term:                 to.Ptr(armreservations.ReservationTermP1Y),
	},
	SKU: &armreservations.SKUName{
		Name: to.Ptr("standard_D1"),
	},
}, 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.CalculatePriceResponse = armreservations.CalculatePriceResponse{
// 	Properties: &armreservations.CalculatePriceResponseProperties{
// 		BillingCurrencyTotal: &armreservations.CalculatePriceResponsePropertiesBillingCurrencyTotal{
// 			Amount: to.Ptr[float64](46),
// 			CurrencyCode: to.Ptr("USD"),
// 		},
// 		PaymentSchedule: []*armreservations.PaymentDetail{
// 			{
// 				BillingCurrencyTotal: &armreservations.Price{
// 					Amount: to.Ptr[float64](40),
// 					CurrencyCode: to.Ptr("EUR"),
// 				},
// 				DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2019-05-14"); return t}()),
// 				PricingCurrencyTotal: &armreservations.Price{
// 					Amount: to.Ptr[float64](46),
// 					CurrencyCode: to.Ptr("USD"),
// 				},
// 			},
// 			{
// 				DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2019-06-14"); return t}()),
// 				PricingCurrencyTotal: &armreservations.Price{
// 					Amount: to.Ptr[float64](46),
// 					CurrencyCode: to.Ptr("USD"),
// 				},
// 			},
// 			{
// 				DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2019-07-14"); return t}()),
// 				PricingCurrencyTotal: &armreservations.Price{
// 					Amount: to.Ptr[float64](46),
// 					CurrencyCode: to.Ptr("USD"),
// 				},
// 		}},
// 		PricingCurrencyTotal: &armreservations.CalculatePriceResponsePropertiesPricingCurrencyTotal{
// 			Amount: to.Ptr[float32](46),
// 			CurrencyCode: to.Ptr("USD"),
// 		},
// 		ReservationOrderID: to.Ptr("6d9cec54-7de8-abcd-9de7-80f5d634f2d2"),
// 		SKUDescription: to.Ptr("standard_D1"),
// 		SKUTitle: to.Ptr("Reserved VM Instance, Standard_D1, US West, 1 Year"),
// 	},
// }
Output:

func (*ReservationOrderClient) ChangeDirectory

ChangeDirectory - Change directory (tenant) of ReservationOrder and all Reservation under it to specified tenant id If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-11-01

  • reservationOrderID - Order Id of the reservation
  • body - Information needed to change directory of reservation order
  • options - ReservationOrderClientChangeDirectoryOptions contains the optional parameters for the ReservationOrderClient.ChangeDirectory method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-11-01/examples/ChangeDirectoryReservationOrder.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armreservations.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewReservationOrderClient().ChangeDirectory(ctx, "a075419f-44cc-497f-b68a-14ee811d48b9", armreservations.ChangeDirectoryRequest{
	DestinationTenantID: to.Ptr("906655ea-30be-4587-9d12-b50e077b0f32"),
}, 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.ChangeDirectoryResponse = armreservations.ChangeDirectoryResponse{
// 	ReservationOrder: &armreservations.ChangeDirectoryResult{
// 		Name: to.Ptr("VM_RI_10-02-2020_15-21"),
// 		Error: to.Ptr("error string"),
// 		ID: to.Ptr("a075419f-44cc-497f-b68a-14ee811d48b9"),
// 		IsSucceeded: to.Ptr(true),
// 	},
// 	Reservations: []*armreservations.ChangeDirectoryResult{
// 		{
// 			Name: to.Ptr("VM_RI_10-02-2020_15-21"),
// 			Error: to.Ptr("error string"),
// 			ID: to.Ptr("1f14354c-dc12-4c8d-8090-6f295a3a34aa"),
// 			IsSucceeded: to.Ptr(true),
// 	}},
// }
Output:

func (*ReservationOrderClient) Get

Get - Get the details of the ReservationOrder. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-11-01

  • reservationOrderID - Order Id of the reservation
  • options - ReservationOrderClientGetOptions contains the optional parameters for the ReservationOrderClient.Get method.
Example (GetReservationOrder)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-11-01/examples/GetReservationOrderDetails.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armreservations.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewReservationOrderClient().Get(ctx, "a075419f-44cc-497f-b68a-14ee811d48b9", &armreservations.ReservationOrderClientGetOptions{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.ReservationOrderResponse = armreservations.ReservationOrderResponse{
// 	Name: to.Ptr("1f14354c-dc12-4c8d-8090-6f295a3a34aa"),
// 	Type: to.Ptr("Microsoft.Capacity/reservationOrders"),
// 	Etag: to.Ptr[int32](7),
// 	ID: to.Ptr("/providers/microsoft.capacity/reservationOrders/1f14354c-dc12-4c8d-8090-6f295a3a34aa"),
// 	Properties: &armreservations.ReservationOrderProperties{
// 		BenefitStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-30T03:49:19.025Z"); return t}()),
// 		BillingPlan: to.Ptr(armreservations.ReservationBillingPlanMonthly),
// 		CreatedDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-30T03:51:49.808Z"); return t}()),
// 		DisplayName: to.Ptr("cabri"),
// 		ExpiryDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2018-08-30"); return t}()),
// 		ExpiryDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-08-30T03:51:49.808Z"); return t}()),
// 		OriginalQuantity: to.Ptr[int32](7),
// 		ProvisioningState: to.Ptr(armreservations.ProvisioningStateSucceeded),
// 		RequestDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-30T03:49:19.025Z"); return t}()),
// 		Reservations: []*armreservations.ReservationResponse{
// 			{
// 				ID: to.Ptr("/providers/microsoft.capacity/reservationOrders/1f14354c-dc12-4c8d-8090-6f295a3a34aa/reservations/c8c926bd-fc5d-4e29-9d43-b68340ac23a6"),
// 		}},
// 		Term: to.Ptr(armreservations.ReservationTermP1Y),
// 	},
// }
Output:

Example (GetReservationWithExpandPayments)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-11-01/examples/GetReservationOrderDetailsWithExpandPlanInformation.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armreservations.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewReservationOrderClient().Get(ctx, "a075419f-44cc-497f-b68a-14ee811d48b9", &armreservations.ReservationOrderClientGetOptions{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.ReservationOrderResponse = armreservations.ReservationOrderResponse{
// 	Name: to.Ptr("1f14354c-dc12-4c8d-8090-6f295a3a34aa"),
// 	Type: to.Ptr("Microsoft.Capacity/reservationOrders"),
// 	Etag: to.Ptr[int32](7),
// 	ID: to.Ptr("/providers/microsoft.capacity/reservationOrders/1f14354c-dc12-4c8d-8090-6f295a3a34aa"),
// 	Properties: &armreservations.ReservationOrderProperties{
// 		BenefitStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-08-30T03:51:49.000Z"); return t}()),
// 		BillingPlan: to.Ptr(armreservations.ReservationBillingPlanMonthly),
// 		CreatedDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-08-30T03:51:49.000Z"); return t}()),
// 		DisplayName: to.Ptr("cabri"),
// 		ExpiryDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2018-08-30"); return t}()),
// 		ExpiryDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-08-30T03:51:49.000Z"); return t}()),
// 		OriginalQuantity: to.Ptr[int32](7),
// 		PlanInformation: &armreservations.ReservationOrderBillingPlanInformation{
// 			NextPaymentDueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2019-09-30"); return t}()),
// 			PricingCurrencyTotal: &armreservations.Price{
// 				Amount: to.Ptr[float64](466),
// 				CurrencyCode: to.Ptr("USD"),
// 			},
// 			StartDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2019-08-30"); return t}()),
// 			Transactions: []*armreservations.PaymentDetail{
// 				{
// 					BillingAccount: to.Ptr("23456"),
// 					BillingCurrencyTotal: &armreservations.Price{
// 						Amount: to.Ptr[float64](466),
// 						CurrencyCode: to.Ptr("USD"),
// 					},
// 					DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2019-09-30"); return t}()),
// 					PaymentDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2019-09-30"); return t}()),
// 					PricingCurrencyTotal: &armreservations.Price{
// 						Amount: to.Ptr[float64](466),
// 						CurrencyCode: to.Ptr("USD"),
// 					},
// 					Status: to.Ptr(armreservations.PaymentStatusSucceeded),
// 				},
// 				{
// 					BillingAccount: to.Ptr("23456"),
// 					BillingCurrencyTotal: &armreservations.Price{
// 						Amount: to.Ptr[float64](466),
// 						CurrencyCode: to.Ptr("USD"),
// 					},
// 					DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2019-10-30"); return t}()),
// 					ExtendedStatusInfo: &armreservations.ExtendedStatusInfo{
// 						Message: to.Ptr("Credit card charge failed."),
// 						StatusCode: to.Ptr(armreservations.ReservationStatusCode("PaymentDeclined")),
// 					},
// 					PaymentDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2019-10-30"); return t}()),
// 					PricingCurrencyTotal: &armreservations.Price{
// 						Amount: to.Ptr[float64](466),
// 						CurrencyCode: to.Ptr("USD"),
// 					},
// 					Status: to.Ptr(armreservations.PaymentStatusFailed),
// 				},
// 				{
// 					BillingAccount: to.Ptr("23456"),
// 					BillingCurrencyTotal: &armreservations.Price{
// 						Amount: to.Ptr[float64](466),
// 						CurrencyCode: to.Ptr("USD"),
// 					},
// 					DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2019-10-31"); return t}()),
// 					PaymentDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2019-10-31"); return t}()),
// 					PricingCurrencyTotal: &armreservations.Price{
// 						Amount: to.Ptr[float64](466),
// 						CurrencyCode: to.Ptr("USD"),
// 					},
// 					Status: to.Ptr(armreservations.PaymentStatusSucceeded),
// 				},
// 				{
// 					BillingAccount: to.Ptr("23456"),
// 					BillingCurrencyTotal: &armreservations.Price{
// 						Amount: to.Ptr[float64](466),
// 						CurrencyCode: to.Ptr("USD"),
// 					},
// 					DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2019-11-30"); return t}()),
// 					PaymentDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2019-11-30"); return t}()),
// 					PricingCurrencyTotal: &armreservations.Price{
// 						Amount: to.Ptr[float64](466),
// 						CurrencyCode: to.Ptr("USD"),
// 					},
// 					Status: to.Ptr(armreservations.PaymentStatusSucceeded),
// 				},
// 				{
// 					BillingAccount: to.Ptr("23456"),
// 					BillingCurrencyTotal: &armreservations.Price{
// 						Amount: to.Ptr[float64](466),
// 						CurrencyCode: to.Ptr("USD"),
// 					},
// 					DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2019-07-14"); return t}()),
// 					PaymentDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2019-06-14"); return t}()),
// 					PricingCurrencyTotal: &armreservations.Price{
// 						Amount: to.Ptr[float64](466),
// 						CurrencyCode: to.Ptr("USD"),
// 					},
// 					Status: to.Ptr(armreservations.PaymentStatusScheduled),
// 				},
// 				{
// 					BillingAccount: to.Ptr("23456"),
// 					BillingCurrencyTotal: &armreservations.Price{
// 						Amount: to.Ptr[float64](466),
// 						CurrencyCode: to.Ptr("USD"),
// 					},
// 					DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2019-06-14"); return t}()),
// 					PaymentDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2019-08-14"); return t}()),
// 					PricingCurrencyTotal: &armreservations.Price{
// 						Amount: to.Ptr[float64](466),
// 						CurrencyCode: to.Ptr("USD"),
// 					},
// 					Status: to.Ptr(armreservations.PaymentStatusScheduled),
// 			}},
// 		},
// 		ProvisioningState: to.Ptr(armreservations.ProvisioningStateSucceeded),
// 		RequestDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-08-30T03:49:19.000Z"); return t}()),
// 		Reservations: []*armreservations.ReservationResponse{
// 			{
// 				ID: to.Ptr("/providers/microsoft.capacity/reservationOrders/1f14354c-dc12-4c8d-8090-6f295a3a34aa/reservations/c8c926bd-fc5d-4e29-9d43-b68340ac23a6"),
// 		}},
// 		Term: to.Ptr(armreservations.ReservationTermP1Y),
// 	},
// }
Output:

func (*ReservationOrderClient) NewListPager

NewListPager - List of all the ReservationOrders that the user has access to in the current tenant.

Generated from API version 2022-11-01

  • options - ReservationOrderClientListOptions contains the optional parameters for the ReservationOrderClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-11-01/examples/GetReservationOrders.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armreservations.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewReservationOrderClient().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.ReservationOrderList = armreservations.ReservationOrderList{
	// 	Value: []*armreservations.ReservationOrderResponse{
	// 		{
	// 			Name: to.Ptr("1e6407ba-37a5-499f-80ed-a3f0f338e443"),
	// 			Type: to.Ptr("Microsoft.Capacity/reservationOrders"),
	// 			Etag: to.Ptr[int32](7),
	// 			ID: to.Ptr("/providers/microsoft.capacity/reservationOrders/1e6407ba-37a5-499f-80ed-a3f0f338e443"),
	// 			Properties: &armreservations.ReservationOrderProperties{
	// 				BenefitStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-29T21:20:23.813Z"); return t}()),
	// 				BillingPlan: to.Ptr(armreservations.ReservationBillingPlanMonthly),
	// 				CreatedDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-29T21:22:56.854Z"); return t}()),
	// 				DisplayName: to.Ptr("cabri"),
	// 				ExpiryDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2018-08-29"); return t}()),
	// 				ExpiryDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-08-29T21:20:23.813Z"); return t}()),
	// 				OriginalQuantity: to.Ptr[int32](1),
	// 				ProvisioningState: to.Ptr(armreservations.ProvisioningStateSucceeded),
	// 				RequestDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-29T21:20:23.813Z"); return t}()),
	// 				Reservations: []*armreservations.ReservationResponse{
	// 					{
	// 						ID: to.Ptr("/providers/microsoft.capacity/reservationOrders/1e6407ba-37a5-499f-80ed-a3f0f338e443/reservations/cae5924e-7a15-419f-a369-124f52d4a106"),
	// 				}},
	// 				Term: to.Ptr(armreservations.ReservationTermP1Y),
	// 			},
	// 		},
	// 		{
	// 			Name: to.Ptr("1ea6e203-288e-4732-b9e1-da8bbe10c614"),
	// 			Type: to.Ptr("Microsoft.Capacity/reservationOrders"),
	// 			Etag: to.Ptr[int32](7),
	// 			ID: to.Ptr("/providers/microsoft.capacity/reservationOrders/1ea6e203-288e-4732-b9e1-da8bbe10c614"),
	// 			Properties: &armreservations.ReservationOrderProperties{
	// 				BenefitStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-30T12:55:40.279Z"); return t}()),
	// 				BillingPlan: to.Ptr(armreservations.ReservationBillingPlanMonthly),
	// 				CreatedDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-30T12:58:20.526Z"); return t}()),
	// 				DisplayName: to.Ptr("cabri"),
	// 				ExpiryDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2018-08-30"); return t}()),
	// 				ExpiryDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-08-30T12:58:20.526Z"); return t}()),
	// 				OriginalQuantity: to.Ptr[int32](9),
	// 				ProvisioningState: to.Ptr(armreservations.ProvisioningStateSucceeded),
	// 				RequestDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-30T12:55:40.279Z"); return t}()),
	// 				Reservations: []*armreservations.ReservationResponse{
	// 					{
	// 						ID: to.Ptr("/providers/microsoft.capacity/reservationOrders/1ea6e203-288e-4732-b9e1-da8bbe10c614/reservations/d04fd48d-e3f6-42a3-a8f6-1ad0b7513e48"),
	// 				}},
	// 				Term: to.Ptr(armreservations.ReservationTermP1Y),
	// 			},
	// 		},
	// 		{
	// 			Name: to.Ptr("1f14354c-dc12-4c8d-8090-6f295a3a34aa"),
	// 			Type: to.Ptr("Microsoft.Capacity/reservationOrders"),
	// 			Etag: to.Ptr[int32](7),
	// 			ID: to.Ptr("/providers/microsoft.capacity/reservationOrders/1f14354c-dc12-4c8d-8090-6f295a3a34aa"),
	// 			Properties: &armreservations.ReservationOrderProperties{
	// 				BenefitStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-30T03:49:19.025Z"); return t}()),
	// 				BillingPlan: to.Ptr(armreservations.ReservationBillingPlanMonthly),
	// 				CreatedDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-30T03:51:49.808Z"); return t}()),
	// 				DisplayName: to.Ptr("cabri"),
	// 				ExpiryDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2018-08-30"); return t}()),
	// 				ExpiryDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-08-30T03:51:49.808Z"); return t}()),
	// 				OriginalQuantity: to.Ptr[int32](7),
	// 				ProvisioningState: to.Ptr(armreservations.ProvisioningStateSucceeded),
	// 				RequestDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-30T03:49:19.025Z"); return t}()),
	// 				Reservations: []*armreservations.ReservationResponse{
	// 					{
	// 						ID: to.Ptr("/providers/microsoft.capacity/reservationOrders/1f14354c-dc12-4c8d-8090-6f295a3a34aa/reservations/c8c926bd-fc5d-4e29-9d43-b68340ac23a6"),
	// 				}},
	// 				Term: to.Ptr(armreservations.ReservationTermP1Y),
	// 			},
	// 	}},
	// }
}
Output:

type ReservationOrderClientBeginPurchaseOptions

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

ReservationOrderClientBeginPurchaseOptions contains the optional parameters for the ReservationOrderClient.BeginPurchase method.

type ReservationOrderClientCalculateOptions

type ReservationOrderClientCalculateOptions struct {
}

ReservationOrderClientCalculateOptions contains the optional parameters for the ReservationOrderClient.Calculate method.

type ReservationOrderClientCalculateResponse

type ReservationOrderClientCalculateResponse struct {
	// The response of calculate price for reservation.
	CalculatePriceResponse
}

ReservationOrderClientCalculateResponse contains the response from method ReservationOrderClient.Calculate.

type ReservationOrderClientChangeDirectoryOptions

type ReservationOrderClientChangeDirectoryOptions struct {
}

ReservationOrderClientChangeDirectoryOptions contains the optional parameters for the ReservationOrderClient.ChangeDirectory method.

type ReservationOrderClientChangeDirectoryResponse

type ReservationOrderClientChangeDirectoryResponse struct {
	// Change directory response
	ChangeDirectoryResponse
}

ReservationOrderClientChangeDirectoryResponse contains the response from method ReservationOrderClient.ChangeDirectory.

type ReservationOrderClientGetOptions

type ReservationOrderClientGetOptions struct {
	// May be used to expand the planInformation.
	Expand *string
}

ReservationOrderClientGetOptions contains the optional parameters for the ReservationOrderClient.Get method.

type ReservationOrderClientGetResponse

type ReservationOrderClientGetResponse struct {
	// Details of a reservation order being returned.
	ReservationOrderResponse
}

ReservationOrderClientGetResponse contains the response from method ReservationOrderClient.Get.

type ReservationOrderClientListOptions

type ReservationOrderClientListOptions struct {
}

ReservationOrderClientListOptions contains the optional parameters for the ReservationOrderClient.NewListPager method.

type ReservationOrderClientListResponse

type ReservationOrderClientListResponse struct {
	// List of `ReservationOrder`s
	ReservationOrderList
}

ReservationOrderClientListResponse contains the response from method ReservationOrderClient.NewListPager.

type ReservationOrderClientPurchaseResponse

type ReservationOrderClientPurchaseResponse struct {
	// Details of a reservation order being returned.
	ReservationOrderResponse
}

ReservationOrderClientPurchaseResponse contains the response from method ReservationOrderClient.BeginPurchase.

type ReservationOrderList

type ReservationOrderList struct {
	// Url to get the next page of reservationOrders.
	NextLink *string
	Value    []*ReservationOrderResponse
}

ReservationOrderList - List of ReservationOrders

func (ReservationOrderList) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ReservationOrderList.

func (*ReservationOrderList) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ReservationOrderList.

type ReservationOrderProperties

type ReservationOrderProperties struct {
	// This is the DateTime when the reservation benefit started.
	BenefitStartTime *time.Time

	// Represent the billing plans.
	BillingPlan *ReservationBillingPlan

	// This is the DateTime when the reservation was created.
	CreatedDateTime *time.Time

	// Friendly name for user to easily identified the reservation.
	DisplayName *string

	// This is the date when the reservation will expire.
	ExpiryDate *time.Time

	// This is the date-time when the reservation will expire.
	ExpiryDateTime *time.Time

	// Total Quantity of the skus purchased in the reservation.
	OriginalQuantity *int32

	// Information describing the type of billing plan for this reservation.
	PlanInformation *ReservationOrderBillingPlanInformation

	// Current state of the reservation.
	ProvisioningState *ProvisioningState

	// This is the DateTime when the reservation was initially requested for purchase.
	RequestDateTime *time.Time
	Reservations    []*ReservationResponse

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

	// Represent the term of reservation.
	Term *ReservationTerm
}

ReservationOrderProperties - Properties of a reservation order.

func (ReservationOrderProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ReservationOrderProperties.

func (*ReservationOrderProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ReservationOrderProperties.

type ReservationOrderResponse

type ReservationOrderResponse struct {
	Etag *int32

	// Properties of a reservation order.
	Properties *ReservationOrderProperties

	// READ-ONLY; Identifier of the reservation
	ID *string

	// READ-ONLY; Name of the reservation
	Name *string

	// READ-ONLY; Metadata pertaining to creation and last modification of the resource.
	SystemData *SystemData

	// READ-ONLY; Type of resource. "Microsoft.Capacity/reservations"
	Type *string
}

ReservationOrderResponse - Details of a reservation order being returned.

func (ReservationOrderResponse) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ReservationOrderResponse.

func (*ReservationOrderResponse) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ReservationOrderResponse.

type ReservationResponse

type ReservationResponse struct {
	Etag *int32

	// Resource Provider type to be reserved.
	Kind *string

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

	// The properties associated to this reservation
	Properties *Properties

	// The sku information associated to this reservation
	SKU *SKUName

	// READ-ONLY; Fully qualified resource ID for the resource. E.g. "/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
}

ReservationResponse - The definition of the reservation.

func (ReservationResponse) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ReservationResponse.

func (*ReservationResponse) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ReservationResponse.

type ReservationSplitProperties

type ReservationSplitProperties struct {
	// List of destination resource id that are created due to split. Format of the resource id is /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}
	SplitDestinations []*string

	// Resource id of the reservation from which this is split. Format of the resource id is /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}
	SplitSource *string
}

ReservationSplitProperties - Properties of reservation split

func (ReservationSplitProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ReservationSplitProperties.

func (*ReservationSplitProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ReservationSplitProperties.

type ReservationStatusCode

type ReservationStatusCode string
const (
	ReservationStatusCodeActive                 ReservationStatusCode = "Active"
	ReservationStatusCodeExpired                ReservationStatusCode = "Expired"
	ReservationStatusCodeMerged                 ReservationStatusCode = "Merged"
	ReservationStatusCodeNone                   ReservationStatusCode = "None"
	ReservationStatusCodePaymentInstrumentError ReservationStatusCode = "PaymentInstrumentError"
	ReservationStatusCodePending                ReservationStatusCode = "Pending"
	ReservationStatusCodeProcessing             ReservationStatusCode = "Processing"
	ReservationStatusCodePurchaseError          ReservationStatusCode = "PurchaseError"
	ReservationStatusCodeSplit                  ReservationStatusCode = "Split"
	ReservationStatusCodeSucceeded              ReservationStatusCode = "Succeeded"
)

func PossibleReservationStatusCodeValues

func PossibleReservationStatusCodeValues() []ReservationStatusCode

PossibleReservationStatusCodeValues returns the possible values for the ReservationStatusCode const type.

type ReservationSummary

type ReservationSummary struct {
	// READ-ONLY; The number of reservation in Cancelled state
	CancelledCount *float32

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

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

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

	// READ-ONLY; The number of reservation in NoBenefit state
	NoBenefitCount *float32

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

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

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

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

ReservationSummary - The roll up count summary of reservations in each state

func (ReservationSummary) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ReservationSummary.

func (*ReservationSummary) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ReservationSummary.

type ReservationSwapProperties

type ReservationSwapProperties struct {
	// Reservation resource id that the original resource gets swapped to. Format of the resource id is /providers/microsoft.capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}
	SwapDestination *string

	// Resource id of the source reservation that gets swapped. Format of the resource id is /providers/microsoft.capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}
	SwapSource *string
}

ReservationSwapProperties - Properties of reservation swap

func (ReservationSwapProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ReservationSwapProperties.

func (*ReservationSwapProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ReservationSwapProperties.

type ReservationTerm

type ReservationTerm string

ReservationTerm - Represent the term of reservation.

const (
	ReservationTermP1Y ReservationTerm = "P1Y"
	ReservationTermP3Y ReservationTerm = "P3Y"
	ReservationTermP5Y ReservationTerm = "P5Y"
)

func PossibleReservationTermValues

func PossibleReservationTermValues() []ReservationTerm

PossibleReservationTermValues returns the possible values for the ReservationTerm const type.

type ReservationToExchange

type ReservationToExchange struct {
	// billing information
	BillingInformation *BillingInformation

	// Pricing information containing the amount and the currency code
	BillingRefundAmount *Price

	// Quantity to be returned
	Quantity *int32

	// Fully qualified id of the reservation being returned.
	ReservationID *string
}

ReservationToExchange - Reservation refund details

func (ReservationToExchange) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ReservationToExchange.

func (*ReservationToExchange) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ReservationToExchange.

type ReservationToPurchaseCalculateExchange

type ReservationToPurchaseCalculateExchange struct {
	// Pricing information containing the amount and the currency code
	BillingCurrencyTotal *Price

	// The request for reservation purchase
	Properties *PurchaseRequest
}

ReservationToPurchaseCalculateExchange - Reservation purchase details

func (ReservationToPurchaseCalculateExchange) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ReservationToPurchaseCalculateExchange.

func (*ReservationToPurchaseCalculateExchange) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ReservationToPurchaseCalculateExchange.

type ReservationToPurchaseExchange

type ReservationToPurchaseExchange struct {
	// Pricing information containing the amount and the currency code
	BillingCurrencyTotal *Price

	// The request for reservation purchase
	Properties *PurchaseRequest

	// Fully qualified id of the reservation being purchased. This value is only guaranteed to be non-null if the purchase is
	// successful.
	ReservationID *string

	// Fully qualified id of the reservationOrder being purchased
	ReservationOrderID *string

	// Status of the individual operation.
	Status *OperationStatus
}

ReservationToPurchaseExchange - Reservation purchase details

func (ReservationToPurchaseExchange) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ReservationToPurchaseExchange.

func (*ReservationToPurchaseExchange) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ReservationToPurchaseExchange.

type ReservationToReturn

type ReservationToReturn struct {
	// Quantity to be returned. Must be greater than zero.
	Quantity *int32

	// Fully qualified identifier of the reservation being returned
	ReservationID *string
}

ReservationToReturn - Reservation to return

func (ReservationToReturn) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ReservationToReturn.

func (*ReservationToReturn) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ReservationToReturn.

type ReservationToReturnForExchange

type ReservationToReturnForExchange struct {
	// billing information
	BillingInformation *BillingInformation

	// Pricing information containing the amount and the currency code
	BillingRefundAmount *Price

	// Quantity to be returned
	Quantity *int32

	// Fully qualified id of the reservation being returned.
	ReservationID *string

	// Status of the individual operation.
	Status *OperationStatus
}

ReservationToReturnForExchange - Reservation refund details

func (ReservationToReturnForExchange) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ReservationToReturnForExchange.

func (*ReservationToReturnForExchange) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ReservationToReturnForExchange.

type ReservationUtilizationAggregates

type ReservationUtilizationAggregates 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
}

ReservationUtilizationAggregates - The aggregate values of reservation utilization

func (ReservationUtilizationAggregates) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ReservationUtilizationAggregates.

func (*ReservationUtilizationAggregates) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ReservationUtilizationAggregates.

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 Resource

type Resource struct {
	// READ-ONLY; Fully qualified resource ID for the resource. E.g. "/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
}

Resource - Common fields that are returned in the response for all Azure Resource Manager resources

func (Resource) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type Resource.

func (*Resource) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type Resource.

type ResourceName

type ResourceName struct {
	// Resource name.
	Value *string

	// READ-ONLY; Resource display localized name.
	LocalizedValue *string
}

ResourceName - Resource name provided by the resource provider. Use this property for quotaRequest parameter.

func (ResourceName) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ResourceName.

func (*ResourceName) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ResourceName.

type ResourceType

type ResourceType string

ResourceType - The resource types.

const (
	ResourceTypeDedicated       ResourceType = "dedicated"
	ResourceTypeLowPriority     ResourceType = "lowPriority"
	ResourceTypeServiceSpecific ResourceType = "serviceSpecific"
	ResourceTypeShared          ResourceType = "shared"
	ResourceTypeStandard        ResourceType = "standard"
)

func PossibleResourceTypeValues

func PossibleResourceTypeValues() []ResourceType

PossibleResourceTypeValues returns the possible values for the ResourceType const type.

type ReturnClient

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

ReturnClient contains the methods for the Return group. Don't use this type directly, use NewReturnClient() instead.

func NewReturnClient

func NewReturnClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*ReturnClient, error)

NewReturnClient creates a new instance of ReturnClient with the specified values.

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

func (*ReturnClient) BeginPost

func (client *ReturnClient) BeginPost(ctx context.Context, reservationOrderID string, body RefundRequest, options *ReturnClientBeginPostOptions) (*runtime.Poller[ReturnClientPostResponse], error)

BeginPost - Return a reservation and get refund information. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-11-01

  • reservationOrderID - Order Id of the reservation
  • body - Information needed for returning reservation.
  • options - ReturnClientBeginPostOptions contains the optional parameters for the ReturnClient.BeginPost method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-11-01/examples/Return.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armreservations.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewReturnClient().BeginPost(ctx, "50000000-aaaa-bbbb-cccc-100000000004", armreservations.RefundRequest{
	Properties: &armreservations.RefundRequestProperties{
		ReservationToReturn: &armreservations.ReservationToReturn{
			Quantity:      to.Ptr[int32](1),
			ReservationID: to.Ptr("/providers/microsoft.capacity/reservationOrders/50000000-aaaa-bbbb-cccc-100000000004/reservations/40000000-aaaa-bbbb-cccc-100000000000"),
		},
		ReturnReason: to.Ptr("PurchasedWrongProduct"),
		Scope:        to.Ptr("Reservation"),
		SessionID:    to.Ptr("10000000-aaaa-bbbb-cccc-200000000000"),
	},
}, 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.ReservationOrderResponse = armreservations.ReservationOrderResponse{
// 	Name: to.Ptr("50000000-aaaa-bbbb-cccc-100000000004"),
// 	Type: to.Ptr("Microsoft.Capacity/reservationOrders"),
// 	Etag: to.Ptr[int32](7),
// 	ID: to.Ptr("/providers/microsoft.capacity/reservationOrders/50000000-aaaa-bbbb-cccc-100000000004"),
// 	Properties: &armreservations.ReservationOrderProperties{
// 		BillingPlan: to.Ptr(armreservations.ReservationBillingPlanMonthly),
// 		CreatedDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-30T03:51:49.808Z"); return t}()),
// 		DisplayName: to.Ptr("cabri"),
// 		ExpiryDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2018-08-30"); return t}()),
// 		ExpiryDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-08-30T03:51:49.808Z"); return t}()),
// 		OriginalQuantity: to.Ptr[int32](7),
// 		ProvisioningState: to.Ptr(armreservations.ProvisioningStateSucceeded),
// 		RequestDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-30T03:49:19.025Z"); return t}()),
// 		Reservations: []*armreservations.ReservationResponse{
// 			{
// 				ID: to.Ptr("/providers/microsoft.capacity/reservationOrders/50000000-aaaa-bbbb-cccc-100000000004/reservations/40000000-aaaa-bbbb-cccc-100000000000"),
// 		}},
// 		Term: to.Ptr(armreservations.ReservationTermP1Y),
// 	},
// }
Output:

type ReturnClientBeginPostOptions

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

ReturnClientBeginPostOptions contains the optional parameters for the ReturnClient.BeginPost method.

type ReturnClientPostResponse

type ReturnClientPostResponse struct {
	// Details of a reservation order being returned.
	ReservationOrderResponse
}

ReturnClientPostResponse contains the response from method ReturnClient.BeginPost.

type SKUCapability

type SKUCapability struct {
	// An invariant to describe the feature.
	Name *string

	// An invariant if the feature is measured by quantity.
	Value *string
}

SKUCapability - Capability of a sku.

func (SKUCapability) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SKUCapability.

func (*SKUCapability) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type SKUCapability.

type SKUName

type SKUName struct {
	Name *string
}

SKUName - The name of sku

func (SKUName) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SKUName.

func (*SKUName) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type SKUName.

type SKUProperty

type SKUProperty struct {
	// An invariant to describe the feature.
	Name *string

	// An invariant if the feature is measured by quantity.
	Value *string
}

SKUProperty - Property of a sku.

func (SKUProperty) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SKUProperty.

func (*SKUProperty) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type SKUProperty.

type SKURestriction

type SKURestriction struct {
	// The reason for restriction.
	ReasonCode *string

	// The type of restrictions.
	Type *string

	// The value of restrictions. If the restriction type is set to location. This would be different locations where the sku
	// is restricted.
	Values []*string
}

SKURestriction - Restriction of a sku.

func (SKURestriction) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SKURestriction.

func (*SKURestriction) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type SKURestriction.

type SavingsPlanPurchaseRequest

type SavingsPlanPurchaseRequest struct {
	// Properties of a savings plan purchase
	Properties *SavingsPlanPurchaseRequestProperties

	// The name of sku
	SKU *SKUName
}

SavingsPlanPurchaseRequest - Request body for savings plan purchase

func (SavingsPlanPurchaseRequest) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SavingsPlanPurchaseRequest.

func (*SavingsPlanPurchaseRequest) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type SavingsPlanPurchaseRequest.

type SavingsPlanPurchaseRequestProperties

type SavingsPlanPurchaseRequestProperties struct {
	// Properties specific to applied scope type. Not required if not applicable. Required and need to provide tenantId and managementGroupId
	// if AppliedScopeType is ManagementGroup
	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 reservation or savings plan
	BillingScopeID *string

	// Commitment towards the benefit.
	Commitment *Commitment

	// Friendly name of the savings plan
	DisplayName *string

	// Represent savings plan term in ISO 8601 format.
	Term *SavingsPlanTerm
}

SavingsPlanPurchaseRequestProperties - Properties of a savings plan purchase

func (SavingsPlanPurchaseRequestProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SavingsPlanPurchaseRequestProperties.

func (*SavingsPlanPurchaseRequestProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type SavingsPlanPurchaseRequestProperties.

type SavingsPlanTerm

type SavingsPlanTerm string

SavingsPlanTerm - Represent savings plan term in ISO 8601 format.

const (
	SavingsPlanTermP1Y SavingsPlanTerm = "P1Y"
	SavingsPlanTermP3Y SavingsPlanTerm = "P3Y"
)

func PossibleSavingsPlanTermValues

func PossibleSavingsPlanTermValues() []SavingsPlanTerm

PossibleSavingsPlanTermValues returns the possible values for the SavingsPlanTerm const type.

type SavingsPlanToPurchaseCalculateExchange

type SavingsPlanToPurchaseCalculateExchange struct {
	// Pricing information containing the amount and the currency code
	BillingCurrencyTotal *Price

	// Request body for savings plan purchase
	Properties *SavingsPlanPurchaseRequest
}

SavingsPlanToPurchaseCalculateExchange - Savings plan purchase details

func (SavingsPlanToPurchaseCalculateExchange) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SavingsPlanToPurchaseCalculateExchange.

func (*SavingsPlanToPurchaseCalculateExchange) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type SavingsPlanToPurchaseCalculateExchange.

type SavingsPlanToPurchaseExchange

type SavingsPlanToPurchaseExchange struct {
	// Pricing information containing the amount and the currency code
	BillingCurrencyTotal *Price

	// Request body for savings plan purchase
	Properties *SavingsPlanPurchaseRequest

	// Fully qualified id of the savings plan being purchased. This value is only guaranteed to be non-null if the purchase is
	// successful.
	SavingsPlanID *string

	// Fully qualified id of the savings plan order being purchased
	SavingsPlanOrderID *string

	// Status of the individual operation.
	Status *OperationStatus
}

SavingsPlanToPurchaseExchange - Savings plan purchase details

func (SavingsPlanToPurchaseExchange) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SavingsPlanToPurchaseExchange.

func (*SavingsPlanToPurchaseExchange) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type SavingsPlanToPurchaseExchange.

type ScopeProperties

type ScopeProperties struct {
	Scope *string
	Valid *bool
}

ScopeProperties - The scope and whether it is valid.

func (ScopeProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ScopeProperties.

func (*ScopeProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ScopeProperties.

type ServiceError

type ServiceError struct {
	// The error code.
	Code *string

	// The error message text.
	Message *string

	// READ-ONLY; The list of error details.
	Details []*ServiceErrorDetail
}

ServiceError - The API error details.

func (ServiceError) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ServiceError.

func (*ServiceError) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ServiceError.

type ServiceErrorDetail

type ServiceErrorDetail struct {
	// READ-ONLY; The error code.
	Code *string

	// READ-ONLY; The error message.
	Message *string
}

ServiceErrorDetail - The error details.

func (ServiceErrorDetail) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ServiceErrorDetail.

func (*ServiceErrorDetail) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ServiceErrorDetail.

type SplitProperties

type SplitProperties struct {
	// List of the quantities in the new reservations to create.
	Quantities []*int32

	// Resource id of the reservation to be split. Format of the resource id should be /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}
	ReservationID *string
}

SplitProperties - Properties for reservation split

func (SplitProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SplitProperties.

func (*SplitProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type SplitProperties.

type SplitRequest

type SplitRequest struct {
	// Properties for reservation split
	Properties *SplitProperties
}

SplitRequest - The request for reservation split

func (SplitRequest) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SplitRequest.

func (*SplitRequest) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type SplitRequest.

type SubRequest

type SubRequest struct {
	// The resource name.
	Name *ResourceName

	// The quota request status.
	ProvisioningState *QuotaRequestState

	// The limit units, such as count and bytes. Use the unit field provided in the response of the GET quota operation.
	Unit *string

	// READ-ONLY; Quota (resource limit).
	Limit *int32

	// READ-ONLY; User-friendly status message.
	Message *string

	// READ-ONLY; Resource type for which the quota check was made.
	ResourceType *string

	// READ-ONLY; Sub request ID for individual request.
	SubRequestID *string
}

SubRequest - The sub-request submitted with the quota request.

func (SubRequest) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SubRequest.

func (*SubRequest) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type SubRequest.

type SubscriptionScopeProperties

type SubscriptionScopeProperties struct {
	Scopes []*ScopeProperties
}

SubscriptionScopeProperties - The scopes checked by the available scope api.

func (SubscriptionScopeProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SubscriptionScopeProperties.

func (*SubscriptionScopeProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type SubscriptionScopeProperties.

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 UserFriendlyAppliedScopeType

type UserFriendlyAppliedScopeType string

UserFriendlyAppliedScopeType - The applied scope type

const (
	UserFriendlyAppliedScopeTypeManagementGroup UserFriendlyAppliedScopeType = "ManagementGroup"
	UserFriendlyAppliedScopeTypeNone            UserFriendlyAppliedScopeType = "None"
	UserFriendlyAppliedScopeTypeResourceGroup   UserFriendlyAppliedScopeType = "ResourceGroup"
	UserFriendlyAppliedScopeTypeShared          UserFriendlyAppliedScopeType = "Shared"
	UserFriendlyAppliedScopeTypeSingle          UserFriendlyAppliedScopeType = "Single"
)

func PossibleUserFriendlyAppliedScopeTypeValues

func PossibleUserFriendlyAppliedScopeTypeValues() []UserFriendlyAppliedScopeType

PossibleUserFriendlyAppliedScopeTypeValues returns the possible values for the UserFriendlyAppliedScopeType const type.

type UserFriendlyRenewState

type UserFriendlyRenewState string

UserFriendlyRenewState - The renew state of the reservation

const (
	UserFriendlyRenewStateNotApplicable UserFriendlyRenewState = "NotApplicable"
	UserFriendlyRenewStateNotRenewed    UserFriendlyRenewState = "NotRenewed"
	UserFriendlyRenewStateOff           UserFriendlyRenewState = "Off"
	UserFriendlyRenewStateOn            UserFriendlyRenewState = "On"
	UserFriendlyRenewStateRenewed       UserFriendlyRenewState = "Renewed"
)

func PossibleUserFriendlyRenewStateValues

func PossibleUserFriendlyRenewStateValues() []UserFriendlyRenewState

PossibleUserFriendlyRenewStateValues returns the possible values for the UserFriendlyRenewState const type.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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