commerce

package
v11.3.0-beta+incompatible Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2017 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package commerce implements the Azure ARM Commerce service API version 2015-06-01-preview.

Index

Constants

View Source
const (
	// DefaultBaseURI is the default URI used for the service Commerce
	DefaultBaseURI = "https://management.azure.com"
)

Variables

This section is empty.

Functions

func UserAgent

func UserAgent() string

UserAgent returns the UserAgent string to use when sending http.Requests.

func Version

func Version() string

Version returns the semantic version (see http://semver.org) of the client.

Types

type AggregationGranularity

type AggregationGranularity string

AggregationGranularity enumerates the values for aggregation granularity.

const (
	// Daily specifies the daily state for aggregation granularity.
	Daily AggregationGranularity = "Daily"
	// Hourly specifies the hourly state for aggregation granularity.
	Hourly AggregationGranularity = "Hourly"
)

type ErrorResponse

type ErrorResponse struct {
	Code    *string `json:"code,omitempty"`
	Message *string `json:"message,omitempty"`
}

ErrorResponse is describes the format of Error response.

type InfoField

type InfoField struct {
	Project *string `json:"project,omitempty"`
}

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

type ManagementClient

type ManagementClient struct {
	autorest.Client
	BaseURI        string
	SubscriptionID string
}

ManagementClient is the base client for Commerce.

func New

func New(subscriptionID string) ManagementClient

New creates an instance of the ManagementClient client.

func NewWithBaseURI

func NewWithBaseURI(baseURI string, subscriptionID string) ManagementClient

NewWithBaseURI creates an instance of the ManagementClient client.

type MeterInfo

type MeterInfo struct {
	MeterID          *uuid.UUID           `json:"MeterId,omitempty"`
	MeterName        *string              `json:"MeterName,omitempty"`
	MeterCategory    *string              `json:"MeterCategory,omitempty"`
	MeterSubCategory *string              `json:"MeterSubCategory,omitempty"`
	Unit             *string              `json:"Unit,omitempty"`
	MeterTags        *[]string            `json:"MeterTags,omitempty"`
	MeterRegion      *string              `json:"MeterRegion,omitempty"`
	MeterRates       *map[string]*float64 `json:"MeterRates,omitempty"`
	EffectiveDate    *date.Time           `json:"EffectiveDate,omitempty"`
	IncludedQuantity *float64             `json:"IncludedQuantity,omitempty"`
}

MeterInfo is detailed information about the meter.

type MonetaryCommitment

type MonetaryCommitment struct {
	EffectiveDate    *date.Time                   `json:"EffectiveDate,omitempty"`
	Name             Name                         `json:"Name,omitempty"`
	TieredDiscount   *map[string]*decimal.Decimal `json:"TieredDiscount,omitempty"`
	ExcludedMeterIds *[]uuid.UUID                 `json:"ExcludedMeterIds,omitempty"`
}

MonetaryCommitment is indicates that a monetary commitment is required for this offer

func (MonetaryCommitment) AsMonetaryCommitment

func (mc MonetaryCommitment) AsMonetaryCommitment() (*MonetaryCommitment, bool)

AsMonetaryCommitment is the OfferTermInfo implementation for MonetaryCommitment.

func (MonetaryCommitment) AsMonetaryCredit

func (mc MonetaryCommitment) AsMonetaryCredit() (*MonetaryCredit, bool)

AsMonetaryCredit is the OfferTermInfo implementation for MonetaryCommitment.

func (MonetaryCommitment) AsRecurringCharge

func (mc MonetaryCommitment) AsRecurringCharge() (*RecurringCharge, bool)

AsRecurringCharge is the OfferTermInfo implementation for MonetaryCommitment.

func (MonetaryCommitment) MarshalJSON

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

MarshalJSON is the custom marshaler for MonetaryCommitment.

type MonetaryCredit

type MonetaryCredit struct {
	EffectiveDate    *date.Time       `json:"EffectiveDate,omitempty"`
	Name             Name             `json:"Name,omitempty"`
	Credit           *decimal.Decimal `json:"Credit,omitempty"`
	ExcludedMeterIds *[]uuid.UUID     `json:"ExcludedMeterIds,omitempty"`
}

MonetaryCredit is indicates that this is a monetary credit offer.

func (MonetaryCredit) AsMonetaryCommitment

func (mc MonetaryCredit) AsMonetaryCommitment() (*MonetaryCommitment, bool)

AsMonetaryCommitment is the OfferTermInfo implementation for MonetaryCredit.

func (MonetaryCredit) AsMonetaryCredit

func (mc MonetaryCredit) AsMonetaryCredit() (*MonetaryCredit, bool)

AsMonetaryCredit is the OfferTermInfo implementation for MonetaryCredit.

func (MonetaryCredit) AsRecurringCharge

func (mc MonetaryCredit) AsRecurringCharge() (*RecurringCharge, bool)

AsRecurringCharge is the OfferTermInfo implementation for MonetaryCredit.

func (MonetaryCredit) MarshalJSON

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

MarshalJSON is the custom marshaler for MonetaryCredit.

type Name

type Name string

Name enumerates the values for name.

const (
	// NameMonetaryCommitment specifies the name monetary commitment state for name.
	NameMonetaryCommitment Name = "Monetary Commitment"
	// NameMonetaryCredit specifies the name monetary credit state for name.
	NameMonetaryCredit Name = "Monetary Credit"
	// NameRecurringCharge specifies the name recurring charge state for name.
	NameRecurringCharge Name = "Recurring Charge"
)

type OfferTermInfo

type OfferTermInfo interface {
	AsMonetaryCredit() (*MonetaryCredit, bool)
	AsMonetaryCommitment() (*MonetaryCommitment, bool)
	AsRecurringCharge() (*RecurringCharge, bool)
}

OfferTermInfo is describes the offer term.

type RateCardClient

type RateCardClient struct {
	ManagementClient
}

RateCardClient is the client for the RateCard methods of the Commerce service.

func NewRateCardClient

func NewRateCardClient(subscriptionID string) RateCardClient

NewRateCardClient creates an instance of the RateCardClient client.

func NewRateCardClientWithBaseURI

func NewRateCardClientWithBaseURI(baseURI string, subscriptionID string) RateCardClient

NewRateCardClientWithBaseURI creates an instance of the RateCardClient client.

func (RateCardClient) Get

func (client RateCardClient) Get(filter string) (result ResourceRateCardInfo, err error)

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.

filter is 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.

func (RateCardClient) GetPreparer

func (client RateCardClient) GetPreparer(filter string) (*http.Request, error)

GetPreparer prepares the Get request.

func (RateCardClient) GetResponder

func (client RateCardClient) GetResponder(resp *http.Response) (result ResourceRateCardInfo, err error)

GetResponder handles the response to the Get request. The method always closes the http.Response Body.

func (RateCardClient) GetSender

func (client RateCardClient) GetSender(req *http.Request) (*http.Response, error)

GetSender sends the Get request. The method will close the http.Response Body if it receives an error.

type RateCardQueryParameters

type RateCardQueryParameters struct {
	OfferDurableID *string `json:"OfferDurableId,omitempty"`
	Currency       *string `json:"Currency,omitempty"`
	Locale         *string `json:"Locale,omitempty"`
	RegionInfo     *string `json:"RegionInfo,omitempty"`
}

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

type RecurringCharge

type RecurringCharge struct {
	EffectiveDate   *date.Time `json:"EffectiveDate,omitempty"`
	Name            Name       `json:"Name,omitempty"`
	RecurringCharge *int32     `json:"RecurringCharge,omitempty"`
}

RecurringCharge is indicates a recurring charge is present for this offer.

func (RecurringCharge) AsMonetaryCommitment

func (rc RecurringCharge) AsMonetaryCommitment() (*MonetaryCommitment, bool)

AsMonetaryCommitment is the OfferTermInfo implementation for RecurringCharge.

func (RecurringCharge) AsMonetaryCredit

func (rc RecurringCharge) AsMonetaryCredit() (*MonetaryCredit, bool)

AsMonetaryCredit is the OfferTermInfo implementation for RecurringCharge.

func (RecurringCharge) AsRecurringCharge

func (rc RecurringCharge) AsRecurringCharge() (*RecurringCharge, bool)

AsRecurringCharge is the OfferTermInfo implementation for RecurringCharge.

func (RecurringCharge) MarshalJSON

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

MarshalJSON is the custom marshaler for RecurringCharge.

type ResourceRateCardInfo

type ResourceRateCardInfo struct {
	autorest.Response `json:"-"`
	Currency          *string          `json:"Currency,omitempty"`
	Locale            *string          `json:"Locale,omitempty"`
	IsTaxIncluded     *bool            `json:"IsTaxIncluded,omitempty"`
	OfferTerms        *[]OfferTermInfo `json:"OfferTerms,omitempty"`
	Meters            *[]MeterInfo     `json:"Meters,omitempty"`
}

ResourceRateCardInfo is price and Metadata information for resources

func (*ResourceRateCardInfo) UnmarshalJSON

func (rrci *ResourceRateCardInfo) UnmarshalJSON(body []byte) error

UnmarshalJSON is the custom unmarshaler for ResourceRateCardInfo struct.

type UsageAggregatesClient

type UsageAggregatesClient struct {
	ManagementClient
}

UsageAggregatesClient is the client for the UsageAggregates methods of the Commerce service.

func NewUsageAggregatesClient

func NewUsageAggregatesClient(subscriptionID string) UsageAggregatesClient

NewUsageAggregatesClient creates an instance of the UsageAggregatesClient client.

func NewUsageAggregatesClientWithBaseURI

func NewUsageAggregatesClientWithBaseURI(baseURI string, subscriptionID string) UsageAggregatesClient

NewUsageAggregatesClientWithBaseURI creates an instance of the UsageAggregatesClient client.

func (UsageAggregatesClient) List

func (client UsageAggregatesClient) List(reportedStartTime date.Time, reportedEndTime date.Time, showDetails *bool, aggregationGranularity AggregationGranularity, continuationToken string) (result UsageAggregationListResult, err error)

List query aggregated Azure subscription consumption data for a date range.

reportedStartTime is the start of the time range to retrieve data for. reportedEndTime is the end of the time range to retrieve data for. showDetails is `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). aggregationGranularity is `Daily` (default) returns the data in daily granularity, `Hourly` returns the data in hourly granularity. continuationToken is 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.

func (UsageAggregatesClient) ListComplete

func (client UsageAggregatesClient) ListComplete(reportedStartTime date.Time, reportedEndTime date.Time, showDetails *bool, aggregationGranularity AggregationGranularity, continuationToken string, cancel <-chan struct{}) (<-chan UsageAggregation, <-chan error)

ListComplete gets all elements from the list without paging.

func (UsageAggregatesClient) ListNextResults

func (client UsageAggregatesClient) ListNextResults(lastResults UsageAggregationListResult) (result UsageAggregationListResult, err error)

ListNextResults retrieves the next set of results, if any.

func (UsageAggregatesClient) ListPreparer

func (client UsageAggregatesClient) ListPreparer(reportedStartTime date.Time, reportedEndTime date.Time, showDetails *bool, aggregationGranularity AggregationGranularity, continuationToken string) (*http.Request, error)

ListPreparer prepares the List request.

func (UsageAggregatesClient) ListResponder

func (client UsageAggregatesClient) ListResponder(resp *http.Response) (result UsageAggregationListResult, err error)

ListResponder handles the response to the List request. The method always closes the http.Response Body.

func (UsageAggregatesClient) ListSender

func (client UsageAggregatesClient) ListSender(req *http.Request) (*http.Response, error)

ListSender sends the List request. The method will close the http.Response Body if it receives an error.

type UsageAggregation

type UsageAggregation struct {
	ID           *string `json:"id,omitempty"`
	Name         *string `json:"name,omitempty"`
	Type         *string `json:"type,omitempty"`
	*UsageSample `json:"properties,omitempty"`
}

UsageAggregation is describes the usageAggregation.

type UsageAggregationListResult

type UsageAggregationListResult struct {
	autorest.Response `json:"-"`
	Value             *[]UsageAggregation `json:"value,omitempty"`
	NextLink          *string             `json:"nextLink,omitempty"`
}

UsageAggregationListResult is the Get UsageAggregates operation response.

func (UsageAggregationListResult) UsageAggregationListResultPreparer

func (client UsageAggregationListResult) UsageAggregationListResultPreparer() (*http.Request, error)

UsageAggregationListResultPreparer prepares a request to retrieve the next set of results. It returns nil if no more results exist.

type UsageSample

type UsageSample struct {
	SubscriptionID   *uuid.UUID              `json:"subscriptionId,omitempty"`
	MeterID          *string                 `json:"meterId,omitempty"`
	UsageStartTime   *date.Time              `json:"usageStartTime,omitempty"`
	UsageEndTime     *date.Time              `json:"usageEndTime,omitempty"`
	Quantity         *map[string]interface{} `json:"quantity,omitempty"`
	Unit             *string                 `json:"unit,omitempty"`
	MeterName        *string                 `json:"meterName,omitempty"`
	MeterCategory    *string                 `json:"meterCategory,omitempty"`
	MeterSubCategory *string                 `json:"meterSubCategory,omitempty"`
	MeterRegion      *string                 `json:"meterRegion,omitempty"`
	InfoFields       *InfoField              `json:"infoFields,omitempty"`
	InstanceData     *string                 `json:"instanceData,omitempty"`
}

UsageSample is describes a sample of the usageAggregation.

Jump to

Keyboard shortcuts

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