Documentation ¶
Index ¶
- type ActionType
- type AppliedScopeProperties
- type AppliedScopeType
- type BillingPlan
- type BillingPlanInformation
- type Commitment
- type CommitmentGrain
- type CreatedByType
- type ExtendedStatusInfo
- type InstanceFlexibility
- type Operation
- type OperationDisplay
- type OperationListResult
- type OperationsClient
- type OperationsClientListOptions
- type OperationsClientListResponse
- type Origin
- type PaymentDetail
- type PaymentStatus
- type Price
- type ProvisioningState
- type PurchaseRequest
- type PurchaseRequestProperties
- type RPClient
- type RPClientValidatePurchaseOptions
- type RPClientValidatePurchaseResponse
- type RenewProperties
- type ReservationOrderAliasClient
- func (client *ReservationOrderAliasClient) BeginCreate(ctx context.Context, reservationOrderAliasName string, ...) (*runtime.Poller[ReservationOrderAliasClientCreateResponse], error)
- func (client *ReservationOrderAliasClient) Get(ctx context.Context, reservationOrderAliasName string, ...) (ReservationOrderAliasClientGetResponse, error)
- type ReservationOrderAliasClientBeginCreateOptions
- type ReservationOrderAliasClientCreateResponse
- type ReservationOrderAliasClientGetOptions
- type ReservationOrderAliasClientGetResponse
- type ReservationOrderAliasRequest
- type ReservationOrderAliasRequestProperties
- type ReservationOrderAliasRequestPropertiesReservedResourceProperties
- type ReservationOrderAliasResponse
- type ReservationOrderAliasResponseProperties
- type ReservationOrderAliasResponsePropertiesReservedResourceProperties
- type ReservedResourceType
- type RoleAssignmentEntity
- type RoleAssignmentEntityProperties
- type SKU
- type SavingsPlanClient
- func (client *SavingsPlanClient) Get(ctx context.Context, savingsPlanOrderID string, savingsPlanID string, ...) (SavingsPlanClientGetResponse, error)
- func (client *SavingsPlanClient) NewListAllPager(options *SavingsPlanClientListAllOptions) *runtime.Pager[SavingsPlanClientListAllResponse]
- func (client *SavingsPlanClient) NewListPager(savingsPlanOrderID string, options *SavingsPlanClientListOptions) *runtime.Pager[SavingsPlanClientListResponse]
- func (client *SavingsPlanClient) Update(ctx context.Context, savingsPlanOrderID string, savingsPlanID string, ...) (SavingsPlanClientUpdateResponse, error)
- func (client *SavingsPlanClient) ValidateUpdate(ctx context.Context, savingsPlanOrderID string, savingsPlanID string, ...) (SavingsPlanClientValidateUpdateResponse, error)
- type SavingsPlanClientGetOptions
- type SavingsPlanClientGetResponse
- type SavingsPlanClientListAllOptions
- type SavingsPlanClientListAllResponse
- type SavingsPlanClientListOptions
- type SavingsPlanClientListResponse
- type SavingsPlanClientUpdateOptions
- type SavingsPlanClientUpdateResponse
- type SavingsPlanClientValidateUpdateOptions
- type SavingsPlanClientValidateUpdateResponse
- type SavingsPlanModel
- type SavingsPlanModelList
- type SavingsPlanModelListResult
- type SavingsPlanModelProperties
- type SavingsPlanOrderAliasClient
- func (client *SavingsPlanOrderAliasClient) BeginCreate(ctx context.Context, savingsPlanOrderAliasName string, ...) (*runtime.Poller[SavingsPlanOrderAliasClientCreateResponse], error)
- func (client *SavingsPlanOrderAliasClient) Get(ctx context.Context, savingsPlanOrderAliasName string, ...) (SavingsPlanOrderAliasClientGetResponse, error)
- type SavingsPlanOrderAliasClientBeginCreateOptions
- type SavingsPlanOrderAliasClientCreateResponse
- type SavingsPlanOrderAliasClientGetOptions
- type SavingsPlanOrderAliasClientGetResponse
- type SavingsPlanOrderAliasModel
- type SavingsPlanOrderAliasProperties
- type SavingsPlanOrderClient
- func (client *SavingsPlanOrderClient) Elevate(ctx context.Context, savingsPlanOrderID string, ...) (SavingsPlanOrderClientElevateResponse, error)
- func (client *SavingsPlanOrderClient) Get(ctx context.Context, savingsPlanOrderID string, ...) (SavingsPlanOrderClientGetResponse, error)
- func (client *SavingsPlanOrderClient) NewListPager(options *SavingsPlanOrderClientListOptions) *runtime.Pager[SavingsPlanOrderClientListResponse]
- type SavingsPlanOrderClientElevateOptions
- type SavingsPlanOrderClientElevateResponse
- type SavingsPlanOrderClientGetOptions
- type SavingsPlanOrderClientGetResponse
- type SavingsPlanOrderClientListOptions
- type SavingsPlanOrderClientListResponse
- type SavingsPlanOrderModel
- type SavingsPlanOrderModelList
- type SavingsPlanOrderModelProperties
- type SavingsPlanPurchaseValidateRequest
- type SavingsPlanSummary
- type SavingsPlanSummaryCount
- type SavingsPlanUpdateRequest
- type SavingsPlanUpdateRequestProperties
- type SavingsPlanUpdateValidateRequest
- type SavingsPlanValidResponseProperty
- type SavingsPlanValidateResponse
- type SystemData
- type Term
- type Utilization
- type UtilizationAggregates
Examples ¶
- OperationsClient.NewListPager
- RPClient.ValidatePurchase
- ReservationOrderAliasClient.BeginCreate
- ReservationOrderAliasClient.Get
- SavingsPlanClient.Get (SavingsPlanItemGet)
- SavingsPlanClient.Get (SavingsPlanItemWithExpandedRenewPropertiesGet)
- SavingsPlanClient.NewListAllPager
- SavingsPlanClient.NewListPager
- SavingsPlanClient.Update
- SavingsPlanClient.ValidateUpdate
- SavingsPlanOrderAliasClient.BeginCreate (SavingsPlanOrderAliasCreate)
- SavingsPlanOrderAliasClient.BeginCreate (SavingsPlanOrderAliasCreateSingleScope)
- SavingsPlanOrderAliasClient.Get
- SavingsPlanOrderClient.Elevate
- SavingsPlanOrderClient.Get (SavingsPlanOrderGet)
- SavingsPlanOrderClient.Get (SavingsPlanOrderWithExpandedPaymentsGet)
- SavingsPlanOrderClient.NewListPager
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActionType ¶
type ActionType string
ActionType - Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs.
const (
ActionTypeInternal ActionType = "Internal"
)
func PossibleActionTypeValues ¶
func PossibleActionTypeValues() []ActionType
PossibleActionTypeValues returns the possible values for the ActionType const type.
type AppliedScopeProperties ¶
type AppliedScopeProperties struct { // Display name DisplayName *string `json:"displayName,omitempty"` // Fully-qualified identifier of the management group where the benefit must be applied. ManagementGroupID *string `json:"managementGroupId,omitempty"` // Fully-qualified identifier of the resource group. ResourceGroupID *string `json:"resourceGroupId,omitempty"` // Fully-qualified identifier of the subscription. SubscriptionID *string `json:"subscriptionId,omitempty"` // Tenant ID where the benefit is applied. TenantID *string `json:"tenantId,omitempty"` }
AppliedScopeProperties - Properties specific to applied scope type. Not required if not applicable.
func (AppliedScopeProperties) MarshalJSON ¶
func (a AppliedScopeProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type AppliedScopeProperties.
func (*AppliedScopeProperties) UnmarshalJSON ¶
func (a *AppliedScopeProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type AppliedScopeProperties.
type AppliedScopeType ¶
type AppliedScopeType string
AppliedScopeType - Type of the Applied Scope.
const ( AppliedScopeTypeManagementGroup AppliedScopeType = "ManagementGroup" AppliedScopeTypeSingle AppliedScopeType = "Single" )
func PossibleAppliedScopeTypeValues ¶
func PossibleAppliedScopeTypeValues() []AppliedScopeType
PossibleAppliedScopeTypeValues returns the possible values for the AppliedScopeType const type.
type BillingPlan ¶
type BillingPlan string
BillingPlan - Represents the billing plan in ISO 8601 format. Required only for monthly billing plans.
const (
BillingPlanP1M BillingPlan = "P1M"
)
func PossibleBillingPlanValues ¶
func PossibleBillingPlanValues() []BillingPlan
PossibleBillingPlanValues returns the possible values for the BillingPlan const type.
type BillingPlanInformation ¶
type BillingPlanInformation struct { // For recurring billing plans, indicates the date when next payment will be processed. Null when total is paid off. NextPaymentDueDate *time.Time `json:"nextPaymentDueDate,omitempty"` // Amount of money to be paid for the Order. Tax is not included. PricingCurrencyTotal *Price `json:"pricingCurrencyTotal,omitempty"` // Date when the billing plan has started. StartDate *time.Time `json:"startDate,omitempty"` Transactions []*PaymentDetail `json:"transactions,omitempty"` }
BillingPlanInformation - Information describing the type of billing plan for this savings plan.
func (BillingPlanInformation) MarshalJSON ¶
func (b BillingPlanInformation) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type BillingPlanInformation.
func (*BillingPlanInformation) UnmarshalJSON ¶
func (b *BillingPlanInformation) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type BillingPlanInformation.
type Commitment ¶
type Commitment struct { Amount *float64 `json:"amount,omitempty"` // The ISO 4217 3-letter currency code for the currency used by this purchase record. CurrencyCode *string `json:"currencyCode,omitempty"` // Commitment grain. Grain *CommitmentGrain `json:"grain,omitempty"` }
Commitment towards the benefit.
func (Commitment) MarshalJSON ¶
func (c Commitment) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type Commitment.
func (*Commitment) UnmarshalJSON ¶
func (c *Commitment) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type Commitment.
type CommitmentGrain ¶
type CommitmentGrain string
CommitmentGrain - Commitment grain.
const (
CommitmentGrainHourly CommitmentGrain = "Hourly"
)
func PossibleCommitmentGrainValues ¶
func PossibleCommitmentGrainValues() []CommitmentGrain
PossibleCommitmentGrainValues returns the possible values for the CommitmentGrain const type.
type CreatedByType ¶
type CreatedByType string
CreatedByType - The type of identity that created the resource.
const ( CreatedByTypeApplication CreatedByType = "Application" CreatedByTypeKey CreatedByType = "Key" CreatedByTypeManagedIdentity CreatedByType = "ManagedIdentity" CreatedByTypeUser CreatedByType = "User" )
func PossibleCreatedByTypeValues ¶
func PossibleCreatedByTypeValues() []CreatedByType
PossibleCreatedByTypeValues returns the possible values for the CreatedByType const type.
type ExtendedStatusInfo ¶
type ExtendedStatusInfo struct { // The message giving detailed information about the status code. Message *string `json:"message,omitempty"` // Status code providing additional information. StatusCode *string `json:"statusCode,omitempty"` }
func (ExtendedStatusInfo) MarshalJSON ¶
func (e ExtendedStatusInfo) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ExtendedStatusInfo.
func (*ExtendedStatusInfo) UnmarshalJSON ¶
func (e *ExtendedStatusInfo) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ExtendedStatusInfo.
type InstanceFlexibility ¶
type InstanceFlexibility string
InstanceFlexibility - Turning this on will apply the reservation discount to other VMs in the same VM size group.
const ( InstanceFlexibilityOff InstanceFlexibility = "Off" InstanceFlexibilityOn InstanceFlexibility = "On" )
func PossibleInstanceFlexibilityValues ¶
func PossibleInstanceFlexibilityValues() []InstanceFlexibility
PossibleInstanceFlexibilityValues returns the possible values for the InstanceFlexibility const type.
type Operation ¶
type Operation struct { // Localized display information for this particular operation. Display *OperationDisplay `json:"display,omitempty"` // READ-ONLY; Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. ActionType *ActionType `json:"actionType,omitempty" azure:"ro"` // READ-ONLY; Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for ARM/control-plane // operations. IsDataAction *bool `json:"isDataAction,omitempty" azure:"ro"` // READ-ONLY; The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write", // "Microsoft.Compute/virtualMachines/capture/action" Name *string `json:"name,omitempty" azure:"ro"` // READ-ONLY; The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default // value is "user,system" Origin *Origin `json:"origin,omitempty" azure:"ro"` }
Operation - Details of a REST API operation, returned from the Resource Provider Operations API
func (Operation) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface for type Operation.
func (*Operation) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaller interface for type Operation.
type OperationDisplay ¶
type OperationDisplay struct { // READ-ONLY; The short, localized friendly description of the operation; suitable for tool tips and detailed views. Description *string `json:"description,omitempty" azure:"ro"` // READ-ONLY; The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual // Machine", "Restart Virtual Machine". Operation *string `json:"operation,omitempty" azure:"ro"` // READ-ONLY; The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft // Compute". Provider *string `json:"provider,omitempty" azure:"ro"` // READ-ONLY; The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job // Schedule Collections". Resource *string `json:"resource,omitempty" azure:"ro"` }
OperationDisplay - Localized display information for this particular operation.
func (OperationDisplay) MarshalJSON ¶
func (o OperationDisplay) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type OperationDisplay.
func (*OperationDisplay) UnmarshalJSON ¶
func (o *OperationDisplay) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type OperationDisplay.
type OperationListResult ¶
type OperationListResult struct { // READ-ONLY; URL to get the next set of operation list results (if there are any). NextLink *string `json:"nextLink,omitempty" azure:"ro"` // READ-ONLY; List of operations supported by the resource provider Value []*Operation `json:"value,omitempty" azure:"ro"` }
OperationListResult - A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results.
func (OperationListResult) MarshalJSON ¶
func (o OperationListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type OperationListResult.
func (*OperationListResult) UnmarshalJSON ¶
func (o *OperationListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type OperationListResult.
type OperationsClient ¶
type OperationsClient struct {
// contains filtered or unexported fields
}
OperationsClient contains the methods for the Operations group. Don't use this type directly, use NewOperationsClient() instead.
func NewOperationsClient ¶
func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*OperationsClient, error)
NewOperationsClient creates a new instance of OperationsClient with the specified values. credential - used to authorize requests. Usually a credential from azidentity. options - pass nil to accept the default values.
func (*OperationsClient) NewListPager ¶
func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse]
NewListPager - List all the operations. Generated from API version 2022-11-01 options - OperationsClientListOptions contains the optional parameters for the OperationsClient.List method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/OperationsGet.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/billingbenefits/armbillingbenefits" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() client, err := armbillingbenefits.NewOperationsClient(cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := client.NewListPager(nil) for pager.More() { nextResult, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range nextResult.Value { // TODO: use page item _ = v } } }
Output:
type OperationsClientListOptions ¶
type OperationsClientListOptions struct { }
OperationsClientListOptions contains the optional parameters for the OperationsClient.List method.
type OperationsClientListResponse ¶
type OperationsClientListResponse struct {
OperationListResult
}
OperationsClientListResponse contains the response from method OperationsClient.List.
type Origin ¶
type Origin string
Origin - The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system"
func PossibleOriginValues ¶
func PossibleOriginValues() []Origin
PossibleOriginValues returns the possible values for the Origin const type.
type PaymentDetail ¶
type PaymentDetail struct { // Billing account BillingAccount *string `json:"billingAccount,omitempty"` // Amount charged in Billing currency. Tax not included. Is null for future payments BillingCurrencyTotal *Price `json:"billingCurrencyTotal,omitempty"` // Date when the payment needs to be done. DueDate *time.Time `json:"dueDate,omitempty"` // Date when the transaction is completed. Is null when it is scheduled. PaymentDate *time.Time `json:"paymentDate,omitempty"` // Amount in pricing currency. Tax not included. PricingCurrencyTotal *Price `json:"pricingCurrencyTotal,omitempty"` // Describes whether the payment is completed, failed, cancelled or scheduled in the future. Status *PaymentStatus `json:"status,omitempty"` // READ-ONLY ExtendedStatusInfo *ExtendedStatusInfo `json:"extendedStatusInfo,omitempty" azure:"ro"` }
PaymentDetail - Information about payment related to a savings plan order.
func (PaymentDetail) MarshalJSON ¶
func (p PaymentDetail) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type PaymentDetail.
func (*PaymentDetail) UnmarshalJSON ¶
func (p *PaymentDetail) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type PaymentDetail.
type PaymentStatus ¶
type PaymentStatus string
PaymentStatus - Describes whether the payment is completed, failed, cancelled or scheduled in the future.
const ( PaymentStatusCancelled PaymentStatus = "Cancelled" PaymentStatusFailed PaymentStatus = "Failed" PaymentStatusScheduled PaymentStatus = "Scheduled" PaymentStatusSucceeded PaymentStatus = "Succeeded" )
func PossiblePaymentStatusValues ¶
func PossiblePaymentStatusValues() []PaymentStatus
PossiblePaymentStatusValues returns the possible values for the PaymentStatus const type.
type Price ¶
type Price struct { Amount *float64 `json:"amount,omitempty"` // The ISO 4217 3-letter currency code for the currency used by this purchase record. CurrencyCode *string `json:"currencyCode,omitempty"` }
func (Price) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface for type Price.
func (*Price) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaller interface for type Price.
type ProvisioningState ¶
type ProvisioningState string
ProvisioningState - Provisioning state
const ( ProvisioningStateCancelled ProvisioningState = "Cancelled" ProvisioningStateConfirmedBilling ProvisioningState = "ConfirmedBilling" ProvisioningStateCreated ProvisioningState = "Created" ProvisioningStateCreating ProvisioningState = "Creating" ProvisioningStateExpired ProvisioningState = "Expired" ProvisioningStateFailed ProvisioningState = "Failed" ProvisioningStatePendingBilling ProvisioningState = "PendingBilling" ProvisioningStateSucceeded ProvisioningState = "Succeeded" )
func PossibleProvisioningStateValues ¶
func PossibleProvisioningStateValues() []ProvisioningState
PossibleProvisioningStateValues returns the possible values for the ProvisioningState const type.
type PurchaseRequest ¶
type PurchaseRequest struct { Properties *PurchaseRequestProperties `json:"properties,omitempty"` // The SKU to be applied for this resource SKU *SKU `json:"sku,omitempty"` }
func (PurchaseRequest) MarshalJSON ¶
func (p PurchaseRequest) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type PurchaseRequest.
func (*PurchaseRequest) UnmarshalJSON ¶
func (p *PurchaseRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type PurchaseRequest.
type PurchaseRequestProperties ¶
type PurchaseRequestProperties struct { // Properties specific to applied scope type. Not required if not applicable. AppliedScopeProperties *AppliedScopeProperties `json:"appliedScopeProperties,omitempty"` // Type of the Applied Scope. AppliedScopeType *AppliedScopeType `json:"appliedScopeType,omitempty"` // Represents the billing plan in ISO 8601 format. Required only for monthly billing plans. BillingPlan *BillingPlan `json:"billingPlan,omitempty"` // Subscription that will be charged for purchasing the benefit BillingScopeID *string `json:"billingScopeId,omitempty"` // Commitment towards the benefit. Commitment *Commitment `json:"commitment,omitempty"` // Friendly name of the savings plan DisplayName *string `json:"displayName,omitempty"` // Setting this to true will automatically purchase a new benefit on the expiration date time. Renew *bool `json:"renew,omitempty"` // Represent benefit term in ISO 8601 format. Term *Term `json:"term,omitempty"` // READ-ONLY; DateTime of the savings plan starts providing benefit from. EffectiveDateTime *time.Time `json:"effectiveDateTime,omitempty" azure:"ro"` }
func (PurchaseRequestProperties) MarshalJSON ¶
func (p PurchaseRequestProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type PurchaseRequestProperties.
func (*PurchaseRequestProperties) UnmarshalJSON ¶
func (p *PurchaseRequestProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type PurchaseRequestProperties.
type RPClient ¶
type RPClient struct {
// contains filtered or unexported fields
}
RPClient contains the methods for the BillingBenefitsRP group. Don't use this type directly, use NewRPClient() instead.
func NewRPClient ¶
func NewRPClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*RPClient, error)
NewRPClient creates a new instance of RPClient with the specified values. credential - used to authorize requests. Usually a credential from azidentity. options - pass nil to accept the default values.
func (*RPClient) ValidatePurchase ¶
func (client *RPClient) ValidatePurchase(ctx context.Context, body SavingsPlanPurchaseValidateRequest, options *RPClientValidatePurchaseOptions) (RPClientValidatePurchaseResponse, error)
ValidatePurchase - Validate savings plan purchase. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2022-11-01 body - Request body for validating the purchase of a savings plan options - RPClientValidatePurchaseOptions contains the optional parameters for the RPClient.ValidatePurchase method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/SavingsPlanValidatePurchase.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/billingbenefits/armbillingbenefits" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() client, err := armbillingbenefits.NewRPClient(cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := client.ValidatePurchase(ctx, armbillingbenefits.SavingsPlanPurchaseValidateRequest{ Benefits: []*armbillingbenefits.SavingsPlanOrderAliasModel{ { Properties: &armbillingbenefits.SavingsPlanOrderAliasProperties{ AppliedScopeProperties: &armbillingbenefits.AppliedScopeProperties{ ResourceGroupID: to.Ptr("/subscriptions/10000000-0000-0000-0000-000000000000/resourceGroups/testrg"), }, AppliedScopeType: to.Ptr(armbillingbenefits.AppliedScopeTypeSingle), BillingScopeID: to.Ptr("/subscriptions/10000000-0000-0000-0000-000000000000"), Commitment: &armbillingbenefits.Commitment{ Amount: to.Ptr[float64](15.23), CurrencyCode: to.Ptr("USD"), Grain: to.Ptr(armbillingbenefits.CommitmentGrainHourly), }, DisplayName: to.Ptr("ComputeSavingsPlan_2021-07-01"), Term: to.Ptr(armbillingbenefits.TermP1Y), }, SKU: &armbillingbenefits.SKU{ Name: to.Ptr("Compute_Savings_Plan"), }, }, { Properties: &armbillingbenefits.SavingsPlanOrderAliasProperties{ AppliedScopeProperties: &armbillingbenefits.AppliedScopeProperties{ ResourceGroupID: to.Ptr("/subscriptions/10000000-0000-0000-0000-000000000000/resourceGroups/RG"), }, AppliedScopeType: to.Ptr(armbillingbenefits.AppliedScopeTypeSingle), BillingScopeID: to.Ptr("/subscriptions/10000000-0000-0000-0000-000000000000"), Commitment: &armbillingbenefits.Commitment{ Amount: to.Ptr[float64](20), CurrencyCode: to.Ptr("USD"), Grain: to.Ptr(armbillingbenefits.CommitmentGrainHourly), }, DisplayName: to.Ptr("ComputeSavingsPlan_2021-07-01"), Term: to.Ptr(armbillingbenefits.TermP1Y), }, SKU: &armbillingbenefits.SKU{ Name: to.Ptr("Compute_Savings_Plan"), }, }}, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // TODO: use response item _ = res }
Output:
type RPClientValidatePurchaseOptions ¶
type RPClientValidatePurchaseOptions struct { }
RPClientValidatePurchaseOptions contains the optional parameters for the RPClient.ValidatePurchase method.
type RPClientValidatePurchaseResponse ¶
type RPClientValidatePurchaseResponse struct {
SavingsPlanValidateResponse
}
RPClientValidatePurchaseResponse contains the response from method RPClient.ValidatePurchase.
type RenewProperties ¶
type RenewProperties struct {
PurchaseProperties *PurchaseRequest `json:"purchaseProperties,omitempty"`
}
func (RenewProperties) MarshalJSON ¶
func (r RenewProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RenewProperties.
func (*RenewProperties) UnmarshalJSON ¶
func (r *RenewProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RenewProperties.
type ReservationOrderAliasClient ¶
type ReservationOrderAliasClient struct {
// contains filtered or unexported fields
}
ReservationOrderAliasClient contains the methods for the ReservationOrderAlias group. Don't use this type directly, use NewReservationOrderAliasClient() instead.
func NewReservationOrderAliasClient ¶
func NewReservationOrderAliasClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*ReservationOrderAliasClient, error)
NewReservationOrderAliasClient creates a new instance of ReservationOrderAliasClient with the specified values. credential - used to authorize requests. Usually a credential from azidentity. options - pass nil to accept the default values.
func (*ReservationOrderAliasClient) BeginCreate ¶
func (client *ReservationOrderAliasClient) BeginCreate(ctx context.Context, reservationOrderAliasName string, body ReservationOrderAliasRequest, options *ReservationOrderAliasClientBeginCreateOptions) (*runtime.Poller[ReservationOrderAliasClientCreateResponse], error)
BeginCreate - Create a reservation order alias. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2022-11-01 reservationOrderAliasName - Name of the reservation order alias body - Request body for creating a reservation order alias options - ReservationOrderAliasClientBeginCreateOptions contains the optional parameters for the ReservationOrderAliasClient.BeginCreate method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/ReservationOrderAliasCreate.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/billingbenefits/armbillingbenefits" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() client, err := armbillingbenefits.NewReservationOrderAliasClient(cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := client.BeginCreate(ctx, "reservationOrderAlias123", armbillingbenefits.ReservationOrderAliasRequest{ Location: to.Ptr("eastus"), Properties: &armbillingbenefits.ReservationOrderAliasRequestProperties{ AppliedScopeProperties: &armbillingbenefits.AppliedScopeProperties{ ResourceGroupID: to.Ptr("/subscriptions/10000000-0000-0000-0000-000000000000/resourceGroups/testrg"), }, AppliedScopeType: to.Ptr(armbillingbenefits.AppliedScopeTypeSingle), BillingPlan: to.Ptr(armbillingbenefits.BillingPlanP1M), BillingScopeID: to.Ptr("/subscriptions/10000000-0000-0000-0000-000000000000"), DisplayName: to.Ptr("ReservationOrder_2022-06-02"), Quantity: to.Ptr[int32](5), Renew: to.Ptr(true), ReservedResourceProperties: &armbillingbenefits.ReservationOrderAliasRequestPropertiesReservedResourceProperties{ InstanceFlexibility: to.Ptr(armbillingbenefits.InstanceFlexibilityOn), }, ReservedResourceType: to.Ptr(armbillingbenefits.ReservedResourceTypeVirtualMachines), Term: to.Ptr(armbillingbenefits.TermP1Y), }, SKU: &armbillingbenefits.SKU{ Name: to.Ptr("Standard_M64s_v2"), }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // TODO: use response item _ = res }
Output:
func (*ReservationOrderAliasClient) Get ¶
func (client *ReservationOrderAliasClient) Get(ctx context.Context, reservationOrderAliasName string, options *ReservationOrderAliasClientGetOptions) (ReservationOrderAliasClientGetResponse, error)
Get - Get a reservation order alias. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2022-11-01 reservationOrderAliasName - Name of the reservation order alias options - ReservationOrderAliasClientGetOptions contains the optional parameters for the ReservationOrderAliasClient.Get method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/ReservationOrderAliasGet.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/billingbenefits/armbillingbenefits" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() client, err := armbillingbenefits.NewReservationOrderAliasClient(cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := client.Get(ctx, "reservationOrderAlias123", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // TODO: use response item _ = res }
Output:
type ReservationOrderAliasClientBeginCreateOptions ¶
type ReservationOrderAliasClientBeginCreateOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
ReservationOrderAliasClientBeginCreateOptions contains the optional parameters for the ReservationOrderAliasClient.BeginCreate method.
type ReservationOrderAliasClientCreateResponse ¶
type ReservationOrderAliasClientCreateResponse struct {
ReservationOrderAliasResponse
}
ReservationOrderAliasClientCreateResponse contains the response from method ReservationOrderAliasClient.Create.
type ReservationOrderAliasClientGetOptions ¶
type ReservationOrderAliasClientGetOptions struct { }
ReservationOrderAliasClientGetOptions contains the optional parameters for the ReservationOrderAliasClient.Get method.
type ReservationOrderAliasClientGetResponse ¶
type ReservationOrderAliasClientGetResponse struct {
ReservationOrderAliasResponse
}
ReservationOrderAliasClientGetResponse contains the response from method ReservationOrderAliasClient.Get.
type ReservationOrderAliasRequest ¶
type ReservationOrderAliasRequest struct { // REQUIRED; Reservation order SKU SKU *SKU `json:"sku,omitempty"` // The Azure Region where the reservation benefits are applied to. Location *string `json:"location,omitempty"` // Reservation order alias request properties Properties *ReservationOrderAliasRequestProperties `json:"properties,omitempty"` // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty" azure:"ro"` // READ-ONLY; The name of the resource Name *string `json:"name,omitempty" azure:"ro"` // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty" azure:"ro"` }
ReservationOrderAliasRequest - Reservation order alias
func (ReservationOrderAliasRequest) MarshalJSON ¶
func (r ReservationOrderAliasRequest) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ReservationOrderAliasRequest.
func (*ReservationOrderAliasRequest) UnmarshalJSON ¶
func (r *ReservationOrderAliasRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ReservationOrderAliasRequest.
type ReservationOrderAliasRequestProperties ¶
type ReservationOrderAliasRequestProperties struct { // Properties specific to applied scope type. Not required if not applicable. AppliedScopeProperties *AppliedScopeProperties `json:"appliedScopeProperties,omitempty"` // Type of the Applied Scope. AppliedScopeType *AppliedScopeType `json:"appliedScopeType,omitempty"` // Represents the billing plan in ISO 8601 format. Required only for monthly billing plans. BillingPlan *BillingPlan `json:"billingPlan,omitempty"` // Subscription that will be charged for purchasing the benefit BillingScopeID *string `json:"billingScopeId,omitempty"` // Display name DisplayName *string `json:"displayName,omitempty"` // Total Quantity of the SKUs purchased in the Reservation. Quantity *int32 `json:"quantity,omitempty"` // Setting this to true will automatically purchase a new benefit on the expiration date time. Renew *bool `json:"renew,omitempty"` // Properties specific to each reserved resource type. Not required if not applicable. ReservedResourceProperties *ReservationOrderAliasRequestPropertiesReservedResourceProperties `json:"reservedResourceProperties,omitempty"` // The type of the resource that is being reserved. ReservedResourceType *ReservedResourceType `json:"reservedResourceType,omitempty"` // This is the date-time when the Azure Hybrid Benefit needs to be reviewed. ReviewDateTime *time.Time `json:"reviewDateTime,omitempty"` // Represent benefit term in ISO 8601 format. Term *Term `json:"term,omitempty"` }
ReservationOrderAliasRequestProperties - Reservation properties
func (ReservationOrderAliasRequestProperties) MarshalJSON ¶
func (r ReservationOrderAliasRequestProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ReservationOrderAliasRequestProperties.
func (*ReservationOrderAliasRequestProperties) UnmarshalJSON ¶
func (r *ReservationOrderAliasRequestProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ReservationOrderAliasRequestProperties.
type ReservationOrderAliasRequestPropertiesReservedResourceProperties ¶
type ReservationOrderAliasRequestPropertiesReservedResourceProperties struct { // Turning this on will apply the reservation discount to other VMs in the same VM size group. InstanceFlexibility *InstanceFlexibility `json:"instanceFlexibility,omitempty"` }
ReservationOrderAliasRequestPropertiesReservedResourceProperties - Properties specific to each reserved resource type. Not required if not applicable.
func (ReservationOrderAliasRequestPropertiesReservedResourceProperties) MarshalJSON ¶
func (r ReservationOrderAliasRequestPropertiesReservedResourceProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ReservationOrderAliasRequestPropertiesReservedResourceProperties.
func (*ReservationOrderAliasRequestPropertiesReservedResourceProperties) UnmarshalJSON ¶
func (r *ReservationOrderAliasRequestPropertiesReservedResourceProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ReservationOrderAliasRequestPropertiesReservedResourceProperties.
type ReservationOrderAliasResponse ¶
type ReservationOrderAliasResponse struct { // REQUIRED; Reservation order SKU SKU *SKU `json:"sku,omitempty"` // The Azure Region where the reserved resource lives. Location *string `json:"location,omitempty"` // Reservation order alias response properties Properties *ReservationOrderAliasResponseProperties `json:"properties,omitempty"` // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty" azure:"ro"` // READ-ONLY; The name of the resource Name *string `json:"name,omitempty" azure:"ro"` // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty" azure:"ro"` }
ReservationOrderAliasResponse - Reservation order alias
func (ReservationOrderAliasResponse) MarshalJSON ¶
func (r ReservationOrderAliasResponse) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ReservationOrderAliasResponse.
func (*ReservationOrderAliasResponse) UnmarshalJSON ¶
func (r *ReservationOrderAliasResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ReservationOrderAliasResponse.
type ReservationOrderAliasResponseProperties ¶
type ReservationOrderAliasResponseProperties struct { // Properties specific to applied scope type. Not required if not applicable. AppliedScopeProperties *AppliedScopeProperties `json:"appliedScopeProperties,omitempty"` // Type of the Applied Scope. AppliedScopeType *AppliedScopeType `json:"appliedScopeType,omitempty"` // Represents the billing plan in ISO 8601 format. Required only for monthly billing plans. BillingPlan *BillingPlan `json:"billingPlan,omitempty"` // Subscription that will be charged for purchasing the benefit BillingScopeID *string `json:"billingScopeId,omitempty"` // Display name DisplayName *string `json:"displayName,omitempty"` // Total Quantity of the SKUs purchased in the Reservation. Quantity *int32 `json:"quantity,omitempty"` // Setting this to true will automatically purchase a new benefit on the expiration date time. Renew *bool `json:"renew,omitempty"` // Properties specific to each reserved resource type. Not required if not applicable. ReservedResourceProperties *ReservationOrderAliasResponsePropertiesReservedResourceProperties `json:"reservedResourceProperties,omitempty"` // The type of the resource that is being reserved. ReservedResourceType *ReservedResourceType `json:"reservedResourceType,omitempty"` // This is the date-time when the Reservation needs to be reviewed. ReviewDateTime *time.Time `json:"reviewDateTime,omitempty"` // Represent benefit term in ISO 8601 format. Term *Term `json:"term,omitempty"` // READ-ONLY; Provisioning state ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` // READ-ONLY; Identifier of the reservation order created ReservationOrderID *string `json:"reservationOrderId,omitempty" azure:"ro"` }
ReservationOrderAliasResponseProperties - Reservation properties
func (ReservationOrderAliasResponseProperties) MarshalJSON ¶
func (r ReservationOrderAliasResponseProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ReservationOrderAliasResponseProperties.
func (*ReservationOrderAliasResponseProperties) UnmarshalJSON ¶
func (r *ReservationOrderAliasResponseProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ReservationOrderAliasResponseProperties.
type ReservationOrderAliasResponsePropertiesReservedResourceProperties ¶
type ReservationOrderAliasResponsePropertiesReservedResourceProperties struct { // Turning this on will apply the reservation discount to other VMs in the same VM size group. InstanceFlexibility *InstanceFlexibility `json:"instanceFlexibility,omitempty"` }
ReservationOrderAliasResponsePropertiesReservedResourceProperties - Properties specific to each reserved resource type. Not required if not applicable.
func (ReservationOrderAliasResponsePropertiesReservedResourceProperties) MarshalJSON ¶
func (r ReservationOrderAliasResponsePropertiesReservedResourceProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ReservationOrderAliasResponsePropertiesReservedResourceProperties.
func (*ReservationOrderAliasResponsePropertiesReservedResourceProperties) UnmarshalJSON ¶
func (r *ReservationOrderAliasResponsePropertiesReservedResourceProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ReservationOrderAliasResponsePropertiesReservedResourceProperties.
type ReservedResourceType ¶
type ReservedResourceType string
ReservedResourceType - The type of the resource that is being reserved.
const ( ReservedResourceTypeAVS ReservedResourceType = "AVS" ReservedResourceTypeAppService ReservedResourceType = "AppService" ReservedResourceTypeAzureDataExplorer ReservedResourceType = "AzureDataExplorer" ReservedResourceTypeAzureFiles ReservedResourceType = "AzureFiles" ReservedResourceTypeBlockBlob ReservedResourceType = "BlockBlob" ReservedResourceTypeCosmosDb ReservedResourceType = "CosmosDb" ReservedResourceTypeDataFactory ReservedResourceType = "DataFactory" ReservedResourceTypeDatabricks ReservedResourceType = "Databricks" ReservedResourceTypeDedicatedHost ReservedResourceType = "DedicatedHost" ReservedResourceTypeManagedDisk ReservedResourceType = "ManagedDisk" ReservedResourceTypeMariaDb ReservedResourceType = "MariaDb" ReservedResourceTypeMySQL ReservedResourceType = "MySql" ReservedResourceTypeNetAppStorage ReservedResourceType = "NetAppStorage" ReservedResourceTypePostgreSQL ReservedResourceType = "PostgreSql" ReservedResourceTypeRedHat ReservedResourceType = "RedHat" ReservedResourceTypeRedHatOsa ReservedResourceType = "RedHatOsa" ReservedResourceTypeRedisCache ReservedResourceType = "RedisCache" ReservedResourceTypeSQLAzureHybridBenefit ReservedResourceType = "SqlAzureHybridBenefit" ReservedResourceTypeSQLDataWarehouse ReservedResourceType = "SqlDataWarehouse" ReservedResourceTypeSQLDatabases ReservedResourceType = "SqlDatabases" ReservedResourceTypeSQLEdge ReservedResourceType = "SqlEdge" ReservedResourceTypeSapHana ReservedResourceType = "SapHana" ReservedResourceTypeSuseLinux ReservedResourceType = "SuseLinux" ReservedResourceTypeVMwareCloudSimple ReservedResourceType = "VMwareCloudSimple" ReservedResourceTypeVirtualMachineSoftware ReservedResourceType = "VirtualMachineSoftware" ReservedResourceTypeVirtualMachines ReservedResourceType = "VirtualMachines" )
func PossibleReservedResourceTypeValues ¶
func PossibleReservedResourceTypeValues() []ReservedResourceType
PossibleReservedResourceTypeValues returns the possible values for the ReservedResourceType const type.
type RoleAssignmentEntity ¶
type RoleAssignmentEntity struct { // Role assignment entity id ID *string `json:"id,omitempty"` // Role assignment entity name Name *string `json:"name,omitempty"` // Role assignment entity properties Properties *RoleAssignmentEntityProperties `json:"properties,omitempty"` }
RoleAssignmentEntity - Role assignment entity
func (RoleAssignmentEntity) MarshalJSON ¶
func (r RoleAssignmentEntity) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RoleAssignmentEntity.
func (*RoleAssignmentEntity) UnmarshalJSON ¶
func (r *RoleAssignmentEntity) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RoleAssignmentEntity.
type RoleAssignmentEntityProperties ¶
type RoleAssignmentEntityProperties struct { // Principal Id PrincipalID *string `json:"principalId,omitempty"` // Role definition id RoleDefinitionID *string `json:"roleDefinitionId,omitempty"` // Scope of the role assignment entity Scope *string `json:"scope,omitempty"` }
RoleAssignmentEntityProperties - Role assignment entity properties
func (RoleAssignmentEntityProperties) MarshalJSON ¶
func (r RoleAssignmentEntityProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RoleAssignmentEntityProperties.
func (*RoleAssignmentEntityProperties) UnmarshalJSON ¶
func (r *RoleAssignmentEntityProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RoleAssignmentEntityProperties.
type SKU ¶
type SKU struct { // Name of the SKU to be applied Name *string `json:"name,omitempty"` }
SKU - The SKU to be applied for this resource
func (SKU) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface for type SKU.
func (*SKU) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaller interface for type SKU.
type SavingsPlanClient ¶
type SavingsPlanClient struct {
// contains filtered or unexported fields
}
SavingsPlanClient contains the methods for the SavingsPlan group. Don't use this type directly, use NewSavingsPlanClient() instead.
func NewSavingsPlanClient ¶
func NewSavingsPlanClient(expand *string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SavingsPlanClient, error)
NewSavingsPlanClient creates a new instance of SavingsPlanClient with the specified values. expand - May be used to expand the detail information of some properties. credential - used to authorize requests. Usually a credential from azidentity. options - pass nil to accept the default values.
func (*SavingsPlanClient) Get ¶
func (client *SavingsPlanClient) Get(ctx context.Context, savingsPlanOrderID string, savingsPlanID string, options *SavingsPlanClientGetOptions) (SavingsPlanClientGetResponse, error)
Get - Get savings plan. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2022-11-01 savingsPlanOrderID - Order ID of the savings plan savingsPlanID - ID of the savings plan options - SavingsPlanClientGetOptions contains the optional parameters for the SavingsPlanClient.Get method.
Example (SavingsPlanItemGet) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/SavingsPlanItemGet.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/billingbenefits/armbillingbenefits" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() client, err := armbillingbenefits.NewSavingsPlanClient(nil, cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := client.Get(ctx, "20000000-0000-0000-0000-000000000000", "30000000-0000-0000-0000-000000000000", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // TODO: use response item _ = res }
Output:
Example (SavingsPlanItemWithExpandedRenewPropertiesGet) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/SavingsPlanItemExpandedGet.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/billingbenefits/armbillingbenefits" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() client, err := armbillingbenefits.NewSavingsPlanClient(to.Ptr("renewProperties"), cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := client.Get(ctx, "20000000-0000-0000-0000-000000000000", "30000000-0000-0000-0000-000000000000", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // TODO: use response item _ = res }
Output:
func (*SavingsPlanClient) NewListAllPager ¶
func (client *SavingsPlanClient) NewListAllPager(options *SavingsPlanClientListAllOptions) *runtime.Pager[SavingsPlanClientListAllResponse]
NewListAllPager - List savings plans. Generated from API version 2022-11-01 options - SavingsPlanClientListAllOptions contains the optional parameters for the SavingsPlanClient.ListAll method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/SavingsPlansList.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/billingbenefits/armbillingbenefits" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() client, err := armbillingbenefits.NewSavingsPlanClient(nil, cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := client.NewListAllPager(&armbillingbenefits.SavingsPlanClientListAllOptions{Filter: to.Ptr("(properties%2farchived+eq+false)"), Orderby: to.Ptr("properties/displayName asc"), RefreshSummary: nil, Skiptoken: to.Ptr[float32](50), SelectedState: nil, Take: to.Ptr[float32](1), }) for pager.More() { nextResult, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range nextResult.Value { // TODO: use page item _ = v } } }
Output:
func (*SavingsPlanClient) NewListPager ¶
func (client *SavingsPlanClient) NewListPager(savingsPlanOrderID string, options *SavingsPlanClientListOptions) *runtime.Pager[SavingsPlanClientListResponse]
NewListPager - List savings plans in an order. Generated from API version 2022-11-01 savingsPlanOrderID - Order ID of the savings plan options - SavingsPlanClientListOptions contains the optional parameters for the SavingsPlanClient.List method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/SavingsPlansInOrderList.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/billingbenefits/armbillingbenefits" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() client, err := armbillingbenefits.NewSavingsPlanClient(nil, cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := client.NewListPager("20000000-0000-0000-0000-000000000000", nil) for pager.More() { nextResult, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range nextResult.Value { // TODO: use page item _ = v } } }
Output:
func (*SavingsPlanClient) Update ¶
func (client *SavingsPlanClient) Update(ctx context.Context, savingsPlanOrderID string, savingsPlanID string, body SavingsPlanUpdateRequest, options *SavingsPlanClientUpdateOptions) (SavingsPlanClientUpdateResponse, error)
Update - Update savings plan. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2022-11-01 savingsPlanOrderID - Order ID of the savings plan savingsPlanID - ID of the savings plan body - Request body for patching a savings plan order alias options - SavingsPlanClientUpdateOptions contains the optional parameters for the SavingsPlanClient.Update method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/SavingsPlanUpdate.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/billingbenefits/armbillingbenefits" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() client, err := armbillingbenefits.NewSavingsPlanClient(nil, cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := client.Update(ctx, "20000000-0000-0000-0000-000000000000", "30000000-0000-0000-0000-000000000000", armbillingbenefits.SavingsPlanUpdateRequest{ Properties: &armbillingbenefits.SavingsPlanUpdateRequestProperties{ AppliedScopeProperties: &armbillingbenefits.AppliedScopeProperties{ ResourceGroupID: to.Ptr("/subscriptions/10000000-0000-0000-0000-000000000000/resourceGroups/testrg"), }, AppliedScopeType: to.Ptr(armbillingbenefits.AppliedScopeTypeSingle), DisplayName: to.Ptr("TestDisplayName"), Renew: to.Ptr(true), RenewProperties: &armbillingbenefits.RenewProperties{ PurchaseProperties: &armbillingbenefits.PurchaseRequest{ Properties: &armbillingbenefits.PurchaseRequestProperties{ AppliedScopeProperties: &armbillingbenefits.AppliedScopeProperties{ ResourceGroupID: to.Ptr("/subscriptions/10000000-0000-0000-0000-000000000000/resourceGroups/testrg"), }, AppliedScopeType: to.Ptr(armbillingbenefits.AppliedScopeTypeSingle), BillingPlan: to.Ptr(armbillingbenefits.BillingPlanP1M), BillingScopeID: to.Ptr("/subscriptions/10000000-0000-0000-0000-000000000000"), Commitment: &armbillingbenefits.Commitment{ Amount: to.Ptr[float64](15.23), CurrencyCode: to.Ptr("USD"), Grain: to.Ptr(armbillingbenefits.CommitmentGrainHourly), }, DisplayName: to.Ptr("TestDisplayName_renewed"), Renew: to.Ptr(false), Term: to.Ptr(armbillingbenefits.TermP1Y), }, SKU: &armbillingbenefits.SKU{ Name: to.Ptr("Compute_Savings_Plan"), }, }, }, }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // TODO: use response item _ = res }
Output:
func (*SavingsPlanClient) ValidateUpdate ¶
func (client *SavingsPlanClient) ValidateUpdate(ctx context.Context, savingsPlanOrderID string, savingsPlanID string, body SavingsPlanUpdateValidateRequest, options *SavingsPlanClientValidateUpdateOptions) (SavingsPlanClientValidateUpdateResponse, error)
ValidateUpdate - Validate savings plan patch. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2022-11-01 savingsPlanOrderID - Order ID of the savings plan savingsPlanID - ID of the savings plan body - Request body for validating a savings plan patch request options - SavingsPlanClientValidateUpdateOptions contains the optional parameters for the SavingsPlanClient.ValidateUpdate method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/SavingsPlanValidateUpdate.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/billingbenefits/armbillingbenefits" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() client, err := armbillingbenefits.NewSavingsPlanClient(nil, cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := client.ValidateUpdate(ctx, "20000000-0000-0000-0000-000000000000", "30000000-0000-0000-0000-000000000000", armbillingbenefits.SavingsPlanUpdateValidateRequest{ Benefits: []*armbillingbenefits.SavingsPlanUpdateRequestProperties{ { AppliedScopeProperties: &armbillingbenefits.AppliedScopeProperties{ ManagementGroupID: to.Ptr("/providers/Microsoft.Management/managementGroups/30000000-0000-0000-0000-000000000100"), TenantID: to.Ptr("30000000-0000-0000-0000-000000000100"), }, AppliedScopeType: to.Ptr(armbillingbenefits.AppliedScopeTypeManagementGroup), }, { AppliedScopeProperties: &armbillingbenefits.AppliedScopeProperties{ ManagementGroupID: to.Ptr("/providers/Microsoft.Management/managementGroups/MockMG"), TenantID: to.Ptr("30000000-0000-0000-0000-000000000100"), }, AppliedScopeType: to.Ptr(armbillingbenefits.AppliedScopeTypeManagementGroup), }}, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // TODO: use response item _ = res }
Output:
type SavingsPlanClientGetOptions ¶
type SavingsPlanClientGetOptions struct { }
SavingsPlanClientGetOptions contains the optional parameters for the SavingsPlanClient.Get method.
type SavingsPlanClientGetResponse ¶
type SavingsPlanClientGetResponse struct {
SavingsPlanModel
}
SavingsPlanClientGetResponse contains the response from method SavingsPlanClient.Get.
type SavingsPlanClientListAllOptions ¶
type SavingsPlanClientListAllOptions struct { // May be used to filter by reservation properties. The filter supports 'eq', 'or', and 'and'. It does not currently support // 'ne', 'gt', 'le', 'ge', or 'not'. Reservation properties include sku/name, // properties/{appliedScopeType, archived, displayName, displayProvisioningState, effectiveDateTime, expiryDate, provisioningState, // quantity, renew, reservedResourceType, term, // userFriendlyAppliedScopeType, userFriendlyRenewState} Filter *string // May be used to sort order by reservation properties. Orderby *string // To indicate whether to refresh the roll up counts of the savings plans group by provisioning states RefreshSummary *string // The selected provisioning state SelectedState *string // The number of savings plans to skip from the list before returning results Skiptoken *float32 // To number of savings plans to return Take *float32 }
SavingsPlanClientListAllOptions contains the optional parameters for the SavingsPlanClient.ListAll method.
type SavingsPlanClientListAllResponse ¶
type SavingsPlanClientListAllResponse struct {
SavingsPlanModelListResult
}
SavingsPlanClientListAllResponse contains the response from method SavingsPlanClient.ListAll.
type SavingsPlanClientListOptions ¶
type SavingsPlanClientListOptions struct { }
SavingsPlanClientListOptions contains the optional parameters for the SavingsPlanClient.List method.
type SavingsPlanClientListResponse ¶
type SavingsPlanClientListResponse struct {
SavingsPlanModelList
}
SavingsPlanClientListResponse contains the response from method SavingsPlanClient.List.
type SavingsPlanClientUpdateOptions ¶
type SavingsPlanClientUpdateOptions struct { }
SavingsPlanClientUpdateOptions contains the optional parameters for the SavingsPlanClient.Update method.
type SavingsPlanClientUpdateResponse ¶
type SavingsPlanClientUpdateResponse struct { SavingsPlanModel // Location contains the information returned from the Location header response. Location *string }
SavingsPlanClientUpdateResponse contains the response from method SavingsPlanClient.Update.
type SavingsPlanClientValidateUpdateOptions ¶
type SavingsPlanClientValidateUpdateOptions struct { }
SavingsPlanClientValidateUpdateOptions contains the optional parameters for the SavingsPlanClient.ValidateUpdate method.
type SavingsPlanClientValidateUpdateResponse ¶
type SavingsPlanClientValidateUpdateResponse struct {
SavingsPlanValidateResponse
}
SavingsPlanClientValidateUpdateResponse contains the response from method SavingsPlanClient.ValidateUpdate.
type SavingsPlanModel ¶
type SavingsPlanModel struct { // REQUIRED; Savings plan SKU SKU *SKU `json:"sku,omitempty"` // Savings plan properties Properties *SavingsPlanModelProperties `json:"properties,omitempty"` // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty" azure:"ro"` // READ-ONLY; The name of the resource Name *string `json:"name,omitempty" azure:"ro"` // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty" azure:"ro"` }
SavingsPlanModel - Savings plan
func (SavingsPlanModel) MarshalJSON ¶
func (s SavingsPlanModel) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SavingsPlanModel.
func (*SavingsPlanModel) UnmarshalJSON ¶
func (s *SavingsPlanModel) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SavingsPlanModel.
type SavingsPlanModelList ¶
type SavingsPlanModelList struct { // Url to get the next page. NextLink *string `json:"nextLink,omitempty"` Value []*SavingsPlanModel `json:"value,omitempty"` }
func (SavingsPlanModelList) MarshalJSON ¶
func (s SavingsPlanModelList) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SavingsPlanModelList.
func (*SavingsPlanModelList) UnmarshalJSON ¶
func (s *SavingsPlanModelList) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SavingsPlanModelList.
type SavingsPlanModelListResult ¶
type SavingsPlanModelListResult struct { // READ-ONLY; The roll out count summary of the savings plans AdditionalProperties []*SavingsPlanSummary `json:"additionalProperties,omitempty" azure:"ro"` // READ-ONLY; Url to get the next page. NextLink *string `json:"nextLink,omitempty" azure:"ro"` // READ-ONLY; The list of savings plans. Value []*SavingsPlanModel `json:"value,omitempty" azure:"ro"` }
func (SavingsPlanModelListResult) MarshalJSON ¶
func (s SavingsPlanModelListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SavingsPlanModelListResult.
func (*SavingsPlanModelListResult) UnmarshalJSON ¶
func (s *SavingsPlanModelListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SavingsPlanModelListResult.
type SavingsPlanModelProperties ¶
type SavingsPlanModelProperties struct { // Properties specific to applied scope type. Not required if not applicable. AppliedScopeProperties *AppliedScopeProperties `json:"appliedScopeProperties,omitempty"` // Type of the Applied Scope. AppliedScopeType *AppliedScopeType `json:"appliedScopeType,omitempty"` // This is the DateTime when the savings plan benefit started. BenefitStartTime *time.Time `json:"benefitStartTime,omitempty"` // Represents the billing plan in ISO 8601 format. Required only for monthly billing plans. BillingPlan *BillingPlan `json:"billingPlan,omitempty"` // Subscription that will be charged for purchasing the benefit BillingScopeID *string `json:"billingScopeId,omitempty"` // Commitment towards the benefit. Commitment *Commitment `json:"commitment,omitempty"` // Display name DisplayName *string `json:"displayName,omitempty"` // Setting this to true will automatically purchase a new benefit on the expiration date time. Renew *bool `json:"renew,omitempty"` // SavingsPlan Id of the SavingsPlan which is purchased because of renew. RenewDestination *string `json:"renewDestination,omitempty"` RenewProperties *RenewProperties `json:"renewProperties,omitempty"` // SavingsPlan Id of the SavingsPlan from which this SavingsPlan is renewed. RenewSource *string `json:"renewSource,omitempty"` // Represent benefit term in ISO 8601 format. Term *Term `json:"term,omitempty"` // READ-ONLY; Fully-qualified identifier of the billing account where the savings plan is applied. Present only for Enterprise // Agreement customers. BillingAccountID *string `json:"billingAccountId,omitempty" azure:"ro"` // READ-ONLY; Fully-qualified identifier of the billing profile where the savings plan is applied. Present only for Field-led // or Customer-led customers. BillingProfileID *string `json:"billingProfileId,omitempty" azure:"ro"` // READ-ONLY; Fully-qualified identifier of the customer where the savings plan is applied. Present only for Partner-led customers. CustomerID *string `json:"customerId,omitempty" azure:"ro"` // READ-ONLY; The provisioning state of the savings plan for display, e.g. Succeeded DisplayProvisioningState *string `json:"displayProvisioningState,omitempty" azure:"ro"` // READ-ONLY; DateTime of the savings plan starts providing benefit from. EffectiveDateTime *time.Time `json:"effectiveDateTime,omitempty" azure:"ro"` // READ-ONLY; Expiry date time ExpiryDateTime *time.Time `json:"expiryDateTime,omitempty" azure:"ro"` // READ-ONLY ExtendedStatusInfo *ExtendedStatusInfo `json:"extendedStatusInfo,omitempty" azure:"ro"` // READ-ONLY; Provisioning state ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` // READ-ONLY; Date time when the savings plan was purchased PurchaseDateTime *time.Time `json:"purchaseDateTime,omitempty" azure:"ro"` // READ-ONLY; The applied scope type of the savings plan for display, e.g. Shared UserFriendlyAppliedScopeType *string `json:"userFriendlyAppliedScopeType,omitempty" azure:"ro"` // READ-ONLY; Savings plan utilization Utilization *Utilization `json:"utilization,omitempty" azure:"ro"` }
SavingsPlanModelProperties - Savings plan properties
func (SavingsPlanModelProperties) MarshalJSON ¶
func (s SavingsPlanModelProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SavingsPlanModelProperties.
func (*SavingsPlanModelProperties) UnmarshalJSON ¶
func (s *SavingsPlanModelProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SavingsPlanModelProperties.
type SavingsPlanOrderAliasClient ¶
type SavingsPlanOrderAliasClient struct {
// contains filtered or unexported fields
}
SavingsPlanOrderAliasClient contains the methods for the SavingsPlanOrderAlias group. Don't use this type directly, use NewSavingsPlanOrderAliasClient() instead.
func NewSavingsPlanOrderAliasClient ¶
func NewSavingsPlanOrderAliasClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*SavingsPlanOrderAliasClient, error)
NewSavingsPlanOrderAliasClient creates a new instance of SavingsPlanOrderAliasClient with the specified values. credential - used to authorize requests. Usually a credential from azidentity. options - pass nil to accept the default values.
func (*SavingsPlanOrderAliasClient) BeginCreate ¶
func (client *SavingsPlanOrderAliasClient) BeginCreate(ctx context.Context, savingsPlanOrderAliasName string, body SavingsPlanOrderAliasModel, options *SavingsPlanOrderAliasClientBeginCreateOptions) (*runtime.Poller[SavingsPlanOrderAliasClientCreateResponse], error)
BeginCreate - Create a savings plan. Learn more about permissions needed at https://go.microsoft.com/fwlink/?linkid=2215851 If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2022-11-01 savingsPlanOrderAliasName - Name of the savings plan order alias body - Request body for creating a savings plan order alias options - SavingsPlanOrderAliasClientBeginCreateOptions contains the optional parameters for the SavingsPlanOrderAliasClient.BeginCreate method.
Example (SavingsPlanOrderAliasCreate) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/SavingsPlanOrderAliasCreate.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/billingbenefits/armbillingbenefits" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() client, err := armbillingbenefits.NewSavingsPlanOrderAliasClient(cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := client.BeginCreate(ctx, "spAlias123", armbillingbenefits.SavingsPlanOrderAliasModel{ Properties: &armbillingbenefits.SavingsPlanOrderAliasProperties{ AppliedScopeType: to.Ptr(armbillingbenefits.AppliedScopeTypeShared), BillingPlan: to.Ptr(armbillingbenefits.BillingPlanP1M), BillingScopeID: to.Ptr("/subscriptions/30000000-0000-0000-0000-000000000000"), Commitment: &armbillingbenefits.Commitment{ Amount: to.Ptr[float64](0.001), CurrencyCode: to.Ptr("USD"), Grain: to.Ptr(armbillingbenefits.CommitmentGrainHourly), }, DisplayName: to.Ptr("Compute_SavingsPlan_10-28-2022_16-38"), Term: to.Ptr(armbillingbenefits.TermP3Y), }, SKU: &armbillingbenefits.SKU{ Name: to.Ptr("Compute_Savings_Plan"), }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // TODO: use response item _ = res }
Output:
Example (SavingsPlanOrderAliasCreateSingleScope) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/SavingsPlanOrderAliasCreateSingleScope.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/billingbenefits/armbillingbenefits" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() client, err := armbillingbenefits.NewSavingsPlanOrderAliasClient(cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := client.BeginCreate(ctx, "spAlias123", armbillingbenefits.SavingsPlanOrderAliasModel{ Properties: &armbillingbenefits.SavingsPlanOrderAliasProperties{ AppliedScopeProperties: &armbillingbenefits.AppliedScopeProperties{ SubscriptionID: to.Ptr("/subscriptions/30000000-0000-0000-0000-000000000000"), }, AppliedScopeType: to.Ptr(armbillingbenefits.AppliedScopeTypeSingle), BillingPlan: to.Ptr(armbillingbenefits.BillingPlanP1M), BillingScopeID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/1234567/billingSubscriptions/30000000-0000-0000-0000-000000000000"), Commitment: &armbillingbenefits.Commitment{ Amount: to.Ptr[float64](0.001), CurrencyCode: to.Ptr("USD"), Grain: to.Ptr(armbillingbenefits.CommitmentGrainHourly), }, DisplayName: to.Ptr("Compute_SavingsPlan_10-28-2022_16-38"), Term: to.Ptr(armbillingbenefits.TermP3Y), }, SKU: &armbillingbenefits.SKU{ Name: to.Ptr("Compute_Savings_Plan"), }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // TODO: use response item _ = res }
Output:
func (*SavingsPlanOrderAliasClient) Get ¶
func (client *SavingsPlanOrderAliasClient) Get(ctx context.Context, savingsPlanOrderAliasName string, options *SavingsPlanOrderAliasClientGetOptions) (SavingsPlanOrderAliasClientGetResponse, error)
Get - Get a savings plan. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2022-11-01 savingsPlanOrderAliasName - Name of the savings plan order alias options - SavingsPlanOrderAliasClientGetOptions contains the optional parameters for the SavingsPlanOrderAliasClient.Get method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/SavingsPlanOrderAliasGet.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/billingbenefits/armbillingbenefits" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() client, err := armbillingbenefits.NewSavingsPlanOrderAliasClient(cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := client.Get(ctx, "spAlias123", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // TODO: use response item _ = res }
Output:
type SavingsPlanOrderAliasClientBeginCreateOptions ¶
type SavingsPlanOrderAliasClientBeginCreateOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
SavingsPlanOrderAliasClientBeginCreateOptions contains the optional parameters for the SavingsPlanOrderAliasClient.BeginCreate method.
type SavingsPlanOrderAliasClientCreateResponse ¶
type SavingsPlanOrderAliasClientCreateResponse struct {
SavingsPlanOrderAliasModel
}
SavingsPlanOrderAliasClientCreateResponse contains the response from method SavingsPlanOrderAliasClient.Create.
type SavingsPlanOrderAliasClientGetOptions ¶
type SavingsPlanOrderAliasClientGetOptions struct { }
SavingsPlanOrderAliasClientGetOptions contains the optional parameters for the SavingsPlanOrderAliasClient.Get method.
type SavingsPlanOrderAliasClientGetResponse ¶
type SavingsPlanOrderAliasClientGetResponse struct {
SavingsPlanOrderAliasModel
}
SavingsPlanOrderAliasClientGetResponse contains the response from method SavingsPlanOrderAliasClient.Get.
type SavingsPlanOrderAliasModel ¶
type SavingsPlanOrderAliasModel struct { // REQUIRED; Savings plan SKU SKU *SKU `json:"sku,omitempty"` // Resource provider kind Kind *string `json:"kind,omitempty"` // Savings plan order alias properties Properties *SavingsPlanOrderAliasProperties `json:"properties,omitempty"` // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty" azure:"ro"` // READ-ONLY; The name of the resource Name *string `json:"name,omitempty" azure:"ro"` // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty" azure:"ro"` }
SavingsPlanOrderAliasModel - Savings plan order alias
func (SavingsPlanOrderAliasModel) MarshalJSON ¶
func (s SavingsPlanOrderAliasModel) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SavingsPlanOrderAliasModel.
func (*SavingsPlanOrderAliasModel) UnmarshalJSON ¶
func (s *SavingsPlanOrderAliasModel) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SavingsPlanOrderAliasModel.
type SavingsPlanOrderAliasProperties ¶
type SavingsPlanOrderAliasProperties struct { // Properties specific to applied scope type. Not required if not applicable. AppliedScopeProperties *AppliedScopeProperties `json:"appliedScopeProperties,omitempty"` // Type of the Applied Scope. AppliedScopeType *AppliedScopeType `json:"appliedScopeType,omitempty"` // Represents the billing plan in ISO 8601 format. Required only for monthly billing plans. BillingPlan *BillingPlan `json:"billingPlan,omitempty"` // Subscription that will be charged for purchasing the benefit BillingScopeID *string `json:"billingScopeId,omitempty"` // Commitment towards the benefit. Commitment *Commitment `json:"commitment,omitempty"` // Display name DisplayName *string `json:"displayName,omitempty"` // Represent benefit term in ISO 8601 format. Term *Term `json:"term,omitempty"` // READ-ONLY; Provisioning state ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` // READ-ONLY; Identifier of the savings plan created SavingsPlanOrderID *string `json:"savingsPlanOrderId,omitempty" azure:"ro"` }
SavingsPlanOrderAliasProperties - Savings plan properties
func (SavingsPlanOrderAliasProperties) MarshalJSON ¶
func (s SavingsPlanOrderAliasProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SavingsPlanOrderAliasProperties.
func (*SavingsPlanOrderAliasProperties) UnmarshalJSON ¶
func (s *SavingsPlanOrderAliasProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SavingsPlanOrderAliasProperties.
type SavingsPlanOrderClient ¶
type SavingsPlanOrderClient struct {
// contains filtered or unexported fields
}
SavingsPlanOrderClient contains the methods for the SavingsPlanOrder group. Don't use this type directly, use NewSavingsPlanOrderClient() instead.
func NewSavingsPlanOrderClient ¶
func NewSavingsPlanOrderClient(expand *string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SavingsPlanOrderClient, error)
NewSavingsPlanOrderClient creates a new instance of SavingsPlanOrderClient with the specified values. expand - May be used to expand the detail information of some properties. credential - used to authorize requests. Usually a credential from azidentity. options - pass nil to accept the default values.
func (*SavingsPlanOrderClient) Elevate ¶
func (client *SavingsPlanOrderClient) Elevate(ctx context.Context, savingsPlanOrderID string, options *SavingsPlanOrderClientElevateOptions) (SavingsPlanOrderClientElevateResponse, error)
Elevate - Elevate as owner on savings plan order based on billing permissions. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2022-11-01 savingsPlanOrderID - Order ID of the savings plan options - SavingsPlanOrderClientElevateOptions contains the optional parameters for the SavingsPlanOrderClient.Elevate method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/SavingsPlanOrderElevate.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/billingbenefits/armbillingbenefits" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() client, err := armbillingbenefits.NewSavingsPlanOrderClient(nil, cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := client.Elevate(ctx, "20000000-0000-0000-0000-000000000000", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // TODO: use response item _ = res }
Output:
func (*SavingsPlanOrderClient) Get ¶
func (client *SavingsPlanOrderClient) Get(ctx context.Context, savingsPlanOrderID string, options *SavingsPlanOrderClientGetOptions) (SavingsPlanOrderClientGetResponse, error)
Get - Get a savings plan order. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2022-11-01 savingsPlanOrderID - Order ID of the savings plan options - SavingsPlanOrderClientGetOptions contains the optional parameters for the SavingsPlanOrderClient.Get method.
Example (SavingsPlanOrderGet) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/SavingsPlanOrderGet.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/billingbenefits/armbillingbenefits" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() client, err := armbillingbenefits.NewSavingsPlanOrderClient(nil, cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := client.Get(ctx, "20000000-0000-0000-0000-000000000000", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // TODO: use response item _ = res }
Output:
Example (SavingsPlanOrderWithExpandedPaymentsGet) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/SavingsPlanOrderExpandedGet.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/billingbenefits/armbillingbenefits" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() client, err := armbillingbenefits.NewSavingsPlanOrderClient(to.Ptr("schedule"), cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := client.Get(ctx, "20000000-0000-0000-0000-000000000000", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // TODO: use response item _ = res }
Output:
func (*SavingsPlanOrderClient) NewListPager ¶
func (client *SavingsPlanOrderClient) NewListPager(options *SavingsPlanOrderClientListOptions) *runtime.Pager[SavingsPlanOrderClientListResponse]
NewListPager - List all Savings plan orders. Generated from API version 2022-11-01 options - SavingsPlanOrderClientListOptions contains the optional parameters for the SavingsPlanOrderClient.List method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/SavingsPlanOrderList.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/billingbenefits/armbillingbenefits" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() client, err := armbillingbenefits.NewSavingsPlanOrderClient(nil, cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := client.NewListPager(nil) for pager.More() { nextResult, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range nextResult.Value { // TODO: use page item _ = v } } }
Output:
type SavingsPlanOrderClientElevateOptions ¶
type SavingsPlanOrderClientElevateOptions struct { }
SavingsPlanOrderClientElevateOptions contains the optional parameters for the SavingsPlanOrderClient.Elevate method.
type SavingsPlanOrderClientElevateResponse ¶
type SavingsPlanOrderClientElevateResponse struct {
RoleAssignmentEntity
}
SavingsPlanOrderClientElevateResponse contains the response from method SavingsPlanOrderClient.Elevate.
type SavingsPlanOrderClientGetOptions ¶
type SavingsPlanOrderClientGetOptions struct { }
SavingsPlanOrderClientGetOptions contains the optional parameters for the SavingsPlanOrderClient.Get method.
type SavingsPlanOrderClientGetResponse ¶
type SavingsPlanOrderClientGetResponse struct {
SavingsPlanOrderModel
}
SavingsPlanOrderClientGetResponse contains the response from method SavingsPlanOrderClient.Get.
type SavingsPlanOrderClientListOptions ¶
type SavingsPlanOrderClientListOptions struct { }
SavingsPlanOrderClientListOptions contains the optional parameters for the SavingsPlanOrderClient.List method.
type SavingsPlanOrderClientListResponse ¶
type SavingsPlanOrderClientListResponse struct {
SavingsPlanOrderModelList
}
SavingsPlanOrderClientListResponse contains the response from method SavingsPlanOrderClient.List.
type SavingsPlanOrderModel ¶
type SavingsPlanOrderModel struct { // REQUIRED; Savings plan SKU SKU *SKU `json:"sku,omitempty"` // Savings plan order properties Properties *SavingsPlanOrderModelProperties `json:"properties,omitempty"` // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty" azure:"ro"` // READ-ONLY; The name of the resource Name *string `json:"name,omitempty" azure:"ro"` // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty" azure:"ro"` }
SavingsPlanOrderModel - Savings plan order
func (SavingsPlanOrderModel) MarshalJSON ¶
func (s SavingsPlanOrderModel) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SavingsPlanOrderModel.
func (*SavingsPlanOrderModel) UnmarshalJSON ¶
func (s *SavingsPlanOrderModel) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SavingsPlanOrderModel.
type SavingsPlanOrderModelList ¶
type SavingsPlanOrderModelList struct { // Url to get the next page. NextLink *string `json:"nextLink,omitempty"` Value []*SavingsPlanOrderModel `json:"value,omitempty"` }
func (SavingsPlanOrderModelList) MarshalJSON ¶
func (s SavingsPlanOrderModelList) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SavingsPlanOrderModelList.
func (*SavingsPlanOrderModelList) UnmarshalJSON ¶
func (s *SavingsPlanOrderModelList) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SavingsPlanOrderModelList.
type SavingsPlanOrderModelProperties ¶
type SavingsPlanOrderModelProperties struct { // This is the DateTime when the savings plan benefit started. BenefitStartTime *time.Time `json:"benefitStartTime,omitempty"` // Represents the billing plan in ISO 8601 format. Required only for monthly billing plans. BillingPlan *BillingPlan `json:"billingPlan,omitempty"` // Subscription that will be charged for purchasing the benefit BillingScopeID *string `json:"billingScopeId,omitempty"` // Display name DisplayName *string `json:"displayName,omitempty"` // Information describing the type of billing plan for this savings plan. PlanInformation *BillingPlanInformation `json:"planInformation,omitempty"` SavingsPlans []*string `json:"savingsPlans,omitempty"` // Represent benefit term in ISO 8601 format. Term *Term `json:"term,omitempty"` // READ-ONLY; Fully-qualified identifier of the billing account where the savings plan is applied. Present only for Enterprise // Agreement customers. BillingAccountID *string `json:"billingAccountId,omitempty" azure:"ro"` // READ-ONLY; Fully-qualified identifier of the billing profile where the savings plan is applied. Present only for Field-led // or Customer-led customers. BillingProfileID *string `json:"billingProfileId,omitempty" azure:"ro"` // READ-ONLY; Fully-qualified identifier of the customer where the savings plan is applied. Present only for Partner-led customers. CustomerID *string `json:"customerId,omitempty" azure:"ro"` // READ-ONLY; Expiry date time ExpiryDateTime *time.Time `json:"expiryDateTime,omitempty" azure:"ro"` // READ-ONLY ExtendedStatusInfo *ExtendedStatusInfo `json:"extendedStatusInfo,omitempty" azure:"ro"` // READ-ONLY; Provisioning state ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` }
SavingsPlanOrderModelProperties - Savings plan order properties
func (SavingsPlanOrderModelProperties) MarshalJSON ¶
func (s SavingsPlanOrderModelProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SavingsPlanOrderModelProperties.
func (*SavingsPlanOrderModelProperties) UnmarshalJSON ¶
func (s *SavingsPlanOrderModelProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SavingsPlanOrderModelProperties.
type SavingsPlanPurchaseValidateRequest ¶
type SavingsPlanPurchaseValidateRequest struct {
Benefits []*SavingsPlanOrderAliasModel `json:"benefits,omitempty"`
}
func (SavingsPlanPurchaseValidateRequest) MarshalJSON ¶
func (s SavingsPlanPurchaseValidateRequest) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SavingsPlanPurchaseValidateRequest.
func (*SavingsPlanPurchaseValidateRequest) UnmarshalJSON ¶
func (s *SavingsPlanPurchaseValidateRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SavingsPlanPurchaseValidateRequest.
type SavingsPlanSummary ¶
type SavingsPlanSummary struct { // The roll up count summary of savings plans in each state Value *SavingsPlanSummaryCount `json:"value,omitempty"` // READ-ONLY; This property has value 'summary' Name *string `json:"name,omitempty" azure:"ro"` }
SavingsPlanSummary - Savings plans list summary
func (SavingsPlanSummary) MarshalJSON ¶
func (s SavingsPlanSummary) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SavingsPlanSummary.
func (*SavingsPlanSummary) UnmarshalJSON ¶
func (s *SavingsPlanSummary) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SavingsPlanSummary.
type SavingsPlanSummaryCount ¶
type SavingsPlanSummaryCount struct { // READ-ONLY; The number of savings plans in Cancelled state CancelledCount *float32 `json:"cancelledCount,omitempty" azure:"ro"` // READ-ONLY; The number of savings plans in Expired state ExpiredCount *float32 `json:"expiredCount,omitempty" azure:"ro"` // READ-ONLY; The number of savings plans in Expiring state ExpiringCount *float32 `json:"expiringCount,omitempty" azure:"ro"` // READ-ONLY; The number of savings plans in Failed state FailedCount *float32 `json:"failedCount,omitempty" azure:"ro"` // READ-ONLY; The number of savings plans in No Benefit state NoBenefitCount *float32 `json:"noBenefitCount,omitempty" azure:"ro"` // READ-ONLY; The number of savings plans in Pending state PendingCount *float32 `json:"pendingCount,omitempty" azure:"ro"` // READ-ONLY; The number of savings plans in Processing state ProcessingCount *float32 `json:"processingCount,omitempty" azure:"ro"` // READ-ONLY; The number of savings plans in Succeeded state SucceededCount *float32 `json:"succeededCount,omitempty" azure:"ro"` // READ-ONLY; The number of savings plans in Warning state WarningCount *float32 `json:"warningCount,omitempty" azure:"ro"` }
SavingsPlanSummaryCount - The roll up count summary of savings plans in each state
func (SavingsPlanSummaryCount) MarshalJSON ¶
func (s SavingsPlanSummaryCount) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SavingsPlanSummaryCount.
func (*SavingsPlanSummaryCount) UnmarshalJSON ¶
func (s *SavingsPlanSummaryCount) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SavingsPlanSummaryCount.
type SavingsPlanUpdateRequest ¶
type SavingsPlanUpdateRequest struct { // Savings plan patch request Properties *SavingsPlanUpdateRequestProperties `json:"properties,omitempty"` }
SavingsPlanUpdateRequest - Savings plan patch request
func (SavingsPlanUpdateRequest) MarshalJSON ¶
func (s SavingsPlanUpdateRequest) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SavingsPlanUpdateRequest.
func (*SavingsPlanUpdateRequest) UnmarshalJSON ¶
func (s *SavingsPlanUpdateRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SavingsPlanUpdateRequest.
type SavingsPlanUpdateRequestProperties ¶
type SavingsPlanUpdateRequestProperties struct { // Properties specific to applied scope type. Not required if not applicable. AppliedScopeProperties *AppliedScopeProperties `json:"appliedScopeProperties,omitempty"` // Type of the Applied Scope. AppliedScopeType *AppliedScopeType `json:"appliedScopeType,omitempty"` // Display name DisplayName *string `json:"displayName,omitempty"` // Setting this to true will automatically purchase a new benefit on the expiration date time. Renew *bool `json:"renew,omitempty"` RenewProperties *RenewProperties `json:"renewProperties,omitempty"` }
SavingsPlanUpdateRequestProperties - Savings plan patch request
func (SavingsPlanUpdateRequestProperties) MarshalJSON ¶
func (s SavingsPlanUpdateRequestProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SavingsPlanUpdateRequestProperties.
func (*SavingsPlanUpdateRequestProperties) UnmarshalJSON ¶
func (s *SavingsPlanUpdateRequestProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SavingsPlanUpdateRequestProperties.
type SavingsPlanUpdateValidateRequest ¶
type SavingsPlanUpdateValidateRequest struct {
Benefits []*SavingsPlanUpdateRequestProperties `json:"benefits,omitempty"`
}
func (SavingsPlanUpdateValidateRequest) MarshalJSON ¶
func (s SavingsPlanUpdateValidateRequest) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SavingsPlanUpdateValidateRequest.
func (*SavingsPlanUpdateValidateRequest) UnmarshalJSON ¶
func (s *SavingsPlanUpdateValidateRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SavingsPlanUpdateValidateRequest.
type SavingsPlanValidResponseProperty ¶
type SavingsPlanValidResponseProperty struct { // Failure reason if the provided input was invalid Reason *string `json:"reason,omitempty"` // Failure reason code if the provided input was invalid ReasonCode *string `json:"reasonCode,omitempty"` // Indicates if the provided input was valid Valid *bool `json:"valid,omitempty"` }
SavingsPlanValidResponseProperty - Benefit scope response property
func (SavingsPlanValidResponseProperty) MarshalJSON ¶
func (s SavingsPlanValidResponseProperty) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SavingsPlanValidResponseProperty.
func (*SavingsPlanValidResponseProperty) UnmarshalJSON ¶
func (s *SavingsPlanValidResponseProperty) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SavingsPlanValidResponseProperty.
type SavingsPlanValidateResponse ¶
type SavingsPlanValidateResponse struct { Benefits []*SavingsPlanValidResponseProperty `json:"benefits,omitempty"` // Url to get the next page. NextLink *string `json:"nextLink,omitempty"` }
func (SavingsPlanValidateResponse) MarshalJSON ¶
func (s SavingsPlanValidateResponse) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SavingsPlanValidateResponse.
func (*SavingsPlanValidateResponse) UnmarshalJSON ¶
func (s *SavingsPlanValidateResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SavingsPlanValidateResponse.
type SystemData ¶
type SystemData struct { // The timestamp of resource creation (UTC). CreatedAt *time.Time `json:"createdAt,omitempty"` // The identity that created the resource. CreatedBy *string `json:"createdBy,omitempty"` // The type of identity that created the resource. CreatedByType *CreatedByType `json:"createdByType,omitempty"` // The timestamp of resource last modification (UTC) LastModifiedAt *time.Time `json:"lastModifiedAt,omitempty"` // The identity that last modified the resource. LastModifiedBy *string `json:"lastModifiedBy,omitempty"` // The type of identity that last modified the resource. LastModifiedByType *CreatedByType `json:"lastModifiedByType,omitempty"` }
SystemData - Metadata pertaining to creation and last modification of the resource.
func (SystemData) MarshalJSON ¶
func (s SystemData) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SystemData.
func (*SystemData) UnmarshalJSON ¶
func (s *SystemData) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SystemData.
type Term ¶
type Term string
Term - Represent benefit term in ISO 8601 format.
func PossibleTermValues ¶
func PossibleTermValues() []Term
PossibleTermValues returns the possible values for the Term const type.
type Utilization ¶
type Utilization struct { // The array of aggregates of a savings plan's utilization Aggregates []*UtilizationAggregates `json:"aggregates,omitempty"` // READ-ONLY; The number of days trend for a savings plan Trend *string `json:"trend,omitempty" azure:"ro"` }
Utilization - Savings plan utilization
func (Utilization) MarshalJSON ¶
func (u Utilization) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type Utilization.
func (*Utilization) UnmarshalJSON ¶
func (u *Utilization) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type Utilization.
type UtilizationAggregates ¶
type UtilizationAggregates struct { // READ-ONLY; The grain of the aggregate Grain *float32 `json:"grain,omitempty" azure:"ro"` // READ-ONLY; The grain unit of the aggregate GrainUnit *string `json:"grainUnit,omitempty" azure:"ro"` // READ-ONLY; The aggregate value Value *float32 `json:"value,omitempty" azure:"ro"` // READ-ONLY; The aggregate value unit ValueUnit *string `json:"valueUnit,omitempty" azure:"ro"` }
UtilizationAggregates - The aggregate values of savings plan utilization
func (UtilizationAggregates) MarshalJSON ¶
func (u UtilizationAggregates) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type UtilizationAggregates.
func (*UtilizationAggregates) UnmarshalJSON ¶
func (u *UtilizationAggregates) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type UtilizationAggregates.