reservation

package
v0.20241029.1112340 Latest Latest
Warning

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

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

README

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

The reservation SDK allows for interaction with Azure Resource Manager billing (API Version 2024-04-01).

This readme covers example usages, but further information on using this SDK can be found in the project root.

Import Path

import "github.com/hashicorp/go-azure-sdk/resource-manager/billing/2024-04-01/reservation"

Client Initialization

client := reservation.NewReservationClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: ReservationClient.GetByReservationOrder

ctx := context.TODO()
id := reservation.NewReservationID("billingAccountName", "reservationOrderId", "reservationId")

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

Example Usage: ReservationClient.UpdateByBillingAccount

ctx := context.TODO()
id := reservation.NewReservationID("billingAccountName", "reservationOrderId", "reservationId")

payload := reservation.Patch{
	// ...
}


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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PossibleValuesForAppliedScopeType

func PossibleValuesForAppliedScopeType() []string

func PossibleValuesForInstanceFlexibility

func PossibleValuesForInstanceFlexibility() []string

func PossibleValuesForReservationBillingPlan

func PossibleValuesForReservationBillingPlan() []string

func PossibleValuesForReservationStatusCode

func PossibleValuesForReservationStatusCode() []string

func ValidateReservationID

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

ValidateReservationID checks that 'input' can be parsed as a Reservation ID

Types

type AppliedScopeType

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

func (*AppliedScopeType) UnmarshalJSON

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

type ExtendedStatusDefinitionProperties

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

type GetByReservationOrderOperationOptions

type GetByReservationOrderOperationOptions struct {
	Expand *string
}

func DefaultGetByReservationOrderOperationOptions

func DefaultGetByReservationOrderOperationOptions() GetByReservationOrderOperationOptions

func (GetByReservationOrderOperationOptions) ToHeaders

func (GetByReservationOrderOperationOptions) ToOData

func (GetByReservationOrderOperationOptions) ToQuery

type GetByReservationOrderOperationResponse

type GetByReservationOrderOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *Reservation
}

type InstanceFlexibility

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

func (*InstanceFlexibility) UnmarshalJSON

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

type Patch

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

type PatchProperties

type PatchProperties struct {
	AppliedScopeProperties *ReservationAppliedScopeProperties `json:"appliedScopeProperties,omitempty"`
	AppliedScopeType       *AppliedScopeType                  `json:"appliedScopeType,omitempty"`
	DisplayName            *string                            `json:"displayName,omitempty"`
	InstanceFlexibility    *InstanceFlexibility               `json:"instanceFlexibility,omitempty"`
	Renew                  *bool                              `json:"renew,omitempty"`
	RenewProperties        *PatchPropertiesRenewProperties    `json:"renewProperties,omitempty"`
	ReviewDateTime         *string                            `json:"reviewDateTime,omitempty"`
}

func (*PatchProperties) GetReviewDateTimeAsTime

func (o *PatchProperties) GetReviewDateTimeAsTime() (*time.Time, error)

func (*PatchProperties) SetReviewDateTimeAsTime

func (o *PatchProperties) SetReviewDateTimeAsTime(input time.Time)

type PatchPropertiesRenewProperties

type PatchPropertiesRenewProperties struct {
	PurchaseProperties *ReservationPurchaseRequest `json:"purchaseProperties,omitempty"`
}

type Price

type Price struct {
	Amount       *float64 `json:"amount,omitempty"`
	CurrencyCode *string  `json:"currencyCode,omitempty"`
}

type RenewPropertiesResponse

type RenewPropertiesResponse struct {
	BillingCurrencyTotal *Price                      `json:"billingCurrencyTotal,omitempty"`
	PricingCurrencyTotal *Price                      `json:"pricingCurrencyTotal,omitempty"`
	PurchaseProperties   *ReservationPurchaseRequest `json:"purchaseProperties,omitempty"`
}

type Reservation

