diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingManagementClient.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingManagementClient.cs index 17e9fa39cf85..60be0935e789 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingManagementClient.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingManagementClient.cs @@ -52,11 +52,6 @@ public partial class BillingManagementClient : ServiceClient public string SubscriptionId { get; set; } - /// - /// Azure Subscription ID. - /// - public string SubscriptionId1 { get; set; } - /// /// The preferred language for the response. /// @@ -145,11 +140,6 @@ public partial class BillingManagementClient : ServiceClient public virtual IBillingPropertyOperations BillingProperty { get; private set; } - /// - /// Gets the IOperations. - /// - public virtual IOperations Operations { get; private set; } - /// /// Gets the IBillingRoleDefinitionsOperations. /// @@ -165,6 +155,11 @@ public partial class BillingManagementClient : ServiceClient public virtual IAgreementsOperations Agreements { get; private set; } + /// + /// Gets the IReservationsOperations. + /// + public virtual IReservationsOperations Reservations { get; private set; } + /// /// Gets the IEnrollmentAccountsOperations. /// @@ -175,6 +170,11 @@ public partial class BillingManagementClient : ServiceClient public virtual IBillingPeriodsOperations BillingPeriods { get; private set; } + /// + /// Gets the IOperations. + /// + public virtual IOperations Operations { get; private set; } + /// /// Initializes a new instance of the BillingManagementClient class. /// @@ -430,12 +430,13 @@ private void Initialize() Transactions = new TransactionsOperations(this); Policies = new PoliciesOperations(this); BillingProperty = new BillingPropertyOperations(this); - Operations = new Operations(this); BillingRoleDefinitions = new BillingRoleDefinitionsOperations(this); BillingRoleAssignments = new BillingRoleAssignmentsOperations(this); Agreements = new AgreementsOperations(this); + Reservations = new ReservationsOperations(this); EnrollmentAccounts = new EnrollmentAccountsOperations(this); BillingPeriods = new BillingPeriodsOperations(this); + Operations = new Operations(this); BaseUri = new System.Uri("https://management.azure.com"); AcceptLanguage = "en-US"; LongRunningOperationRetryTimeout = 30; diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IBillingManagementClient.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IBillingManagementClient.cs index b268a854c813..0a60e7c5f29e 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IBillingManagementClient.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IBillingManagementClient.cs @@ -46,11 +46,6 @@ public partial interface IBillingManagementClient : System.IDisposable /// string SubscriptionId { get; set; } - /// - /// Azure Subscription ID. - /// - string SubscriptionId1 { get; set; } - /// /// The preferred language for the response. /// @@ -140,11 +135,6 @@ public partial interface IBillingManagementClient : System.IDisposable /// IBillingPropertyOperations BillingProperty { get; } - /// - /// Gets the IOperations. - /// - IOperations Operations { get; } - /// /// Gets the IBillingRoleDefinitionsOperations. /// @@ -160,6 +150,11 @@ public partial interface IBillingManagementClient : System.IDisposable /// IAgreementsOperations Agreements { get; } + /// + /// Gets the IReservationsOperations. + /// + IReservationsOperations Reservations { get; } + /// /// Gets the IEnrollmentAccountsOperations. /// @@ -170,5 +165,10 @@ public partial interface IBillingManagementClient : System.IDisposable /// IBillingPeriodsOperations BillingPeriods { get; } + /// + /// Gets the IOperations. + /// + IOperations Operations { get; } + } } diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IInvoicesOperations.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IInvoicesOperations.cs index f5e65474be40..bea8100231d5 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IInvoicesOperations.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IInvoicesOperations.cs @@ -179,6 +179,35 @@ public partial interface IInvoicesOperations /// Task> DownloadInvoiceWithHttpMessagesAsync(string billingAccountName, string invoiceName, string downloadToken, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// 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. + /// + /// + /// + /// The ID that uniquely identifies a billing account. + /// + /// + /// An array of download urls for individual documents + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> DownloadMultipleBillingProfileInvoicesWithHttpMessagesAsync(string billingAccountName, IList downloadUrls, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Lists the invoices for a subscription. /// /// @@ -254,6 +283,30 @@ public partial interface IInvoicesOperations /// Task> DownloadBillingSubscriptionInvoiceWithHttpMessagesAsync(string invoiceName, string downloadToken, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Gets a URL to download multiple invoice documents (invoice pdf, tax + /// receipts, credit notes) as a zip file. + /// + /// + /// + /// An array of download urls for individual documents + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> DownloadMultipleBillingSubscriptionInvoicesWithHttpMessagesAsync(IList downloadUrls, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Gets a URL to download an invoice. The operation is supported for /// billing accounts with agreement type Microsoft Partner Agreement or /// Microsoft Customer Agreement. @@ -285,6 +338,35 @@ public partial interface IInvoicesOperations /// Task> BeginDownloadInvoiceWithHttpMessagesAsync(string billingAccountName, string invoiceName, string downloadToken, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// 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. + /// + /// + /// + /// The ID that uniquely identifies a billing account. + /// + /// + /// An array of download urls for individual documents + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginDownloadMultipleBillingProfileInvoicesWithHttpMessagesAsync(string billingAccountName, IList downloadUrls, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Gets a URL to download an invoice. /// /// @@ -311,6 +393,30 @@ public partial interface IInvoicesOperations /// Task> BeginDownloadBillingSubscriptionInvoiceWithHttpMessagesAsync(string invoiceName, string downloadToken, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Gets a URL to download multiple invoice documents (invoice pdf, tax + /// receipts, credit notes) as a zip file. + /// + /// + /// + /// An array of download urls for individual documents + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginDownloadMultipleBillingSubscriptionInvoicesWithHttpMessagesAsync(IList downloadUrls, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Lists the invoices for a billing account for a given start date and /// end date. The operation is supported for billing accounts with /// agreement type Microsoft Partner Agreement or Microsoft Customer diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IOperations.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IOperations.cs index ecace1e9febc..b05e5ef9e988 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IOperations.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IOperations.cs @@ -33,7 +33,7 @@ public partial interface IOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -56,7 +56,7 @@ public partial interface IOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IReservationsOperations.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IReservationsOperations.cs new file mode 100644 index 000000000000..d4349e8f167e --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IReservationsOperations.cs @@ -0,0 +1,152 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Billing +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// ReservationsOperations operations. + /// + public partial interface IReservationsOperations + { + /// + /// Lists the reservations for a billing account and the roll up counts + /// of reservations group by provisioning states. + /// + /// + /// The ID that uniquely identifies a billing account. + /// + /// + /// May be used to filter by reservation properties. The filter + /// supports 'eq', 'or', and 'and'. It does not currently support 'ne', + /// 'gt', 'le', 'ge', or 'not'. + /// + /// + /// May be used to sort order by reservation properties. + /// + /// + /// To indicate whether to refresh the roll up counts of the + /// reservations group by provisioning states + /// + /// + /// The selected provisioning state + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListByBillingAccountWithHttpMessagesAsync(string billingAccountName, string filter = default(string), string orderby = default(string), string refreshSummary = default(string), string selectedState = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists the reservations for a billing profile and the roll up counts + /// of reservations group by provisioning state. + /// + /// + /// The ID that uniquely identifies a billing account. + /// + /// + /// The ID that uniquely identifies a billing profile. + /// + /// + /// May be used to filter by reservation properties. The filter + /// supports 'eq', 'or', and 'and'. It does not currently support 'ne', + /// 'gt', 'le', 'ge', or 'not'. + /// + /// + /// May be used to sort order by reservation properties. + /// + /// + /// To indicate whether to refresh the roll up counts of the + /// reservations group by provisioning state + /// + /// + /// The selected provisioning state + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListByBillingProfileWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string filter = default(string), string orderby = default(string), string refreshSummary = default(string), string selectedState = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists the reservations for a billing account and the roll up counts + /// of reservations group by provisioning states. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListByBillingAccountNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists the reservations for a billing profile and the roll up counts + /// of reservations group by provisioning state. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListByBillingProfileNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/InvoicesOperations.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/InvoicesOperations.cs index 8040182feb5d..8d3e83360cb5 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/InvoicesOperations.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/InvoicesOperations.cs @@ -859,6 +859,32 @@ internal InvoicesOperations(BillingManagementClient client) return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } + /// + /// 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. + /// + /// + /// + /// The ID that uniquely identifies a billing account. + /// + /// + /// An array of download urls for individual documents + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> DownloadMultipleBillingProfileInvoicesWithHttpMessagesAsync(string billingAccountName, IList downloadUrls, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDownloadMultipleBillingProfileInvoicesWithHttpMessagesAsync(billingAccountName, downloadUrls, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + /// /// Lists the invoices for a subscription. /// @@ -1259,6 +1285,27 @@ internal InvoicesOperations(BillingManagementClient client) return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } + /// + /// Gets a URL to download multiple invoice documents (invoice pdf, tax + /// receipts, credit notes) as a zip file. + /// + /// + /// + /// An array of download urls for individual documents + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> DownloadMultipleBillingSubscriptionInvoicesWithHttpMessagesAsync(IList downloadUrls, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDownloadMultipleBillingSubscriptionInvoicesWithHttpMessagesAsync(downloadUrls, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + /// /// Gets a URL to download an invoice. The operation is supported for billing /// accounts with agreement type Microsoft Partner Agreement or Microsoft @@ -1471,6 +1518,212 @@ internal InvoicesOperations(BillingManagementClient client) return _result; } + /// + /// 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. + /// + /// + /// + /// The ID that uniquely identifies a billing account. + /// + /// + /// An array of download urls for individual documents + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> BeginDownloadMultipleBillingProfileInvoicesWithHttpMessagesAsync(string billingAccountName, IList downloadUrls, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (billingAccountName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "billingAccountName"); + } + if (downloadUrls == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "downloadUrls"); + } + string apiVersion = "2020-05-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("billingAccountName", billingAccountName); + tracingParameters.Add("downloadUrls", downloadUrls); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginDownloadMultipleBillingProfileInvoices", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/downloadDocuments").ToString(); + _url = _url.Replace("{billingAccountName}", System.Uri.EscapeDataString(billingAccountName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(downloadUrls != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(downloadUrls, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + /// /// Gets a URL to download an invoice. /// @@ -1677,6 +1930,206 @@ internal InvoicesOperations(BillingManagementClient client) return _result; } + /// + /// Gets a URL to download multiple invoice documents (invoice pdf, tax + /// receipts, credit notes) as a zip file. + /// + /// + /// + /// An array of download urls for individual documents + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> BeginDownloadMultipleBillingSubscriptionInvoicesWithHttpMessagesAsync(IList downloadUrls, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (downloadUrls == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "downloadUrls"); + } + string apiVersion = "2020-05-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("downloadUrls", downloadUrls); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginDownloadMultipleBillingSubscriptionInvoices", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/default/billingSubscriptions/{subscriptionId}/downloadDocuments").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(downloadUrls != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(downloadUrls, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + /// /// Lists the invoices for a billing account for a given start date and end /// date. The operation is supported for billing accounts with agreement type diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/InvoicesOperationsExtensions.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/InvoicesOperationsExtensions.cs index 51e787b272ca..840ef43f2a1c 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/InvoicesOperationsExtensions.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/InvoicesOperationsExtensions.cs @@ -13,6 +13,8 @@ namespace Microsoft.Azure.Management.Billing using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; + using System.Collections; + using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; @@ -275,6 +277,54 @@ public static DownloadUrl DownloadInvoice(this IInvoicesOperations operations, s } } + /// + /// 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. + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// The ID that uniquely identifies a billing account. + /// + /// + /// An array of download urls for individual documents + /// + public static DownloadUrl DownloadMultipleBillingProfileInvoices(this IInvoicesOperations operations, string billingAccountName, IList downloadUrls) + { + return operations.DownloadMultipleBillingProfileInvoicesAsync(billingAccountName, downloadUrls).GetAwaiter().GetResult(); + } + + /// + /// 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. + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// The ID that uniquely identifies a billing account. + /// + /// + /// An array of download urls for individual documents + /// + /// + /// The cancellation token. + /// + public static async Task DownloadMultipleBillingProfileInvoicesAsync(this IInvoicesOperations operations, string billingAccountName, IList downloadUrls, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.DownloadMultipleBillingProfileInvoicesWithHttpMessagesAsync(billingAccountName, downloadUrls, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Lists the invoices for a subscription. /// @@ -395,6 +445,44 @@ public static DownloadUrl DownloadBillingSubscriptionInvoice(this IInvoicesOpera } } + /// + /// Gets a URL to download multiple invoice documents (invoice pdf, tax + /// receipts, credit notes) as a zip file. + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// An array of download urls for individual documents + /// + public static DownloadUrl DownloadMultipleBillingSubscriptionInvoices(this IInvoicesOperations operations, IList downloadUrls) + { + return operations.DownloadMultipleBillingSubscriptionInvoicesAsync(downloadUrls).GetAwaiter().GetResult(); + } + + /// + /// Gets a URL to download multiple invoice documents (invoice pdf, tax + /// receipts, credit notes) as a zip file. + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// An array of download urls for individual documents + /// + /// + /// The cancellation token. + /// + public static async Task DownloadMultipleBillingSubscriptionInvoicesAsync(this IInvoicesOperations operations, IList downloadUrls, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.DownloadMultipleBillingSubscriptionInvoicesWithHttpMessagesAsync(downloadUrls, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Gets a URL to download an invoice. The operation is supported for billing /// accounts with agreement type Microsoft Partner Agreement or Microsoft @@ -447,6 +535,54 @@ public static DownloadUrl BeginDownloadInvoice(this IInvoicesOperations operatio } } + /// + /// 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. + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// The ID that uniquely identifies a billing account. + /// + /// + /// An array of download urls for individual documents + /// + public static DownloadUrl BeginDownloadMultipleBillingProfileInvoices(this IInvoicesOperations operations, string billingAccountName, IList downloadUrls) + { + return operations.BeginDownloadMultipleBillingProfileInvoicesAsync(billingAccountName, downloadUrls).GetAwaiter().GetResult(); + } + + /// + /// 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. + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// The ID that uniquely identifies a billing account. + /// + /// + /// An array of download urls for individual documents + /// + /// + /// The cancellation token. + /// + public static async Task BeginDownloadMultipleBillingProfileInvoicesAsync(this IInvoicesOperations operations, string billingAccountName, IList downloadUrls, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginDownloadMultipleBillingProfileInvoicesWithHttpMessagesAsync(billingAccountName, downloadUrls, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Gets a URL to download an invoice. /// @@ -489,6 +625,44 @@ public static DownloadUrl BeginDownloadBillingSubscriptionInvoice(this IInvoices } } + /// + /// Gets a URL to download multiple invoice documents (invoice pdf, tax + /// receipts, credit notes) as a zip file. + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// An array of download urls for individual documents + /// + public static DownloadUrl BeginDownloadMultipleBillingSubscriptionInvoices(this IInvoicesOperations operations, IList downloadUrls) + { + return operations.BeginDownloadMultipleBillingSubscriptionInvoicesAsync(downloadUrls).GetAwaiter().GetResult(); + } + + /// + /// Gets a URL to download multiple invoice documents (invoice pdf, tax + /// receipts, credit notes) as a zip file. + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// An array of download urls for individual documents + /// + /// + /// The cancellation token. + /// + public static async Task BeginDownloadMultipleBillingSubscriptionInvoicesAsync(this IInvoicesOperations operations, IList downloadUrls, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginDownloadMultipleBillingSubscriptionInvoicesWithHttpMessagesAsync(downloadUrls, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Lists the invoices for a billing account for a given start date and end /// date. The operation is supported for billing accounts with agreement type diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/AddressDetails.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/AddressDetails.cs index be2312fb279b..3a8c28eeac12 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/AddressDetails.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/AddressDetails.cs @@ -34,6 +34,7 @@ public AddressDetails() /// Country code uses ISO2, 2-digit /// format. /// First name. + /// Middle name. /// Last name. /// Company name. /// Address line 2. @@ -44,9 +45,10 @@ public AddressDetails() /// Postal code. /// Email address. /// Phone number. - public AddressDetails(string addressLine1, string country, string firstName = default(string), string lastName = default(string), string companyName = default(string), string addressLine2 = default(string), string addressLine3 = default(string), string city = default(string), string district = default(string), string region = default(string), string postalCode = default(string), string email = default(string), string phoneNumber = default(string)) + public AddressDetails(string addressLine1, string country, string firstName = default(string), string middleName = default(string), string lastName = default(string), string companyName = default(string), string addressLine2 = default(string), string addressLine3 = default(string), string city = default(string), string district = default(string), string region = default(string), string postalCode = default(string), string email = default(string), string phoneNumber = default(string)) { FirstName = firstName; + MiddleName = middleName; LastName = lastName; CompanyName = companyName; AddressLine1 = addressLine1; @@ -73,6 +75,12 @@ public AddressDetails() [JsonProperty(PropertyName = "firstName")] public string FirstName { get; set; } + /// + /// Gets or sets middle name. + /// + [JsonProperty(PropertyName = "middleName")] + public string MiddleName { get; set; } + /// /// Gets or sets last name. /// diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Agreement.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Agreement.cs index ef8b3b47aa74..62776d49dff9 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Agreement.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Agreement.cs @@ -45,6 +45,9 @@ public Agreement() /// The mode of acceptance for an /// agreement. Possible values include: 'ClickToAccept', /// 'ESignEmbedded', 'ESignOffline' + /// The list of billing profiles + /// associated with agreement and present only for specific + /// agreements. /// The date from which the agreement is /// effective. /// The date when the agreement @@ -52,12 +55,13 @@ public Agreement() /// The list of participants that /// participates in acceptance of an agreement. /// The current status of the agreement. - public Agreement(string id = default(string), string name = default(string), string type = default(string), string agreementLink = default(string), string category = default(string), string acceptanceMode = default(string), System.DateTime? effectiveDate = default(System.DateTime?), System.DateTime? expirationDate = default(System.DateTime?), IList participants = default(IList), string status = default(string)) + public Agreement(string id = default(string), string name = default(string), string type = default(string), string agreementLink = default(string), string category = default(string), string acceptanceMode = default(string), BillingProfileInfo billingProfileInfo = default(BillingProfileInfo), System.DateTime? effectiveDate = default(System.DateTime?), System.DateTime? expirationDate = default(System.DateTime?), IList participants = default(IList), string status = default(string)) : base(id, name, type) { AgreementLink = agreementLink; Category = category; AcceptanceMode = acceptanceMode; + BillingProfileInfo = billingProfileInfo; EffectiveDate = effectiveDate; ExpirationDate = expirationDate; Participants = participants; @@ -91,6 +95,13 @@ public Agreement() [JsonProperty(PropertyName = "properties.acceptanceMode")] public string AcceptanceMode { get; private set; } + /// + /// Gets the list of billing profiles associated with agreement and + /// present only for specific agreements. + /// + [JsonProperty(PropertyName = "properties.billingProfileInfo")] + public BillingProfileInfo BillingProfileInfo { get; private set; } + /// /// Gets the date from which the agreement is effective. /// diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingAccount.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingAccount.cs index d6f75c453bd2..2fae9912217d 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingAccount.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingAccount.cs @@ -61,7 +61,9 @@ public BillingAccount() /// enrollment. /// Indicates whether user has read access /// to the billing account. - public BillingAccount(string id = default(string), string name = default(string), string type = default(string), string displayName = default(string), AddressDetails soldTo = default(AddressDetails), string agreementType = default(string), string accountType = default(string), string accountStatus = default(string), BillingProfilesOnExpand billingProfiles = default(BillingProfilesOnExpand), Enrollment enrollmentDetails = default(Enrollment), IList departments = default(IList), IList enrollmentAccounts = default(IList), bool? hasReadAccess = default(bool?)) + /// Notification email address, + /// only for legacy accounts + public BillingAccount(string id = default(string), string name = default(string), string type = default(string), string displayName = default(string), AddressDetails soldTo = default(AddressDetails), string agreementType = default(string), string accountType = default(string), string accountStatus = default(string), BillingProfilesOnExpand billingProfiles = default(BillingProfilesOnExpand), Enrollment enrollmentDetails = default(Enrollment), IList departments = default(IList), IList enrollmentAccounts = default(IList), bool? hasReadAccess = default(bool?), string notificationEmailAddress = default(string)) : base(id, name, type) { DisplayName = displayName; @@ -74,6 +76,7 @@ public BillingAccount() Departments = departments; EnrollmentAccounts = enrollmentAccounts; HasReadAccess = hasReadAccess; + NotificationEmailAddress = notificationEmailAddress; CustomInit(); } @@ -151,6 +154,12 @@ public BillingAccount() [JsonProperty(PropertyName = "properties.hasReadAccess")] public bool? HasReadAccess { get; private set; } + /// + /// Gets or sets notification email address, only for legacy accounts + /// + [JsonProperty(PropertyName = "properties.notificationEmailAddress")] + public string NotificationEmailAddress { get; set; } + /// /// Validate the object. /// diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingAccountUpdateRequest.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingAccountUpdateRequest.cs index 597cbbfc8e58..2c487c7e040a 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingAccountUpdateRequest.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingAccountUpdateRequest.cs @@ -60,7 +60,9 @@ public BillingAccountUpdateRequest() /// enrollment. /// Indicates whether user has read access /// to the billing account. - public BillingAccountUpdateRequest(string displayName = default(string), AddressDetails soldTo = default(AddressDetails), string agreementType = default(string), string accountType = default(string), string accountStatus = default(string), BillingProfilesOnExpand billingProfiles = default(BillingProfilesOnExpand), Enrollment enrollmentDetails = default(Enrollment), IList departments = default(IList), IList enrollmentAccounts = default(IList), bool? hasReadAccess = default(bool?)) + /// Notification email address, + /// only for legacy accounts + public BillingAccountUpdateRequest(string displayName = default(string), AddressDetails soldTo = default(AddressDetails), string agreementType = default(string), string accountType = default(string), string accountStatus = default(string), BillingProfilesOnExpand billingProfiles = default(BillingProfilesOnExpand), Enrollment enrollmentDetails = default(Enrollment), IList departments = default(IList), IList enrollmentAccounts = default(IList), bool? hasReadAccess = default(bool?), string notificationEmailAddress = default(string)) { DisplayName = displayName; SoldTo = soldTo; @@ -72,6 +74,7 @@ public BillingAccountUpdateRequest() Departments = departments; EnrollmentAccounts = enrollmentAccounts; HasReadAccess = hasReadAccess; + NotificationEmailAddress = notificationEmailAddress; CustomInit(); } @@ -149,6 +152,12 @@ public BillingAccountUpdateRequest() [JsonProperty(PropertyName = "properties.hasReadAccess")] public bool? HasReadAccess { get; private set; } + /// + /// Gets or sets notification email address, only for legacy accounts + /// + [JsonProperty(PropertyName = "properties.notificationEmailAddress")] + public string NotificationEmailAddress { get; set; } + /// /// Validate the object. /// diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingProfile.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingProfile.cs index 35a438a6a3d6..e382ca14cd58 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingProfile.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingProfile.cs @@ -40,7 +40,14 @@ public BillingProfile() /// The name of the billing profile. /// The purchase order name that will appear on /// the invoices generated for the billing profile. + /// Identifies which services and + /// purchases are paid by a billing profile. Possible values include: + /// 'Direct', 'IndirectCustomer', 'IndirectPartner', + /// 'CSPPartner' /// Billing address. + /// Identifies the billing + /// profile that is linked to another billing profile in indirect + /// purchase motion. /// Flag controlling whether the /// invoices for the billing profile are sent through email. /// The day of the month when the invoice for @@ -63,12 +70,19 @@ public BillingProfile() /// 'SpendingLimitReached', 'SpendingLimitExpired' /// The billing profile spending limit. /// Possible values include: 'Off', 'On' - public BillingProfile(string id = default(string), string name = default(string), string type = default(string), string displayName = default(string), string poNumber = default(string), AddressDetails billTo = default(AddressDetails), bool? invoiceEmailOptIn = default(bool?), int? invoiceDay = default(int?), string currency = default(string), IList enabledAzurePlans = default(IList), InvoiceSectionsOnExpand invoiceSections = default(InvoiceSectionsOnExpand), bool? hasReadAccess = default(bool?), string systemId = default(string), string status = default(string), string statusReasonCode = default(string), string spendingLimit = default(string)) + /// Identifies the cloud environments that + /// are associated with a billing profile. This is a system managed + /// optional field and gets updated as the billing profile gets + /// associated with accounts in various clouds. + /// Tags of billing profiles. + public BillingProfile(string id = default(string), string name = default(string), string type = default(string), string displayName = default(string), string poNumber = default(string), string billingRelationshipType = default(string), AddressDetails billTo = default(AddressDetails), IndirectRelationshipInfo indirectRelationshipInfo = default(IndirectRelationshipInfo), bool? invoiceEmailOptIn = default(bool?), int? invoiceDay = default(int?), string currency = default(string), IList enabledAzurePlans = default(IList), InvoiceSectionsOnExpand invoiceSections = default(InvoiceSectionsOnExpand), bool? hasReadAccess = default(bool?), string systemId = default(string), string status = default(string), string statusReasonCode = default(string), string spendingLimit = default(string), IList targetClouds = default(IList), IDictionary tags = default(IDictionary)) : base(id, name, type) { DisplayName = displayName; PoNumber = poNumber; + BillingRelationshipType = billingRelationshipType; BillTo = billTo; + IndirectRelationshipInfo = indirectRelationshipInfo; InvoiceEmailOptIn = invoiceEmailOptIn; InvoiceDay = invoiceDay; Currency = currency; @@ -79,6 +93,8 @@ public BillingProfile() Status = status; StatusReasonCode = statusReasonCode; SpendingLimit = spendingLimit; + TargetClouds = targetClouds; + Tags = tags; CustomInit(); } @@ -100,12 +116,27 @@ public BillingProfile() [JsonProperty(PropertyName = "properties.poNumber")] public string PoNumber { get; set; } + /// + /// Gets identifies which services and purchases are paid by a billing + /// profile. Possible values include: 'Direct', 'IndirectCustomer', + /// 'IndirectPartner', 'CSPPartner' + /// + [JsonProperty(PropertyName = "properties.billingRelationshipType")] + public string BillingRelationshipType { get; private set; } + /// /// Gets or sets billing address. /// [JsonProperty(PropertyName = "properties.billTo")] public AddressDetails BillTo { get; set; } + /// + /// Gets identifies the billing profile that is linked to another + /// billing profile in indirect purchase motion. + /// + [JsonProperty(PropertyName = "properties.indirectRelationshipInfo")] + public IndirectRelationshipInfo IndirectRelationshipInfo { get; private set; } + /// /// Gets or sets flag controlling whether the invoices for the billing /// profile are sent through email. @@ -175,6 +206,21 @@ public BillingProfile() [JsonProperty(PropertyName = "properties.spendingLimit")] public string SpendingLimit { get; private set; } + /// + /// Gets identifies the cloud environments that are associated with a + /// billing profile. This is a system managed optional field and gets + /// updated as the billing profile gets associated with accounts in + /// various clouds. + /// + [JsonProperty(PropertyName = "properties.targetClouds")] + public IList TargetClouds { get; private set; } + + /// + /// Gets or sets tags of billing profiles. + /// + [JsonProperty(PropertyName = "properties.tags")] + public IDictionary Tags { get; set; } + /// /// Validate the object. /// diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingProfileInfo.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingProfileInfo.cs new file mode 100644 index 000000000000..e227776ecee1 --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingProfileInfo.cs @@ -0,0 +1,73 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Billing.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Details about billing profile associated with agreement and available + /// only for specific agreements. + /// + public partial class BillingProfileInfo + { + /// + /// Initializes a new instance of the BillingProfileInfo class. + /// + public BillingProfileInfo() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the BillingProfileInfo class. + /// + /// The unique identifier for the + /// billing profile. + /// The name of the billing + /// profile + /// Billing account + /// name. This property is available for a specific type of + /// agreement. + public BillingProfileInfo(string billingProfileId = default(string), string billingProfileDisplayName = default(string), string indirectRelationshipOrganizationName = default(string)) + { + BillingProfileId = billingProfileId; + BillingProfileDisplayName = billingProfileDisplayName; + IndirectRelationshipOrganizationName = indirectRelationshipOrganizationName; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the unique identifier for the billing profile. + /// + [JsonProperty(PropertyName = "billingProfileId")] + public string BillingProfileId { get; set; } + + /// + /// Gets or sets the name of the billing profile + /// + [JsonProperty(PropertyName = "billingProfileDisplayName")] + public string BillingProfileDisplayName { get; set; } + + /// + /// Gets or sets billing account name. This property is available for a + /// specific type of agreement. + /// + [JsonProperty(PropertyName = "indirectRelationshipOrganizationName")] + public string IndirectRelationshipOrganizationName { get; set; } + + } +} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingRelationshipType.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingRelationshipType.cs new file mode 100644 index 000000000000..c7ca4e637710 --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingRelationshipType.cs @@ -0,0 +1,24 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Billing.Models +{ + + /// + /// Defines values for BillingRelationshipType. + /// + public static class BillingRelationshipType + { + public const string Direct = "Direct"; + public const string IndirectCustomer = "IndirectCustomer"; + public const string IndirectPartner = "IndirectPartner"; + public const string CSPPartner = "CSPPartner"; + } +} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingSubscription.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingSubscription.cs index e6b5472658b7..0c3d56613d70 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingSubscription.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingSubscription.cs @@ -13,6 +13,8 @@ namespace Microsoft.Azure.Management.Billing.Models using Microsoft.Rest; using Microsoft.Rest.Serialization; using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// @@ -64,7 +66,10 @@ public BillingSubscription() /// subscription. /// The sku description of the Azure plan /// for the subscription. - public BillingSubscription(string id = default(string), string name = default(string), string type = default(string), string displayName = default(string), System.Guid? subscriptionId = default(System.Guid?), string subscriptionBillingStatus = default(string), Amount lastMonthCharges = default(Amount), Amount monthToDateCharges = default(Amount), string billingProfileId = default(string), string billingProfileDisplayName = default(string), string costCenter = default(string), string customerId = default(string), string customerDisplayName = default(string), string invoiceSectionId = default(string), string invoiceSectionDisplayName = default(string), Reseller reseller = default(Reseller), string skuId = default(string), string skuDescription = default(string)) + /// The suspension reason for a + /// subscription. Applies only to subscriptions in Microsoft Online + /// Services Program billing accounts. + public BillingSubscription(string id = default(string), string name = default(string), string type = default(string), string displayName = default(string), System.Guid? subscriptionId = default(System.Guid?), string subscriptionBillingStatus = default(string), Amount lastMonthCharges = default(Amount), Amount monthToDateCharges = default(Amount), string billingProfileId = default(string), string billingProfileDisplayName = default(string), string costCenter = default(string), string customerId = default(string), string customerDisplayName = default(string), string invoiceSectionId = default(string), string invoiceSectionDisplayName = default(string), Reseller reseller = default(Reseller), string skuId = default(string), string skuDescription = default(string), IList suspensionReasons = default(IList)) : base(id, name, type) { DisplayName = displayName; @@ -82,6 +87,7 @@ public BillingSubscription() Reseller = reseller; SkuId = skuId; SkuDescription = skuDescription; + SuspensionReasons = suspensionReasons; CustomInit(); } @@ -190,5 +196,13 @@ public BillingSubscription() [JsonProperty(PropertyName = "properties.skuDescription")] public string SkuDescription { get; private set; } + /// + /// Gets the suspension reason for a subscription. Applies only to + /// subscriptions in Microsoft Online Services Program billing + /// accounts. + /// + [JsonProperty(PropertyName = "properties.suspensionReasons")] + public IList SuspensionReasons { get; private set; } + } } diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/EnrollmentAccount.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/EnrollmentAccount.cs index 140c2fb209c5..af1175af8b6a 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/EnrollmentAccount.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/EnrollmentAccount.cs @@ -41,6 +41,8 @@ public EnrollmentAccount() /// enrollment account. /// The owner of the enrollment /// account. + /// The enrollment account owner email + /// address. /// The status of the enrollment account. /// The start date of the enrollment /// account. @@ -48,12 +50,13 @@ public EnrollmentAccount() /// account. /// Associated department. By default this is /// not populated, unless it's specified in $expand. - public EnrollmentAccount(string id = default(string), string name = default(string), string type = default(string), string accountName = default(string), string costCenter = default(string), string accountOwner = default(string), string status = default(string), System.DateTime? startDate = default(System.DateTime?), System.DateTime? endDate = default(System.DateTime?), Department department = default(Department)) + public EnrollmentAccount(string id = default(string), string name = default(string), string type = default(string), string accountName = default(string), string costCenter = default(string), string accountOwner = default(string), string accountOwnerEmail = default(string), string status = default(string), System.DateTime? startDate = default(System.DateTime?), System.DateTime? endDate = default(System.DateTime?), Department department = default(Department)) : base(id, name, type) { AccountName = accountName; CostCenter = costCenter; AccountOwner = accountOwner; + AccountOwnerEmail = accountOwnerEmail; Status = status; StartDate = startDate; EndDate = endDate; @@ -85,6 +88,12 @@ public EnrollmentAccount() [JsonProperty(PropertyName = "properties.accountOwner")] public string AccountOwner { get; set; } + /// + /// Gets or sets the enrollment account owner email address. + /// + [JsonProperty(PropertyName = "properties.accountOwnerEmail")] + public string AccountOwnerEmail { get; set; } + /// /// Gets or sets the status of the enrollment account. /// diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/EnrollmentPolicies.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/EnrollmentPolicies.cs index a01dd23728c3..8b7e269a46ae 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/EnrollmentPolicies.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/EnrollmentPolicies.cs @@ -33,16 +33,16 @@ public EnrollmentPolicies() /// whether Account Owners can view charges. /// The policy that controls /// whether Department Administrators can view charges. - /// The policy that controls whether + /// The policy that controls whether /// Azure marketplace purchases are allowed in the enrollment. /// The policy that controls /// whether Azure reservation purchases are allowed in the /// enrollment. - public EnrollmentPolicies(bool? accountOwnerViewCharges = default(bool?), bool? departmentAdminViewCharges = default(bool?), bool? marketplacesEnabled = default(bool?), bool? reservedInstancesEnabled = default(bool?)) + public EnrollmentPolicies(bool? accountOwnerViewCharges = default(bool?), bool? departmentAdminViewCharges = default(bool?), bool? marketplaceEnabled = default(bool?), bool? reservedInstancesEnabled = default(bool?)) { AccountOwnerViewCharges = accountOwnerViewCharges; DepartmentAdminViewCharges = departmentAdminViewCharges; - MarketplacesEnabled = marketplacesEnabled; + MarketplaceEnabled = marketplaceEnabled; ReservedInstancesEnabled = reservedInstancesEnabled; CustomInit(); } @@ -70,8 +70,8 @@ public EnrollmentPolicies() /// Gets the policy that controls whether Azure marketplace purchases /// are allowed in the enrollment. /// - [JsonProperty(PropertyName = "marketplacesEnabled")] - public bool? MarketplacesEnabled { get; private set; } + [JsonProperty(PropertyName = "marketplaceEnabled")] + public bool? MarketplaceEnabled { get; private set; } /// /// Gets the policy that controls whether Azure reservation purchases diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ErrorDetails.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ErrorDetails.cs index 2abc90d1ef82..4a12173390bc 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ErrorDetails.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ErrorDetails.cs @@ -11,6 +11,8 @@ namespace Microsoft.Azure.Management.Billing.Models { using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// @@ -33,11 +35,13 @@ public ErrorDetails() /// Error message indicating why the operation /// failed. /// The target of the particular error. - public ErrorDetails(string code = default(string), string message = default(string), string target = default(string)) + /// The sub details of the error. + public ErrorDetails(string code = default(string), string message = default(string), string target = default(string), IList details = default(IList)) { Code = code; Message = message; Target = target; + Details = details; CustomInit(); } @@ -64,5 +68,11 @@ public ErrorDetails() [JsonProperty(PropertyName = "target")] public string Target { get; private set; } + /// + /// Gets the sub details of the error. + /// + [JsonProperty(PropertyName = "details")] + public IList Details { get; private set; } + } } diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ErrorSubDetailsItem.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ErrorSubDetailsItem.cs new file mode 100644 index 000000000000..76071d4e8fd5 --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ErrorSubDetailsItem.cs @@ -0,0 +1,65 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Billing.Models +{ + using Newtonsoft.Json; + using System.Linq; + + public partial class ErrorSubDetailsItem + { + /// + /// Initializes a new instance of the ErrorSubDetailsItem class. + /// + public ErrorSubDetailsItem() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ErrorSubDetailsItem class. + /// + /// Error code. + /// Error message indicating why the operation + /// failed. + /// The target of the particular error. + public ErrorSubDetailsItem(string code = default(string), string message = default(string), string target = default(string)) + { + Code = code; + Message = message; + Target = target; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets error code. + /// + [JsonProperty(PropertyName = "code")] + public string Code { get; private set; } + + /// + /// Gets error message indicating why the operation failed. + /// + [JsonProperty(PropertyName = "message")] + public string Message { get; private set; } + + /// + /// Gets the target of the particular error. + /// + [JsonProperty(PropertyName = "target")] + public string Target { get; private set; } + + } +} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/IndirectRelationshipInfo.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/IndirectRelationshipInfo.cs new file mode 100644 index 000000000000..977b6f231d37 --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/IndirectRelationshipInfo.cs @@ -0,0 +1,74 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Billing.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The billing profile details of the partner of the customer for an + /// indirect motion. + /// + public partial class IndirectRelationshipInfo + { + /// + /// Initializes a new instance of the IndirectRelationshipInfo class. + /// + public IndirectRelationshipInfo() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the IndirectRelationshipInfo class. + /// + /// The billing account name of the + /// partner or the customer for an indirect motion. + /// The billing profile name of the + /// partner or the customer for an indirect motion. + /// The display name of the partner or + /// customer for an indirect motion. + public IndirectRelationshipInfo(string billingAccountName = default(string), string billingProfileName = default(string), string displayName = default(string)) + { + BillingAccountName = billingAccountName; + BillingProfileName = billingProfileName; + DisplayName = displayName; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the billing account name of the partner or the + /// customer for an indirect motion. + /// + [JsonProperty(PropertyName = "billingAccountName")] + public string BillingAccountName { get; set; } + + /// + /// Gets or sets the billing profile name of the partner or the + /// customer for an indirect motion. + /// + [JsonProperty(PropertyName = "billingProfileName")] + public string BillingProfileName { get; set; } + + /// + /// Gets or sets the display name of the partner or customer for an + /// indirect motion. + /// + [JsonProperty(PropertyName = "displayName")] + public string DisplayName { get; set; } + + } +} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Invoice.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Invoice.cs index 6d360f88ac10..06fa88a34473 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Invoice.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Invoice.cs @@ -41,7 +41,7 @@ public Invoice() /// The date when the invoice was /// generated. /// The current status of the invoice. Possible - /// values include: 'Due', 'OverDue', 'Paid' + /// values include: 'Due', 'OverDue', 'Paid', 'Void' /// The amount due as of now. /// The amount of Azure prepayment /// applied to the charges. This field is applicable to billing @@ -83,9 +83,18 @@ public Invoice() /// List of documents available to download /// such as invoice and tax receipt. /// List of payments. + /// Rebill details for an invoice. + /// The type of the document. Possible + /// values include: 'Invoice', 'CreditNote' + /// The Id of the active invoice which + /// is originally billed after this invoice was voided. This field is + /// applicable to the void invoices 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. /// The ID of the subscription for which /// the invoice is generated. - public Invoice(string id = default(string), string name = default(string), string type = default(string), System.DateTime? dueDate = default(System.DateTime?), System.DateTime? invoiceDate = default(System.DateTime?), string status = default(string), Amount amountDue = default(Amount), Amount azurePrepaymentApplied = default(Amount), Amount billedAmount = default(Amount), Amount creditAmount = default(Amount), Amount freeAzureCreditApplied = default(Amount), Amount subTotal = default(Amount), Amount taxAmount = default(Amount), Amount totalAmount = default(Amount), System.DateTime? invoicePeriodStartDate = default(System.DateTime?), System.DateTime? invoicePeriodEndDate = default(System.DateTime?), string invoiceType = default(string), bool? isMonthlyInvoice = default(bool?), string billingProfileId = default(string), string billingProfileDisplayName = default(string), string purchaseOrderNumber = default(string), IList documents = default(IList), IList payments = default(IList), string subscriptionId = default(string)) + public Invoice(string id = default(string), string name = default(string), string type = default(string), System.DateTime? dueDate = default(System.DateTime?), System.DateTime? invoiceDate = default(System.DateTime?), string status = default(string), Amount amountDue = default(Amount), Amount azurePrepaymentApplied = default(Amount), Amount billedAmount = default(Amount), Amount creditAmount = default(Amount), Amount freeAzureCreditApplied = default(Amount), Amount subTotal = default(Amount), Amount taxAmount = default(Amount), Amount totalAmount = default(Amount), System.DateTime? invoicePeriodStartDate = default(System.DateTime?), System.DateTime? invoicePeriodEndDate = default(System.DateTime?), string invoiceType = default(string), bool? isMonthlyInvoice = default(bool?), string billingProfileId = default(string), string billingProfileDisplayName = default(string), string purchaseOrderNumber = default(string), IList documents = default(IList), IList payments = default(IList), IDictionary rebillDetails = default(IDictionary), string documentType = default(string), string billedDocumentId = default(string), string creditForDocumentId = default(string), string subscriptionId = default(string)) : base(id, name, type) { DueDate = dueDate; @@ -108,6 +117,10 @@ public Invoice() PurchaseOrderNumber = purchaseOrderNumber; Documents = documents; Payments = payments; + RebillDetails = rebillDetails; + DocumentType = documentType; + BilledDocumentId = billedDocumentId; + CreditForDocumentId = creditForDocumentId; SubscriptionId = subscriptionId; CustomInit(); } @@ -131,7 +144,7 @@ public Invoice() /// /// Gets the current status of the invoice. Possible values include: - /// 'Due', 'OverDue', 'Paid' + /// 'Due', 'OverDue', 'Paid', 'Void' /// [JsonProperty(PropertyName = "properties.status")] public string Status { get; private set; } @@ -257,6 +270,35 @@ public Invoice() [JsonProperty(PropertyName = "properties.payments")] public IList Payments { get; private set; } + /// + /// Gets rebill details for an invoice. + /// + [JsonProperty(PropertyName = "properties.rebillDetails")] + public IDictionary RebillDetails { get; private set; } + + /// + /// Gets the type of the document. Possible values include: 'Invoice', + /// 'CreditNote' + /// + [JsonProperty(PropertyName = "properties.documentType")] + public string DocumentType { get; private set; } + + /// + /// Gets the Id of the active invoice which is originally billed after + /// this invoice was voided. This field is applicable to the void + /// invoices only. + /// + [JsonProperty(PropertyName = "properties.billedDocumentId")] + public string BilledDocumentId { get; private set; } + + /// + /// Gets 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. + /// + [JsonProperty(PropertyName = "properties.creditForDocumentId")] + public string CreditForDocumentId { get; private set; } + /// /// Gets the ID of the subscription for which the invoice is generated. /// diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/InvoiceDocumentType.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/InvoiceDocumentType.cs new file mode 100644 index 000000000000..983a4ab07e51 --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/InvoiceDocumentType.cs @@ -0,0 +1,22 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Billing.Models +{ + + /// + /// Defines values for InvoiceDocumentType. + /// + public static class InvoiceDocumentType + { + public const string Invoice = "Invoice"; + public const string CreditNote = "CreditNote"; + } +} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/InvoiceSection.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/InvoiceSection.cs index 1a7aaac35a84..49031416a287 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/InvoiceSection.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/InvoiceSection.cs @@ -40,14 +40,28 @@ public InvoiceSection() /// The name of the invoice section. /// Dictionary of metadata associated with the /// invoice section. + /// Identifies the state of an invoice section. + /// Possible values include: 'Active', 'Restricted' /// The system generated unique identifier for /// an invoice section. - public InvoiceSection(string id = default(string), string name = default(string), string type = default(string), string displayName = default(string), IDictionary labels = default(IDictionary), string systemId = default(string)) + /// Dictionary of metadata associated with the + /// invoice section. Maximum key/value length supported of 256 + /// characters. Keys/value should not empty value nor null. Keys can + /// not contain < > % & \ ? / + /// Identifies the cloud environments that + /// are associated with an invoice section. This is a system managed + /// optional field and gets updated as the invoice section gets + /// associated with accounts in various clouds. Possible values + /// include: 'USGov', 'USNat', 'USSec' + public InvoiceSection(string id = default(string), string name = default(string), string type = default(string), string displayName = default(string), IDictionary labels = default(IDictionary), string state = default(string), string systemId = default(string), IDictionary tags = default(IDictionary), string targetCloud = default(string)) : base(id, name, type) { DisplayName = displayName; Labels = labels; + State = state; SystemId = systemId; + Tags = tags; + TargetCloud = targetCloud; CustomInit(); } @@ -69,11 +83,36 @@ public InvoiceSection() [JsonProperty(PropertyName = "properties.labels")] public IDictionary Labels { get; set; } + /// + /// Gets identifies the state of an invoice section. Possible values + /// include: 'Active', 'Restricted' + /// + [JsonProperty(PropertyName = "properties.state")] + public string State { get; private set; } + /// /// Gets the system generated unique identifier for an invoice section. /// [JsonProperty(PropertyName = "properties.systemId")] public string SystemId { get; private set; } + /// + /// Gets or sets dictionary of metadata associated with the invoice + /// section. Maximum key/value length supported of 256 characters. + /// Keys/value should not empty value nor null. Keys can not contain + /// &lt; &gt; % &amp; \ ? / + /// + [JsonProperty(PropertyName = "properties.tags")] + public IDictionary Tags { get; set; } + + /// + /// Gets identifies the cloud environments that are associated with an + /// invoice section. This is a system managed optional field and gets + /// updated as the invoice section gets associated with accounts in + /// various clouds. Possible values include: 'USGov', 'USNat', 'USSec' + /// + [JsonProperty(PropertyName = "properties.targetCloud")] + public string TargetCloud { get; private set; } + } } diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/InvoiceSectionState.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/InvoiceSectionState.cs new file mode 100644 index 000000000000..243d3b1e54fd --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/InvoiceSectionState.cs @@ -0,0 +1,22 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Billing.Models +{ + + /// + /// Defines values for InvoiceSectionState. + /// + public static class InvoiceSectionState + { + public const string Active = "Active"; + public const string Restricted = "Restricted"; + } +} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/InvoiceStatus.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/InvoiceStatus.cs index 4a4bcaa725a2..f8c757a57b3e 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/InvoiceStatus.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/InvoiceStatus.cs @@ -19,5 +19,6 @@ public static class InvoiceStatus public const string Due = "Due"; public const string OverDue = "OverDue"; public const string Paid = "Paid"; + public const string Void = "Void"; } } diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/InvoicesDownloadMultipleBillingProfileInvoicesHeaders.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/InvoicesDownloadMultipleBillingProfileInvoicesHeaders.cs new file mode 100644 index 000000000000..51d530bd903a --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/InvoicesDownloadMultipleBillingProfileInvoicesHeaders.cs @@ -0,0 +1,66 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Billing.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Defines headers for DownloadMultipleBillingProfileInvoices operation. + /// + public partial class InvoicesDownloadMultipleBillingProfileInvoicesHeaders + { + /// + /// Initializes a new instance of the + /// InvoicesDownloadMultipleBillingProfileInvoicesHeaders class. + /// + public InvoicesDownloadMultipleBillingProfileInvoicesHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// InvoicesDownloadMultipleBillingProfileInvoicesHeaders class. + /// + /// GET this URL to retrieve the status of the + /// asynchronous operation. + /// The amount of delay to use while the + /// status of the operation is checked. The value is expressed in + /// seconds. + public InvoicesDownloadMultipleBillingProfileInvoicesHeaders(string location = default(string), string retryAfter = default(string)) + { + Location = location; + RetryAfter = retryAfter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets GET this URL to retrieve the status of the + /// asynchronous operation. + /// + [JsonProperty(PropertyName = "Location")] + public string Location { get; set; } + + /// + /// Gets or sets the amount of delay to use while the status of the + /// operation is checked. The value is expressed in seconds. + /// + [JsonProperty(PropertyName = "Retry-After")] + public string RetryAfter { get; set; } + + } +} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/InvoicesDownloadMultipleBillingSubscriptionInvoicesHeaders.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/InvoicesDownloadMultipleBillingSubscriptionInvoicesHeaders.cs new file mode 100644 index 000000000000..9b04b5139046 --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/InvoicesDownloadMultipleBillingSubscriptionInvoicesHeaders.cs @@ -0,0 +1,67 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Billing.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Defines headers for DownloadMultipleBillingSubscriptionInvoices + /// operation. + /// + public partial class InvoicesDownloadMultipleBillingSubscriptionInvoicesHeaders + { + /// + /// Initializes a new instance of the + /// InvoicesDownloadMultipleBillingSubscriptionInvoicesHeaders class. + /// + public InvoicesDownloadMultipleBillingSubscriptionInvoicesHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// InvoicesDownloadMultipleBillingSubscriptionInvoicesHeaders class. + /// + /// GET this URL to retrieve the status of the + /// asynchronous operation. + /// The amount of delay to use while the + /// status of the operation is checked. The value is expressed in + /// seconds. + public InvoicesDownloadMultipleBillingSubscriptionInvoicesHeaders(string location = default(string), string retryAfter = default(string)) + { + Location = location; + RetryAfter = retryAfter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets GET this URL to retrieve the status of the + /// asynchronous operation. + /// + [JsonProperty(PropertyName = "Location")] + public string Location { get; set; } + + /// + /// Gets or sets the amount of delay to use while the status of the + /// operation is checked. The value is expressed in seconds. + /// + [JsonProperty(PropertyName = "Retry-After")] + public string RetryAfter { get; set; } + + } +} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Operation.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Operation.cs index 20cb7d5af963..f17cb0dfd2e8 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Operation.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Operation.cs @@ -31,11 +31,14 @@ public Operation() /// /// Operation name: /// {provider}/{resource}/{operation}. + /// Identifies if the operation is a data + /// operation. /// The object that represents the /// operation. - public Operation(string name = default(string), OperationDisplay display = default(OperationDisplay)) + public Operation(string name = default(string), bool? isDataAction = default(bool?), OperationDisplay display = default(OperationDisplay)) { Name = name; + IsDataAction = isDataAction; Display = display; CustomInit(); } @@ -51,6 +54,12 @@ public Operation() [JsonProperty(PropertyName = "name")] public string Name { get; private set; } + /// + /// Gets identifies if the operation is a data operation. + /// + [JsonProperty(PropertyName = "isDataAction")] + public bool? IsDataAction { get; private set; } + /// /// Gets or sets the object that represents the operation. /// diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/OperationDisplay.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/OperationDisplay.cs index 1fb0a8ab0c51..37475feeb74a 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/OperationDisplay.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/OperationDisplay.cs @@ -34,11 +34,13 @@ public OperationDisplay() /// such as invoice and billing subscription. /// Operation type such as read, write and /// delete. - public OperationDisplay(string provider = default(string), string resource = default(string), string operation = default(string)) + /// Description of operation. + public OperationDisplay(string provider = default(string), string resource = default(string), string operation = default(string), string description = default(string)) { Provider = provider; Resource = resource; Operation = operation; + Description = description; CustomInit(); } @@ -66,5 +68,11 @@ public OperationDisplay() [JsonProperty(PropertyName = "operation")] public string Operation { get; private set; } + /// + /// Gets description of operation. + /// + [JsonProperty(PropertyName = "description")] + public string Description { get; private set; } + } } diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/OperationsErrorDetails.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/OperationsErrorDetails.cs new file mode 100644 index 000000000000..ea359fa2384c --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/OperationsErrorDetails.cs @@ -0,0 +1,68 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Billing.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The details of the error. + /// + public partial class OperationsErrorDetails + { + /// + /// Initializes a new instance of the OperationsErrorDetails class. + /// + public OperationsErrorDetails() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the OperationsErrorDetails class. + /// + /// Error code. + /// Error message indicating why the operation + /// failed. + /// The target of the particular error. + public OperationsErrorDetails(string code = default(string), string message = default(string), string target = default(string)) + { + Code = code; + Message = message; + Target = target; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets error code. + /// + [JsonProperty(PropertyName = "code")] + public string Code { get; private set; } + + /// + /// Gets error message indicating why the operation failed. + /// + [JsonProperty(PropertyName = "message")] + public string Message { get; private set; } + + /// + /// Gets the target of the particular error. + /// + [JsonProperty(PropertyName = "target")] + public string Target { get; private set; } + + } +} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/OperationsErrorResponse.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/OperationsErrorResponse.cs new file mode 100644 index 000000000000..6a95e3c1dd3e --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/OperationsErrorResponse.cs @@ -0,0 +1,52 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Billing.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Error response indicates that the service is not able to process the + /// incoming request. The reason is provided in the error message. + /// + public partial class OperationsErrorResponse + { + /// + /// Initializes a new instance of the OperationsErrorResponse class. + /// + public OperationsErrorResponse() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the OperationsErrorResponse class. + /// + /// The details of the error. + public OperationsErrorResponse(OperationsErrorDetails error = default(OperationsErrorDetails)) + { + Error = error; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the details of the error. + /// + [JsonProperty(PropertyName = "error")] + public OperationsErrorDetails Error { get; set; } + + } +} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/OperationsErrorResponseException.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/OperationsErrorResponseException.cs new file mode 100644 index 000000000000..5c38ee87afc5 --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/OperationsErrorResponseException.cs @@ -0,0 +1,62 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Billing.Models +{ + using Microsoft.Rest; + + /// + /// Exception thrown for an invalid response with OperationsErrorResponse + /// information. + /// + public partial class OperationsErrorResponseException : RestException + { + /// + /// Gets information about the associated HTTP request. + /// + public HttpRequestMessageWrapper Request { get; set; } + + /// + /// Gets information about the associated HTTP response. + /// + public HttpResponseMessageWrapper Response { get; set; } + + /// + /// Gets or sets the body object. + /// + public OperationsErrorResponse Body { get; set; } + + /// + /// Initializes a new instance of the OperationsErrorResponseException class. + /// + public OperationsErrorResponseException() + { + } + + /// + /// Initializes a new instance of the OperationsErrorResponseException class. + /// + /// The exception message. + public OperationsErrorResponseException(string message) + : this(message, null) + { + } + + /// + /// Initializes a new instance of the OperationsErrorResponseException class. + /// + /// The exception message. + /// Inner exception. + public OperationsErrorResponseException(string message, System.Exception innerException) + : base(message, innerException) + { + } + } +} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/RebillDetails.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/RebillDetails.cs new file mode 100644 index 000000000000..d5a307f5710f --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/RebillDetails.cs @@ -0,0 +1,70 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Billing.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The rebill details of an invoice. + /// + public partial class RebillDetails + { + /// + /// Initializes a new instance of the RebillDetails class. + /// + public RebillDetails() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the RebillDetails class. + /// + /// The ID of credit note. + /// The ID of invoice. + /// Rebill details for an + /// invoice. + public RebillDetails(string creditNoteDocumentId = default(string), string invoiceDocumentId = default(string), IDictionary rebillDetailsProperty = default(IDictionary)) + { + CreditNoteDocumentId = creditNoteDocumentId; + InvoiceDocumentId = invoiceDocumentId; + RebillDetailsProperty = rebillDetailsProperty; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the ID of credit note. + /// + [JsonProperty(PropertyName = "creditNoteDocumentId")] + public string CreditNoteDocumentId { get; private set; } + + /// + /// Gets the ID of invoice. + /// + [JsonProperty(PropertyName = "invoiceDocumentId")] + public string InvoiceDocumentId { get; private set; } + + /// + /// Gets rebill details for an invoice. + /// + [JsonProperty(PropertyName = "rebillDetails")] + public IDictionary RebillDetailsProperty { get; private set; } + + } +} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Reservation.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Reservation.cs new file mode 100644 index 000000000000..447582fe5d41 --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Reservation.cs @@ -0,0 +1,242 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Billing.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The definition of the reservation. + /// + [Rest.Serialization.JsonTransformation] + public partial class Reservation + { + /// + /// Initializes a new instance of the Reservation class. + /// + public Reservation() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Reservation class. + /// + /// The id of the reservation. + /// The name of the reservation. + /// The type of the reservation. + /// The location of the reservation. + /// The sku information associated to this + /// reservation + /// The array of applied scopes of a + /// reservation. Will be null if the reservation is in Shared + /// scope + /// The applied scope type of the + /// reservation. + /// The reserved source type of the + /// reservation, e.g. virtual machine. + /// The number of the reservation. + /// The provisioning state of the + /// reservation, e.g. Succeeded + /// The expiry date of the reservation + /// The provisioning state of the + /// reservation, e.g. Succeeded + /// The display name of the + /// reservation + /// The provisioning state of + /// the reservation for display, e.g. Succeeded + /// The renew state of the + /// reservation for display, e.g. On + /// The applied scope type + /// of the reservation for display, e.g. Shared + /// The effective date time of the + /// reservation + /// The sku description of the + /// reservation + /// The term of the reservation, e.g. P1Y + /// The renew state of the reservation + /// The renew source of the + /// reservation + /// Reservation utilization + public Reservation(string id = default(string), string name = default(string), string type = default(string), string location = default(string), ReservationSkuProperty sku = default(ReservationSkuProperty), IList appliedScopes = default(IList), string appliedScopeType = default(string), string reservedResourceType = default(string), double? quantity = default(double?), string provisioningState = default(string), string expiryDate = default(string), string provisioningSubState = default(string), string displayName = default(string), string displayProvisioningState = default(string), string userFriendlyRenewState = default(string), string userFriendlyAppliedScopeType = default(string), string effectiveDateTime = default(string), string skuDescription = default(string), string term = default(string), bool? renew = default(bool?), string renewSource = default(string), ReservationPropertyUtilization utilization = default(ReservationPropertyUtilization)) + { + Id = id; + Name = name; + Type = type; + Location = location; + Sku = sku; + AppliedScopes = appliedScopes; + AppliedScopeType = appliedScopeType; + ReservedResourceType = reservedResourceType; + Quantity = quantity; + ProvisioningState = provisioningState; + ExpiryDate = expiryDate; + ProvisioningSubState = provisioningSubState; + DisplayName = displayName; + DisplayProvisioningState = displayProvisioningState; + UserFriendlyRenewState = userFriendlyRenewState; + UserFriendlyAppliedScopeType = userFriendlyAppliedScopeType; + EffectiveDateTime = effectiveDateTime; + SkuDescription = skuDescription; + Term = term; + Renew = renew; + RenewSource = renewSource; + Utilization = utilization; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the id of the reservation. + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; private set; } + + /// + /// Gets the name of the reservation. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets the type of the reservation. + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } + + /// + /// Gets the location of the reservation. + /// + [JsonProperty(PropertyName = "location")] + public string Location { get; private set; } + + /// + /// Gets or sets the sku information associated to this reservation + /// + [JsonProperty(PropertyName = "sku")] + public ReservationSkuProperty Sku { get; set; } + + /// + /// Gets or sets the array of applied scopes of a reservation. Will be + /// null if the reservation is in Shared scope + /// + [JsonProperty(PropertyName = "properties.appliedScopes")] + public IList AppliedScopes { get; set; } + + /// + /// Gets the applied scope type of the reservation. + /// + [JsonProperty(PropertyName = "properties.appliedScopeType")] + public string AppliedScopeType { get; private set; } + + /// + /// Gets the reserved source type of the reservation, e.g. virtual + /// machine. + /// + [JsonProperty(PropertyName = "properties.reservedResourceType")] + public string ReservedResourceType { get; private set; } + + /// + /// Gets the number of the reservation. + /// + [JsonProperty(PropertyName = "properties.quantity")] + public double? Quantity { get; private set; } + + /// + /// Gets the provisioning state of the reservation, e.g. Succeeded + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; private set; } + + /// + /// Gets the expiry date of the reservation + /// + [JsonProperty(PropertyName = "properties.expiryDate")] + public string ExpiryDate { get; private set; } + + /// + /// Gets the provisioning state of the reservation, e.g. Succeeded + /// + [JsonProperty(PropertyName = "properties.provisioningSubState")] + public string ProvisioningSubState { get; private set; } + + /// + /// Gets the display name of the reservation + /// + [JsonProperty(PropertyName = "properties.displayName")] + public string DisplayName { get; private set; } + + /// + /// Gets the provisioning state of the reservation for display, e.g. + /// Succeeded + /// + [JsonProperty(PropertyName = "properties.displayProvisioningState")] + public string DisplayProvisioningState { get; private set; } + + /// + /// Gets the renew state of the reservation for display, e.g. On + /// + [JsonProperty(PropertyName = "properties.userFriendlyRenewState")] + public string UserFriendlyRenewState { get; private set; } + + /// + /// Gets the applied scope type of the reservation for display, e.g. + /// Shared + /// + [JsonProperty(PropertyName = "properties.userFriendlyAppliedScopeType")] + public string UserFriendlyAppliedScopeType { get; private set; } + + /// + /// Gets the effective date time of the reservation + /// + [JsonProperty(PropertyName = "properties.effectiveDateTime")] + public string EffectiveDateTime { get; private set; } + + /// + /// Gets the sku description of the reservation + /// + [JsonProperty(PropertyName = "properties.skuDescription")] + public string SkuDescription { get; private set; } + + /// + /// Gets the term of the reservation, e.g. P1Y + /// + [JsonProperty(PropertyName = "properties.term")] + public string Term { get; private set; } + + /// + /// Gets the renew state of the reservation + /// + [JsonProperty(PropertyName = "properties.renew")] + public bool? Renew { get; private set; } + + /// + /// Gets the renew source of the reservation + /// + [JsonProperty(PropertyName = "properties.renewSource")] + public string RenewSource { get; private set; } + + /// + /// Gets reservation utilization + /// + [JsonProperty(PropertyName = "properties.utilization")] + public ReservationPropertyUtilization Utilization { get; private set; } + + } +} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ReservationPropertyUtilization.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ReservationPropertyUtilization.cs new file mode 100644 index 000000000000..bebc695a4c71 --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ReservationPropertyUtilization.cs @@ -0,0 +1,65 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Billing.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Reservation utilization + /// + public partial class ReservationPropertyUtilization + { + /// + /// Initializes a new instance of the ReservationPropertyUtilization + /// class. + /// + public ReservationPropertyUtilization() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ReservationPropertyUtilization + /// class. + /// + /// The number of days trend for a + /// reservation + /// The array of aggregates of a reservation's + /// utilization + public ReservationPropertyUtilization(string trend = default(string), IList aggregates = default(IList)) + { + Trend = trend; + Aggregates = aggregates; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the number of days trend for a reservation + /// + [JsonProperty(PropertyName = "trend")] + public string Trend { get; private set; } + + /// + /// Gets or sets the array of aggregates of a reservation's utilization + /// + [JsonProperty(PropertyName = "aggregates")] + public IList Aggregates { get; set; } + + } +} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ReservationSkuProperty.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ReservationSkuProperty.cs new file mode 100644 index 000000000000..759aa20cfdc4 --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ReservationSkuProperty.cs @@ -0,0 +1,51 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Billing.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The property of reservation sku object. + /// + public partial class ReservationSkuProperty + { + /// + /// Initializes a new instance of the ReservationSkuProperty class. + /// + public ReservationSkuProperty() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ReservationSkuProperty class. + /// + /// The name of the reservation sku. + public ReservationSkuProperty(string name = default(string)) + { + Name = name; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the name of the reservation sku. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + } +} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ReservationSummary.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ReservationSummary.cs new file mode 100644 index 000000000000..84d57affa1a6 --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ReservationSummary.cs @@ -0,0 +1,97 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Billing.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The roll up count summary of reservations in each state + /// + public partial class ReservationSummary + { + /// + /// Initializes a new instance of the ReservationSummary class. + /// + public ReservationSummary() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ReservationSummary class. + /// + /// The number of reservation in Succeeded + /// state + /// The number of reservation in Failed + /// state + /// The number of reservation in Expiring + /// state + /// The number of reservation in Expired + /// state + /// The number of reservation in Pending + /// state + /// The number of reservation in Cancelled + /// state + public ReservationSummary(double? succeededCount = default(double?), double? failedCount = default(double?), double? expiringCount = default(double?), double? expiredCount = default(double?), double? pendingCount = default(double?), double? cancelledCount = default(double?)) + { + SucceededCount = succeededCount; + FailedCount = failedCount; + ExpiringCount = expiringCount; + ExpiredCount = expiredCount; + PendingCount = pendingCount; + CancelledCount = cancelledCount; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the number of reservation in Succeeded state + /// + [JsonProperty(PropertyName = "succeededCount")] + public double? SucceededCount { get; private set; } + + /// + /// Gets the number of reservation in Failed state + /// + [JsonProperty(PropertyName = "failedCount")] + public double? FailedCount { get; private set; } + + /// + /// Gets the number of reservation in Expiring state + /// + [JsonProperty(PropertyName = "expiringCount")] + public double? ExpiringCount { get; private set; } + + /// + /// Gets the number of reservation in Expired state + /// + [JsonProperty(PropertyName = "expiredCount")] + public double? ExpiredCount { get; private set; } + + /// + /// Gets the number of reservation in Pending state + /// + [JsonProperty(PropertyName = "pendingCount")] + public double? PendingCount { get; private set; } + + /// + /// Gets the number of reservation in Cancelled state + /// + [JsonProperty(PropertyName = "cancelledCount")] + public double? CancelledCount { get; private set; } + + } +} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ReservationUtilizationAggregates.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ReservationUtilizationAggregates.cs new file mode 100644 index 000000000000..aad6eb9b1657 --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ReservationUtilizationAggregates.cs @@ -0,0 +1,77 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Billing.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The aggregate values of reservation utilization + /// + public partial class ReservationUtilizationAggregates + { + /// + /// Initializes a new instance of the ReservationUtilizationAggregates + /// class. + /// + public ReservationUtilizationAggregates() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ReservationUtilizationAggregates + /// class. + /// + /// The grain of the aggregate + /// The grain unit of the aggregate + /// The aggregate value + /// The aggregate value unit + public ReservationUtilizationAggregates(double? grain = default(double?), string grainUnit = default(string), double? value = default(double?), string valueUnit = default(string)) + { + Grain = grain; + GrainUnit = grainUnit; + Value = value; + ValueUnit = valueUnit; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the grain of the aggregate + /// + [JsonProperty(PropertyName = "grain")] + public double? Grain { get; private set; } + + /// + /// Gets the grain unit of the aggregate + /// + [JsonProperty(PropertyName = "grainUnit")] + public string GrainUnit { get; private set; } + + /// + /// Gets the aggregate value + /// + [JsonProperty(PropertyName = "value")] + public double? Value { get; private set; } + + /// + /// Gets the aggregate value unit + /// + [JsonProperty(PropertyName = "valueUnit")] + public string ValueUnit { get; private set; } + + } +} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/SubscriptionTransferValidationErrorCode.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/SubscriptionTransferValidationErrorCode.cs index 128d487ef129..faa6b7973d28 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/SubscriptionTransferValidationErrorCode.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/SubscriptionTransferValidationErrorCode.cs @@ -16,13 +16,25 @@ namespace Microsoft.Azure.Management.Billing.Models /// public static class SubscriptionTransferValidationErrorCode { + public const string BillingAccountInactive = "BillingAccountInactive"; + public const string CrossBillingAccountNotAllowed = "CrossBillingAccountNotAllowed"; + public const string DestinationBillingProfileInactive = "DestinationBillingProfileInactive"; + public const string DestinationBillingProfileNotFound = "DestinationBillingProfileNotFound"; + public const string DestinationBillingProfilePastDue = "DestinationBillingProfilePastDue"; + public const string DestinationInvoiceSectionInactive = "DestinationInvoiceSectionInactive"; + public const string DestinationInvoiceSectionNotFound = "DestinationInvoiceSectionNotFound"; + public const string InsufficientPermissionOnDestination = "InsufficientPermissionOnDestination"; + public const string InsufficientPermissionOnSource = "InsufficientPermissionOnSource"; + public const string InvalidDestination = "InvalidDestination"; public const string InvalidSource = "InvalidSource"; + public const string MarketplaceNotEnabledOnDestination = "MarketplaceNotEnabledOnDestination"; + public const string NotAvailableForDestinationMarket = "NotAvailableForDestinationMarket"; + public const string ProductInactive = "ProductInactive"; + public const string ProductNotFound = "ProductNotFound"; + public const string ProductTypeNotSupported = "ProductTypeNotSupported"; + public const string SourceBillingProfilePastDue = "SourceBillingProfilePastDue"; + public const string SourceInvoiceSectionInactive = "SourceInvoiceSectionInactive"; public const string SubscriptionNotActive = "SubscriptionNotActive"; - public const string InsufficientPermissionOnSource = "InsufficientPermissionOnSource"; - public const string InsufficientPermissionOnDestination = "InsufficientPermissionOnDestination"; - public const string DestinationBillingProfilePastDue = "DestinationBillingProfilePastDue"; public const string SubscriptionTypeNotSupported = "SubscriptionTypeNotSupported"; - public const string CrossBillingAccountNotAllowed = "CrossBillingAccountNotAllowed"; - public const string NotAvailableForDestinationMarket = "NotAvailableForDestinationMarket"; } } diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/TargetCloud.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/TargetCloud.cs new file mode 100644 index 000000000000..25fca188d989 --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/TargetCloud.cs @@ -0,0 +1,23 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Billing.Models +{ + + /// + /// Defines values for TargetCloud. + /// + public static class TargetCloud + { + public const string USGov = "USGov"; + public const string USNat = "USNat"; + public const string USSec = "USSec"; + } +} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ValidateSubscriptionTransferEligibilityError.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ValidateSubscriptionTransferEligibilityError.cs index 93b4696ea517..2531f615dd01 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ValidateSubscriptionTransferEligibilityError.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ValidateSubscriptionTransferEligibilityError.cs @@ -32,12 +32,20 @@ public ValidateSubscriptionTransferEligibilityError() /// ValidateSubscriptionTransferEligibilityError class. /// /// Error code for the product transfer validation. - /// Possible values include: 'InvalidSource', 'SubscriptionNotActive', - /// 'InsufficientPermissionOnSource', - /// 'InsufficientPermissionOnDestination', - /// 'DestinationBillingProfilePastDue', 'SubscriptionTypeNotSupported', + /// Possible values include: 'BillingAccountInactive', /// 'CrossBillingAccountNotAllowed', - /// 'NotAvailableForDestinationMarket' + /// 'DestinationBillingProfileInactive', + /// 'DestinationBillingProfileNotFound', + /// 'DestinationBillingProfilePastDue', + /// 'DestinationInvoiceSectionInactive', + /// 'DestinationInvoiceSectionNotFound', + /// 'InsufficientPermissionOnDestination', + /// 'InsufficientPermissionOnSource', 'InvalidDestination', + /// 'InvalidSource', 'MarketplaceNotEnabledOnDestination', + /// 'NotAvailableForDestinationMarket', 'ProductInactive', + /// 'ProductNotFound', 'ProductTypeNotSupported', + /// 'SourceBillingProfilePastDue', 'SourceInvoiceSectionInactive', + /// 'SubscriptionNotActive', 'SubscriptionTypeNotSupported' /// The error message. /// Detailed error message explaining the /// error. @@ -56,11 +64,20 @@ public ValidateSubscriptionTransferEligibilityError() /// /// Gets or sets error code for the product transfer validation. - /// Possible values include: 'InvalidSource', 'SubscriptionNotActive', - /// 'InsufficientPermissionOnSource', + /// Possible values include: 'BillingAccountInactive', + /// 'CrossBillingAccountNotAllowed', + /// 'DestinationBillingProfileInactive', + /// 'DestinationBillingProfileNotFound', + /// 'DestinationBillingProfilePastDue', + /// 'DestinationInvoiceSectionInactive', + /// 'DestinationInvoiceSectionNotFound', /// 'InsufficientPermissionOnDestination', - /// 'DestinationBillingProfilePastDue', 'SubscriptionTypeNotSupported', - /// 'CrossBillingAccountNotAllowed', 'NotAvailableForDestinationMarket' + /// 'InsufficientPermissionOnSource', 'InvalidDestination', + /// 'InvalidSource', 'MarketplaceNotEnabledOnDestination', + /// 'NotAvailableForDestinationMarket', 'ProductInactive', + /// 'ProductNotFound', 'ProductTypeNotSupported', + /// 'SourceBillingProfilePastDue', 'SourceInvoiceSectionInactive', + /// 'SubscriptionNotActive', 'SubscriptionTypeNotSupported' /// [JsonProperty(PropertyName = "code")] public string Code { get; set; } diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Operations.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Operations.cs index fc25808bd07b..8e81f1c32a0e 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Operations.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Operations.cs @@ -60,7 +60,7 @@ internal Operations(BillingManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -151,11 +151,11 @@ internal Operations(BillingManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new OperationsErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + OperationsErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -224,7 +224,7 @@ internal Operations(BillingManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -320,11 +320,11 @@ internal Operations(BillingManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new OperationsErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + OperationsErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/ReservationsOperations.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/ReservationsOperations.cs new file mode 100644 index 000000000000..5e78013e4a21 --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/ReservationsOperations.cs @@ -0,0 +1,823 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Billing +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// ReservationsOperations operations. + /// + internal partial class ReservationsOperations : IServiceOperations, IReservationsOperations + { + /// + /// Initializes a new instance of the ReservationsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal ReservationsOperations(BillingManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the BillingManagementClient + /// + public BillingManagementClient Client { get; private set; } + + /// + /// Lists the reservations for a billing account and the roll up counts of + /// reservations group by provisioning states. + /// + /// + /// The ID that uniquely identifies a billing account. + /// + /// + /// May be used to filter by reservation properties. The filter supports 'eq', + /// 'or', and 'and'. It does not currently support 'ne', 'gt', 'le', 'ge', or + /// 'not'. + /// + /// + /// May be used to sort order by reservation properties. + /// + /// + /// To indicate whether to refresh the roll up counts of the reservations group + /// by provisioning states + /// + /// + /// The selected provisioning state + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListByBillingAccountWithHttpMessagesAsync(string billingAccountName, string filter = default(string), string orderby = default(string), string refreshSummary = default(string), string selectedState = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (billingAccountName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "billingAccountName"); + } + string apiVersion = "2020-05-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("billingAccountName", billingAccountName); + tracingParameters.Add("filter", filter); + tracingParameters.Add("orderby", orderby); + tracingParameters.Add("refreshSummary", refreshSummary); + tracingParameters.Add("selectedState", selectedState); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByBillingAccount", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/reservations").ToString(); + _url = _url.Replace("{billingAccountName}", System.Uri.EscapeDataString(billingAccountName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (filter != null) + { + _queryParameters.Add(string.Format("$filter={0}", System.Uri.EscapeDataString(filter))); + } + if (orderby != null) + { + _queryParameters.Add(string.Format("$orderby={0}", System.Uri.EscapeDataString(orderby))); + } + if (refreshSummary != null) + { + _queryParameters.Add(string.Format("refreshSummary={0}", System.Uri.EscapeDataString(refreshSummary))); + } + if (selectedState != null) + { + _queryParameters.Add(string.Format("selectedState={0}", System.Uri.EscapeDataString(selectedState))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Lists the reservations for a billing profile and the roll up counts of + /// reservations group by provisioning state. + /// + /// + /// The ID that uniquely identifies a billing account. + /// + /// + /// The ID that uniquely identifies a billing profile. + /// + /// + /// May be used to filter by reservation properties. The filter supports 'eq', + /// 'or', and 'and'. It does not currently support 'ne', 'gt', 'le', 'ge', or + /// 'not'. + /// + /// + /// May be used to sort order by reservation properties. + /// + /// + /// To indicate whether to refresh the roll up counts of the reservations group + /// by provisioning state + /// + /// + /// The selected provisioning state + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListByBillingProfileWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string filter = default(string), string orderby = default(string), string refreshSummary = default(string), string selectedState = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (billingAccountName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "billingAccountName"); + } + if (billingProfileName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "billingProfileName"); + } + string apiVersion = "2020-05-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("billingAccountName", billingAccountName); + tracingParameters.Add("billingProfileName", billingProfileName); + tracingParameters.Add("filter", filter); + tracingParameters.Add("orderby", orderby); + tracingParameters.Add("refreshSummary", refreshSummary); + tracingParameters.Add("selectedState", selectedState); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByBillingProfile", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/reservations").ToString(); + _url = _url.Replace("{billingAccountName}", System.Uri.EscapeDataString(billingAccountName)); + _url = _url.Replace("{billingProfileName}", System.Uri.EscapeDataString(billingProfileName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (filter != null) + { + _queryParameters.Add(string.Format("$filter={0}", System.Uri.EscapeDataString(filter))); + } + if (orderby != null) + { + _queryParameters.Add(string.Format("$orderby={0}", System.Uri.EscapeDataString(orderby))); + } + if (refreshSummary != null) + { + _queryParameters.Add(string.Format("refreshSummary={0}", System.Uri.EscapeDataString(refreshSummary))); + } + if (selectedState != null) + { + _queryParameters.Add(string.Format("selectedState={0}", System.Uri.EscapeDataString(selectedState))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Lists the reservations for a billing account and the roll up counts of + /// reservations group by provisioning states. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListByBillingAccountNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByBillingAccountNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Lists the reservations for a billing profile and the roll up counts of + /// reservations group by provisioning state. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListByBillingProfileNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByBillingProfileNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/ReservationsOperationsExtensions.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/ReservationsOperationsExtensions.cs new file mode 100644 index 000000000000..08416844af1b --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/ReservationsOperationsExtensions.cs @@ -0,0 +1,235 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Billing +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for ReservationsOperations. + /// + public static partial class ReservationsOperationsExtensions + { + /// + /// Lists the reservations for a billing account and the roll up counts of + /// reservations group by provisioning states. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The ID that uniquely identifies a billing account. + /// + /// + /// May be used to filter by reservation properties. The filter supports 'eq', + /// 'or', and 'and'. It does not currently support 'ne', 'gt', 'le', 'ge', or + /// 'not'. + /// + /// + /// May be used to sort order by reservation properties. + /// + /// + /// To indicate whether to refresh the roll up counts of the reservations group + /// by provisioning states + /// + /// + /// The selected provisioning state + /// + public static IPage ListByBillingAccount(this IReservationsOperations operations, string billingAccountName, string filter = default(string), string orderby = default(string), string refreshSummary = default(string), string selectedState = default(string)) + { + return operations.ListByBillingAccountAsync(billingAccountName, filter, orderby, refreshSummary, selectedState).GetAwaiter().GetResult(); + } + + /// + /// Lists the reservations for a billing account and the roll up counts of + /// reservations group by provisioning states. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The ID that uniquely identifies a billing account. + /// + /// + /// May be used to filter by reservation properties. The filter supports 'eq', + /// 'or', and 'and'. It does not currently support 'ne', 'gt', 'le', 'ge', or + /// 'not'. + /// + /// + /// May be used to sort order by reservation properties. + /// + /// + /// To indicate whether to refresh the roll up counts of the reservations group + /// by provisioning states + /// + /// + /// The selected provisioning state + /// + /// + /// The cancellation token. + /// + public static async Task> ListByBillingAccountAsync(this IReservationsOperations operations, string billingAccountName, string filter = default(string), string orderby = default(string), string refreshSummary = default(string), string selectedState = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByBillingAccountWithHttpMessagesAsync(billingAccountName, filter, orderby, refreshSummary, selectedState, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Lists the reservations for a billing profile and the roll up counts of + /// reservations group by provisioning state. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The ID that uniquely identifies a billing account. + /// + /// + /// The ID that uniquely identifies a billing profile. + /// + /// + /// May be used to filter by reservation properties. The filter supports 'eq', + /// 'or', and 'and'. It does not currently support 'ne', 'gt', 'le', 'ge', or + /// 'not'. + /// + /// + /// May be used to sort order by reservation properties. + /// + /// + /// To indicate whether to refresh the roll up counts of the reservations group + /// by provisioning state + /// + /// + /// The selected provisioning state + /// + public static IPage ListByBillingProfile(this IReservationsOperations operations, string billingAccountName, string billingProfileName, string filter = default(string), string orderby = default(string), string refreshSummary = default(string), string selectedState = default(string)) + { + return operations.ListByBillingProfileAsync(billingAccountName, billingProfileName, filter, orderby, refreshSummary, selectedState).GetAwaiter().GetResult(); + } + + /// + /// Lists the reservations for a billing profile and the roll up counts of + /// reservations group by provisioning state. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The ID that uniquely identifies a billing account. + /// + /// + /// The ID that uniquely identifies a billing profile. + /// + /// + /// May be used to filter by reservation properties. The filter supports 'eq', + /// 'or', and 'and'. It does not currently support 'ne', 'gt', 'le', 'ge', or + /// 'not'. + /// + /// + /// May be used to sort order by reservation properties. + /// + /// + /// To indicate whether to refresh the roll up counts of the reservations group + /// by provisioning state + /// + /// + /// The selected provisioning state + /// + /// + /// The cancellation token. + /// + public static async Task> ListByBillingProfileAsync(this IReservationsOperations operations, string billingAccountName, string billingProfileName, string filter = default(string), string orderby = default(string), string refreshSummary = default(string), string selectedState = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByBillingProfileWithHttpMessagesAsync(billingAccountName, billingProfileName, filter, orderby, refreshSummary, selectedState, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Lists the reservations for a billing account and the roll up counts of + /// reservations group by provisioning states. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListByBillingAccountNext(this IReservationsOperations operations, string nextPageLink) + { + return operations.ListByBillingAccountNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists the reservations for a billing account and the roll up counts of + /// reservations group by provisioning states. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByBillingAccountNextAsync(this IReservationsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByBillingAccountNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Lists the reservations for a billing profile and the roll up counts of + /// reservations group by provisioning state. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListByBillingProfileNext(this IReservationsOperations operations, string nextPageLink) + { + return operations.ListByBillingProfileNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists the reservations for a billing profile and the roll up counts of + /// reservations group by provisioning state. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByBillingProfileNextAsync(this IReservationsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByBillingProfileNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/SdkInfo_BillingManagementClient.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/SdkInfo_BillingManagementClient.cs index 64cfd41202ee..bc658097299c 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/SdkInfo_BillingManagementClient.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/SdkInfo_BillingManagementClient.cs @@ -38,20 +38,10 @@ public static IEnumerable> ApiInfo_BillingManageme new Tuple("Billing", "Operations", "2020-05-01"), new Tuple("Billing", "Policies", "2020-05-01"), new Tuple("Billing", "Products", "2020-05-01"), + new Tuple("Billing", "Reservations", "2020-05-01"), new Tuple("Billing", "Transactions", "2020-05-01"), }.AsEnumerable(); } } - // BEGIN: Code Generation Metadata Section - public static readonly String AutoRestVersion = "v2"; - public static readonly String AutoRestBootStrapperVersion = "autorest@2.0.4413"; - public static readonly String AutoRestCmdExecuted = "cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/billing/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --csharp-sdks-folder=C:\\Users\\ansar\\Documents\\GitHub\\azure-sdk-for-net\\sdk"; - public static readonly String GithubForkName = "Azure"; - public static readonly String GithubBranchName = "master"; - public static readonly String GithubCommidId = "bfd326ea58084517f8e9cb2e6bdbcb0c400f6370"; - public static readonly String CodeGenerationErrors = ""; - public static readonly String GithubRepoName = "azure-rest-api-specs"; - // END: Code Generation Metadata Section } } -