armcommerce

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AggregationGranularity

type AggregationGranularity string
const (
	AggregationGranularityDaily  AggregationGranularity = "Daily"
	AggregationGranularityHourly AggregationGranularity = "Hourly"
)

func PossibleAggregationGranularityValues

func PossibleAggregationGranularityValues() []AggregationGranularity

PossibleAggregationGranularityValues returns the possible values for the AggregationGranularity const type.

type ClientFactory

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

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

func NewClientFactory

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

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

  • subscriptionID - It uniquely identifies Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*ClientFactory) NewRateCardClient

func (c *ClientFactory) NewRateCardClient() *RateCardClient

func (*ClientFactory) NewUsageAggregatesClient

func (c *ClientFactory) NewUsageAggregatesClient() *UsageAggregatesClient

type ErrorResponse

type ErrorResponse struct {
	// Error code
	Code *string `json:"code,omitempty"`

	// Error message indicating why the operation failed.
	Message *string `json:"message,omitempty"`
}

ErrorResponse - Describes the format of Error response.

func (ErrorResponse) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ErrorResponse.

func (*ErrorResponse) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ErrorResponse.

type InfoField

type InfoField struct {
	// Identifies the name of the instance provisioned by the user.
	Project *string `json:"project,omitempty"`
}

InfoField - Key-value pairs of instance details in the legacy format.

func (InfoField) MarshalJSON

func (i InfoField) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type InfoField.

func (*InfoField) UnmarshalJSON

func (i *InfoField) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type InfoField.

type MeterInfo

type MeterInfo struct {
	// Indicates the date from which the meter rate is effective.
	EffectiveDate *time.Time `json:"EffectiveDate,omitempty"`

	// The resource quantity that is included in the offer at no cost. Consumption beyond this quantity will be charged.
	IncludedQuantity *float32 `json:"IncludedQuantity,omitempty"`

	// The category of the meter, e.g., 'Cloud services', 'Networking', etc..
	MeterCategory *string `json:"MeterCategory,omitempty"`

	// The unique identifier of the resource.
	MeterID *string `json:"MeterId,omitempty"`

	// The name of the meter, within the given meter category
	MeterName *string `json:"MeterName,omitempty"`

	// The list of key/value pairs for the meter rates, in the format 'key':'value' where key = the meter quantity, and value
	// = the corresponding price
	MeterRates map[string]*float32 `json:"MeterRates,omitempty"`

	// The region in which the Azure service is available.
	MeterRegion *string `json:"MeterRegion,omitempty"`

	// The subcategory of the meter, e.g., 'A6 Cloud services', 'ExpressRoute (IXP)', etc..
	MeterSubCategory *string `json:"MeterSubCategory,omitempty"`

	// Provides additional meter data. 'Third Party' indicates a meter with no discount. Blanks indicate First Party.
	MeterTags []*string `json:"MeterTags,omitempty"`

	// The unit in which the meter consumption is charged, e.g., 'Hours', 'GB', etc.
	Unit *string `json:"Unit,omitempty"`
}

MeterInfo - Detailed information about the meter.

func (MeterInfo) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type MeterInfo.

func (*MeterInfo) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type MeterInfo.

type MonetaryCommitment

type MonetaryCommitment struct {
	// REQUIRED; Name of the offer term
	Name *OfferTermInfo `json:"Name,omitempty"`

	// Indicates the date from which the offer term is effective.
	EffectiveDate *time.Time `json:"EffectiveDate,omitempty"`

	// An array of meter ids that are excluded from the given offer terms.
	ExcludedMeterIDs []*string `json:"ExcludedMeterIds,omitempty"`

	// The list of key/value pairs for the tiered meter rates, in the format 'key':'value' where key = price, and value = the
	// corresponding discount percentage. This field is used only by offer terms of type
	// 'Monetary Commitment'.
	TieredDiscount map[string]*float64 `json:"TieredDiscount,omitempty"`
}

MonetaryCommitment - Indicates that a monetary commitment is required for this offer

func (*MonetaryCommitment) GetOfferTermInfoAutoGenerated

func (m *MonetaryCommitment) GetOfferTermInfoAutoGenerated() *OfferTermInfoAutoGenerated