type Reservation struct {
	Etag       *int64                  `json:"etag,omitempty"`
	Id         *string                 `json:"id,omitempty"`
	Location   *string                 `json:"location,omitempty"`
	Name       *string                 `json:"name,omitempty"`
	Properties *ReservationProperty    `json:"properties,omitempty"`
	Sku        *ReservationSkuProperty `json:"sku,omitempty"`
	SystemData *systemdata.SystemData  `json:"systemData,omitempty"`
	Tags       *map[string]string      `json:"tags,omitempty"`
	Type       *string                 `json:"type,omitempty"`
}

type ReservationAppliedScopeProperties

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

type ReservationBillingPlan

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

func (*ReservationBillingPlan) UnmarshalJSON

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

type ReservationClient

type ReservationClient struct {
	Client *resourcemanager.Client
}

func NewReservationClientWithBaseURI

func NewReservationClientWithBaseURI(sdkApi sdkEnv.Api) (*ReservationClient, error)

func (ReservationClient) GetByReservationOrder

GetByReservationOrder ...

func (ReservationClient) UpdateByBillingAccount

func (c ReservationClient) UpdateByBillingAccount(ctx context.Context, id ReservationId, input Patch) (result UpdateByBillingAccountOperationResponse, err error)

UpdateByBillingAccount ...

func (ReservationClient) UpdateByBillingAccountThenPoll

func (c ReservationClient) UpdateByBillingAccountThenPoll(ctx context.Context, id ReservationId, input Patch) error

UpdateByBillingAccountThenPoll performs UpdateByBillingAccount then polls until it's completed

type ReservationExtendedStatusInfo

type ReservationExtendedStatusInfo struct {
	Message    *string                             `json:"message,omitempty"`
	Properties *ExtendedStatusDefinitionProperties `json:"properties,omitempty"`
	StatusCode *ReservationStatusCode              `json:"statusCode,omitempty"`
}

type ReservationId

type ReservationId struct {
	BillingAccountName string
	ReservationOrderId string
	ReservationId      string
}

ReservationId is a struct representing the Resource ID for a Reservation

func NewReservationID

func NewReservationID(billingAccountName string, reservationOrderId string, reservationId string) ReservationId

NewReservationID returns a new ReservationId struct

func ParseReservationID

func ParseReservationID(input string) (*ReservationId, error)

ParseReservationID parses 'input' into a ReservationId

func ParseReservationIDInsensitively

func ParseReservationIDInsensitively(input string) (*ReservationId, error)

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

func (*ReservationId) FromParseResult

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

func (ReservationId) ID

func (id ReservationId) ID() string

ID returns the formatted Reservation ID

func (ReservationId) Segments

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

Segments returns a slice of Resource ID Segments which comprise this Reservation ID

func (ReservationId) String

func (id ReservationId) String() string

String returns a human-readable description of this Reservation ID

type ReservationMergeProperties

type ReservationMergeProperties struct {
	MergeDestination *string   `json:"mergeDestination,omitempty"`
	MergeSources     *[]string `json:"mergeSources,omitempty"`
}

type ReservationProperty

