vendor: update all dependencies to latest versions

This commit is contained in:
Nick Craig-Wood
2017-09-30 15:27:27 +01:00
parent 911d121bb9
commit b017fcfe9a
3048 changed files with 537055 additions and 189679 deletions
+3 -5
View File
@@ -1,5 +1,4 @@
// Package commerce implements the Azure ARM Commerce service API version
// 2015-06-01-preview.
// Package commerce implements the Azure ARM Commerce service API version 2015-06-01-preview.
//
//
package commerce
@@ -18,9 +17,8 @@ package commerce
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
import (
"github.com/Azure/go-autorest/autorest"
+210 -11
View File
@@ -14,15 +14,16 @@ package commerce
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
import (
"encoding/json"
"errors"
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/date"
"github.com/Azure/go-autorest/autorest/to"
"github.com/satori/uuid"
uuid "github.com/satori/go.uuid"
"github.com/shopspring/decimal"
"net/http"
)
@@ -37,6 +38,18 @@ const (
Hourly AggregationGranularity = "Hourly"
)
// Name enumerates the values for name.
type Name string
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"
)
// ErrorResponse is describes the format of Error response.
type ErrorResponse struct {
Code *string `json:"code,omitempty"`
@@ -62,28 +75,126 @@ type MeterInfo struct {
IncludedQuantity *float64 `json:"IncludedQuantity,omitempty"`
}
// MonetaryCommitment is indicates that a monetary commitment is required for
// this offer
// MonetaryCommitment is indicates that a monetary commitment is required for this offer
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"`
}
// MarshalJSON is the custom marshaler for MonetaryCommitment.
func (mc MonetaryCommitment) MarshalJSON() ([]byte, error) {
mc.Name = NameMonetaryCommitment
type Alias MonetaryCommitment
return json.Marshal(&struct {
Alias
}{
Alias: (Alias)(mc),
})
}
// AsMonetaryCredit is the OfferTermInfo implementation for MonetaryCommitment.
func (mc MonetaryCommitment) AsMonetaryCredit() (*MonetaryCredit, bool) {
return nil, false
}
// AsMonetaryCommitment is the OfferTermInfo implementation for MonetaryCommitment.
func (mc MonetaryCommitment) AsMonetaryCommitment() (*MonetaryCommitment, bool) {
return &mc, true
}
// AsRecurringCharge is the OfferTermInfo implementation for MonetaryCommitment.
func (mc MonetaryCommitment) AsRecurringCharge() (*RecurringCharge, bool) {
return nil, false
}
// MonetaryCredit is indicates that this is a monetary credit offer.
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"`
}
// OfferTermInfo is describes the offer term.
type OfferTermInfo struct {
EffectiveDate *date.Time `json:"EffectiveDate,omitempty"`
// MarshalJSON is the custom marshaler for MonetaryCredit.
func (mc MonetaryCredit) MarshalJSON() ([]byte, error) {
mc.Name = NameMonetaryCredit
type Alias MonetaryCredit
return json.Marshal(&struct {
Alias
}{
Alias: (Alias)(mc),
})
}
// RateCardQueryParameters is parameters that are used in the odata $filter
// query parameter for providing RateCard information.
// AsMonetaryCredit is the OfferTermInfo implementation for MonetaryCredit.
func (mc MonetaryCredit) AsMonetaryCredit() (*MonetaryCredit, bool) {
return &mc, true
}
// AsMonetaryCommitment is the OfferTermInfo implementation for MonetaryCredit.
func (mc MonetaryCredit) AsMonetaryCommitment() (*MonetaryCommitment, bool) {
return nil, false
}
// AsRecurringCharge is the OfferTermInfo implementation for MonetaryCredit.
func (mc MonetaryCredit) AsRecurringCharge() (*RecurringCharge, bool) {
return nil, false
}
// OfferTermInfo is describes the offer term.
type OfferTermInfo interface {
AsMonetaryCredit() (*MonetaryCredit, bool)
AsMonetaryCommitment() (*MonetaryCommitment, bool)
AsRecurringCharge() (*RecurringCharge, bool)
}
func unmarshalOfferTermInfo(body []byte) (OfferTermInfo, error) {
var m map[string]interface{}
err := json.Unmarshal(body, &m)
if err != nil {
return nil, err
}
switch m["Name"] {
case string(NameMonetaryCredit):
var mc MonetaryCredit
err := json.Unmarshal(body, &mc)
return mc, err
case string(NameMonetaryCommitment):
var mc MonetaryCommitment
err := json.Unmarshal(body, &mc)
return mc, err
case string(NameRecurringCharge):
var rc RecurringCharge
err := json.Unmarshal(body, &rc)
return rc, err
default:
return nil, errors.New("Unsupported type")
}
}
func unmarshalOfferTermInfoArray(body []byte) ([]OfferTermInfo, error) {
var rawMessages []*json.RawMessage
err := json.Unmarshal(body, &rawMessages)
if err != nil {
return nil, err
}
otiArray := make([]OfferTermInfo, len(rawMessages))
for index, rawMessage := range rawMessages {
oti, err := unmarshalOfferTermInfo(*rawMessage)
if err != nil {
return nil, err
}
otiArray[index] = oti
}
return otiArray, nil
}
// RateCardQueryParameters is parameters that are used in the odata $filter query parameter for providing RateCard
// information.
type RateCardQueryParameters struct {
OfferDurableID *string `json:"OfferDurableId,omitempty"`
Currency *string `json:"Currency,omitempty"`
@@ -94,9 +205,36 @@ type RateCardQueryParameters struct {
// RecurringCharge is indicates a recurring charge is present for this offer.
type RecurringCharge struct {
EffectiveDate *date.Time `json:"EffectiveDate,omitempty"`
Name Name `json:"Name,omitempty"`
RecurringCharge *int32 `json:"RecurringCharge,omitempty"`
}
// MarshalJSON is the custom marshaler for RecurringCharge.
func (rc RecurringCharge) MarshalJSON() ([]byte, error) {
rc.Name = NameRecurringCharge
type Alias RecurringCharge
return json.Marshal(&struct {
Alias
}{
Alias: (Alias)(rc),
})
}
// AsMonetaryCredit is the OfferTermInfo implementation for RecurringCharge.
func (rc RecurringCharge) AsMonetaryCredit() (*MonetaryCredit, bool) {
return nil, false
}
// AsMonetaryCommitment is the OfferTermInfo implementation for RecurringCharge.
func (rc RecurringCharge) AsMonetaryCommitment() (*MonetaryCommitment, bool) {
return nil, false
}
// AsRecurringCharge is the OfferTermInfo implementation for RecurringCharge.
func (rc RecurringCharge) AsRecurringCharge() (*RecurringCharge, bool) {
return &rc, true
}
// ResourceRateCardInfo is price and Metadata information for resources
type ResourceRateCardInfo struct {
autorest.Response `json:"-"`
@@ -107,6 +245,67 @@ type ResourceRateCardInfo struct {
Meters *[]MeterInfo `json:"Meters,omitempty"`
}
// UnmarshalJSON is the custom unmarshaler for ResourceRateCardInfo struct.
func (rrci *ResourceRateCardInfo) UnmarshalJSON(body []byte) error {
var m map[string]*json.RawMessage
err := json.Unmarshal(body, &m)
if err != nil {
return err
}
var v *json.RawMessage
v = m["Currency"]
if v != nil {
var currency string
err = json.Unmarshal(*m["Currency"], &currency)
if err != nil {
return err
}
rrci.Currency = &currency
}
v = m["Locale"]
if v != nil {
var locale string
err = json.Unmarshal(*m["Locale"], &locale)
if err != nil {
return err
}
rrci.Locale = &locale
}
v = m["IsTaxIncluded"]
if v != nil {
var isTaxIncluded bool
err = json.Unmarshal(*m["IsTaxIncluded"], &isTaxIncluded)
if err != nil {
return err
}
rrci.IsTaxIncluded = &isTaxIncluded
}
v = m["OfferTerms"]
if v != nil {
offerTerms, err := unmarshalOfferTermInfoArray(*m["OfferTerms"])
if err != nil {
return err
}
rrci.OfferTerms = &offerTerms
}
v = m["Meters"]
if v != nil {
var meters []MeterInfo
err = json.Unmarshal(*m["Meters"], &meters)
if err != nil {
return err
}
rrci.Meters = &meters
}
return nil
}
// UsageAggregation is describes the usageAggregation.
type UsageAggregation struct {
ID *string `json:"id,omitempty"`
+13 -20
View File
@@ -14,9 +14,8 @@ package commerce
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
import (
"github.com/Azure/go-autorest/autorest"
@@ -24,8 +23,7 @@ import (
"net/http"
)
// RateCardClient is the client for the RateCard methods of the Commerce
// service.
// RateCardClient is the client for the RateCard methods of the Commerce service.
type RateCardClient struct {
ManagementClient
}
@@ -35,26 +33,21 @@ func NewRateCardClient(subscriptionID string) RateCardClient {
return NewRateCardClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewRateCardClientWithBaseURI creates an instance of the RateCardClient
// client.
// NewRateCardClientWithBaseURI creates an instance of the RateCardClient client.
func NewRateCardClientWithBaseURI(baseURI string, subscriptionID string) RateCardClient {
return RateCardClient{NewWithBaseURI(baseURI, subscriptionID)}
}
// 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.
// 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.
// 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 (client RateCardClient) Get(filter string) (result ResourceRateCardInfo, err error) {
req, err := client.GetPreparer(filter)
if err != nil {
+59 -23
View File
@@ -14,9 +14,8 @@ package commerce
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
import (
"github.com/Azure/go-autorest/autorest"
@@ -25,40 +24,32 @@ import (
"net/http"
)
// UsageAggregatesClient is the client for the UsageAggregates methods of the
// Commerce service.
// UsageAggregatesClient is the client for the UsageAggregates methods of the Commerce service.
type UsageAggregatesClient struct {
ManagementClient
}
// NewUsageAggregatesClient creates an instance of the UsageAggregatesClient
// client.
// NewUsageAggregatesClient creates an instance of the UsageAggregatesClient client.
func NewUsageAggregatesClient(subscriptionID string) UsageAggregatesClient {
return NewUsageAggregatesClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewUsageAggregatesClientWithBaseURI creates an instance of the
// UsageAggregatesClient client.
// NewUsageAggregatesClientWithBaseURI creates an instance of the UsageAggregatesClient client.
func NewUsageAggregatesClientWithBaseURI(baseURI string, subscriptionID string) UsageAggregatesClient {
return UsageAggregatesClient{NewWithBaseURI(baseURI, subscriptionID)}
}
// 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.
// 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 (client UsageAggregatesClient) List(reportedStartTime date.Time, reportedEndTime date.Time, showDetails *bool, aggregationGranularity AggregationGranularity, continuationToken string) (result UsageAggregationListResult, err error) {
req, err := client.ListPreparer(reportedStartTime, reportedEndTime, showDetails, aggregationGranularity, continuationToken)
if err != nil {
@@ -153,3 +144,48 @@ func (client UsageAggregatesClient) ListNextResults(lastResults UsageAggregation
return
}
// ListComplete gets all elements from the list without paging.
func (client UsageAggregatesClient) ListComplete(reportedStartTime date.Time, reportedEndTime date.Time, showDetails *bool, aggregationGranularity AggregationGranularity, continuationToken string, cancel <-chan struct{}) (<-chan UsageAggregation, <-chan error) {
resultChan := make(chan UsageAggregation)
errChan := make(chan error, 1)
go func() {
defer func() {
close(resultChan)
close(errChan)
}()
list, err := client.List(reportedStartTime, reportedEndTime, showDetails, aggregationGranularity, continuationToken)
if err != nil {
errChan <- err
return
}
if list.Value != nil {
for _, item := range *list.Value {
select {
case <-cancel:
return
case resultChan <- item:
// Intentionally left blank
}
}
}
for list.NextLink != nil {
list, err = client.ListNextResults(list)
if err != nil {
errChan <- err
return
}
if list.Value != nil {
for _, item := range *list.Value {
select {
case <-cancel:
return
case resultChan <- item:
// Intentionally left blank
}
}
}
}
}()
return resultChan, errChan
}
+4 -5
View File
@@ -14,16 +14,15 @@ package commerce
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
// UserAgent returns the UserAgent string to use when sending http.Requests.
func UserAgent() string {
return "Azure-SDK-For-Go/v10.1.0-beta arm-commerce/2015-06-01-preview"
return "Azure-SDK-For-Go/v11.0.0-beta arm-commerce/2015-06-01-preview"
}
// Version returns the semantic version (see http://semver.org) of the client.
func Version() string {
return "v10.1.0-beta"
return "v11.0.0-beta"
}