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..829d62cd3e40 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. /// 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..a02b22605ab9 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. /// 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/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/BillingProfile.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingProfile.cs index 35a438a6a3d6..edfc1a407607 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,18 @@ 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. + 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)) : base(id, name, type) { DisplayName = displayName; PoNumber = poNumber; + BillingRelationshipType = billingRelationshipType; BillTo = billTo; + IndirectRelationshipInfo = indirectRelationshipInfo; InvoiceEmailOptIn = invoiceEmailOptIn; InvoiceDay = invoiceDay; Currency = currency; @@ -79,6 +92,7 @@ public BillingProfile() Status = status; StatusReasonCode = statusReasonCode; SpendingLimit = spendingLimit; + TargetClouds = targetClouds; CustomInit(); } @@ -100,12 +114,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 +204,15 @@ 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; } + /// /// Validate the object. /// 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/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..8516701512f2 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,23 @@ 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)) + /// 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), string targetCloud = default(string)) : base(id, name, type) { DisplayName = displayName; Labels = labels; + State = state; SystemId = systemId; + TargetCloud = targetCloud; CustomInit(); } @@ -69,11 +78,27 @@ 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 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/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/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/SdkInfo_BillingManagementClient.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/SdkInfo_BillingManagementClient.cs index 64cfd41202ee..284b74359f7a 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 @@ -42,16 +42,5 @@ public static IEnumerable> ApiInfo_BillingManageme }.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 } } -