GetOfferTermInfoAutoGenerated implements the OfferTermInfoAutoGeneratedClassification interface for type MonetaryCommitment.

func (MonetaryCommitment) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type MonetaryCommitment.

func (*MonetaryCommitment) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type MonetaryCommitment.

type MonetaryCredit

type MonetaryCredit struct {
	// REQUIRED; Name of the offer term
	Name *OfferTermInfo `json:"Name,omitempty"`

	// The amount of credit provided under the terms of the given offer level.
	Credit *float64 `json:"Credit,omitempty"`

	// Indicates the date from which the offer term is effective.
	EffectiveDate *time.Time `json:"EffectiveDate,omitempty"`

	// An array of meter ids that are excluded from the given offer terms.
	ExcludedMeterIDs []*string `json:"ExcludedMeterIds,omitempty"`
}

MonetaryCredit - Indicates that this is a monetary credit offer.

func (*MonetaryCredit) GetOfferTermInfoAutoGenerated

func (m *MonetaryCredit) GetOfferTermInfoAutoGenerated() *OfferTermInfoAutoGenerated

GetOfferTermInfoAutoGenerated implements the OfferTermInfoAutoGeneratedClassification interface for type MonetaryCredit.

func (MonetaryCredit) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type MonetaryCredit.

func (*MonetaryCredit) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type MonetaryCredit.

type OfferTermInfo

type OfferTermInfo string

OfferTermInfo - Name of the offer term

const (
	OfferTermInfoRecurringCharge    OfferTermInfo = "Recurring Charge"
	OfferTermInfoMonetaryCommitment OfferTermInfo = "Monetary Commitment"
	OfferTermInfoMonetaryCredit     OfferTermInfo = "Monetary Credit"
)

func PossibleOfferTermInfoValues

func PossibleOfferTermInfoValues() []OfferTermInfo

PossibleOfferTermInfoValues returns the possible values for the OfferTermInfo const type.

type OfferTermInfoAutoGenerated

type OfferTermInfoAutoGenerated struct {
	// REQUIRED; Name of the offer term
	Name *OfferTermInfo `json:"Name,omitempty"`

	// Indicates the date from which the offer term is effective.
	EffectiveDate *time.Time `json:"EffectiveDate,omitempty"`
}

OfferTermInfoAutoGenerated - Describes the offer term.

func (*OfferTermInfoAutoGenerated) GetOfferTermInfoAutoGenerated

func (o *OfferTermInfoAutoGenerated) GetOfferTermInfoAutoGenerated() *OfferTermInfoAutoGenerated

GetOfferTermInfoAutoGenerated implements the OfferTermInfoAutoGeneratedClassification interface for type OfferTermInfoAutoGenerated.

func (OfferTermInfoAutoGenerated) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type OfferTermInfoAutoGenerated.

func (*OfferTermInfoAutoGenerated) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type OfferTermInfoAutoGenerated.

type OfferTermInfoAutoGeneratedClassification

type OfferTermInfoAutoGeneratedClassification interface {
	// GetOfferTermInfoAutoGenerated returns the OfferTermInfoAutoGenerated content of the underlying type.
	GetOfferTermInfoAutoGenerated() *OfferTermInfoAutoGenerated
}

OfferTermInfoAutoGeneratedClassification provides polymorphic access to related types. Call the interface's GetOfferTermInfoAutoGenerated() method to access the common type. Use a type switch to determine the concrete type. The possible types are: - *MonetaryCommitment, *MonetaryCredit, *OfferTermInfoAutoGenerated, *RecurringCharge

type RateCardClient

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

RateCardClient contains the methods for the RateCard group. Don't use this type directly, use NewRateCardClient() instead.

func NewRateCardClient

func NewRateCardClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*RateCardClient, error)

NewRateCardClient creates a new instance of RateCardClient with the specified values.

  • subscriptionID - It uniquely identifies Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*RateCardClient) Get