type ReservationProperty struct {
	AppliedScopeProperties       *ReservationAppliedScopeProperties `json:"appliedScopeProperties,omitempty"`
	AppliedScopeType             *string                            `json:"appliedScopeType,omitempty"`
	AppliedScopes                *[]string                          `json:"appliedScopes,omitempty"`
	Archived                     *bool                              `json:"archived,omitempty"`
	BenefitStartTime             *string                            `json:"benefitStartTime,omitempty"`
	BillingPlan                  *ReservationBillingPlan            `json:"billingPlan,omitempty"`
	BillingScopeId               *string                            `json:"billingScopeId,omitempty"`
	Capabilities                 *string                            `json:"capabilities,omitempty"`
	DisplayName                  *string                            `json:"displayName,omitempty"`
	DisplayProvisioningState     *string                            `json:"displayProvisioningState,omitempty"`
	EffectiveDateTime            *string                            `json:"effectiveDateTime,omitempty"`
	ExpiryDate                   *string                            `json:"expiryDate,omitempty"`
	ExpiryDateTime               *string                            `json:"expiryDateTime,omitempty"`
	ExtendedStatusInfo           *ReservationExtendedStatusInfo     `json:"extendedStatusInfo,omitempty"`
	InstanceFlexibility          *InstanceFlexibility               `json:"instanceFlexibility,omitempty"`
	LastUpdatedDateTime          *string                            `json:"lastUpdatedDateTime,omitempty"`
	MergeProperties              *ReservationMergeProperties        `json:"mergeProperties,omitempty"`
	ProductCode                  *string                            `json:"productCode,omitempty"`
	ProvisioningState            *string                            `json:"provisioningState,omitempty"`
	ProvisioningSubState         *string                            `json:"provisioningSubState,omitempty"`
	PurchaseDate                 *string                            `json:"purchaseDate,omitempty"`
	PurchaseDateTime             *string                            `json:"purchaseDateTime,omitempty"`
	Quantity                     *float64                           `json:"quantity,omitempty"`
	Renew                        *bool                              `json:"renew,omitempty"`
	RenewDestination             *string                            `json:"renewDestination,omitempty"`
	RenewProperties              *RenewPropertiesResponse           `json:"renewProperties,omitempty"`
	RenewSource                  *string                            `json:"renewSource,omitempty"`
	ReservedResourceType         *string                            `json:"reservedResourceType,omitempty"`
	ReviewDateTime               *string                            `json:"reviewDateTime,omitempty"`
	SkuDescription               *string                            `json:"skuDescription,omitempty"`
	SplitProperties              *ReservationSplitProperties        `json:"splitProperties,omitempty"`
	SwapProperties               *ReservationSwapProperties         `json:"swapProperties,omitempty"`
	Term                         *string                            `json:"term,omitempty"`
	UserFriendlyAppliedScopeType *string                            `json:"userFriendlyAppliedScopeType,omitempty"`
	UserFriendlyRenewState       *string                            `json:"userFriendlyRenewState,omitempty"`
	Utilization                  *ReservationPropertyUtilization    `json:"utilization,omitempty"`
}

func (*ReservationProperty) GetBenefitStartTimeAsTime

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

func (*ReservationProperty) GetEffectiveDateTimeAsTime

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

func (*ReservationProperty) GetExpiryDateTimeAsTime

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

func (*ReservationProperty) GetLastUpdatedDateTimeAsTime

func (o *ReservationProperty) GetLastUpdatedDateTimeAsTime() (*time.Time, error)

func (*ReservationProperty) GetPurchaseDateTimeAsTime

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

func (*ReservationProperty) GetReviewDateTimeAsTime

func (o *ReservationProperty) GetReviewDateTimeAsTime() (*time.Time, error)

func (*ReservationProperty) SetBenefitStartTimeAsTime

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

func (*ReservationProperty) SetEffectiveDateTimeAsTime

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

func (*ReservationProperty) SetExpiryDateTimeAsTime

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

func (*ReservationProperty) SetLastUpdatedDateTimeAsTime

func (o *ReservationProperty) SetLastUpdatedDateTimeAsTime(input time.Time)

func (*ReservationProperty) SetPurchaseDateTimeAsTime

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

func (*ReservationProperty) SetReviewDateTimeAsTime

func (o *ReservationProperty) SetReviewDateTimeAsTime(input time.Time)

type ReservationPropertyUtilization

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

type ReservationPurchaseRequest

type ReservationPurchaseRequest struct {
	Location   *string                               `json:"location,omitempty"`
	Properties *ReservationPurchaseRequestProperties `json:"properties,omitempty"`
	Sku        *SkuName                              `json:"sku,omitempty"`
}

type ReservationPurchaseRequestProperties

