diff --git a/services/preview/billing/mgmt/2020-05-01-preview/billing/accounts.go b/services/preview/billing/mgmt/2020-05-01-preview/billing/accounts.go index 0037c3b5fd9b..412d84b7f6d8 100644 --- a/services/preview/billing/mgmt/2020-05-01-preview/billing/accounts.go +++ b/services/preview/billing/mgmt/2020-05-01-preview/billing/accounts.go @@ -31,14 +31,14 @@ type AccountsClient struct { } // NewAccountsClient creates an instance of the AccountsClient client. -func NewAccountsClient(subscriptionID string, subscriptionID1 string) AccountsClient { - return NewAccountsClientWithBaseURI(DefaultBaseURI, subscriptionID, subscriptionID1) +func NewAccountsClient(subscriptionID string) AccountsClient { + return NewAccountsClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewAccountsClientWithBaseURI creates an instance of the AccountsClient client using a custom endpoint. Use this // when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewAccountsClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) AccountsClient { - return AccountsClient{NewWithBaseURI(baseURI, subscriptionID, subscriptionID1)} +func NewAccountsClientWithBaseURI(baseURI string, subscriptionID string) AccountsClient { + return AccountsClient{NewWithBaseURI(baseURI, subscriptionID)} } // Get gets a billing account by its ID. diff --git a/services/preview/billing/mgmt/2020-05-01-preview/billing/address.go b/services/preview/billing/mgmt/2020-05-01-preview/billing/address.go index 2444623f33b7..bc411463c3be 100644 --- a/services/preview/billing/mgmt/2020-05-01-preview/billing/address.go +++ b/services/preview/billing/mgmt/2020-05-01-preview/billing/address.go @@ -32,14 +32,14 @@ type AddressClient struct { } // NewAddressClient creates an instance of the AddressClient client. -func NewAddressClient(subscriptionID string, subscriptionID1 string) AddressClient { - return NewAddressClientWithBaseURI(DefaultBaseURI, subscriptionID, subscriptionID1) +func NewAddressClient(subscriptionID string) AddressClient { + return NewAddressClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewAddressClientWithBaseURI creates an instance of the AddressClient client using a custom endpoint. Use this when // interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewAddressClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) AddressClient { - return AddressClient{NewWithBaseURI(baseURI, subscriptionID, subscriptionID1)} +func NewAddressClientWithBaseURI(baseURI string, subscriptionID string) AddressClient { + return AddressClient{NewWithBaseURI(baseURI, subscriptionID)} } // Validate validates an address. Use the operation to validate an address before using it as soldTo or a billTo diff --git a/services/preview/billing/mgmt/2020-05-01-preview/billing/agreements.go b/services/preview/billing/mgmt/2020-05-01-preview/billing/agreements.go index a20778e8fd18..c5ed9db34dba 100644 --- a/services/preview/billing/mgmt/2020-05-01-preview/billing/agreements.go +++ b/services/preview/billing/mgmt/2020-05-01-preview/billing/agreements.go @@ -31,14 +31,14 @@ type AgreementsClient struct { } // NewAgreementsClient creates an instance of the AgreementsClient client. -func NewAgreementsClient(subscriptionID string, subscriptionID1 string) AgreementsClient { - return NewAgreementsClientWithBaseURI(DefaultBaseURI, subscriptionID, subscriptionID1) +func NewAgreementsClient(subscriptionID string) AgreementsClient { + return NewAgreementsClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewAgreementsClientWithBaseURI creates an instance of the AgreementsClient client using a custom endpoint. Use this // when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewAgreementsClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) AgreementsClient { - return AgreementsClient{NewWithBaseURI(baseURI, subscriptionID, subscriptionID1)} +func NewAgreementsClientWithBaseURI(baseURI string, subscriptionID string) AgreementsClient { + return AgreementsClient{NewWithBaseURI(baseURI, subscriptionID)} } // Get gets an agreement by ID. diff --git a/services/preview/billing/mgmt/2020-05-01-preview/billing/availablebalances.go b/services/preview/billing/mgmt/2020-05-01-preview/billing/availablebalances.go index 895eae47a0ba..9e7029db721c 100644 --- a/services/preview/billing/mgmt/2020-05-01-preview/billing/availablebalances.go +++ b/services/preview/billing/mgmt/2020-05-01-preview/billing/availablebalances.go @@ -31,15 +31,15 @@ type AvailableBalancesClient struct { } // NewAvailableBalancesClient creates an instance of the AvailableBalancesClient client. -func NewAvailableBalancesClient(subscriptionID string, subscriptionID1 string) AvailableBalancesClient { - return NewAvailableBalancesClientWithBaseURI(DefaultBaseURI, subscriptionID, subscriptionID1) +func NewAvailableBalancesClient(subscriptionID string) AvailableBalancesClient { + return NewAvailableBalancesClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewAvailableBalancesClientWithBaseURI creates an instance of the AvailableBalancesClient client using a custom // endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure // stack). -func NewAvailableBalancesClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) AvailableBalancesClient { - return AvailableBalancesClient{NewWithBaseURI(baseURI, subscriptionID, subscriptionID1)} +func NewAvailableBalancesClientWithBaseURI(baseURI string, subscriptionID string) AvailableBalancesClient { + return AvailableBalancesClient{NewWithBaseURI(baseURI, subscriptionID)} } // Get the available credit balance for a billing profile. This is the balance that can be used for pay now to settle diff --git a/services/preview/billing/mgmt/2020-05-01-preview/billing/billingapi/interfaces.go b/services/preview/billing/mgmt/2020-05-01-preview/billing/billingapi/interfaces.go index d056c822a530..cdac352351d5 100644 --- a/services/preview/billing/mgmt/2020-05-01-preview/billing/billingapi/interfaces.go +++ b/services/preview/billing/mgmt/2020-05-01-preview/billing/billingapi/interfaces.go @@ -143,6 +143,8 @@ var _ ProductsClientAPI = (*billing.ProductsClient)(nil) type InvoicesClientAPI interface { DownloadBillingSubscriptionInvoice(ctx context.Context, invoiceName string, downloadToken string) (result billing.InvoicesDownloadBillingSubscriptionInvoiceFuture, err error) DownloadInvoice(ctx context.Context, billingAccountName string, invoiceName string, downloadToken string) (result billing.InvoicesDownloadInvoiceFuture, err error) + DownloadMultipleBillingProfileInvoices(ctx context.Context, billingAccountName string, downloadUrls []string) (result billing.InvoicesDownloadMultipleBillingProfileInvoicesFuture, err error) + DownloadMultipleBillingSubscriptionInvoices(ctx context.Context, downloadUrls []string) (result billing.InvoicesDownloadMultipleBillingSubscriptionInvoicesFuture, err error) Get(ctx context.Context, billingAccountName string, invoiceName string) (result billing.Invoice, err error) GetByID(ctx context.Context, invoiceName string) (result billing.Invoice, err error) GetBySubscriptionAndInvoiceID(ctx context.Context, invoiceName string) (result billing.Invoice, err error) diff --git a/services/preview/billing/mgmt/2020-05-01-preview/billing/client.go b/services/preview/billing/mgmt/2020-05-01-preview/billing/client.go index 69c283a26a61..d338d2469098 100644 --- a/services/preview/billing/mgmt/2020-05-01-preview/billing/client.go +++ b/services/preview/billing/mgmt/2020-05-01-preview/billing/client.go @@ -32,23 +32,21 @@ const ( // BaseClient is the base client for Billing. type BaseClient struct { autorest.Client - BaseURI string - SubscriptionID string - SubscriptionID1 string + BaseURI string + SubscriptionID string } // New creates an instance of the BaseClient client. -func New(subscriptionID string, subscriptionID1 string) BaseClient { - return NewWithBaseURI(DefaultBaseURI, subscriptionID, subscriptionID1) +func New(subscriptionID string) BaseClient { + return NewWithBaseURI(DefaultBaseURI, subscriptionID) } // NewWithBaseURI creates an instance of the BaseClient client using a custom endpoint. Use this when interacting with // an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) BaseClient { +func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { return BaseClient{ - Client: autorest.NewClientWithUserAgent(UserAgent()), - BaseURI: baseURI, - SubscriptionID: subscriptionID, - SubscriptionID1: subscriptionID1, + Client: autorest.NewClientWithUserAgent(UserAgent()), + BaseURI: baseURI, + SubscriptionID: subscriptionID, } } diff --git a/services/preview/billing/mgmt/2020-05-01-preview/billing/customers.go b/services/preview/billing/mgmt/2020-05-01-preview/billing/customers.go index 9677392cee4a..9693fb625f8e 100644 --- a/services/preview/billing/mgmt/2020-05-01-preview/billing/customers.go +++ b/services/preview/billing/mgmt/2020-05-01-preview/billing/customers.go @@ -31,14 +31,14 @@ type CustomersClient struct { } // NewCustomersClient creates an instance of the CustomersClient client. -func NewCustomersClient(subscriptionID string, subscriptionID1 string) CustomersClient { - return NewCustomersClientWithBaseURI(DefaultBaseURI, subscriptionID, subscriptionID1) +func NewCustomersClient(subscriptionID string) CustomersClient { + return NewCustomersClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewCustomersClientWithBaseURI creates an instance of the CustomersClient client using a custom endpoint. Use this // when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewCustomersClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) CustomersClient { - return CustomersClient{NewWithBaseURI(baseURI, subscriptionID, subscriptionID1)} +func NewCustomersClientWithBaseURI(baseURI string, subscriptionID string) CustomersClient { + return CustomersClient{NewWithBaseURI(baseURI, subscriptionID)} } // Get gets a customer by its ID. The operation is supported only for billing accounts with agreement type Microsoft diff --git a/services/preview/billing/mgmt/2020-05-01-preview/billing/enrollmentaccounts.go b/services/preview/billing/mgmt/2020-05-01-preview/billing/enrollmentaccounts.go index 82aa173f1928..9b675f99c74e 100644 --- a/services/preview/billing/mgmt/2020-05-01-preview/billing/enrollmentaccounts.go +++ b/services/preview/billing/mgmt/2020-05-01-preview/billing/enrollmentaccounts.go @@ -31,15 +31,15 @@ type EnrollmentAccountsClient struct { } // NewEnrollmentAccountsClient creates an instance of the EnrollmentAccountsClient client. -func NewEnrollmentAccountsClient(subscriptionID string, subscriptionID1 string) EnrollmentAccountsClient { - return NewEnrollmentAccountsClientWithBaseURI(DefaultBaseURI, subscriptionID, subscriptionID1) +func NewEnrollmentAccountsClient(subscriptionID string) EnrollmentAccountsClient { + return NewEnrollmentAccountsClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewEnrollmentAccountsClientWithBaseURI creates an instance of the EnrollmentAccountsClient client using a custom // endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure // stack). -func NewEnrollmentAccountsClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) EnrollmentAccountsClient { - return EnrollmentAccountsClient{NewWithBaseURI(baseURI, subscriptionID, subscriptionID1)} +func NewEnrollmentAccountsClientWithBaseURI(baseURI string, subscriptionID string) EnrollmentAccountsClient { + return EnrollmentAccountsClient{NewWithBaseURI(baseURI, subscriptionID)} } // Get gets a enrollment account by name. diff --git a/services/preview/billing/mgmt/2020-05-01-preview/billing/enums.go b/services/preview/billing/mgmt/2020-05-01-preview/billing/enums.go index ae774ecab204..cb726b1a1bf5 100644 --- a/services/preview/billing/mgmt/2020-05-01-preview/billing/enums.go +++ b/services/preview/billing/mgmt/2020-05-01-preview/billing/enums.go @@ -193,6 +193,21 @@ func PossibleFrequencyValues() []Frequency { return []Frequency{Monthly, OneTime, UsageBased} } +// InvoiceDocumentType enumerates the values for invoice document type. +type InvoiceDocumentType string + +const ( + // InvoiceDocumentTypeCreditNote ... + InvoiceDocumentTypeCreditNote InvoiceDocumentType = "CreditNote" + // InvoiceDocumentTypeInvoice ... + InvoiceDocumentTypeInvoice InvoiceDocumentType = "Invoice" +) + +// PossibleInvoiceDocumentTypeValues returns an array of possible values for the InvoiceDocumentType const type. +func PossibleInvoiceDocumentTypeValues() []InvoiceDocumentType { + return []InvoiceDocumentType{InvoiceDocumentTypeCreditNote, InvoiceDocumentTypeInvoice} +} + // InvoiceSectionState enumerates the values for invoice section state. type InvoiceSectionState string @@ -218,11 +233,13 @@ const ( OverDue InvoiceStatus = "OverDue" // Paid ... Paid InvoiceStatus = "Paid" + // Void ... + Void InvoiceStatus = "Void" ) // PossibleInvoiceStatusValues returns an array of possible values for the InvoiceStatus const type. func PossibleInvoiceStatusValues() []InvoiceStatus { - return []InvoiceStatus{Due, OverDue, Paid} + return []InvoiceStatus{Due, OverDue, Paid, Void} } // InvoiceType enumerates the values for invoice type. diff --git a/services/preview/billing/mgmt/2020-05-01-preview/billing/instructions.go b/services/preview/billing/mgmt/2020-05-01-preview/billing/instructions.go index 9d55fce93708..c35013217250 100644 --- a/services/preview/billing/mgmt/2020-05-01-preview/billing/instructions.go +++ b/services/preview/billing/mgmt/2020-05-01-preview/billing/instructions.go @@ -32,14 +32,14 @@ type InstructionsClient struct { } // NewInstructionsClient creates an instance of the InstructionsClient client. -func NewInstructionsClient(subscriptionID string, subscriptionID1 string) InstructionsClient { - return NewInstructionsClientWithBaseURI(DefaultBaseURI, subscriptionID, subscriptionID1) +func NewInstructionsClient(subscriptionID string) InstructionsClient { + return NewInstructionsClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewInstructionsClientWithBaseURI creates an instance of the InstructionsClient client using a custom endpoint. Use // this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewInstructionsClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) InstructionsClient { - return InstructionsClient{NewWithBaseURI(baseURI, subscriptionID, subscriptionID1)} +func NewInstructionsClientWithBaseURI(baseURI string, subscriptionID string) InstructionsClient { + return InstructionsClient{NewWithBaseURI(baseURI, subscriptionID)} } // Get get the instruction by name. These are custom billing instructions and are only applicable for certain diff --git a/services/preview/billing/mgmt/2020-05-01-preview/billing/invoices.go b/services/preview/billing/mgmt/2020-05-01-preview/billing/invoices.go index ba76aaec3fe8..785e9ca4129f 100644 --- a/services/preview/billing/mgmt/2020-05-01-preview/billing/invoices.go +++ b/services/preview/billing/mgmt/2020-05-01-preview/billing/invoices.go @@ -21,6 +21,7 @@ import ( "context" "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" "github.com/Azure/go-autorest/tracing" "net/http" ) @@ -31,14 +32,14 @@ type InvoicesClient struct { } // NewInvoicesClient creates an instance of the InvoicesClient client. -func NewInvoicesClient(subscriptionID string, subscriptionID1 string) InvoicesClient { - return NewInvoicesClientWithBaseURI(DefaultBaseURI, subscriptionID, subscriptionID1) +func NewInvoicesClient(subscriptionID string) InvoicesClient { + return NewInvoicesClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewInvoicesClientWithBaseURI creates an instance of the InvoicesClient client using a custom endpoint. Use this // when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewInvoicesClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) InvoicesClient { - return InvoicesClient{NewWithBaseURI(baseURI, subscriptionID, subscriptionID1)} +func NewInvoicesClientWithBaseURI(baseURI string, subscriptionID string) InvoicesClient { + return InvoicesClient{NewWithBaseURI(baseURI, subscriptionID)} } // DownloadBillingSubscriptionInvoice gets a URL to download an invoice. @@ -193,6 +194,170 @@ func (client InvoicesClient) DownloadInvoiceResponder(resp *http.Response) (resu return } +// DownloadMultipleBillingProfileInvoices gets a URL to download multiple invoice documents (invoice pdf, tax receipts, +// credit notes) as a zip file. The operation is supported for billing accounts with agreement type Microsoft Partner +// Agreement or Microsoft Customer Agreement. +// Parameters: +// billingAccountName - the ID that uniquely identifies a billing account. +// downloadUrls - an array of download urls for individual documents +func (client InvoicesClient) DownloadMultipleBillingProfileInvoices(ctx context.Context, billingAccountName string, downloadUrls []string) (result InvoicesDownloadMultipleBillingProfileInvoicesFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/InvoicesClient.DownloadMultipleBillingProfileInvoices") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: downloadUrls, + Constraints: []validation.Constraint{{Target: "downloadUrls", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("billing.InvoicesClient", "DownloadMultipleBillingProfileInvoices", err.Error()) + } + + req, err := client.DownloadMultipleBillingProfileInvoicesPreparer(ctx, billingAccountName, downloadUrls) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.InvoicesClient", "DownloadMultipleBillingProfileInvoices", nil, "Failure preparing request") + return + } + + result, err = client.DownloadMultipleBillingProfileInvoicesSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.InvoicesClient", "DownloadMultipleBillingProfileInvoices", result.Response(), "Failure sending request") + return + } + + return +} + +// DownloadMultipleBillingProfileInvoicesPreparer prepares the DownloadMultipleBillingProfileInvoices request. +func (client InvoicesClient) DownloadMultipleBillingProfileInvoicesPreparer(ctx context.Context, billingAccountName string, downloadUrls []string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "billingAccountName": autorest.Encode("path", billingAccountName), + } + + const APIVersion = "2020-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/downloadDocuments", pathParameters), + autorest.WithJSON(downloadUrls), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DownloadMultipleBillingProfileInvoicesSender sends the DownloadMultipleBillingProfileInvoices request. The method will close the +// http.Response Body if it receives an error. +func (client InvoicesClient) DownloadMultipleBillingProfileInvoicesSender(req *http.Request) (future InvoicesDownloadMultipleBillingProfileInvoicesFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// DownloadMultipleBillingProfileInvoicesResponder handles the response to the DownloadMultipleBillingProfileInvoices request. The method always +// closes the http.Response Body. +func (client InvoicesClient) DownloadMultipleBillingProfileInvoicesResponder(resp *http.Response) (result DownloadURL, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// DownloadMultipleBillingSubscriptionInvoices gets a URL to download multiple invoice documents (invoice pdf, tax +// receipts, credit notes) as a zip file. +// Parameters: +// downloadUrls - an array of download urls for individual documents +func (client InvoicesClient) DownloadMultipleBillingSubscriptionInvoices(ctx context.Context, downloadUrls []string) (result InvoicesDownloadMultipleBillingSubscriptionInvoicesFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/InvoicesClient.DownloadMultipleBillingSubscriptionInvoices") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: downloadUrls, + Constraints: []validation.Constraint{{Target: "downloadUrls", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("billing.InvoicesClient", "DownloadMultipleBillingSubscriptionInvoices", err.Error()) + } + + req, err := client.DownloadMultipleBillingSubscriptionInvoicesPreparer(ctx, downloadUrls) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.InvoicesClient", "DownloadMultipleBillingSubscriptionInvoices", nil, "Failure preparing request") + return + } + + result, err = client.DownloadMultipleBillingSubscriptionInvoicesSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.InvoicesClient", "DownloadMultipleBillingSubscriptionInvoices", result.Response(), "Failure sending request") + return + } + + return +} + +// DownloadMultipleBillingSubscriptionInvoicesPreparer prepares the DownloadMultipleBillingSubscriptionInvoices request. +func (client InvoicesClient) DownloadMultipleBillingSubscriptionInvoicesPreparer(ctx context.Context, downloadUrls []string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.Billing/billingAccounts/default/billingSubscriptions/{subscriptionId}/downloadDocuments", pathParameters), + autorest.WithJSON(downloadUrls), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DownloadMultipleBillingSubscriptionInvoicesSender sends the DownloadMultipleBillingSubscriptionInvoices request. The method will close the +// http.Response Body if it receives an error. +func (client InvoicesClient) DownloadMultipleBillingSubscriptionInvoicesSender(req *http.Request) (future InvoicesDownloadMultipleBillingSubscriptionInvoicesFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// DownloadMultipleBillingSubscriptionInvoicesResponder handles the response to the DownloadMultipleBillingSubscriptionInvoices request. The method always +// closes the http.Response Body. +func (client InvoicesClient) DownloadMultipleBillingSubscriptionInvoicesResponder(resp *http.Response) (result DownloadURL, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + // Get gets an invoice by billing account name and ID. The operation is supported for billing accounts with agreement // type Microsoft Partner Agreement or Microsoft Customer Agreement. // Parameters: diff --git a/services/preview/billing/mgmt/2020-05-01-preview/billing/invoicesections.go b/services/preview/billing/mgmt/2020-05-01-preview/billing/invoicesections.go index 8ac06303c1e4..18a63e39850b 100644 --- a/services/preview/billing/mgmt/2020-05-01-preview/billing/invoicesections.go +++ b/services/preview/billing/mgmt/2020-05-01-preview/billing/invoicesections.go @@ -31,14 +31,14 @@ type InvoiceSectionsClient struct { } // NewInvoiceSectionsClient creates an instance of the InvoiceSectionsClient client. -func NewInvoiceSectionsClient(subscriptionID string, subscriptionID1 string) InvoiceSectionsClient { - return NewInvoiceSectionsClientWithBaseURI(DefaultBaseURI, subscriptionID, subscriptionID1) +func NewInvoiceSectionsClient(subscriptionID string) InvoiceSectionsClient { + return NewInvoiceSectionsClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewInvoiceSectionsClientWithBaseURI creates an instance of the InvoiceSectionsClient client using a custom endpoint. // Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewInvoiceSectionsClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) InvoiceSectionsClient { - return InvoiceSectionsClient{NewWithBaseURI(baseURI, subscriptionID, subscriptionID1)} +func NewInvoiceSectionsClientWithBaseURI(baseURI string, subscriptionID string) InvoiceSectionsClient { + return InvoiceSectionsClient{NewWithBaseURI(baseURI, subscriptionID)} } // CreateOrUpdate creates or updates an invoice section. The operation is supported only for billing accounts with diff --git a/services/preview/billing/mgmt/2020-05-01-preview/billing/models.go b/services/preview/billing/mgmt/2020-05-01-preview/billing/models.go index 3cccd8130e26..037ace81b06c 100644 --- a/services/preview/billing/mgmt/2020-05-01-preview/billing/models.go +++ b/services/preview/billing/mgmt/2020-05-01-preview/billing/models.go @@ -30,7 +30,7 @@ import ( ) // The package's fully qualified name. -const fqdn = "github.com/Azure/azure-sdk-for-go/services/billing/mgmt/2020-05-01/billing" +const fqdn = "github.com/Azure/azure-sdk-for-go/services/preview/billing/mgmt/2020-05-01-preview/billing" // Account a billing account. type Account struct { @@ -1602,6 +1602,8 @@ type ErrorDetails struct { Message *string `json:"message,omitempty"` // Target - READ-ONLY; The target of the particular error. Target *string `json:"target,omitempty"` + // Details - READ-ONLY; The sub details of the error. + Details *[]ErrorSubDetailsItem `json:"details,omitempty"` } // ErrorResponse error response indicates that the service is not able to process the incoming request. The @@ -1611,6 +1613,16 @@ type ErrorResponse struct { Error *ErrorDetails `json:"error,omitempty"` } +// ErrorSubDetailsItem ... +type ErrorSubDetailsItem struct { + // Code - READ-ONLY; Error code. + Code *string `json:"code,omitempty"` + // Message - READ-ONLY; Error message indicating why the operation failed. + Message *string `json:"message,omitempty"` + // Target - READ-ONLY; The target of the particular error. + Target *string `json:"target,omitempty"` +} + // IndirectRelationshipInfo the billing profile details of the partner of the customer for an indirect motion. type IndirectRelationshipInfo struct { // BillingAccountName - The billing account name of the partner or the customer for an indirect motion. @@ -2097,7 +2109,7 @@ type InvoiceProperties struct { DueDate *date.Time `json:"dueDate,omitempty"` // InvoiceDate - READ-ONLY; The date when the invoice was generated. InvoiceDate *date.Time `json:"invoiceDate,omitempty"` - // Status - READ-ONLY; The current status of the invoice. Possible values include: 'Due', 'OverDue', 'Paid' + // Status - READ-ONLY; The current status of the invoice. Possible values include: 'Due', 'OverDue', 'Paid', 'Void' Status InvoiceStatus `json:"status,omitempty"` // AmountDue - READ-ONLY; The amount due as of now. AmountDue *Amount `json:"amountDue,omitempty"` @@ -2133,10 +2145,24 @@ type InvoiceProperties struct { Documents *[]Document `json:"documents,omitempty"` // Payments - READ-ONLY; List of payments. Payments *[]PaymentProperties `json:"payments,omitempty"` + // RebillDetails - READ-ONLY; Rebill details for an invoice. + RebillDetails map[string]*RebillDetails `json:"rebillDetails"` + // DocumentType - READ-ONLY; The type of the document. Possible values include: 'InvoiceDocumentTypeInvoice', 'InvoiceDocumentTypeCreditNote' + DocumentType InvoiceDocumentType `json:"documentType,omitempty"` + // BilledDocumentID - READ-ONLY; The Id of the active invoice which is originally billed after this invoice was voided. This field is applicable to the void invoices only. + BilledDocumentID *string `json:"billedDocumentId,omitempty"` + // CreditForDocumentID - READ-ONLY; The Id of the invoice which got voided and this credit note was issued as a result. This field is applicable to the credit notes only. + CreditForDocumentID *string `json:"creditForDocumentId,omitempty"` // SubscriptionID - READ-ONLY; The ID of the subscription for which the invoice is generated. SubscriptionID *string `json:"subscriptionId,omitempty"` } +// MarshalJSON is the custom marshaler for InvoiceProperties. +func (IP InvoiceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + // InvoicesDownloadBillingSubscriptionInvoiceFuture an abstraction for monitoring and retrieving the results of // a long-running operation. type InvoicesDownloadBillingSubscriptionInvoiceFuture struct { @@ -2195,6 +2221,64 @@ func (future *InvoicesDownloadInvoiceFuture) Result(client InvoicesClient) (du D return } +// InvoicesDownloadMultipleBillingProfileInvoicesFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type InvoicesDownloadMultipleBillingProfileInvoicesFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *InvoicesDownloadMultipleBillingProfileInvoicesFuture) Result(client InvoicesClient) (du DownloadURL, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.InvoicesDownloadMultipleBillingProfileInvoicesFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("billing.InvoicesDownloadMultipleBillingProfileInvoicesFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if du.Response.Response, err = future.GetResult(sender); err == nil && du.Response.Response.StatusCode != http.StatusNoContent { + du, err = client.DownloadMultipleBillingProfileInvoicesResponder(du.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.InvoicesDownloadMultipleBillingProfileInvoicesFuture", "Result", du.Response.Response, "Failure responding to request") + } + } + return +} + +// InvoicesDownloadMultipleBillingSubscriptionInvoicesFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type InvoicesDownloadMultipleBillingSubscriptionInvoicesFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *InvoicesDownloadMultipleBillingSubscriptionInvoicesFuture) Result(client InvoicesClient) (du DownloadURL, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.InvoicesDownloadMultipleBillingSubscriptionInvoicesFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("billing.InvoicesDownloadMultipleBillingSubscriptionInvoicesFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if du.Response.Response, err = future.GetResult(sender); err == nil && du.Response.Response.StatusCode != http.StatusNoContent { + du, err = client.DownloadMultipleBillingSubscriptionInvoicesResponder(du.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.InvoicesDownloadMultipleBillingSubscriptionInvoicesFuture", "Result", du.Response.Response, "Failure responding to request") + } + } + return +} + // InvoiceSection an invoice section. type InvoiceSection struct { autorest.Response `json:"-"` @@ -4168,6 +4252,22 @@ func (pp PropertyProperties) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// RebillDetails the rebill details of an invoice. +type RebillDetails struct { + // CreditNoteDocumentID - READ-ONLY; The ID of credit note. + CreditNoteDocumentID *string `json:"creditNoteDocumentId,omitempty"` + // InvoiceDocumentID - READ-ONLY; The ID of invoice. + InvoiceDocumentID *string `json:"invoiceDocumentId,omitempty"` + // RebillDetails - READ-ONLY; Rebill details for an invoice. + RebillDetails map[string]*RebillDetails `json:"rebillDetails"` +} + +// MarshalJSON is the custom marshaler for RebillDetails. +func (rd RebillDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + // Reseller details of the reseller. type Reseller struct { // ResellerID - READ-ONLY; The MPN ID of the reseller. diff --git a/services/preview/billing/mgmt/2020-05-01-preview/billing/operations.go b/services/preview/billing/mgmt/2020-05-01-preview/billing/operations.go index e69efcaaf2f1..22c983a6462a 100644 --- a/services/preview/billing/mgmt/2020-05-01-preview/billing/operations.go +++ b/services/preview/billing/mgmt/2020-05-01-preview/billing/operations.go @@ -31,14 +31,14 @@ type OperationsClient struct { } // NewOperationsClient creates an instance of the OperationsClient client. -func NewOperationsClient(subscriptionID string, subscriptionID1 string) OperationsClient { - return NewOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID, subscriptionID1) +func NewOperationsClient(subscriptionID string) OperationsClient { + return NewOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewOperationsClientWithBaseURI creates an instance of the OperationsClient client using a custom endpoint. Use this // when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) OperationsClient { - return OperationsClient{NewWithBaseURI(baseURI, subscriptionID, subscriptionID1)} +func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { + return OperationsClient{NewWithBaseURI(baseURI, subscriptionID)} } // List lists the available billing REST API operations. diff --git a/services/preview/billing/mgmt/2020-05-01-preview/billing/periods.go b/services/preview/billing/mgmt/2020-05-01-preview/billing/periods.go index 88f9072f7160..d6505b8d2001 100644 --- a/services/preview/billing/mgmt/2020-05-01-preview/billing/periods.go +++ b/services/preview/billing/mgmt/2020-05-01-preview/billing/periods.go @@ -32,14 +32,14 @@ type PeriodsClient struct { } // NewPeriodsClient creates an instance of the PeriodsClient client. -func NewPeriodsClient(subscriptionID string, subscriptionID1 string) PeriodsClient { - return NewPeriodsClientWithBaseURI(DefaultBaseURI, subscriptionID, subscriptionID1) +func NewPeriodsClient(subscriptionID string) PeriodsClient { + return NewPeriodsClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewPeriodsClientWithBaseURI creates an instance of the PeriodsClient client using a custom endpoint. Use this when // interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewPeriodsClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) PeriodsClient { - return PeriodsClient{NewWithBaseURI(baseURI, subscriptionID, subscriptionID1)} +func NewPeriodsClientWithBaseURI(baseURI string, subscriptionID string) PeriodsClient { + return PeriodsClient{NewWithBaseURI(baseURI, subscriptionID)} } // Get gets a named billing period. This is only supported for Azure Web-Direct subscriptions. Other subscription diff --git a/services/preview/billing/mgmt/2020-05-01-preview/billing/permissions.go b/services/preview/billing/mgmt/2020-05-01-preview/billing/permissions.go index 1764b97a11a8..47470e602e1c 100644 --- a/services/preview/billing/mgmt/2020-05-01-preview/billing/permissions.go +++ b/services/preview/billing/mgmt/2020-05-01-preview/billing/permissions.go @@ -31,14 +31,14 @@ type PermissionsClient struct { } // NewPermissionsClient creates an instance of the PermissionsClient client. -func NewPermissionsClient(subscriptionID string, subscriptionID1 string) PermissionsClient { - return NewPermissionsClientWithBaseURI(DefaultBaseURI, subscriptionID, subscriptionID1) +func NewPermissionsClient(subscriptionID string) PermissionsClient { + return NewPermissionsClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewPermissionsClientWithBaseURI creates an instance of the PermissionsClient client using a custom endpoint. Use // this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewPermissionsClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) PermissionsClient { - return PermissionsClient{NewWithBaseURI(baseURI, subscriptionID, subscriptionID1)} +func NewPermissionsClientWithBaseURI(baseURI string, subscriptionID string) PermissionsClient { + return PermissionsClient{NewWithBaseURI(baseURI, subscriptionID)} } // ListByBillingAccount lists the billing permissions the caller has on a billing account. diff --git a/services/preview/billing/mgmt/2020-05-01-preview/billing/policies.go b/services/preview/billing/mgmt/2020-05-01-preview/billing/policies.go index 9f4baf309e86..bb26fafdd9f0 100644 --- a/services/preview/billing/mgmt/2020-05-01-preview/billing/policies.go +++ b/services/preview/billing/mgmt/2020-05-01-preview/billing/policies.go @@ -31,14 +31,14 @@ type PoliciesClient struct { } // NewPoliciesClient creates an instance of the PoliciesClient client. -func NewPoliciesClient(subscriptionID string, subscriptionID1 string) PoliciesClient { - return NewPoliciesClientWithBaseURI(DefaultBaseURI, subscriptionID, subscriptionID1) +func NewPoliciesClient(subscriptionID string) PoliciesClient { + return NewPoliciesClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewPoliciesClientWithBaseURI creates an instance of the PoliciesClient client using a custom endpoint. Use this // when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewPoliciesClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) PoliciesClient { - return PoliciesClient{NewWithBaseURI(baseURI, subscriptionID, subscriptionID1)} +func NewPoliciesClientWithBaseURI(baseURI string, subscriptionID string) PoliciesClient { + return PoliciesClient{NewWithBaseURI(baseURI, subscriptionID)} } // GetByBillingProfile lists the policies for a billing profile. This operation is supported only for billing accounts diff --git a/services/preview/billing/mgmt/2020-05-01-preview/billing/products.go b/services/preview/billing/mgmt/2020-05-01-preview/billing/products.go index 500870502f1f..8ca49db9db14 100644 --- a/services/preview/billing/mgmt/2020-05-01-preview/billing/products.go +++ b/services/preview/billing/mgmt/2020-05-01-preview/billing/products.go @@ -31,14 +31,14 @@ type ProductsClient struct { } // NewProductsClient creates an instance of the ProductsClient client. -func NewProductsClient(subscriptionID string, subscriptionID1 string) ProductsClient { - return NewProductsClientWithBaseURI(DefaultBaseURI, subscriptionID, subscriptionID1) +func NewProductsClient(subscriptionID string) ProductsClient { + return NewProductsClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewProductsClientWithBaseURI creates an instance of the ProductsClient client using a custom endpoint. Use this // when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewProductsClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) ProductsClient { - return ProductsClient{NewWithBaseURI(baseURI, subscriptionID, subscriptionID1)} +func NewProductsClientWithBaseURI(baseURI string, subscriptionID string) ProductsClient { + return ProductsClient{NewWithBaseURI(baseURI, subscriptionID)} } // Get gets a product by ID. The operation is supported only for billing accounts with agreement type Microsoft diff --git a/services/preview/billing/mgmt/2020-05-01-preview/billing/profiles.go b/services/preview/billing/mgmt/2020-05-01-preview/billing/profiles.go index c33fd6693aab..63e703e33a0f 100644 --- a/services/preview/billing/mgmt/2020-05-01-preview/billing/profiles.go +++ b/services/preview/billing/mgmt/2020-05-01-preview/billing/profiles.go @@ -32,14 +32,14 @@ type ProfilesClient struct { } // NewProfilesClient creates an instance of the ProfilesClient client. -func NewProfilesClient(subscriptionID string, subscriptionID1 string) ProfilesClient { - return NewProfilesClientWithBaseURI(DefaultBaseURI, subscriptionID, subscriptionID1) +func NewProfilesClient(subscriptionID string) ProfilesClient { + return NewProfilesClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewProfilesClientWithBaseURI creates an instance of the ProfilesClient client using a custom endpoint. Use this // when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewProfilesClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) ProfilesClient { - return ProfilesClient{NewWithBaseURI(baseURI, subscriptionID, subscriptionID1)} +func NewProfilesClientWithBaseURI(baseURI string, subscriptionID string) ProfilesClient { + return ProfilesClient{NewWithBaseURI(baseURI, subscriptionID)} } // CreateOrUpdate creates or updates a billing profile. The operation is supported for billing accounts with agreement diff --git a/services/preview/billing/mgmt/2020-05-01-preview/billing/property.go b/services/preview/billing/mgmt/2020-05-01-preview/billing/property.go index 81c4d0c7aec6..e3552a270530 100644 --- a/services/preview/billing/mgmt/2020-05-01-preview/billing/property.go +++ b/services/preview/billing/mgmt/2020-05-01-preview/billing/property.go @@ -31,14 +31,14 @@ type PropertyClient struct { } // NewPropertyClient creates an instance of the PropertyClient client. -func NewPropertyClient(subscriptionID string, subscriptionID1 string) PropertyClient { - return NewPropertyClientWithBaseURI(DefaultBaseURI, subscriptionID, subscriptionID1) +func NewPropertyClient(subscriptionID string) PropertyClient { + return NewPropertyClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewPropertyClientWithBaseURI creates an instance of the PropertyClient client using a custom endpoint. Use this // when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewPropertyClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) PropertyClient { - return PropertyClient{NewWithBaseURI(baseURI, subscriptionID, subscriptionID1)} +func NewPropertyClientWithBaseURI(baseURI string, subscriptionID string) PropertyClient { + return PropertyClient{NewWithBaseURI(baseURI, subscriptionID)} } // Get get the billing properties for a subscription. This operation is not supported for billing accounts with diff --git a/services/preview/billing/mgmt/2020-05-01-preview/billing/roleassignments.go b/services/preview/billing/mgmt/2020-05-01-preview/billing/roleassignments.go index 52a5f7ad5b02..5c07cb589f6b 100644 --- a/services/preview/billing/mgmt/2020-05-01-preview/billing/roleassignments.go +++ b/services/preview/billing/mgmt/2020-05-01-preview/billing/roleassignments.go @@ -31,14 +31,14 @@ type RoleAssignmentsClient struct { } // NewRoleAssignmentsClient creates an instance of the RoleAssignmentsClient client. -func NewRoleAssignmentsClient(subscriptionID string, subscriptionID1 string) RoleAssignmentsClient { - return NewRoleAssignmentsClientWithBaseURI(DefaultBaseURI, subscriptionID, subscriptionID1) +func NewRoleAssignmentsClient(subscriptionID string) RoleAssignmentsClient { + return NewRoleAssignmentsClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewRoleAssignmentsClientWithBaseURI creates an instance of the RoleAssignmentsClient client using a custom endpoint. // Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewRoleAssignmentsClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) RoleAssignmentsClient { - return RoleAssignmentsClient{NewWithBaseURI(baseURI, subscriptionID, subscriptionID1)} +func NewRoleAssignmentsClientWithBaseURI(baseURI string, subscriptionID string) RoleAssignmentsClient { + return RoleAssignmentsClient{NewWithBaseURI(baseURI, subscriptionID)} } // DeleteByBillingAccount deletes a role assignment for the caller on a billing account. The operation is supported for diff --git a/services/preview/billing/mgmt/2020-05-01-preview/billing/roledefinitions.go b/services/preview/billing/mgmt/2020-05-01-preview/billing/roledefinitions.go index 57233738666f..1b69e8b5c397 100644 --- a/services/preview/billing/mgmt/2020-05-01-preview/billing/roledefinitions.go +++ b/services/preview/billing/mgmt/2020-05-01-preview/billing/roledefinitions.go @@ -31,14 +31,14 @@ type RoleDefinitionsClient struct { } // NewRoleDefinitionsClient creates an instance of the RoleDefinitionsClient client. -func NewRoleDefinitionsClient(subscriptionID string, subscriptionID1 string) RoleDefinitionsClient { - return NewRoleDefinitionsClientWithBaseURI(DefaultBaseURI, subscriptionID, subscriptionID1) +func NewRoleDefinitionsClient(subscriptionID string) RoleDefinitionsClient { + return NewRoleDefinitionsClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewRoleDefinitionsClientWithBaseURI creates an instance of the RoleDefinitionsClient client using a custom endpoint. // Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewRoleDefinitionsClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) RoleDefinitionsClient { - return RoleDefinitionsClient{NewWithBaseURI(baseURI, subscriptionID, subscriptionID1)} +func NewRoleDefinitionsClientWithBaseURI(baseURI string, subscriptionID string) RoleDefinitionsClient { + return RoleDefinitionsClient{NewWithBaseURI(baseURI, subscriptionID)} } // GetByBillingAccount gets the definition for a role on a billing account. The operation is supported for billing diff --git a/services/preview/billing/mgmt/2020-05-01-preview/billing/subscriptions.go b/services/preview/billing/mgmt/2020-05-01-preview/billing/subscriptions.go index 7f129ef815cc..42ab09739dad 100644 --- a/services/preview/billing/mgmt/2020-05-01-preview/billing/subscriptions.go +++ b/services/preview/billing/mgmt/2020-05-01-preview/billing/subscriptions.go @@ -32,14 +32,14 @@ type SubscriptionsClient struct { } // NewSubscriptionsClient creates an instance of the SubscriptionsClient client. -func NewSubscriptionsClient(subscriptionID string, subscriptionID1 string) SubscriptionsClient { - return NewSubscriptionsClientWithBaseURI(DefaultBaseURI, subscriptionID, subscriptionID1) +func NewSubscriptionsClient(subscriptionID string) SubscriptionsClient { + return NewSubscriptionsClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewSubscriptionsClientWithBaseURI creates an instance of the SubscriptionsClient client using a custom endpoint. // Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewSubscriptionsClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) SubscriptionsClient { - return SubscriptionsClient{NewWithBaseURI(baseURI, subscriptionID, subscriptionID1)} +func NewSubscriptionsClientWithBaseURI(baseURI string, subscriptionID string) SubscriptionsClient { + return SubscriptionsClient{NewWithBaseURI(baseURI, subscriptionID)} } // Get gets a subscription by its ID. The operation is supported for billing accounts with agreement type Microsoft diff --git a/services/preview/billing/mgmt/2020-05-01-preview/billing/transactions.go b/services/preview/billing/mgmt/2020-05-01-preview/billing/transactions.go index 05854239e0eb..cf40662e2576 100644 --- a/services/preview/billing/mgmt/2020-05-01-preview/billing/transactions.go +++ b/services/preview/billing/mgmt/2020-05-01-preview/billing/transactions.go @@ -31,14 +31,14 @@ type TransactionsClient struct { } // NewTransactionsClient creates an instance of the TransactionsClient client. -func NewTransactionsClient(subscriptionID string, subscriptionID1 string) TransactionsClient { - return NewTransactionsClientWithBaseURI(DefaultBaseURI, subscriptionID, subscriptionID1) +func NewTransactionsClient(subscriptionID string) TransactionsClient { + return NewTransactionsClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewTransactionsClientWithBaseURI creates an instance of the TransactionsClient client using a custom endpoint. Use // this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewTransactionsClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) TransactionsClient { - return TransactionsClient{NewWithBaseURI(baseURI, subscriptionID, subscriptionID1)} +func NewTransactionsClientWithBaseURI(baseURI string, subscriptionID string) TransactionsClient { + return TransactionsClient{NewWithBaseURI(baseURI, subscriptionID)} } // ListByInvoice lists the transactions for an invoice. Transactions include purchases, refunds and Azure usage diff --git a/services/preview/billing/mgmt/2020-05-01-preview/billing/version.go b/services/preview/billing/mgmt/2020-05-01-preview/billing/version.go index 4e7c9c5d7fad..a74a1d76b8c0 100644 --- a/services/preview/billing/mgmt/2020-05-01-preview/billing/version.go +++ b/services/preview/billing/mgmt/2020-05-01-preview/billing/version.go @@ -21,7 +21,7 @@ import "github.com/Azure/azure-sdk-for-go/version" // UserAgent returns the UserAgent string to use when sending http.Requests. func UserAgent() string { - return "Azure-SDK-For-Go/" + Version() + " billing/2020-05-01" + return "Azure-SDK-For-Go/" + Version() + " billing/2020-05-01-preview" } // Version returns the semantic version (see http://semver.org) of the client.