Get - Enables you to query for the resource/meter metadata and related prices used in a given subscription by Offer ID, Currency, Locale and Region. The metadata associated with the billing meters, including but not limited to service names, types, resources, units of measure, and regions, is subject to change at any time and without notice. If you intend to use this billing data in an automated fashion, please use the billing meter GUID to uniquely identify each billable item. If the billing meter GUID is scheduled to change due to a new billing model, you will be notified in advance of the change. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2015-06-01-preview

  • filter - The filter to apply on the operation. It ONLY supports the 'eq' and 'and' logical operators at this time. All the 4 query parameters 'OfferDurableId', 'Currency', 'Locale', 'Region' are required to be a part of the $filter.
  • options - RateCardClientGetOptions contains the optional parameters for the RateCardClient.Get method.

type RateCardClientGetOptions

type RateCardClientGetOptions struct {
}

RateCardClientGetOptions contains the optional parameters for the RateCardClient.Get method.

type RateCardClientGetResponse

type RateCardClientGetResponse struct {
	ResourceRateCardInfo
}

RateCardClientGetResponse contains the response from method RateCardClient.Get.

type RateCardQueryParameters

type RateCardQueryParameters struct {
	// REQUIRED; The currency in which the rates need to be provided.
	Currency *string `json:"Currency,omitempty"`

	// REQUIRED; The culture in which the resource metadata needs to be localized.
	Locale *string `json:"Locale,omitempty"`

	// REQUIRED; The Offer ID parameter consists of the 'MS-AZR-' prefix, plus the Offer ID number (e.g., MS-AZR-0026P). See https://azure.microsoft.com/en-us/support/legal/offer-details/
	// for more information on the
	// list of available Offer IDs, country/region availability, and billing currency.
	OfferDurableID *string `json:"OfferDurableId,omitempty"`

	// REQUIRED; 2 letter ISO code where the offer was purchased.
	RegionInfo *string `json:"RegionInfo,omitempty"`
}

RateCardQueryParameters - Parameters that are used in the odata $filter query parameter for providing RateCard information.

func (RateCardQueryParameters) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type RateCardQueryParameters.

func (*RateCardQueryParameters) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type RateCardQueryParameters.

type RecurringCharge

type RecurringCharge struct {
	// REQUIRED; Name of the offer term
	Name *OfferTermInfo `json:"Name,omitempty"`

	// Indicates the date from which the offer term is effective.
	EffectiveDate *time.Time `json:"EffectiveDate,omitempty"`

	// The amount of recurring charge as per the offer term.
	RecurringCharge *int32 `json:"RecurringCharge,omitempty"`
}

RecurringCharge - Indicates a recurring charge is present for this offer.

func (*RecurringCharge) GetOfferTermInfoAutoGenerated

func (r *RecurringCharge) GetOfferTermInfoAutoGenerated() *OfferTermInfoAutoGenerated

GetOfferTermInfoAutoGenerated implements the OfferTermInfoAutoGeneratedClassification interface for type RecurringCharge.

func (RecurringCharge) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type RecurringCharge.

func (*RecurringCharge) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type RecurringCharge.

type ResourceRateCardInfo

type ResourceRateCardInfo struct {
	// The currency in which the rates are provided.
	Currency *string `json:"Currency,omitempty"`

	// All rates are pretax, so this will always be returned as 'false'.
	IsTaxIncluded *bool `json:"IsTaxIncluded,omitempty"`

	// The culture in which the resource information is localized.
	Locale *string `json:"Locale,omitempty"`

	// A list of meters.
	Meters []*MeterInfo `json:"Meters,omitempty"`

	// A list of offer terms.
	OfferTerms []OfferTermInfoAutoGeneratedClassification `json:"OfferTerms,omitempty"`
}

ResourceRateCardInfo - Price and Metadata information for resources

func (ResourceRateCardInfo) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ResourceRateCardInfo.

func (*ResourceRateCardInfo) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ResourceRateCardInfo.

type UsageAggregatesClient

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

UsageAggregatesClient contains the methods for the UsageAggregates group. Don't use this type directly, use NewUsageAggregatesClient() instead.

func NewUsageAggregatesClient

func NewUsageAggregatesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*UsageAggregatesClient, error)

NewUsageAggregatesClient creates a new instance of UsageAggregatesClient with the specified values.

  • subscriptionID - It uniquely identifies Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*UsageAggregatesClient) NewListPager

func (client *UsageAggregatesClient) NewListPager(reportedStartTime time.Time, reportedEndTime time.Time, options *UsageAggregatesClientListOptions) *runtime.Pager[UsageAggregatesClientListResponse]