type ReservationPurchaseRequestProperties struct {
	AppliedScopeProperties     *ReservationAppliedScopeProperties                              `json:"appliedScopeProperties,omitempty"`
	AppliedScopeType           *AppliedScopeType                                               `json:"appliedScopeType,omitempty"`
	AppliedScopes              *[]string                                                       `json:"appliedScopes,omitempty"`
	BillingPlan                *ReservationBillingPlan                                         `json:"billingPlan,omitempty"`
	BillingScopeId             *string                                                         `json:"billingScopeId,omitempty"`
	DisplayName                *string                                                         `json:"displayName,omitempty"`
	InstanceFlexibility        *InstanceFlexibility                                            `json:"instanceFlexibility,omitempty"`
	Quantity                   *int64                                                          `json:"quantity,omitempty"`
	Renew                      *bool                                                           `json:"renew,omitempty"`
	ReservedResourceProperties *ReservationPurchaseRequestPropertiesReservedResourceProperties `json:"reservedResourceProperties,omitempty"`
	ReservedResourceType       *string                                                         `json:"reservedResourceType,omitempty"`
	ReviewDateTime             *string                                                         `json:"reviewDateTime,omitempty"`
	Term                       *string                                                         `json:"term,omitempty"`
}

func (*ReservationPurchaseRequestProperties) GetReviewDateTimeAsTime

func (o *ReservationPurchaseRequestProperties) GetReviewDateTimeAsTime() (*time.Time, error)

func (*ReservationPurchaseRequestProperties) SetReviewDateTimeAsTime

func (o *ReservationPurchaseRequestProperties) SetReviewDateTimeAsTime(input time.Time)

type ReservationPurchaseRequestPropertiesReservedResourceProperties

type ReservationPurchaseRequestPropertiesReservedResourceProperties struct {
	InstanceFlexibility *InstanceFlexibility `json:"instanceFlexibility,omitempty"`
}

type ReservationSkuProperty

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

type ReservationSplitProperties

type ReservationSplitProperties struct {
	SplitDestinations *[]string `json:"splitDestinations,omitempty"`
	SplitSource       *string   `json:"splitSource,omitempty"`
}

type ReservationStatusCode

type ReservationStatusCode string
const (
	ReservationStatusCodeActive                             ReservationStatusCode = "Active"
	ReservationStatusCodeCapacityError                      ReservationStatusCode = "CapacityError"
	ReservationStatusCodeCapacityRestricted                 ReservationStatusCode = "CapacityRestricted"
	ReservationStatusCodeCreditLineCheckFailed              ReservationStatusCode = "CreditLineCheckFailed"
	ReservationStatusCodeExchanged                          ReservationStatusCode = "Exchanged"
	ReservationStatusCodeExpired                            ReservationStatusCode = "Expired"
	ReservationStatusCodeMerged                             ReservationStatusCode = "Merged"
	ReservationStatusCodeNoBenefit                          ReservationStatusCode = "NoBenefit"
	ReservationStatusCodeNoBenefitDueToSubscriptionDeletion ReservationStatusCode = "NoBenefitDueToSubscriptionDeletion"
	ReservationStatusCodeNoBenefitDueToSubscriptionTransfer ReservationStatusCode = "NoBenefitDueToSubscriptionTransfer"
	ReservationStatusCodeNone                               ReservationStatusCode = "None"
	ReservationStatusCodePaymentInstrumentError             ReservationStatusCode = "PaymentInstrumentError"
	ReservationStatusCodePending                            ReservationStatusCode = "Pending"
	ReservationStatusCodeProcessing                         ReservationStatusCode = "Processing"
	ReservationStatusCodePurchaseError                      ReservationStatusCode = "PurchaseError"
	ReservationStatusCodeRiskCheckFailed                    ReservationStatusCode = "RiskCheckFailed"
	ReservationStatusCodeSplit                              ReservationStatusCode = "Split"
	ReservationStatusCodeSucceeded                          ReservationStatusCode = "Succeeded"
	ReservationStatusCodeUnknownError                       ReservationStatusCode = "UnknownError"
	ReservationStatusCodeWarning                            ReservationStatusCode = "Warning"
)

func (*ReservationStatusCode) UnmarshalJSON

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

type ReservationSwapProperties

type ReservationSwapProperties struct {
	SwapDestination *string `json:"swapDestination,omitempty"`
	SwapSource      *string `json:"swapSource,omitempty"`
}

type ReservationUtilizationAggregates

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

type SkuName

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

type UpdateByBillingAccountOperationResponse

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

Jump to

Keyboard shortcuts

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