NewListPager - Query aggregated Azure subscription consumption data for a date range.

Generated from API version 2015-06-01-preview

  • reportedStartTime - The start of the time range to retrieve data for.
  • reportedEndTime - The end of the time range to retrieve data for.
  • options - UsageAggregatesClientListOptions contains the optional parameters for the UsageAggregatesClient.NewListPager method.

type UsageAggregatesClientListOptions

type UsageAggregatesClientListOptions struct {
	// Daily (default) returns the data in daily granularity, Hourly returns the data in hourly granularity.
	AggregationGranularity *AggregationGranularity
	// Used when a continuation token string is provided in the response body of the previous call, enabling paging through a
	// large result set. If not present, the data is retrieved from the beginning of the
	// day/hour (based on the granularity) passed in.
	ContinuationToken *string
	// True returns usage data in instance-level detail, false causes server-side aggregation with fewer details. For example,
	// if you have 3 website instances, by default you will get 3 line items for
	// website consumption. If you specify showDetails = false, the data will be aggregated as a single line item for website
	// consumption within the time period (for the given subscriptionId, meterId,
	// usageStartTime and usageEndTime).
	ShowDetails *bool
}

UsageAggregatesClientListOptions contains the optional parameters for the UsageAggregatesClient.NewListPager method.

type UsageAggregatesClientListResponse

type UsageAggregatesClientListResponse struct {
	UsageAggregationListResult
}

UsageAggregatesClientListResponse contains the response from method UsageAggregatesClient.NewListPager.

type UsageAggregation

type UsageAggregation struct {
	// Unique Id for the usage aggregate.
	ID *string `json:"id,omitempty"`

	// Name of the usage aggregate.
	Name *string `json:"name,omitempty"`

	// Usage data.
	Properties *UsageSample `json:"properties,omitempty"`

	// Type of the resource being returned.
	Type *string `json:"type,omitempty"`
}

UsageAggregation - Describes the usageAggregation.

func (UsageAggregation) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type UsageAggregation.

func (*UsageAggregation) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type UsageAggregation.

type UsageAggregationListResult

type UsageAggregationListResult struct {
	// Gets or sets the link to the next set of results.
	NextLink *string `json:"nextLink,omitempty"`

	// Gets or sets details for the requested aggregation.
	Value []*UsageAggregation `json:"value,omitempty"`
}

UsageAggregationListResult - The Get UsageAggregates operation response.

func (UsageAggregationListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type UsageAggregationListResult.

func (*UsageAggregationListResult) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type UsageAggregationListResult.

type UsageSample

type UsageSample struct {
	// Key-value pairs of instance details (legacy format).
	InfoFields *InfoField `json:"infoFields,omitempty"`

	// Key-value pairs of instance details represented as a string.
	InstanceData *string `json:"instanceData,omitempty"`

	// Category of the consumed resource.
	MeterCategory *string `json:"meterCategory,omitempty"`

	// Unique ID for the resource that was consumed (aka ResourceID).
	MeterID *string `json:"meterId,omitempty"`

	// Friendly name of the resource being consumed.
	MeterName *string `json:"meterName,omitempty"`

	// Region of the meterId used for billing purposes
	MeterRegion *string `json:"meterRegion,omitempty"`

	// Sub-category of the consumed resource.
	MeterSubCategory *string `json:"meterSubCategory,omitempty"`

	// The amount of the resource consumption that occurred in this time frame.
	Quantity *float32 `json:"quantity,omitempty"`

	// The subscription identifier for the Azure user.
	SubscriptionID *string `json:"subscriptionId,omitempty"`

	// The unit in which the usage for this resource is being counted, e.g. Hours, GB.
	Unit *string `json:"unit,omitempty"`

	// UTC end time for the usage bucket to which this usage aggregate belongs.
	UsageEndTime *time.Time `json:"usageEndTime,omitempty"`

	// UTC start time for the usage bucket to which this usage aggregate belongs.
	UsageStartTime *time.Time `json:"usageStartTime,omitempty"`
}

UsageSample - Describes a sample of the usageAggregation.

func (UsageSample) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type UsageSample.

func (*UsageSample) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type UsageSample.

Jump to

Keyboard shortcuts

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