diff --git a/.github/pull.yml b/.github/pull.yml new file mode 100644 index 000000000000..e053ddf153e0 --- /dev/null +++ b/.github/pull.yml @@ -0,0 +1,7 @@ +# https://github.com/wei/pull#advanced-setup-with-config +version: "1" +rules: + - base: master + upstream: Azure:master + mergeMethod: rebase +label: "AutoPull" \ No newline at end of file diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/AddressOperations.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/AddressOperations.cs new file mode 100644 index 000000000000..39dd36a238d1 --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/AddressOperations.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 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; + + /// + /// AddressOperations operations. + /// + internal partial class AddressOperations : IServiceOperations, IAddressOperations + { + /// + /// Initializes a new instance of the AddressOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal AddressOperations(BillingManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the BillingManagementClient + /// + public BillingManagementClient Client { get; private set; } + + /// + /// Validates the address. + /// + /// + /// + /// + /// 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> ValidateWithHttpMessagesAsync(AddressDetails address, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (address == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "address"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("address", address); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Validate", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/validateAddress").ToString(); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.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(address != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(address, 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) + { + 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/AddressOperationsExtensions.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/AddressOperationsExtensions.cs new file mode 100644 index 000000000000..c0e8399bdcc2 --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/AddressOperationsExtensions.cs @@ -0,0 +1,57 @@ +// +// 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 AddressOperations. + /// + public static partial class AddressOperationsExtensions + { + /// + /// Validates the address. + /// + /// + /// The operations group for this extension method. + /// + /// + /// + public static ValidateAddressResponse Validate(this IAddressOperations operations, AddressDetails address) + { + return operations.ValidateAsync(address).GetAwaiter().GetResult(); + } + + /// + /// Validates the address. + /// + /// + /// The operations group for this extension method. + /// + /// + /// + /// + /// The cancellation token. + /// + public static async Task ValidateAsync(this IAddressOperations operations, AddressDetails address, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ValidateWithHttpMessagesAsync(address, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/AgreementsOperations.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/AgreementsOperations.cs index b7bfd8dccd11..355ab9591a9b 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/AgreementsOperations.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/AgreementsOperations.cs @@ -80,7 +80,7 @@ internal AgreementsOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListByBillingAccountNameWithHttpMessagesAsync(string billingAccountName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListByBillingAccountWithHttpMessagesAsync(string billingAccountName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.ApiVersion == null) { @@ -100,7 +100,7 @@ internal AgreementsOperations(BillingManagementClient client) tracingParameters.Add("billingAccountName", billingAccountName); tracingParameters.Add("expand", expand); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByBillingAccountName", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListByBillingAccount", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/AgreementsOperationsExtensions.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/AgreementsOperationsExtensions.cs index 2657b2b3af17..459d37367761 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/AgreementsOperationsExtensions.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/AgreementsOperationsExtensions.cs @@ -33,9 +33,9 @@ public static partial class AgreementsOperationsExtensions /// /// May be used to expand the participants. /// - public static AgreementListResult ListByBillingAccountName(this IAgreementsOperations operations, string billingAccountName, string expand = default(string)) + public static AgreementListResult ListByBillingAccount(this IAgreementsOperations operations, string billingAccountName, string expand = default(string)) { - return operations.ListByBillingAccountNameAsync(billingAccountName, expand).GetAwaiter().GetResult(); + return operations.ListByBillingAccountAsync(billingAccountName, expand).GetAwaiter().GetResult(); } /// @@ -53,9 +53,9 @@ public static partial class AgreementsOperationsExtensions /// /// The cancellation token. /// - public static async Task ListByBillingAccountNameAsync(this IAgreementsOperations operations, string billingAccountName, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task ListByBillingAccountAsync(this IAgreementsOperations operations, string billingAccountName, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListByBillingAccountNameWithHttpMessagesAsync(billingAccountName, expand, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListByBillingAccountWithHttpMessagesAsync(billingAccountName, expand, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingAccountsOperations.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingAccountsOperations.cs index 1d076d68748b..e4b1b16addf6 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingAccountsOperations.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingAccountsOperations.cs @@ -54,7 +54,7 @@ internal BillingAccountsOperations(BillingManagementClient client) /// Lists all billing accounts for a user which he has access to. /// /// - /// May be used to expand the invoiceSections and billingProfiles. + /// May be used to expand the address, invoiceSections and billingProfiles. /// /// /// Headers that will be added to request. @@ -233,7 +233,7 @@ internal BillingAccountsOperations(BillingManagementClient client) /// billing Account Id. /// /// - /// May be used to expand the invoiceSections and billingProfiles. + /// May be used to expand the address, invoiceSections and billingProfiles. /// /// /// Headers that will be added to request. @@ -411,5 +411,218 @@ internal BillingAccountsOperations(BillingManagementClient client) return _result; } + /// + /// The operation to update a billing account. + /// + /// + /// billing Account Id. + /// + /// + /// Request parameters supplied to the update billing account operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> UpdateWithHttpMessagesAsync(string billingAccountName, BillingAccountUpdateRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(billingAccountName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// The operation to update a billing account. + /// + /// + /// billing Account Id. + /// + /// + /// Request parameters supplied to the update billing account 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> BeginUpdateWithHttpMessagesAsync(string billingAccountName, BillingAccountUpdateRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (billingAccountName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "billingAccountName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("billingAccountName", billingAccountName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}").ToString(); + _url = _url.Replace("{billingAccountName}", System.Uri.EscapeDataString(billingAccountName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.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("PATCH"); + _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(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, 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); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + } } diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingAccountsOperationsExtensions.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingAccountsOperationsExtensions.cs index ba67081d8381..073c2a3f17fe 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingAccountsOperationsExtensions.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingAccountsOperationsExtensions.cs @@ -28,7 +28,7 @@ public static partial class BillingAccountsOperationsExtensions /// The operations group for this extension method. /// /// - /// May be used to expand the invoiceSections and billingProfiles. + /// May be used to expand the address, invoiceSections and billingProfiles. /// public static BillingAccountListResult List(this IBillingAccountsOperations operations, string expand = default(string)) { @@ -42,7 +42,7 @@ public static partial class BillingAccountsOperationsExtensions /// The operations group for this extension method. /// /// - /// May be used to expand the invoiceSections and billingProfiles. + /// May be used to expand the address, invoiceSections and billingProfiles. /// /// /// The cancellation token. @@ -65,7 +65,7 @@ public static partial class BillingAccountsOperationsExtensions /// billing Account Id. /// /// - /// May be used to expand the invoiceSections and billingProfiles. + /// May be used to expand the address, invoiceSections and billingProfiles. /// public static BillingAccount Get(this IBillingAccountsOperations operations, string billingAccountName, string expand = default(string)) { @@ -82,7 +82,7 @@ public static partial class BillingAccountsOperationsExtensions /// billing Account Id. /// /// - /// May be used to expand the invoiceSections and billingProfiles. + /// May be used to expand the address, invoiceSections and billingProfiles. /// /// /// The cancellation token. @@ -95,5 +95,85 @@ public static partial class BillingAccountsOperationsExtensions } } + /// + /// The operation to update a billing account. + /// + /// + /// The operations group for this extension method. + /// + /// + /// billing Account Id. + /// + /// + /// Request parameters supplied to the update billing account operation. + /// + public static BillingAccount Update(this IBillingAccountsOperations operations, string billingAccountName, BillingAccountUpdateRequest parameters) + { + return operations.UpdateAsync(billingAccountName, parameters).GetAwaiter().GetResult(); + } + + /// + /// The operation to update a billing account. + /// + /// + /// The operations group for this extension method. + /// + /// + /// billing Account Id. + /// + /// + /// Request parameters supplied to the update billing account operation. + /// + /// + /// The cancellation token. + /// + public static async Task UpdateAsync(this IBillingAccountsOperations operations, string billingAccountName, BillingAccountUpdateRequest parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(billingAccountName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// The operation to update a billing account. + /// + /// + /// The operations group for this extension method. + /// + /// + /// billing Account Id. + /// + /// + /// Request parameters supplied to the update billing account operation. + /// + public static BillingAccount BeginUpdate(this IBillingAccountsOperations operations, string billingAccountName, BillingAccountUpdateRequest parameters) + { + return operations.BeginUpdateAsync(billingAccountName, parameters).GetAwaiter().GetResult(); + } + + /// + /// The operation to update a billing account. + /// + /// + /// The operations group for this extension method. + /// + /// + /// billing Account Id. + /// + /// + /// Request parameters supplied to the update billing account operation. + /// + /// + /// The cancellation token. + /// + public static async Task BeginUpdateAsync(this IBillingAccountsOperations operations, string billingAccountName, BillingAccountUpdateRequest parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(billingAccountName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + } } 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 c1d0683efb03..ff06f40bc480 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingManagementClient.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingManagementClient.cs @@ -49,7 +49,7 @@ public partial class BillingManagementClient : ServiceClient /// Version of the API to be used with the client request. The current version - /// is 2018-11-01-preview. + /// is 2019-10-01-preview. /// public string ApiVersion { get; private set; } @@ -86,6 +86,11 @@ public partial class BillingManagementClient : ServiceClient public virtual IPaymentMethodsOperations PaymentMethods { get; private set; } + /// + /// Gets the IAddressOperations. + /// + public virtual IAddressOperations Address { get; private set; } + /// /// Gets the IAvailableBalancesOperations. /// @@ -96,45 +101,55 @@ public partial class BillingManagementClient : ServiceClient public virtual IBillingProfilesOperations BillingProfiles { get; private set; } + /// + /// Gets the ICustomersOperations. + /// + public virtual ICustomersOperations Customers { get; private set; } + /// /// Gets the IInvoiceSectionsOperations. /// public virtual IInvoiceSectionsOperations InvoiceSections { get; private set; } /// - /// Gets the IDepartmentsOperations. + /// Gets the IBillingPermissionsOperations. /// - public virtual IDepartmentsOperations Departments { get; private set; } + public virtual IBillingPermissionsOperations BillingPermissions { get; private set; } /// - /// Gets the IEnrollmentAccountsOperations. + /// Gets the IBillingSubscriptionsOperations. /// - public virtual IEnrollmentAccountsOperations EnrollmentAccounts { get; private set; } + public virtual IBillingSubscriptionsOperations BillingSubscriptions { get; private set; } /// - /// Gets the IInvoicesOperations. + /// Gets the IProductsOperations. /// - public virtual IInvoicesOperations Invoices { get; private set; } + public virtual IProductsOperations Products { get; private set; } /// - /// Gets the IPriceSheetOperations. + /// Gets the ITransactionsOperations. /// - public virtual IPriceSheetOperations PriceSheet { get; private set; } + public virtual ITransactionsOperations Transactions { get; private set; } /// - /// Gets the IBillingSubscriptionsOperations. + /// Gets the IDepartmentsOperations. /// - public virtual IBillingSubscriptionsOperations BillingSubscriptions { get; private set; } + public virtual IDepartmentsOperations Departments { get; private set; } /// - /// Gets the IProductsOperations. + /// Gets the IEnrollmentAccountsOperations. /// - public virtual IProductsOperations Products { get; private set; } + public virtual IEnrollmentAccountsOperations EnrollmentAccounts { get; private set; } /// - /// Gets the ITransactionsOperations. + /// Gets the IInvoicesOperations. /// - public virtual ITransactionsOperations Transactions { get; private set; } + public virtual IInvoicesOperations Invoices { get; private set; } + + /// + /// Gets the IPriceSheetOperations. + /// + public virtual IPriceSheetOperations PriceSheet { get; private set; } /// /// Gets the IPoliciesOperations. @@ -151,6 +166,16 @@ public partial class BillingManagementClient : ServiceClient public virtual ITransfersOperations Transfers { get; private set; } + /// + /// Gets the IPartnerTransfersOperations. + /// + public virtual IPartnerTransfersOperations PartnerTransfers { get; private set; } + + /// + /// Gets the IPartnerTransfersTransfersOperations. + /// + public virtual IPartnerTransfersTransfersOperations PartnerTransfersTransfers { get; private set; } + /// /// Gets the IRecipientTransfersOperations. /// @@ -161,11 +186,6 @@ public partial class BillingManagementClient : ServiceClient public virtual IOperations Operations { get; private set; } - /// - /// Gets the IBillingPermissionsOperations. - /// - public virtual IBillingPermissionsOperations BillingPermissions { get; private set; } - /// /// Gets the IBillingRoleDefinitionsOperations. /// @@ -181,6 +201,11 @@ public partial class BillingManagementClient : ServiceClient public virtual IAgreementsOperations Agreements { get; private set; } + /// + /// Gets the ILineOfCreditsOperations. + /// + public virtual ILineOfCreditsOperations LineOfCredits { get; private set; } + /// /// Initializes a new instance of the BillingManagementClient class. /// @@ -424,27 +449,32 @@ private void Initialize() { BillingAccounts = new BillingAccountsOperations(this); PaymentMethods = new PaymentMethodsOperations(this); + Address = new AddressOperations(this); AvailableBalances = new AvailableBalancesOperations(this); BillingProfiles = new BillingProfilesOperations(this); + Customers = new CustomersOperations(this); InvoiceSections = new InvoiceSectionsOperations(this); + BillingPermissions = new BillingPermissionsOperations(this); + BillingSubscriptions = new BillingSubscriptionsOperations(this); + Products = new ProductsOperations(this); + Transactions = new TransactionsOperations(this); Departments = new DepartmentsOperations(this); EnrollmentAccounts = new EnrollmentAccountsOperations(this); Invoices = new InvoicesOperations(this); PriceSheet = new PriceSheetOperations(this); - BillingSubscriptions = new BillingSubscriptionsOperations(this); - Products = new ProductsOperations(this); - Transactions = new TransactionsOperations(this); Policies = new PoliciesOperations(this); BillingProperty = new BillingPropertyOperations(this); Transfers = new TransfersOperations(this); + PartnerTransfers = new PartnerTransfersOperations(this); + PartnerTransfersTransfers = new PartnerTransfersTransfersOperations(this); RecipientTransfers = new RecipientTransfersOperations(this); Operations = new Operations(this); - BillingPermissions = new BillingPermissionsOperations(this); BillingRoleDefinitions = new BillingRoleDefinitionsOperations(this); BillingRoleAssignments = new BillingRoleAssignmentsOperations(this); Agreements = new AgreementsOperations(this); + LineOfCredits = new LineOfCreditsOperations(this); BaseUri = new System.Uri("https://management.azure.com"); - ApiVersion = "2018-11-01-preview"; + ApiVersion = "2019-10-01-preview"; AcceptLanguage = "en-US"; LongRunningOperationRetryTimeout = 30; GenerateClientRequestId = true; diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingPermissionsOperations.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingPermissionsOperations.cs index 1018381b8005..391530e8e167 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingPermissionsOperations.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingPermissionsOperations.cs @@ -50,6 +50,192 @@ internal BillingPermissionsOperations(BillingManagementClient client) /// public BillingManagementClient Client { get; private set; } + /// + /// Lists all billing permissions the caller has for a customer. + /// + /// + /// billing Account Id. + /// + /// + /// Customer name. + /// + /// + /// 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> ListByCustomerWithHttpMessagesAsync(string billingAccountName, string customerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (billingAccountName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "billingAccountName"); + } + if (customerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "customerName"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("billingAccountName", billingAccountName); + tracingParameters.Add("customerName", customerName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByCustomer", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/customers/{customerName}/billingPermissions").ToString(); + _url = _url.Replace("{billingAccountName}", System.Uri.EscapeDataString(billingAccountName)); + _url = _url.Replace("{customerName}", System.Uri.EscapeDataString(customerName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.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("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 all billing permissions for the caller under a billing account. /// @@ -100,7 +286,7 @@ internal BillingPermissionsOperations(BillingManagementClient client) } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/providers/Microsoft.Billing/billingPermissions").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingPermissions").ToString(); _url = _url.Replace("{billingAccountName}", System.Uri.EscapeDataString(billingAccountName)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -233,6 +419,9 @@ internal BillingPermissionsOperations(BillingManagementClient client) /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// @@ -257,7 +446,7 @@ internal BillingPermissionsOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListByInvoiceSectionsWithHttpMessagesAsync(string billingAccountName, string invoiceSectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListByInvoiceSectionsWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.ApiVersion == null) { @@ -267,6 +456,10 @@ internal BillingPermissionsOperations(BillingManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "billingAccountName"); } + if (billingProfileName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "billingProfileName"); + } if (invoiceSectionName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "invoiceSectionName"); @@ -279,14 +472,16 @@ internal BillingPermissionsOperations(BillingManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("billingAccountName", billingAccountName); + tracingParameters.Add("billingProfileName", billingProfileName); tracingParameters.Add("invoiceSectionName", invoiceSectionName); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListByInvoiceSections", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/providers/Microsoft.Billing/billingPermissions").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/billingPermissions").ToString(); _url = _url.Replace("{billingAccountName}", System.Uri.EscapeDataString(billingAccountName)); + _url = _url.Replace("{billingProfileName}", System.Uri.EscapeDataString(billingProfileName)); _url = _url.Replace("{invoiceSectionName}", System.Uri.EscapeDataString(invoiceSectionName)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -414,7 +609,7 @@ internal BillingPermissionsOperations(BillingManagementClient client) } /// - /// Lists all billingPermissions for the caller has for a billing account. + /// Lists all billing permissions the caller has for a billing account. /// /// /// billing Account Id. @@ -471,7 +666,7 @@ internal BillingPermissionsOperations(BillingManagementClient client) } // 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}/providers/Microsoft.Billing/billingPermissions").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/billingPermissions").ToString(); _url = _url.Replace("{billingAccountName}", System.Uri.EscapeDataString(billingAccountName)); _url = _url.Replace("{billingProfileName}", System.Uri.EscapeDataString(billingProfileName)); List _queryParameters = new List(); diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingPermissionsOperationsExtensions.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingPermissionsOperationsExtensions.cs index a6b04a53d5e7..1367a626c59d 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingPermissionsOperationsExtensions.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingPermissionsOperationsExtensions.cs @@ -21,6 +21,46 @@ namespace Microsoft.Azure.Management.Billing /// public static partial class BillingPermissionsOperationsExtensions { + /// + /// Lists all billing permissions the caller has for a customer. + /// + /// + /// The operations group for this extension method. + /// + /// + /// billing Account Id. + /// + /// + /// Customer name. + /// + public static BillingPermissionsListResult ListByCustomer(this IBillingPermissionsOperations operations, string billingAccountName, string customerName) + { + return operations.ListByCustomerAsync(billingAccountName, customerName).GetAwaiter().GetResult(); + } + + /// + /// Lists all billing permissions the caller has for a customer. + /// + /// + /// The operations group for this extension method. + /// + /// + /// billing Account Id. + /// + /// + /// Customer name. + /// + /// + /// The cancellation token. + /// + public static async Task ListByCustomerAsync(this IBillingPermissionsOperations operations, string billingAccountName, string customerName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByCustomerWithHttpMessagesAsync(billingAccountName, customerName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Lists all billing permissions for the caller under a billing account. /// @@ -64,12 +104,15 @@ public static BillingPermissionsListResult ListByBillingAccount(this IBillingPer /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// - public static BillingPermissionsListResult ListByInvoiceSections(this IBillingPermissionsOperations operations, string billingAccountName, string invoiceSectionName) + public static BillingPermissionsListResult ListByInvoiceSections(this IBillingPermissionsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName) { - return operations.ListByInvoiceSectionsAsync(billingAccountName, invoiceSectionName).GetAwaiter().GetResult(); + return operations.ListByInvoiceSectionsAsync(billingAccountName, billingProfileName, invoiceSectionName).GetAwaiter().GetResult(); } /// @@ -81,22 +124,25 @@ public static BillingPermissionsListResult ListByInvoiceSections(this IBillingPe /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// /// /// The cancellation token. /// - public static async Task ListByInvoiceSectionsAsync(this IBillingPermissionsOperations operations, string billingAccountName, string invoiceSectionName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task ListByInvoiceSectionsAsync(this IBillingPermissionsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListByInvoiceSectionsWithHttpMessagesAsync(billingAccountName, invoiceSectionName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListByInvoiceSectionsWithHttpMessagesAsync(billingAccountName, billingProfileName, invoiceSectionName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Lists all billingPermissions for the caller has for a billing account. + /// Lists all billing permissions the caller has for a billing account. /// /// /// The operations group for this extension method. @@ -113,7 +159,7 @@ public static BillingPermissionsListResult ListByBillingProfile(this IBillingPer } /// - /// Lists all billingPermissions for the caller has for a billing account. + /// Lists all billing permissions the caller has for a billing account. /// /// /// The operations group for this extension method. diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingProfilesOperations.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingProfilesOperations.cs index 9eece86c0e50..061988d6dd62 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingProfilesOperations.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingProfilesOperations.cs @@ -80,7 +80,7 @@ internal BillingProfilesOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListByBillingAccountNameWithHttpMessagesAsync(string billingAccountName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListByBillingAccountWithHttpMessagesAsync(string billingAccountName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.ApiVersion == null) { @@ -100,7 +100,7 @@ internal BillingProfilesOperations(BillingManagementClient client) tracingParameters.Add("billingAccountName", billingAccountName); tracingParameters.Add("expand", expand); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByBillingAccountName", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListByBillingAccount", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -429,6 +429,31 @@ internal BillingProfilesOperations(BillingManagementClient client) return _result; } + /// + /// The operation to create a BillingProfile. + /// + /// + /// billing Account Id. + /// + /// + /// Billing Profile Id. + /// + /// + /// Request parameters supplied to the Create BillingProfile operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateWithHttpMessagesAsync(string billingAccountName, string billingProfileName, BillingProfileCreationRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateWithHttpMessagesAsync(billingAccountName, billingProfileName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + /// /// The operation to update a billing profile. /// @@ -439,7 +464,7 @@ internal BillingProfilesOperations(BillingManagementClient client) /// Billing Profile Id. /// /// - /// Parameters supplied to the update billing profile operation. + /// Request parameters supplied to the update billing profile operation. /// /// /// The headers that will be added to request. @@ -454,6 +479,219 @@ internal BillingProfilesOperations(BillingManagementClient client) return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } + /// + /// The operation to create a BillingProfile. + /// + /// + /// billing Account Id. + /// + /// + /// Billing Profile Id. + /// + /// + /// Request parameters supplied to the Create BillingProfile 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> BeginCreateWithHttpMessagesAsync(string billingAccountName, string billingProfileName, BillingProfileCreationRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (billingAccountName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "billingAccountName"); + } + if (billingProfileName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "billingProfileName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("billingAccountName", billingAccountName); + tracingParameters.Add("billingProfileName", billingProfileName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreate", 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}").ToString(); + _url = _url.Replace("{billingAccountName}", System.Uri.EscapeDataString(billingAccountName)); + _url = _url.Replace("{billingProfileName}", System.Uri.EscapeDataString(billingProfileName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.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("PUT"); + _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(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, 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; + } + /// /// The operation to update a billing profile. /// @@ -464,7 +702,7 @@ internal BillingProfilesOperations(BillingManagementClient client) /// Billing Profile Id. /// /// - /// Parameters supplied to the update billing profile operation. + /// Request parameters supplied to the update billing profile operation. /// /// /// Headers that will be added to request. @@ -535,7 +773,7 @@ internal BillingProfilesOperations(BillingManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingProfilesOperationsExtensions.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingProfilesOperationsExtensions.cs index 7d9e353cfb46..a38bc7332d4e 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingProfilesOperationsExtensions.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingProfilesOperationsExtensions.cs @@ -33,9 +33,9 @@ public static partial class BillingProfilesOperationsExtensions /// /// May be used to expand the invoiceSections. /// - public static BillingProfileListResult ListByBillingAccountName(this IBillingProfilesOperations operations, string billingAccountName, string expand = default(string)) + public static BillingProfileListResult ListByBillingAccount(this IBillingProfilesOperations operations, string billingAccountName, string expand = default(string)) { - return operations.ListByBillingAccountNameAsync(billingAccountName, expand).GetAwaiter().GetResult(); + return operations.ListByBillingAccountAsync(billingAccountName, expand).GetAwaiter().GetResult(); } /// @@ -53,9 +53,9 @@ public static partial class BillingProfilesOperationsExtensions /// /// The cancellation token. /// - public static async Task ListByBillingAccountNameAsync(this IBillingProfilesOperations operations, string billingAccountName, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task ListByBillingAccountAsync(this IBillingProfilesOperations operations, string billingAccountName, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListByBillingAccountNameWithHttpMessagesAsync(billingAccountName, expand, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListByBillingAccountWithHttpMessagesAsync(billingAccountName, expand, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -107,6 +107,52 @@ public static partial class BillingProfilesOperationsExtensions } } + /// + /// The operation to create a BillingProfile. + /// + /// + /// The operations group for this extension method. + /// + /// + /// billing Account Id. + /// + /// + /// Billing Profile Id. + /// + /// + /// Request parameters supplied to the Create BillingProfile operation. + /// + public static BillingProfile Create(this IBillingProfilesOperations operations, string billingAccountName, string billingProfileName, BillingProfileCreationRequest parameters) + { + return operations.CreateAsync(billingAccountName, billingProfileName, parameters).GetAwaiter().GetResult(); + } + + /// + /// The operation to create a BillingProfile. + /// + /// + /// The operations group for this extension method. + /// + /// + /// billing Account Id. + /// + /// + /// Billing Profile Id. + /// + /// + /// Request parameters supplied to the Create BillingProfile operation. + /// + /// + /// The cancellation token. + /// + public static async Task CreateAsync(this IBillingProfilesOperations operations, string billingAccountName, string billingProfileName, BillingProfileCreationRequest parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateWithHttpMessagesAsync(billingAccountName, billingProfileName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// The operation to update a billing profile. /// @@ -120,7 +166,7 @@ public static partial class BillingProfilesOperationsExtensions /// Billing Profile Id. /// /// - /// Parameters supplied to the update billing profile operation. + /// Request parameters supplied to the update billing profile operation. /// public static BillingProfile Update(this IBillingProfilesOperations operations, string billingAccountName, string billingProfileName, BillingProfile parameters) { @@ -140,7 +186,7 @@ public static BillingProfile Update(this IBillingProfilesOperations operations, /// Billing Profile Id. /// /// - /// Parameters supplied to the update billing profile operation. + /// Request parameters supplied to the update billing profile operation. /// /// /// The cancellation token. @@ -153,6 +199,52 @@ public static BillingProfile Update(this IBillingProfilesOperations operations, } } + /// + /// The operation to create a BillingProfile. + /// + /// + /// The operations group for this extension method. + /// + /// + /// billing Account Id. + /// + /// + /// Billing Profile Id. + /// + /// + /// Request parameters supplied to the Create BillingProfile operation. + /// + public static BillingProfile BeginCreate(this IBillingProfilesOperations operations, string billingAccountName, string billingProfileName, BillingProfileCreationRequest parameters) + { + return operations.BeginCreateAsync(billingAccountName, billingProfileName, parameters).GetAwaiter().GetResult(); + } + + /// + /// The operation to create a BillingProfile. + /// + /// + /// The operations group for this extension method. + /// + /// + /// billing Account Id. + /// + /// + /// Billing Profile Id. + /// + /// + /// Request parameters supplied to the Create BillingProfile operation. + /// + /// + /// The cancellation token. + /// + public static async Task BeginCreateAsync(this IBillingProfilesOperations operations, string billingAccountName, string billingProfileName, BillingProfileCreationRequest parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginCreateWithHttpMessagesAsync(billingAccountName, billingProfileName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// The operation to update a billing profile. /// @@ -166,7 +258,7 @@ public static BillingProfile Update(this IBillingProfilesOperations operations, /// Billing Profile Id. /// /// - /// Parameters supplied to the update billing profile operation. + /// Request parameters supplied to the update billing profile operation. /// public static BillingProfile BeginUpdate(this IBillingProfilesOperations operations, string billingAccountName, string billingProfileName, BillingProfile parameters) { @@ -186,7 +278,7 @@ public static BillingProfile BeginUpdate(this IBillingProfilesOperations operati /// Billing Profile Id. /// /// - /// Parameters supplied to the update billing profile operation. + /// Request parameters supplied to the update billing profile operation. /// /// /// The cancellation token. diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingPropertyOperations.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingPropertyOperations.cs index beaef84cd1f6..2fc34c5602fd 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingPropertyOperations.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingPropertyOperations.cs @@ -52,7 +52,7 @@ internal BillingPropertyOperations(BillingManagementClient client) /// /// Get billing property by subscription Id. - /// + /// /// /// /// Headers that will be added to request. diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingPropertyOperationsExtensions.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingPropertyOperationsExtensions.cs index 1cd9c6c24a44..99b7476e92a2 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingPropertyOperationsExtensions.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingPropertyOperationsExtensions.cs @@ -23,7 +23,7 @@ public static partial class BillingPropertyOperationsExtensions { /// /// Get billing property by subscription Id. - /// + /// /// /// /// The operations group for this extension method. @@ -35,7 +35,7 @@ public static BillingProperty Get(this IBillingPropertyOperations operations) /// /// Get billing property by subscription Id. - /// + /// /// /// /// The operations group for this extension method. diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingRoleAssignmentsOperations.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingRoleAssignmentsOperations.cs index ad2df2ce0444..5375183fd3b5 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingRoleAssignmentsOperations.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingRoleAssignmentsOperations.cs @@ -108,7 +108,7 @@ internal BillingRoleAssignmentsOperations(BillingManagementClient client) } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/providers/Microsoft.Billing/billingRoleAssignments/{billingRoleAssignmentName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleAssignments/{billingRoleAssignmentName}").ToString(); _url = _url.Replace("{billingAccountName}", System.Uri.EscapeDataString(billingAccountName)); _url = _url.Replace("{billingRoleAssignmentName}", System.Uri.EscapeDataString(billingRoleAssignmentName)); List _queryParameters = new List(); @@ -266,7 +266,7 @@ internal BillingRoleAssignmentsOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> DeleteByBillingAccountNameWithHttpMessagesAsync(string billingAccountName, string billingRoleAssignmentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> DeleteByBillingAccountWithHttpMessagesAsync(string billingAccountName, string billingRoleAssignmentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.ApiVersion == null) { @@ -290,11 +290,11 @@ internal BillingRoleAssignmentsOperations(BillingManagementClient client) tracingParameters.Add("billingAccountName", billingAccountName); tracingParameters.Add("billingRoleAssignmentName", billingRoleAssignmentName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteByBillingAccountName", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteByBillingAccount", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/providers/Microsoft.Billing/billingRoleAssignments/{billingRoleAssignmentName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleAssignments/{billingRoleAssignmentName}").ToString(); _url = _url.Replace("{billingAccountName}", System.Uri.EscapeDataString(billingAccountName)); _url = _url.Replace("{billingRoleAssignmentName}", System.Uri.EscapeDataString(billingRoleAssignmentName)); List _queryParameters = new List(); @@ -428,6 +428,9 @@ internal BillingRoleAssignmentsOperations(BillingManagementClient client) /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// @@ -455,7 +458,7 @@ internal BillingRoleAssignmentsOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetByInvoiceSectionNameWithHttpMessagesAsync(string billingAccountName, string invoiceSectionName, string billingRoleAssignmentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetByInvoiceSectionWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, string billingRoleAssignmentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.ApiVersion == null) { @@ -465,6 +468,10 @@ internal BillingRoleAssignmentsOperations(BillingManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "billingAccountName"); } + if (billingProfileName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "billingProfileName"); + } if (invoiceSectionName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "invoiceSectionName"); @@ -481,15 +488,17 @@ internal BillingRoleAssignmentsOperations(BillingManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("billingAccountName", billingAccountName); + tracingParameters.Add("billingProfileName", billingProfileName); tracingParameters.Add("invoiceSectionName", invoiceSectionName); tracingParameters.Add("billingRoleAssignmentName", billingRoleAssignmentName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetByInvoiceSectionName", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetByInvoiceSection", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/providers/Microsoft.Billing/billingRoleAssignments/{billingRoleAssignmentName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/billingRoleAssignments/{billingRoleAssignmentName}").ToString(); _url = _url.Replace("{billingAccountName}", System.Uri.EscapeDataString(billingAccountName)); + _url = _url.Replace("{billingProfileName}", System.Uri.EscapeDataString(billingProfileName)); _url = _url.Replace("{invoiceSectionName}", System.Uri.EscapeDataString(invoiceSectionName)); _url = _url.Replace("{billingRoleAssignmentName}", System.Uri.EscapeDataString(billingRoleAssignmentName)); List _queryParameters = new List(); @@ -623,6 +632,9 @@ internal BillingRoleAssignmentsOperations(BillingManagementClient client) /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// @@ -650,7 +662,7 @@ internal BillingRoleAssignmentsOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> DeleteByInvoiceSectionNameWithHttpMessagesAsync(string billingAccountName, string invoiceSectionName, string billingRoleAssignmentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> DeleteByInvoiceSectionWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, string billingRoleAssignmentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.ApiVersion == null) { @@ -660,6 +672,10 @@ internal BillingRoleAssignmentsOperations(BillingManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "billingAccountName"); } + if (billingProfileName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "billingProfileName"); + } if (invoiceSectionName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "invoiceSectionName"); @@ -676,15 +692,17 @@ internal BillingRoleAssignmentsOperations(BillingManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("billingAccountName", billingAccountName); + tracingParameters.Add("billingProfileName", billingProfileName); tracingParameters.Add("invoiceSectionName", invoiceSectionName); tracingParameters.Add("billingRoleAssignmentName", billingRoleAssignmentName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteByInvoiceSectionName", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteByInvoiceSection", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/providers/Microsoft.Billing/billingRoleAssignments/{billingRoleAssignmentName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/billingRoleAssignments/{billingRoleAssignmentName}").ToString(); _url = _url.Replace("{billingAccountName}", System.Uri.EscapeDataString(billingAccountName)); + _url = _url.Replace("{billingProfileName}", System.Uri.EscapeDataString(billingProfileName)); _url = _url.Replace("{invoiceSectionName}", System.Uri.EscapeDataString(invoiceSectionName)); _url = _url.Replace("{billingRoleAssignmentName}", System.Uri.EscapeDataString(billingRoleAssignmentName)); List _queryParameters = new List(); @@ -845,7 +863,7 @@ internal BillingRoleAssignmentsOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetByBillingProfileNameWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string billingRoleAssignmentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetByBillingProfileWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string billingRoleAssignmentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.ApiVersion == null) { @@ -874,11 +892,11 @@ internal BillingRoleAssignmentsOperations(BillingManagementClient client) tracingParameters.Add("billingProfileName", billingProfileName); tracingParameters.Add("billingRoleAssignmentName", billingRoleAssignmentName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetByBillingProfileName", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetByBillingProfile", 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}/providers/Microsoft.Billing/billingRoleAssignments/{billingRoleAssignmentName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/billingRoleAssignments/{billingRoleAssignmentName}").ToString(); _url = _url.Replace("{billingAccountName}", System.Uri.EscapeDataString(billingAccountName)); _url = _url.Replace("{billingProfileName}", System.Uri.EscapeDataString(billingProfileName)); _url = _url.Replace("{billingRoleAssignmentName}", System.Uri.EscapeDataString(billingRoleAssignmentName)); @@ -1040,7 +1058,7 @@ internal BillingRoleAssignmentsOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> DeleteByBillingProfileNameWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string billingRoleAssignmentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> DeleteByBillingProfileWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string billingRoleAssignmentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.ApiVersion == null) { @@ -1069,11 +1087,11 @@ internal BillingRoleAssignmentsOperations(BillingManagementClient client) tracingParameters.Add("billingProfileName", billingProfileName); tracingParameters.Add("billingRoleAssignmentName", billingRoleAssignmentName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteByBillingProfileName", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteByBillingProfile", 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}/providers/Microsoft.Billing/billingRoleAssignments/{billingRoleAssignmentName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/billingRoleAssignments/{billingRoleAssignmentName}").ToString(); _url = _url.Replace("{billingAccountName}", System.Uri.EscapeDataString(billingAccountName)); _url = _url.Replace("{billingProfileName}", System.Uri.EscapeDataString(billingProfileName)); _url = _url.Replace("{billingRoleAssignmentName}", System.Uri.EscapeDataString(billingRoleAssignmentName)); @@ -1229,7 +1247,7 @@ internal BillingRoleAssignmentsOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListByBillingAccountNameWithHttpMessagesAsync(string billingAccountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListByBillingAccountWithHttpMessagesAsync(string billingAccountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.ApiVersion == null) { @@ -1248,11 +1266,11 @@ internal BillingRoleAssignmentsOperations(BillingManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("billingAccountName", billingAccountName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByBillingAccountName", tracingParameters); + 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}/providers/Microsoft.Billing/billingRoleAssignments").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleAssignments").ToString(); _url = _url.Replace("{billingAccountName}", System.Uri.EscapeDataString(billingAccountName)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -1385,6 +1403,9 @@ internal BillingRoleAssignmentsOperations(BillingManagementClient client) /// /// billing Account Id. /// + /// + /// Parameters supplied to add a role assignment. + /// /// /// Headers that will be added to request. /// @@ -1406,7 +1427,7 @@ internal BillingRoleAssignmentsOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> AddByBillingAccountNameWithHttpMessagesAsync(string billingAccountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> AddByBillingAccountWithHttpMessagesAsync(string billingAccountName, BillingRoleAssignmentPayload parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.ApiVersion == null) { @@ -1416,7 +1437,10 @@ internal BillingRoleAssignmentsOperations(BillingManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "billingAccountName"); } - BillingRoleAssignmentPayload parameters = new BillingRoleAssignmentPayload(); + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1427,11 +1451,11 @@ internal BillingRoleAssignmentsOperations(BillingManagementClient client) tracingParameters.Add("billingAccountName", billingAccountName); tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "AddByBillingAccountName", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "AddByBillingAccount", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/providers/Microsoft.Billing/createBillingRoleAssignment").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/createBillingRoleAssignment").ToString(); _url = _url.Replace("{billingAccountName}", System.Uri.EscapeDataString(billingAccountName)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -1570,6 +1594,9 @@ internal BillingRoleAssignmentsOperations(BillingManagementClient client) /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// @@ -1594,7 +1621,7 @@ internal BillingRoleAssignmentsOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListByInvoiceSectionNameWithHttpMessagesAsync(string billingAccountName, string invoiceSectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListByInvoiceSectionWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.ApiVersion == null) { @@ -1604,6 +1631,10 @@ internal BillingRoleAssignmentsOperations(BillingManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "billingAccountName"); } + if (billingProfileName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "billingProfileName"); + } if (invoiceSectionName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "invoiceSectionName"); @@ -1616,14 +1647,16 @@ internal BillingRoleAssignmentsOperations(BillingManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("billingAccountName", billingAccountName); + tracingParameters.Add("billingProfileName", billingProfileName); tracingParameters.Add("invoiceSectionName", invoiceSectionName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByInvoiceSectionName", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListByInvoiceSection", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/providers/Microsoft.Billing/billingRoleAssignments").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/billingRoleAssignments").ToString(); _url = _url.Replace("{billingAccountName}", System.Uri.EscapeDataString(billingAccountName)); + _url = _url.Replace("{billingProfileName}", System.Uri.EscapeDataString(billingProfileName)); _url = _url.Replace("{invoiceSectionName}", System.Uri.EscapeDataString(invoiceSectionName)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -1756,9 +1789,15 @@ internal BillingRoleAssignmentsOperations(BillingManagementClient client) /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// + /// + /// Parameters supplied to add a role assignment. + /// /// /// Headers that will be added to request. /// @@ -1780,7 +1819,7 @@ internal BillingRoleAssignmentsOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> AddByInvoiceSectionNameWithHttpMessagesAsync(string billingAccountName, string invoiceSectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> AddByInvoiceSectionWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, BillingRoleAssignmentPayload parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.ApiVersion == null) { @@ -1790,11 +1829,18 @@ internal BillingRoleAssignmentsOperations(BillingManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "billingAccountName"); } + if (billingProfileName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "billingProfileName"); + } if (invoiceSectionName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "invoiceSectionName"); } - BillingRoleAssignmentPayload parameters = new BillingRoleAssignmentPayload(); + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1803,15 +1849,17 @@ internal BillingRoleAssignmentsOperations(BillingManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("billingAccountName", billingAccountName); + tracingParameters.Add("billingProfileName", billingProfileName); tracingParameters.Add("invoiceSectionName", invoiceSectionName); tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "AddByInvoiceSectionName", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "AddByInvoiceSection", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/providers/Microsoft.Billing/createBillingRoleAssignment").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/createBillingRoleAssignment").ToString(); _url = _url.Replace("{billingAccountName}", System.Uri.EscapeDataString(billingAccountName)); + _url = _url.Replace("{billingProfileName}", System.Uri.EscapeDataString(billingProfileName)); _url = _url.Replace("{invoiceSectionName}", System.Uri.EscapeDataString(invoiceSectionName)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -1974,7 +2022,7 @@ internal BillingRoleAssignmentsOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListByBillingProfileNameWithHttpMessagesAsync(string billingAccountName, string billingProfileName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListByBillingProfileWithHttpMessagesAsync(string billingAccountName, string billingProfileName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.ApiVersion == null) { @@ -1998,11 +2046,11 @@ internal BillingRoleAssignmentsOperations(BillingManagementClient client) tracingParameters.Add("billingAccountName", billingAccountName); tracingParameters.Add("billingProfileName", billingProfileName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByBillingProfileName", tracingParameters); + 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}/providers/Microsoft.Billing/billingRoleAssignments").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/billingRoleAssignments").ToString(); _url = _url.Replace("{billingAccountName}", System.Uri.EscapeDataString(billingAccountName)); _url = _url.Replace("{billingProfileName}", System.Uri.EscapeDataString(billingProfileName)); List _queryParameters = new List(); @@ -2139,6 +2187,9 @@ internal BillingRoleAssignmentsOperations(BillingManagementClient client) /// /// Billing Profile Id. /// + /// + /// Parameters supplied to add a role assignment. + /// /// /// Headers that will be added to request. /// @@ -2160,7 +2211,7 @@ internal BillingRoleAssignmentsOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> AddByBillingProfileNameWithHttpMessagesAsync(string billingAccountName, string billingProfileName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> AddByBillingProfileWithHttpMessagesAsync(string billingAccountName, string billingProfileName, BillingRoleAssignmentPayload parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.ApiVersion == null) { @@ -2174,7 +2225,10 @@ internal BillingRoleAssignmentsOperations(BillingManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "billingProfileName"); } - BillingRoleAssignmentPayload parameters = new BillingRoleAssignmentPayload(); + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2186,11 +2240,11 @@ internal BillingRoleAssignmentsOperations(BillingManagementClient client) tracingParameters.Add("billingProfileName", billingProfileName); tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "AddByBillingProfileName", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "AddByBillingProfile", 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}/providers/Microsoft.Billing/createBillingRoleAssignment").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/createBillingRoleAssignment").ToString(); _url = _url.Replace("{billingAccountName}", System.Uri.EscapeDataString(billingAccountName)); _url = _url.Replace("{billingProfileName}", System.Uri.EscapeDataString(billingProfileName)); List _queryParameters = new List(); diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingRoleAssignmentsOperationsExtensions.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingRoleAssignmentsOperationsExtensions.cs index c4067a9f8cd3..cb60a1654a81 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingRoleAssignmentsOperationsExtensions.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingRoleAssignmentsOperationsExtensions.cs @@ -73,9 +73,9 @@ public static BillingRoleAssignment GetByBillingAccount(this IBillingRoleAssignm /// /// role assignment id. /// - public static BillingRoleAssignment DeleteByBillingAccountName(this IBillingRoleAssignmentsOperations operations, string billingAccountName, string billingRoleAssignmentName) + public static BillingRoleAssignment DeleteByBillingAccount(this IBillingRoleAssignmentsOperations operations, string billingAccountName, string billingRoleAssignmentName) { - return operations.DeleteByBillingAccountNameAsync(billingAccountName, billingRoleAssignmentName).GetAwaiter().GetResult(); + return operations.DeleteByBillingAccountAsync(billingAccountName, billingRoleAssignmentName).GetAwaiter().GetResult(); } /// @@ -93,9 +93,9 @@ public static BillingRoleAssignment DeleteByBillingAccountName(this IBillingRole /// /// The cancellation token. /// - public static async Task DeleteByBillingAccountNameAsync(this IBillingRoleAssignmentsOperations operations, string billingAccountName, string billingRoleAssignmentName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task DeleteByBillingAccountAsync(this IBillingRoleAssignmentsOperations operations, string billingAccountName, string billingRoleAssignmentName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.DeleteByBillingAccountNameWithHttpMessagesAsync(billingAccountName, billingRoleAssignmentName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.DeleteByBillingAccountWithHttpMessagesAsync(billingAccountName, billingRoleAssignmentName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -110,15 +110,18 @@ public static BillingRoleAssignment DeleteByBillingAccountName(this IBillingRole /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// /// /// role assignment id. /// - public static BillingRoleAssignment GetByInvoiceSectionName(this IBillingRoleAssignmentsOperations operations, string billingAccountName, string invoiceSectionName, string billingRoleAssignmentName) + public static BillingRoleAssignment GetByInvoiceSection(this IBillingRoleAssignmentsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, string billingRoleAssignmentName) { - return operations.GetByInvoiceSectionNameAsync(billingAccountName, invoiceSectionName, billingRoleAssignmentName).GetAwaiter().GetResult(); + return operations.GetByInvoiceSectionAsync(billingAccountName, billingProfileName, invoiceSectionName, billingRoleAssignmentName).GetAwaiter().GetResult(); } /// @@ -130,6 +133,9 @@ public static BillingRoleAssignment GetByInvoiceSectionName(this IBillingRoleAss /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// @@ -139,9 +145,9 @@ public static BillingRoleAssignment GetByInvoiceSectionName(this IBillingRoleAss /// /// The cancellation token. /// - public static async Task GetByInvoiceSectionNameAsync(this IBillingRoleAssignmentsOperations operations, string billingAccountName, string invoiceSectionName, string billingRoleAssignmentName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetByInvoiceSectionAsync(this IBillingRoleAssignmentsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, string billingRoleAssignmentName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetByInvoiceSectionNameWithHttpMessagesAsync(billingAccountName, invoiceSectionName, billingRoleAssignmentName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetByInvoiceSectionWithHttpMessagesAsync(billingAccountName, billingProfileName, invoiceSectionName, billingRoleAssignmentName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -156,15 +162,18 @@ public static BillingRoleAssignment GetByInvoiceSectionName(this IBillingRoleAss /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// /// /// role assignment id. /// - public static BillingRoleAssignment DeleteByInvoiceSectionName(this IBillingRoleAssignmentsOperations operations, string billingAccountName, string invoiceSectionName, string billingRoleAssignmentName) + public static BillingRoleAssignment DeleteByInvoiceSection(this IBillingRoleAssignmentsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, string billingRoleAssignmentName) { - return operations.DeleteByInvoiceSectionNameAsync(billingAccountName, invoiceSectionName, billingRoleAssignmentName).GetAwaiter().GetResult(); + return operations.DeleteByInvoiceSectionAsync(billingAccountName, billingProfileName, invoiceSectionName, billingRoleAssignmentName).GetAwaiter().GetResult(); } /// @@ -176,6 +185,9 @@ public static BillingRoleAssignment DeleteByInvoiceSectionName(this IBillingRole /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// @@ -185,9 +197,9 @@ public static BillingRoleAssignment DeleteByInvoiceSectionName(this IBillingRole /// /// The cancellation token. /// - public static async Task DeleteByInvoiceSectionNameAsync(this IBillingRoleAssignmentsOperations operations, string billingAccountName, string invoiceSectionName, string billingRoleAssignmentName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task DeleteByInvoiceSectionAsync(this IBillingRoleAssignmentsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, string billingRoleAssignmentName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.DeleteByInvoiceSectionNameWithHttpMessagesAsync(billingAccountName, invoiceSectionName, billingRoleAssignmentName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.DeleteByInvoiceSectionWithHttpMessagesAsync(billingAccountName, billingProfileName, invoiceSectionName, billingRoleAssignmentName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -208,9 +220,9 @@ public static BillingRoleAssignment DeleteByInvoiceSectionName(this IBillingRole /// /// role assignment id. /// - public static BillingRoleAssignment GetByBillingProfileName(this IBillingRoleAssignmentsOperations operations, string billingAccountName, string billingProfileName, string billingRoleAssignmentName) + public static BillingRoleAssignment GetByBillingProfile(this IBillingRoleAssignmentsOperations operations, string billingAccountName, string billingProfileName, string billingRoleAssignmentName) { - return operations.GetByBillingProfileNameAsync(billingAccountName, billingProfileName, billingRoleAssignmentName).GetAwaiter().GetResult(); + return operations.GetByBillingProfileAsync(billingAccountName, billingProfileName, billingRoleAssignmentName).GetAwaiter().GetResult(); } /// @@ -231,9 +243,9 @@ public static BillingRoleAssignment GetByBillingProfileName(this IBillingRoleAss /// /// The cancellation token. /// - public static async Task GetByBillingProfileNameAsync(this IBillingRoleAssignmentsOperations operations, string billingAccountName, string billingProfileName, string billingRoleAssignmentName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetByBillingProfileAsync(this IBillingRoleAssignmentsOperations operations, string billingAccountName, string billingProfileName, string billingRoleAssignmentName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetByBillingProfileNameWithHttpMessagesAsync(billingAccountName, billingProfileName, billingRoleAssignmentName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetByBillingProfileWithHttpMessagesAsync(billingAccountName, billingProfileName, billingRoleAssignmentName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -254,9 +266,9 @@ public static BillingRoleAssignment GetByBillingProfileName(this IBillingRoleAss /// /// role assignment id. /// - public static BillingRoleAssignment DeleteByBillingProfileName(this IBillingRoleAssignmentsOperations operations, string billingAccountName, string billingProfileName, string billingRoleAssignmentName) + public static BillingRoleAssignment DeleteByBillingProfile(this IBillingRoleAssignmentsOperations operations, string billingAccountName, string billingProfileName, string billingRoleAssignmentName) { - return operations.DeleteByBillingProfileNameAsync(billingAccountName, billingProfileName, billingRoleAssignmentName).GetAwaiter().GetResult(); + return operations.DeleteByBillingProfileAsync(billingAccountName, billingProfileName, billingRoleAssignmentName).GetAwaiter().GetResult(); } /// @@ -277,9 +289,9 @@ public static BillingRoleAssignment DeleteByBillingProfileName(this IBillingRole /// /// The cancellation token. /// - public static async Task DeleteByBillingProfileNameAsync(this IBillingRoleAssignmentsOperations operations, string billingAccountName, string billingProfileName, string billingRoleAssignmentName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task DeleteByBillingProfileAsync(this IBillingRoleAssignmentsOperations operations, string billingAccountName, string billingProfileName, string billingRoleAssignmentName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.DeleteByBillingProfileNameWithHttpMessagesAsync(billingAccountName, billingProfileName, billingRoleAssignmentName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.DeleteByBillingProfileWithHttpMessagesAsync(billingAccountName, billingProfileName, billingRoleAssignmentName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -294,9 +306,9 @@ public static BillingRoleAssignment DeleteByBillingProfileName(this IBillingRole /// /// billing Account Id. /// - public static BillingRoleAssignmentListResult ListByBillingAccountName(this IBillingRoleAssignmentsOperations operations, string billingAccountName) + public static BillingRoleAssignmentListResult ListByBillingAccount(this IBillingRoleAssignmentsOperations operations, string billingAccountName) { - return operations.ListByBillingAccountNameAsync(billingAccountName).GetAwaiter().GetResult(); + return operations.ListByBillingAccountAsync(billingAccountName).GetAwaiter().GetResult(); } /// @@ -311,9 +323,9 @@ public static BillingRoleAssignmentListResult ListByBillingAccountName(this IBil /// /// The cancellation token. /// - public static async Task ListByBillingAccountNameAsync(this IBillingRoleAssignmentsOperations operations, string billingAccountName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task ListByBillingAccountAsync(this IBillingRoleAssignmentsOperations operations, string billingAccountName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListByBillingAccountNameWithHttpMessagesAsync(billingAccountName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListByBillingAccountWithHttpMessagesAsync(billingAccountName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -328,9 +340,12 @@ public static BillingRoleAssignmentListResult ListByBillingAccountName(this IBil /// /// billing Account Id. /// - public static BillingRoleAssignmentListResult AddByBillingAccountName(this IBillingRoleAssignmentsOperations operations, string billingAccountName) + /// + /// Parameters supplied to add a role assignment. + /// + public static BillingRoleAssignmentListResult AddByBillingAccount(this IBillingRoleAssignmentsOperations operations, string billingAccountName, BillingRoleAssignmentPayload parameters) { - return operations.AddByBillingAccountNameAsync(billingAccountName).GetAwaiter().GetResult(); + return operations.AddByBillingAccountAsync(billingAccountName, parameters).GetAwaiter().GetResult(); } /// @@ -342,12 +357,15 @@ public static BillingRoleAssignmentListResult AddByBillingAccountName(this IBill /// /// billing Account Id. /// + /// + /// Parameters supplied to add a role assignment. + /// /// /// The cancellation token. /// - public static async Task AddByBillingAccountNameAsync(this IBillingRoleAssignmentsOperations operations, string billingAccountName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task AddByBillingAccountAsync(this IBillingRoleAssignmentsOperations operations, string billingAccountName, BillingRoleAssignmentPayload parameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.AddByBillingAccountNameWithHttpMessagesAsync(billingAccountName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.AddByBillingAccountWithHttpMessagesAsync(billingAccountName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -362,12 +380,15 @@ public static BillingRoleAssignmentListResult AddByBillingAccountName(this IBill /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// - public static BillingRoleAssignmentListResult ListByInvoiceSectionName(this IBillingRoleAssignmentsOperations operations, string billingAccountName, string invoiceSectionName) + public static BillingRoleAssignmentListResult ListByInvoiceSection(this IBillingRoleAssignmentsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName) { - return operations.ListByInvoiceSectionNameAsync(billingAccountName, invoiceSectionName).GetAwaiter().GetResult(); + return operations.ListByInvoiceSectionAsync(billingAccountName, billingProfileName, invoiceSectionName).GetAwaiter().GetResult(); } /// @@ -379,15 +400,18 @@ public static BillingRoleAssignmentListResult ListByInvoiceSectionName(this IBil /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// /// /// The cancellation token. /// - public static async Task ListByInvoiceSectionNameAsync(this IBillingRoleAssignmentsOperations operations, string billingAccountName, string invoiceSectionName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task ListByInvoiceSectionAsync(this IBillingRoleAssignmentsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListByInvoiceSectionNameWithHttpMessagesAsync(billingAccountName, invoiceSectionName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListByInvoiceSectionWithHttpMessagesAsync(billingAccountName, billingProfileName, invoiceSectionName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -402,12 +426,18 @@ public static BillingRoleAssignmentListResult ListByInvoiceSectionName(this IBil /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// - public static BillingRoleAssignmentListResult AddByInvoiceSectionName(this IBillingRoleAssignmentsOperations operations, string billingAccountName, string invoiceSectionName) + /// + /// Parameters supplied to add a role assignment. + /// + public static BillingRoleAssignmentListResult AddByInvoiceSection(this IBillingRoleAssignmentsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, BillingRoleAssignmentPayload parameters) { - return operations.AddByInvoiceSectionNameAsync(billingAccountName, invoiceSectionName).GetAwaiter().GetResult(); + return operations.AddByInvoiceSectionAsync(billingAccountName, billingProfileName, invoiceSectionName, parameters).GetAwaiter().GetResult(); } /// @@ -419,15 +449,21 @@ public static BillingRoleAssignmentListResult AddByInvoiceSectionName(this IBill /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// + /// + /// Parameters supplied to add a role assignment. + /// /// /// The cancellation token. /// - public static async Task AddByInvoiceSectionNameAsync(this IBillingRoleAssignmentsOperations operations, string billingAccountName, string invoiceSectionName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task AddByInvoiceSectionAsync(this IBillingRoleAssignmentsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, BillingRoleAssignmentPayload parameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.AddByInvoiceSectionNameWithHttpMessagesAsync(billingAccountName, invoiceSectionName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.AddByInvoiceSectionWithHttpMessagesAsync(billingAccountName, billingProfileName, invoiceSectionName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -445,9 +481,9 @@ public static BillingRoleAssignmentListResult AddByInvoiceSectionName(this IBill /// /// Billing Profile Id. /// - public static BillingRoleAssignmentListResult ListByBillingProfileName(this IBillingRoleAssignmentsOperations operations, string billingAccountName, string billingProfileName) + public static BillingRoleAssignmentListResult ListByBillingProfile(this IBillingRoleAssignmentsOperations operations, string billingAccountName, string billingProfileName) { - return operations.ListByBillingProfileNameAsync(billingAccountName, billingProfileName).GetAwaiter().GetResult(); + return operations.ListByBillingProfileAsync(billingAccountName, billingProfileName).GetAwaiter().GetResult(); } /// @@ -465,9 +501,9 @@ public static BillingRoleAssignmentListResult ListByBillingProfileName(this IBil /// /// The cancellation token. /// - public static async Task ListByBillingProfileNameAsync(this IBillingRoleAssignmentsOperations operations, string billingAccountName, string billingProfileName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task ListByBillingProfileAsync(this IBillingRoleAssignmentsOperations operations, string billingAccountName, string billingProfileName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListByBillingProfileNameWithHttpMessagesAsync(billingAccountName, billingProfileName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListByBillingProfileWithHttpMessagesAsync(billingAccountName, billingProfileName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -485,9 +521,12 @@ public static BillingRoleAssignmentListResult ListByBillingProfileName(this IBil /// /// Billing Profile Id. /// - public static BillingRoleAssignmentListResult AddByBillingProfileName(this IBillingRoleAssignmentsOperations operations, string billingAccountName, string billingProfileName) + /// + /// Parameters supplied to add a role assignment. + /// + public static BillingRoleAssignmentListResult AddByBillingProfile(this IBillingRoleAssignmentsOperations operations, string billingAccountName, string billingProfileName, BillingRoleAssignmentPayload parameters) { - return operations.AddByBillingProfileNameAsync(billingAccountName, billingProfileName).GetAwaiter().GetResult(); + return operations.AddByBillingProfileAsync(billingAccountName, billingProfileName, parameters).GetAwaiter().GetResult(); } /// @@ -502,12 +541,15 @@ public static BillingRoleAssignmentListResult AddByBillingProfileName(this IBill /// /// Billing Profile Id. /// + /// + /// Parameters supplied to add a role assignment. + /// /// /// The cancellation token. /// - public static async Task AddByBillingProfileNameAsync(this IBillingRoleAssignmentsOperations operations, string billingAccountName, string billingProfileName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task AddByBillingProfileAsync(this IBillingRoleAssignmentsOperations operations, string billingAccountName, string billingProfileName, BillingRoleAssignmentPayload parameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.AddByBillingProfileNameWithHttpMessagesAsync(billingAccountName, billingProfileName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.AddByBillingProfileWithHttpMessagesAsync(billingAccountName, billingProfileName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingRoleDefinitionsOperations.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingRoleDefinitionsOperations.cs index 3388eb2759da..db1c6fc46e7f 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingRoleDefinitionsOperations.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingRoleDefinitionsOperations.cs @@ -80,7 +80,7 @@ internal BillingRoleDefinitionsOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetByBillingAccountNameWithHttpMessagesAsync(string billingAccountName, string billingRoleDefinitionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetByBillingAccountWithHttpMessagesAsync(string billingAccountName, string billingRoleDefinitionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.ApiVersion == null) { @@ -104,11 +104,11 @@ internal BillingRoleDefinitionsOperations(BillingManagementClient client) tracingParameters.Add("billingAccountName", billingAccountName); tracingParameters.Add("billingRoleDefinitionName", billingRoleDefinitionName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetByBillingAccountName", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetByBillingAccount", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/providers/Microsoft.Billing/billingRoleDefinitions/{billingRoleDefinitionName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleDefinitions/{billingRoleDefinitionName}").ToString(); _url = _url.Replace("{billingAccountName}", System.Uri.EscapeDataString(billingAccountName)); _url = _url.Replace("{billingRoleDefinitionName}", System.Uri.EscapeDataString(billingRoleDefinitionName)); List _queryParameters = new List(); @@ -242,6 +242,9 @@ internal BillingRoleDefinitionsOperations(BillingManagementClient client) /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// @@ -269,7 +272,7 @@ internal BillingRoleDefinitionsOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetByInvoiceSectionNameWithHttpMessagesAsync(string billingAccountName, string invoiceSectionName, string billingRoleDefinitionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetByInvoiceSectionWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, string billingRoleDefinitionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.ApiVersion == null) { @@ -279,6 +282,10 @@ internal BillingRoleDefinitionsOperations(BillingManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "billingAccountName"); } + if (billingProfileName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "billingProfileName"); + } if (invoiceSectionName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "invoiceSectionName"); @@ -295,15 +302,17 @@ internal BillingRoleDefinitionsOperations(BillingManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("billingAccountName", billingAccountName); + tracingParameters.Add("billingProfileName", billingProfileName); tracingParameters.Add("invoiceSectionName", invoiceSectionName); tracingParameters.Add("billingRoleDefinitionName", billingRoleDefinitionName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetByInvoiceSectionName", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetByInvoiceSection", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/providers/Microsoft.Billing/billingRoleDefinitions/{billingRoleDefinitionName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/billingRoleDefinitions/{billingRoleDefinitionName}").ToString(); _url = _url.Replace("{billingAccountName}", System.Uri.EscapeDataString(billingAccountName)); + _url = _url.Replace("{billingProfileName}", System.Uri.EscapeDataString(billingProfileName)); _url = _url.Replace("{invoiceSectionName}", System.Uri.EscapeDataString(invoiceSectionName)); _url = _url.Replace("{billingRoleDefinitionName}", System.Uri.EscapeDataString(billingRoleDefinitionName)); List _queryParameters = new List(); @@ -464,7 +473,7 @@ internal BillingRoleDefinitionsOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetByBillingProfileNameWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string billingRoleDefinitionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetByBillingProfileWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string billingRoleDefinitionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.ApiVersion == null) { @@ -493,11 +502,11 @@ internal BillingRoleDefinitionsOperations(BillingManagementClient client) tracingParameters.Add("billingProfileName", billingProfileName); tracingParameters.Add("billingRoleDefinitionName", billingRoleDefinitionName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetByBillingProfileName", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetByBillingProfile", 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}/providers/Microsoft.Billing/billingRoleDefinitions/{billingRoleDefinitionName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/billingRoleDefinitions/{billingRoleDefinitionName}").ToString(); _url = _url.Replace("{billingAccountName}", System.Uri.EscapeDataString(billingAccountName)); _url = _url.Replace("{billingProfileName}", System.Uri.EscapeDataString(billingProfileName)); _url = _url.Replace("{billingRoleDefinitionName}", System.Uri.EscapeDataString(billingRoleDefinitionName)); @@ -653,7 +662,7 @@ internal BillingRoleDefinitionsOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListByBillingAccountNameWithHttpMessagesAsync(string billingAccountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListByBillingAccountWithHttpMessagesAsync(string billingAccountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.ApiVersion == null) { @@ -672,11 +681,11 @@ internal BillingRoleDefinitionsOperations(BillingManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("billingAccountName", billingAccountName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByBillingAccountName", tracingParameters); + 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}/providers/Microsoft.Billing/billingRoleDefinitions").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleDefinitions").ToString(); _url = _url.Replace("{billingAccountName}", System.Uri.EscapeDataString(billingAccountName)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -809,6 +818,9 @@ internal BillingRoleDefinitionsOperations(BillingManagementClient client) /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// @@ -833,7 +845,7 @@ internal BillingRoleDefinitionsOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListByInvoiceSectionNameWithHttpMessagesAsync(string billingAccountName, string invoiceSectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListByInvoiceSectionWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.ApiVersion == null) { @@ -843,6 +855,10 @@ internal BillingRoleDefinitionsOperations(BillingManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "billingAccountName"); } + if (billingProfileName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "billingProfileName"); + } if (invoiceSectionName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "invoiceSectionName"); @@ -855,14 +871,16 @@ internal BillingRoleDefinitionsOperations(BillingManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("billingAccountName", billingAccountName); + tracingParameters.Add("billingProfileName", billingProfileName); tracingParameters.Add("invoiceSectionName", invoiceSectionName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByInvoiceSectionName", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListByInvoiceSection", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/providers/Microsoft.Billing/billingRoleDefinitions").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/billingRoleDefinitions").ToString(); _url = _url.Replace("{billingAccountName}", System.Uri.EscapeDataString(billingAccountName)); + _url = _url.Replace("{billingProfileName}", System.Uri.EscapeDataString(billingProfileName)); _url = _url.Replace("{invoiceSectionName}", System.Uri.EscapeDataString(invoiceSectionName)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -1019,7 +1037,7 @@ internal BillingRoleDefinitionsOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListByBillingProfileNameWithHttpMessagesAsync(string billingAccountName, string billingProfileName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListByBillingProfileWithHttpMessagesAsync(string billingAccountName, string billingProfileName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.ApiVersion == null) { @@ -1043,11 +1061,11 @@ internal BillingRoleDefinitionsOperations(BillingManagementClient client) tracingParameters.Add("billingAccountName", billingAccountName); tracingParameters.Add("billingProfileName", billingProfileName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByBillingProfileName", tracingParameters); + 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}/providers/Microsoft.Billing/billingRoleDefinitions").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/billingRoleDefinitions").ToString(); _url = _url.Replace("{billingAccountName}", System.Uri.EscapeDataString(billingAccountName)); _url = _url.Replace("{billingProfileName}", System.Uri.EscapeDataString(billingProfileName)); List _queryParameters = new List(); diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingRoleDefinitionsOperationsExtensions.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingRoleDefinitionsOperationsExtensions.cs index cb1c83e8c923..10e68be3ec67 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingRoleDefinitionsOperationsExtensions.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingRoleDefinitionsOperationsExtensions.cs @@ -33,9 +33,9 @@ public static partial class BillingRoleDefinitionsOperationsExtensions /// /// role definition id. /// - public static BillingRoleDefinition GetByBillingAccountName(this IBillingRoleDefinitionsOperations operations, string billingAccountName, string billingRoleDefinitionName) + public static BillingRoleDefinition GetByBillingAccount(this IBillingRoleDefinitionsOperations operations, string billingAccountName, string billingRoleDefinitionName) { - return operations.GetByBillingAccountNameAsync(billingAccountName, billingRoleDefinitionName).GetAwaiter().GetResult(); + return operations.GetByBillingAccountAsync(billingAccountName, billingRoleDefinitionName).GetAwaiter().GetResult(); } /// @@ -53,9 +53,9 @@ public static BillingRoleDefinition GetByBillingAccountName(this IBillingRoleDef /// /// The cancellation token. /// - public static async Task GetByBillingAccountNameAsync(this IBillingRoleDefinitionsOperations operations, string billingAccountName, string billingRoleDefinitionName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetByBillingAccountAsync(this IBillingRoleDefinitionsOperations operations, string billingAccountName, string billingRoleDefinitionName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetByBillingAccountNameWithHttpMessagesAsync(billingAccountName, billingRoleDefinitionName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetByBillingAccountWithHttpMessagesAsync(billingAccountName, billingRoleDefinitionName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -70,15 +70,18 @@ public static BillingRoleDefinition GetByBillingAccountName(this IBillingRoleDef /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// /// /// role definition id. /// - public static BillingRoleDefinition GetByInvoiceSectionName(this IBillingRoleDefinitionsOperations operations, string billingAccountName, string invoiceSectionName, string billingRoleDefinitionName) + public static BillingRoleDefinition GetByInvoiceSection(this IBillingRoleDefinitionsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, string billingRoleDefinitionName) { - return operations.GetByInvoiceSectionNameAsync(billingAccountName, invoiceSectionName, billingRoleDefinitionName).GetAwaiter().GetResult(); + return operations.GetByInvoiceSectionAsync(billingAccountName, billingProfileName, invoiceSectionName, billingRoleDefinitionName).GetAwaiter().GetResult(); } /// @@ -90,6 +93,9 @@ public static BillingRoleDefinition GetByInvoiceSectionName(this IBillingRoleDef /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// @@ -99,9 +105,9 @@ public static BillingRoleDefinition GetByInvoiceSectionName(this IBillingRoleDef /// /// The cancellation token. /// - public static async Task GetByInvoiceSectionNameAsync(this IBillingRoleDefinitionsOperations operations, string billingAccountName, string invoiceSectionName, string billingRoleDefinitionName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetByInvoiceSectionAsync(this IBillingRoleDefinitionsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, string billingRoleDefinitionName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetByInvoiceSectionNameWithHttpMessagesAsync(billingAccountName, invoiceSectionName, billingRoleDefinitionName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetByInvoiceSectionWithHttpMessagesAsync(billingAccountName, billingProfileName, invoiceSectionName, billingRoleDefinitionName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -122,9 +128,9 @@ public static BillingRoleDefinition GetByInvoiceSectionName(this IBillingRoleDef /// /// role definition id. /// - public static BillingRoleDefinition GetByBillingProfileName(this IBillingRoleDefinitionsOperations operations, string billingAccountName, string billingProfileName, string billingRoleDefinitionName) + public static BillingRoleDefinition GetByBillingProfile(this IBillingRoleDefinitionsOperations operations, string billingAccountName, string billingProfileName, string billingRoleDefinitionName) { - return operations.GetByBillingProfileNameAsync(billingAccountName, billingProfileName, billingRoleDefinitionName).GetAwaiter().GetResult(); + return operations.GetByBillingProfileAsync(billingAccountName, billingProfileName, billingRoleDefinitionName).GetAwaiter().GetResult(); } /// @@ -145,9 +151,9 @@ public static BillingRoleDefinition GetByBillingProfileName(this IBillingRoleDef /// /// The cancellation token. /// - public static async Task GetByBillingProfileNameAsync(this IBillingRoleDefinitionsOperations operations, string billingAccountName, string billingProfileName, string billingRoleDefinitionName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetByBillingProfileAsync(this IBillingRoleDefinitionsOperations operations, string billingAccountName, string billingProfileName, string billingRoleDefinitionName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetByBillingProfileNameWithHttpMessagesAsync(billingAccountName, billingProfileName, billingRoleDefinitionName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetByBillingProfileWithHttpMessagesAsync(billingAccountName, billingProfileName, billingRoleDefinitionName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -162,9 +168,9 @@ public static BillingRoleDefinition GetByBillingProfileName(this IBillingRoleDef /// /// billing Account Id. /// - public static BillingRoleDefinitionListResult ListByBillingAccountName(this IBillingRoleDefinitionsOperations operations, string billingAccountName) + public static BillingRoleDefinitionListResult ListByBillingAccount(this IBillingRoleDefinitionsOperations operations, string billingAccountName) { - return operations.ListByBillingAccountNameAsync(billingAccountName).GetAwaiter().GetResult(); + return operations.ListByBillingAccountAsync(billingAccountName).GetAwaiter().GetResult(); } /// @@ -179,9 +185,9 @@ public static BillingRoleDefinitionListResult ListByBillingAccountName(this IBil /// /// The cancellation token. /// - public static async Task ListByBillingAccountNameAsync(this IBillingRoleDefinitionsOperations operations, string billingAccountName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task ListByBillingAccountAsync(this IBillingRoleDefinitionsOperations operations, string billingAccountName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListByBillingAccountNameWithHttpMessagesAsync(billingAccountName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListByBillingAccountWithHttpMessagesAsync(billingAccountName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -196,12 +202,15 @@ public static BillingRoleDefinitionListResult ListByBillingAccountName(this IBil /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// - public static BillingRoleDefinitionListResult ListByInvoiceSectionName(this IBillingRoleDefinitionsOperations operations, string billingAccountName, string invoiceSectionName) + public static BillingRoleDefinitionListResult ListByInvoiceSection(this IBillingRoleDefinitionsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName) { - return operations.ListByInvoiceSectionNameAsync(billingAccountName, invoiceSectionName).GetAwaiter().GetResult(); + return operations.ListByInvoiceSectionAsync(billingAccountName, billingProfileName, invoiceSectionName).GetAwaiter().GetResult(); } /// @@ -213,15 +222,18 @@ public static BillingRoleDefinitionListResult ListByInvoiceSectionName(this IBil /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// /// /// The cancellation token. /// - public static async Task ListByInvoiceSectionNameAsync(this IBillingRoleDefinitionsOperations operations, string billingAccountName, string invoiceSectionName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task ListByInvoiceSectionAsync(this IBillingRoleDefinitionsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListByInvoiceSectionNameWithHttpMessagesAsync(billingAccountName, invoiceSectionName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListByInvoiceSectionWithHttpMessagesAsync(billingAccountName, billingProfileName, invoiceSectionName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -239,9 +251,9 @@ public static BillingRoleDefinitionListResult ListByInvoiceSectionName(this IBil /// /// Billing Profile Id. /// - public static BillingRoleDefinitionListResult ListByBillingProfileName(this IBillingRoleDefinitionsOperations operations, string billingAccountName, string billingProfileName) + public static BillingRoleDefinitionListResult ListByBillingProfile(this IBillingRoleDefinitionsOperations operations, string billingAccountName, string billingProfileName) { - return operations.ListByBillingProfileNameAsync(billingAccountName, billingProfileName).GetAwaiter().GetResult(); + return operations.ListByBillingProfileAsync(billingAccountName, billingProfileName).GetAwaiter().GetResult(); } /// @@ -259,9 +271,9 @@ public static BillingRoleDefinitionListResult ListByBillingProfileName(this IBil /// /// The cancellation token. /// - public static async Task ListByBillingProfileNameAsync(this IBillingRoleDefinitionsOperations operations, string billingAccountName, string billingProfileName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task ListByBillingProfileAsync(this IBillingRoleDefinitionsOperations operations, string billingAccountName, string billingProfileName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListByBillingProfileNameWithHttpMessagesAsync(billingAccountName, billingProfileName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListByBillingProfileWithHttpMessagesAsync(billingAccountName, billingProfileName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingSubscriptionsOperations.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingSubscriptionsOperations.cs index 08090ecc3117..fa77fa944c0a 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingSubscriptionsOperations.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingSubscriptionsOperations.cs @@ -51,12 +51,15 @@ internal BillingSubscriptionsOperations(BillingManagementClient client) public BillingManagementClient Client { get; private set; } /// - /// Lists billing subscriptions by billing account name. + /// Lists billing subscription by customer id. /// /// /// /// billing Account Id. /// + /// + /// Customer name. + /// /// /// Headers that will be added to request. /// @@ -78,12 +81,16 @@ internal BillingSubscriptionsOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByBillingAccountNameWithHttpMessagesAsync(string billingAccountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListByCustomerWithHttpMessagesAsync(string billingAccountName, string customerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (billingAccountName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "billingAccountName"); } + if (customerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "customerName"); + } if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); @@ -96,13 +103,15 @@ internal BillingSubscriptionsOperations(BillingManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("billingAccountName", billingAccountName); + tracingParameters.Add("customerName", customerName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByBillingAccountName", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListByCustomer", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingSubscriptions").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/customers/{customerName}/billingSubscriptions").ToString(); _url = _url.Replace("{billingAccountName}", System.Uri.EscapeDataString(billingAccountName)); + _url = _url.Replace("{customerName}", System.Uri.EscapeDataString(customerName)); List _queryParameters = new List(); if (Client.ApiVersion != null) { @@ -196,7 +205,7 @@ internal BillingSubscriptionsOperations(BillingManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -209,7 +218,7 @@ internal BillingSubscriptionsOperations(BillingManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -229,14 +238,17 @@ internal BillingSubscriptionsOperations(BillingManagementClient client) } /// - /// Lists billing subscriptions by billing profile name. + /// Get a single billing subscription by id. /// /// /// /// billing Account Id. /// - /// - /// Billing Profile Id. + /// + /// Customer name. + /// + /// + /// Billing Subscription Id. /// /// /// Headers that will be added to request. @@ -259,15 +271,19 @@ internal BillingSubscriptionsOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListByBillingProfileNameWithHttpMessagesAsync(string billingAccountName, string billingProfileName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetByCustomerWithHttpMessagesAsync(string billingAccountName, string customerName, string billingSubscriptionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (billingAccountName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "billingAccountName"); } - if (billingProfileName == null) + if (customerName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "billingProfileName"); + throw new ValidationException(ValidationRules.CannotBeNull, "customerName"); + } + if (billingSubscriptionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "billingSubscriptionName"); } if (Client.ApiVersion == null) { @@ -281,15 +297,17 @@ internal BillingSubscriptionsOperations(BillingManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("billingAccountName", billingAccountName); - tracingParameters.Add("billingProfileName", billingProfileName); + tracingParameters.Add("customerName", customerName); + tracingParameters.Add("billingSubscriptionName", billingSubscriptionName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByBillingProfileName", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetByCustomer", 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}/billingSubscriptions").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/customers/{customerName}/billingSubscriptions/{billingSubscriptionName}").ToString(); _url = _url.Replace("{billingAccountName}", System.Uri.EscapeDataString(billingAccountName)); - _url = _url.Replace("{billingProfileName}", System.Uri.EscapeDataString(billingProfileName)); + _url = _url.Replace("{customerName}", System.Uri.EscapeDataString(customerName)); + _url = _url.Replace("{billingSubscriptionName}", System.Uri.EscapeDataString(billingSubscriptionName)); List _queryParameters = new List(); if (Client.ApiVersion != null) { @@ -383,7 +401,7 @@ internal BillingSubscriptionsOperations(BillingManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -396,7 +414,7 @@ internal BillingSubscriptionsOperations(BillingManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -416,15 +434,12 @@ internal BillingSubscriptionsOperations(BillingManagementClient client) } /// - /// Lists billing subscription by invoice section name. - /// + /// Lists billing subscriptions by billing account name. + /// /// /// /// billing Account Id. /// - /// - /// InvoiceSection Id. - /// /// /// Headers that will be added to request. /// @@ -446,16 +461,12 @@ internal BillingSubscriptionsOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListByInvoiceSectionNameWithHttpMessagesAsync(string billingAccountName, string invoiceSectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListByBillingAccountWithHttpMessagesAsync(string billingAccountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (billingAccountName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "billingAccountName"); } - if (invoiceSectionName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "invoiceSectionName"); - } if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); @@ -468,15 +479,13 @@ internal BillingSubscriptionsOperations(BillingManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("billingAccountName", billingAccountName); - tracingParameters.Add("invoiceSectionName", invoiceSectionName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByInvoiceSectionName", tracingParameters); + 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}/invoiceSections/{invoiceSectionName}/billingSubscriptions").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingSubscriptions").ToString(); _url = _url.Replace("{billingAccountName}", System.Uri.EscapeDataString(billingAccountName)); - _url = _url.Replace("{invoiceSectionName}", System.Uri.EscapeDataString(invoiceSectionName)); List _queryParameters = new List(); if (Client.ApiVersion != null) { @@ -570,7 +579,7 @@ internal BillingSubscriptionsOperations(BillingManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -583,7 +592,7 @@ internal BillingSubscriptionsOperations(BillingManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -603,17 +612,14 @@ internal BillingSubscriptionsOperations(BillingManagementClient client) } /// - /// Get a single billing subscription by name. - /// + /// Lists billing subscriptions by billing profile name. + /// /// /// /// billing Account Id. /// - /// - /// InvoiceSection Id. - /// - /// - /// Billing Subscription Id. + /// + /// Billing Profile Id. /// /// /// Headers that will be added to request. @@ -636,19 +642,15 @@ internal BillingSubscriptionsOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string billingAccountName, string invoiceSectionName, string billingSubscriptionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListByBillingProfileWithHttpMessagesAsync(string billingAccountName, string billingProfileName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (billingAccountName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "billingAccountName"); } - if (invoiceSectionName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "invoiceSectionName"); - } - if (billingSubscriptionName == null) + if (billingProfileName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "billingSubscriptionName"); + throw new ValidationException(ValidationRules.CannotBeNull, "billingProfileName"); } if (Client.ApiVersion == null) { @@ -662,17 +664,15 @@ internal BillingSubscriptionsOperations(BillingManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("billingAccountName", billingAccountName); - tracingParameters.Add("invoiceSectionName", invoiceSectionName); - tracingParameters.Add("billingSubscriptionName", billingSubscriptionName); + tracingParameters.Add("billingProfileName", billingProfileName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + 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}/invoiceSections/{invoiceSectionName}/billingSubscriptions/{billingSubscriptionName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/billingSubscriptions").ToString(); _url = _url.Replace("{billingAccountName}", System.Uri.EscapeDataString(billingAccountName)); - _url = _url.Replace("{invoiceSectionName}", System.Uri.EscapeDataString(invoiceSectionName)); - _url = _url.Replace("{billingSubscriptionName}", System.Uri.EscapeDataString(billingSubscriptionName)); + _url = _url.Replace("{billingProfileName}", System.Uri.EscapeDataString(billingProfileName)); List _queryParameters = new List(); if (Client.ApiVersion != null) { @@ -766,7 +766,7 @@ internal BillingSubscriptionsOperations(BillingManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -779,7 +779,7 @@ internal BillingSubscriptionsOperations(BillingManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -799,50 +799,18 @@ internal BillingSubscriptionsOperations(BillingManagementClient client) } /// - /// Transfers the subscription from one invoice section to another within a - /// billing account. + /// Lists billing subscription by invoice section name. + /// /// /// /// billing Account Id. /// - /// - /// InvoiceSection Id. - /// - /// - /// Billing Subscription Id. - /// - /// - /// Parameters supplied to the Transfer Billing Subscription operation. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> TransferWithHttpMessagesAsync(string billingAccountName, string invoiceSectionName, string billingSubscriptionName, TransferBillingSubscriptionRequestProperties parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginTransferWithHttpMessagesAsync(billingAccountName, invoiceSectionName, billingSubscriptionName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Transfers the subscription from one invoice section to another within a - /// billing account. - /// - /// - /// billing Account Id. + /// + /// Billing Profile Id. /// /// /// InvoiceSection Id. /// - /// - /// Billing Subscription Id. - /// - /// - /// Parameters supplied to the Transfer Billing Subscription operation. - /// /// /// Headers that will be added to request. /// @@ -864,23 +832,23 @@ internal BillingSubscriptionsOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginTransferWithHttpMessagesAsync(string billingAccountName, string invoiceSectionName, string billingSubscriptionName, TransferBillingSubscriptionRequestProperties parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListByInvoiceSectionWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (billingAccountName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "billingAccountName"); } - if (invoiceSectionName == null) + if (billingProfileName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "invoiceSectionName"); + throw new ValidationException(ValidationRules.CannotBeNull, "billingProfileName"); } - if (billingSubscriptionName == null) + if (invoiceSectionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "billingSubscriptionName"); + throw new ValidationException(ValidationRules.CannotBeNull, "invoiceSectionName"); } - if (parameters == null) + if (Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -890,19 +858,22 @@ internal BillingSubscriptionsOperations(BillingManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("billingAccountName", billingAccountName); + tracingParameters.Add("billingProfileName", billingProfileName); tracingParameters.Add("invoiceSectionName", invoiceSectionName); - tracingParameters.Add("billingSubscriptionName", billingSubscriptionName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginTransfer", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListByInvoiceSection", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/billingSubscriptions/{billingSubscriptionName}/transfer").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/billingSubscriptions").ToString(); _url = _url.Replace("{billingAccountName}", System.Uri.EscapeDataString(billingAccountName)); + _url = _url.Replace("{billingProfileName}", System.Uri.EscapeDataString(billingProfileName)); _url = _url.Replace("{invoiceSectionName}", System.Uri.EscapeDataString(invoiceSectionName)); - _url = _url.Replace("{billingSubscriptionName}", System.Uri.EscapeDataString(billingSubscriptionName)); List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); @@ -910,7 +881,7 @@ internal BillingSubscriptionsOperations(BillingManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -941,12 +912,6 @@ internal BillingSubscriptionsOperations(BillingManagementClient client) // Serialize Request string _requestContent = null; - if(parameters != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, 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) { @@ -967,7 +932,7 @@ internal BillingSubscriptionsOperations(BillingManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 200) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -997,7 +962,7 @@ internal BillingSubscriptionsOperations(BillingManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1010,7 +975,7 @@ internal BillingSubscriptionsOperations(BillingManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -1022,19 +987,6 @@ internal BillingSubscriptionsOperations(BillingManagementClient client) 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); @@ -1043,8 +995,848 @@ internal BillingSubscriptionsOperations(BillingManagementClient client) } /// - /// Lists billing subscriptions by billing account name. - /// + /// Get a single billing subscription by name. + /// + /// + /// + /// billing Account Id. + /// + /// + /// Billing Profile Id. + /// + /// + /// InvoiceSection Id. + /// + /// + /// Billing Subscription Id. + /// + /// + /// 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> GetWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, string billingSubscriptionName, 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"); + } + if (invoiceSectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "invoiceSectionName"); + } + if (billingSubscriptionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "billingSubscriptionName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("billingAccountName", billingAccountName); + tracingParameters.Add("billingProfileName", billingProfileName); + tracingParameters.Add("invoiceSectionName", invoiceSectionName); + tracingParameters.Add("billingSubscriptionName", billingSubscriptionName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", 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}/invoiceSections/{invoiceSectionName}/billingSubscriptions/{billingSubscriptionName}").ToString(); + _url = _url.Replace("{billingAccountName}", System.Uri.EscapeDataString(billingAccountName)); + _url = _url.Replace("{billingProfileName}", System.Uri.EscapeDataString(billingProfileName)); + _url = _url.Replace("{invoiceSectionName}", System.Uri.EscapeDataString(invoiceSectionName)); + _url = _url.Replace("{billingSubscriptionName}", System.Uri.EscapeDataString(billingSubscriptionName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.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("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; + } + + /// + /// Transfers the subscription from one invoice section to another within a + /// billing account. + /// + /// + /// billing Account Id. + /// + /// + /// Billing Profile Id. + /// + /// + /// InvoiceSection Id. + /// + /// + /// Billing Subscription Id. + /// + /// + /// Request parameters supplied to the Transfer Billing Subscription operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> TransferWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, string billingSubscriptionName, TransferBillingSubscriptionRequestProperties parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginTransferWithHttpMessagesAsync(billingAccountName, billingProfileName, invoiceSectionName, billingSubscriptionName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Validates the transfer of billing subscriptions across invoice sections. + /// + /// + /// billing Account Id. + /// + /// + /// Billing Profile Id. + /// + /// + /// InvoiceSection Id. + /// + /// + /// Billing Subscription Id. + /// + /// + /// Parameters supplied to the Transfer Billing Subscription 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> ValidateTransferWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, string billingSubscriptionName, TransferBillingSubscriptionRequestProperties parameters, 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"); + } + if (invoiceSectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "invoiceSectionName"); + } + if (billingSubscriptionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "billingSubscriptionName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("billingAccountName", billingAccountName); + tracingParameters.Add("billingProfileName", billingProfileName); + tracingParameters.Add("invoiceSectionName", invoiceSectionName); + tracingParameters.Add("billingSubscriptionName", billingSubscriptionName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ValidateTransfer", 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}/invoiceSections/{invoiceSectionName}/billingSubscriptions/{billingSubscriptionName}/validateTransferEligibility").ToString(); + _url = _url.Replace("{billingAccountName}", System.Uri.EscapeDataString(billingAccountName)); + _url = _url.Replace("{billingProfileName}", System.Uri.EscapeDataString(billingProfileName)); + _url = _url.Replace("{invoiceSectionName}", System.Uri.EscapeDataString(invoiceSectionName)); + _url = _url.Replace("{billingSubscriptionName}", System.Uri.EscapeDataString(billingSubscriptionName)); + 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("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(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, 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) + { + 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; + } + + /// + /// Transfers the subscription from one invoice section to another within a + /// billing account. + /// + /// + /// billing Account Id. + /// + /// + /// Billing Profile Id. + /// + /// + /// InvoiceSection Id. + /// + /// + /// Billing Subscription Id. + /// + /// + /// Request parameters supplied to the Transfer Billing Subscription 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> BeginTransferWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, string billingSubscriptionName, TransferBillingSubscriptionRequestProperties parameters, 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"); + } + if (invoiceSectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "invoiceSectionName"); + } + if (billingSubscriptionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "billingSubscriptionName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("billingAccountName", billingAccountName); + tracingParameters.Add("billingProfileName", billingProfileName); + tracingParameters.Add("invoiceSectionName", invoiceSectionName); + tracingParameters.Add("billingSubscriptionName", billingSubscriptionName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginTransfer", 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}/invoiceSections/{invoiceSectionName}/billingSubscriptions/{billingSubscriptionName}/transfer").ToString(); + _url = _url.Replace("{billingAccountName}", System.Uri.EscapeDataString(billingAccountName)); + _url = _url.Replace("{billingProfileName}", System.Uri.EscapeDataString(billingProfileName)); + _url = _url.Replace("{invoiceSectionName}", System.Uri.EscapeDataString(invoiceSectionName)); + _url = _url.Replace("{billingSubscriptionName}", System.Uri.EscapeDataString(billingSubscriptionName)); + 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("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(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, 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 billing subscription by customer id. + /// + /// + /// + /// 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>> ListByCustomerNextWithHttpMessagesAsync(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, "ListByCustomerNext", 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 billing subscriptions by billing account name. + /// /// /// /// The NextLink from the previous successful call to List operation. @@ -1070,7 +1862,7 @@ internal BillingSubscriptionsOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByBillingAccountNameNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListByBillingAccountNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -1085,7 +1877,7 @@ internal BillingSubscriptionsOperations(BillingManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByBillingAccountNameNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListByBillingAccountNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -1179,7 +1971,7 @@ internal BillingSubscriptionsOperations(BillingManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1192,7 +1984,7 @@ internal BillingSubscriptionsOperations(BillingManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingSubscriptionsOperationsExtensions.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingSubscriptionsOperationsExtensions.cs index b0c9011256f2..e4cc2f127fb0 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingSubscriptionsOperationsExtensions.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingSubscriptionsOperationsExtensions.cs @@ -22,7 +22,7 @@ namespace Microsoft.Azure.Management.Billing public static partial class BillingSubscriptionsOperationsExtensions { /// - /// Lists billing subscriptions by billing account name. + /// Lists billing subscription by customer id. /// /// /// @@ -31,13 +31,16 @@ public static partial class BillingSubscriptionsOperationsExtensions /// /// billing Account Id. /// - public static IPage ListByBillingAccountName(this IBillingSubscriptionsOperations operations, string billingAccountName) + /// + /// Customer name. + /// + public static IPage ListByCustomer(this IBillingSubscriptionsOperations operations, string billingAccountName, string customerName) { - return operations.ListByBillingAccountNameAsync(billingAccountName).GetAwaiter().GetResult(); + return operations.ListByCustomerAsync(billingAccountName, customerName).GetAwaiter().GetResult(); } /// - /// Lists billing subscriptions by billing account name. + /// Lists billing subscription by customer id. /// /// /// @@ -46,19 +49,43 @@ public static IPage ListByBillingAccountName(this IB /// /// billing Account Id. /// + /// + /// Customer name. + /// /// /// The cancellation token. /// - public static async Task> ListByBillingAccountNameAsync(this IBillingSubscriptionsOperations operations, string billingAccountName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListByCustomerAsync(this IBillingSubscriptionsOperations operations, string billingAccountName, string customerName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListByBillingAccountNameWithHttpMessagesAsync(billingAccountName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListByCustomerWithHttpMessagesAsync(billingAccountName, customerName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Lists billing subscriptions by billing profile name. + /// Get a single billing subscription by id. + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// billing Account Id. + /// + /// + /// Customer name. + /// + /// + /// Billing Subscription Id. + /// + public static BillingSubscription GetByCustomer(this IBillingSubscriptionsOperations operations, string billingAccountName, string customerName, string billingSubscriptionName) + { + return operations.GetByCustomerAsync(billingAccountName, customerName, billingSubscriptionName).GetAwaiter().GetResult(); + } + + /// + /// Get a single billing subscription by id. /// /// /// @@ -67,17 +94,80 @@ public static IPage ListByBillingAccountName(this IB /// /// billing Account Id. /// + /// + /// Customer name. + /// + /// + /// Billing Subscription Id. + /// + /// + /// The cancellation token. + /// + public static async Task GetByCustomerAsync(this IBillingSubscriptionsOperations operations, string billingAccountName, string customerName, string billingSubscriptionName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetByCustomerWithHttpMessagesAsync(billingAccountName, customerName, billingSubscriptionName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Lists billing subscriptions by billing account name. + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// billing Account Id. + /// + public static IPage ListByBillingAccount(this IBillingSubscriptionsOperations operations, string billingAccountName) + { + return operations.ListByBillingAccountAsync(billingAccountName).GetAwaiter().GetResult(); + } + + /// + /// Lists billing subscriptions by billing account name. + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// billing Account Id. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByBillingAccountAsync(this IBillingSubscriptionsOperations operations, string billingAccountName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByBillingAccountWithHttpMessagesAsync(billingAccountName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Lists billing subscriptions by billing profile name. + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// billing Account Id. + /// /// /// Billing Profile Id. /// - public static BillingSubscriptionsListResult ListByBillingProfileName(this IBillingSubscriptionsOperations operations, string billingAccountName, string billingProfileName) + public static BillingSubscriptionsListResult ListByBillingProfile(this IBillingSubscriptionsOperations operations, string billingAccountName, string billingProfileName) { - return operations.ListByBillingProfileNameAsync(billingAccountName, billingProfileName).GetAwaiter().GetResult(); + return operations.ListByBillingProfileAsync(billingAccountName, billingProfileName).GetAwaiter().GetResult(); } /// /// Lists billing subscriptions by billing profile name. - /// + /// /// /// /// The operations group for this extension method. @@ -91,9 +181,9 @@ public static BillingSubscriptionsListResult ListByBillingProfileName(this IBill /// /// The cancellation token. /// - public static async Task ListByBillingProfileNameAsync(this IBillingSubscriptionsOperations operations, string billingAccountName, string billingProfileName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task ListByBillingProfileAsync(this IBillingSubscriptionsOperations operations, string billingAccountName, string billingProfileName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListByBillingProfileNameWithHttpMessagesAsync(billingAccountName, billingProfileName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListByBillingProfileWithHttpMessagesAsync(billingAccountName, billingProfileName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -101,7 +191,7 @@ public static BillingSubscriptionsListResult ListByBillingProfileName(this IBill /// /// Lists billing subscription by invoice section name. - /// + /// /// /// /// The operations group for this extension method. @@ -109,17 +199,20 @@ public static BillingSubscriptionsListResult ListByBillingProfileName(this IBill /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// - public static BillingSubscriptionsListResult ListByInvoiceSectionName(this IBillingSubscriptionsOperations operations, string billingAccountName, string invoiceSectionName) + public static BillingSubscriptionsListResult ListByInvoiceSection(this IBillingSubscriptionsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName) { - return operations.ListByInvoiceSectionNameAsync(billingAccountName, invoiceSectionName).GetAwaiter().GetResult(); + return operations.ListByInvoiceSectionAsync(billingAccountName, billingProfileName, invoiceSectionName).GetAwaiter().GetResult(); } /// /// Lists billing subscription by invoice section name. - /// + /// /// /// /// The operations group for this extension method. @@ -127,15 +220,18 @@ public static BillingSubscriptionsListResult ListByInvoiceSectionName(this IBill /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// /// /// The cancellation token. /// - public static async Task ListByInvoiceSectionNameAsync(this IBillingSubscriptionsOperations operations, string billingAccountName, string invoiceSectionName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task ListByInvoiceSectionAsync(this IBillingSubscriptionsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListByInvoiceSectionNameWithHttpMessagesAsync(billingAccountName, invoiceSectionName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListByInvoiceSectionWithHttpMessagesAsync(billingAccountName, billingProfileName, invoiceSectionName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -143,7 +239,7 @@ public static BillingSubscriptionsListResult ListByInvoiceSectionName(this IBill /// /// Get a single billing subscription by name. - /// + /// /// /// /// The operations group for this extension method. @@ -151,20 +247,23 @@ public static BillingSubscriptionsListResult ListByInvoiceSectionName(this IBill /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// /// /// Billing Subscription Id. /// - public static BillingSubscriptionSummary Get(this IBillingSubscriptionsOperations operations, string billingAccountName, string invoiceSectionName, string billingSubscriptionName) + public static BillingSubscription Get(this IBillingSubscriptionsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, string billingSubscriptionName) { - return operations.GetAsync(billingAccountName, invoiceSectionName, billingSubscriptionName).GetAwaiter().GetResult(); + return operations.GetAsync(billingAccountName, billingProfileName, invoiceSectionName, billingSubscriptionName).GetAwaiter().GetResult(); } /// /// Get a single billing subscription by name. - /// + /// /// /// /// The operations group for this extension method. @@ -172,6 +271,9 @@ public static BillingSubscriptionSummary Get(this IBillingSubscriptionsOperation /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// @@ -181,9 +283,9 @@ public static BillingSubscriptionSummary Get(this IBillingSubscriptionsOperation /// /// The cancellation token. /// - public static async Task GetAsync(this IBillingSubscriptionsOperations operations, string billingAccountName, string invoiceSectionName, string billingSubscriptionName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetAsync(this IBillingSubscriptionsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, string billingSubscriptionName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(billingAccountName, invoiceSectionName, billingSubscriptionName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetWithHttpMessagesAsync(billingAccountName, billingProfileName, invoiceSectionName, billingSubscriptionName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -199,6 +301,9 @@ public static BillingSubscriptionSummary Get(this IBillingSubscriptionsOperation /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// @@ -206,11 +311,11 @@ public static BillingSubscriptionSummary Get(this IBillingSubscriptionsOperation /// Billing Subscription Id. /// /// - /// Parameters supplied to the Transfer Billing Subscription operation. + /// Request parameters supplied to the Transfer Billing Subscription operation. /// - public static TransferBillingSubscriptionResult Transfer(this IBillingSubscriptionsOperations operations, string billingAccountName, string invoiceSectionName, string billingSubscriptionName, TransferBillingSubscriptionRequestProperties parameters) + public static TransferBillingSubscriptionResult Transfer(this IBillingSubscriptionsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, string billingSubscriptionName, TransferBillingSubscriptionRequestProperties parameters) { - return operations.TransferAsync(billingAccountName, invoiceSectionName, billingSubscriptionName, parameters).GetAwaiter().GetResult(); + return operations.TransferAsync(billingAccountName, billingProfileName, invoiceSectionName, billingSubscriptionName, parameters).GetAwaiter().GetResult(); } /// @@ -223,6 +328,67 @@ public static TransferBillingSubscriptionResult Transfer(this IBillingSubscripti /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// + /// + /// InvoiceSection Id. + /// + /// + /// Billing Subscription Id. + /// + /// + /// Request parameters supplied to the Transfer Billing Subscription operation. + /// + /// + /// The cancellation token. + /// + public static async Task TransferAsync(this IBillingSubscriptionsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, string billingSubscriptionName, TransferBillingSubscriptionRequestProperties parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.TransferWithHttpMessagesAsync(billingAccountName, billingProfileName, invoiceSectionName, billingSubscriptionName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Validates the transfer of billing subscriptions across invoice sections. + /// + /// + /// The operations group for this extension method. + /// + /// + /// billing Account Id. + /// + /// + /// Billing Profile Id. + /// + /// + /// InvoiceSection Id. + /// + /// + /// Billing Subscription Id. + /// + /// + /// Parameters supplied to the Transfer Billing Subscription operation. + /// + public static ValidateSubscriptionTransferEligibilityResult ValidateTransfer(this IBillingSubscriptionsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, string billingSubscriptionName, TransferBillingSubscriptionRequestProperties parameters) + { + return operations.ValidateTransferAsync(billingAccountName, billingProfileName, invoiceSectionName, billingSubscriptionName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Validates the transfer of billing subscriptions across invoice sections. + /// + /// + /// The operations group for this extension method. + /// + /// + /// billing Account Id. + /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// @@ -235,9 +401,9 @@ public static TransferBillingSubscriptionResult Transfer(this IBillingSubscripti /// /// The cancellation token. /// - public static async Task TransferAsync(this IBillingSubscriptionsOperations operations, string billingAccountName, string invoiceSectionName, string billingSubscriptionName, TransferBillingSubscriptionRequestProperties parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task ValidateTransferAsync(this IBillingSubscriptionsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, string billingSubscriptionName, TransferBillingSubscriptionRequestProperties parameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.TransferWithHttpMessagesAsync(billingAccountName, invoiceSectionName, billingSubscriptionName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ValidateTransferWithHttpMessagesAsync(billingAccountName, billingProfileName, invoiceSectionName, billingSubscriptionName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -253,6 +419,9 @@ public static TransferBillingSubscriptionResult Transfer(this IBillingSubscripti /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// @@ -260,11 +429,11 @@ public static TransferBillingSubscriptionResult Transfer(this IBillingSubscripti /// Billing Subscription Id. /// /// - /// Parameters supplied to the Transfer Billing Subscription operation. + /// Request parameters supplied to the Transfer Billing Subscription operation. /// - public static TransferBillingSubscriptionResult BeginTransfer(this IBillingSubscriptionsOperations operations, string billingAccountName, string invoiceSectionName, string billingSubscriptionName, TransferBillingSubscriptionRequestProperties parameters) + public static TransferBillingSubscriptionResult BeginTransfer(this IBillingSubscriptionsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, string billingSubscriptionName, TransferBillingSubscriptionRequestProperties parameters) { - return operations.BeginTransferAsync(billingAccountName, invoiceSectionName, billingSubscriptionName, parameters).GetAwaiter().GetResult(); + return operations.BeginTransferAsync(billingAccountName, billingProfileName, invoiceSectionName, billingSubscriptionName, parameters).GetAwaiter().GetResult(); } /// @@ -277,6 +446,9 @@ public static TransferBillingSubscriptionResult BeginTransfer(this IBillingSubsc /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// @@ -284,21 +456,21 @@ public static TransferBillingSubscriptionResult BeginTransfer(this IBillingSubsc /// Billing Subscription Id. /// /// - /// Parameters supplied to the Transfer Billing Subscription operation. + /// Request parameters supplied to the Transfer Billing Subscription operation. /// /// /// The cancellation token. /// - public static async Task BeginTransferAsync(this IBillingSubscriptionsOperations operations, string billingAccountName, string invoiceSectionName, string billingSubscriptionName, TransferBillingSubscriptionRequestProperties parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginTransferAsync(this IBillingSubscriptionsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, string billingSubscriptionName, TransferBillingSubscriptionRequestProperties parameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.BeginTransferWithHttpMessagesAsync(billingAccountName, invoiceSectionName, billingSubscriptionName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginTransferWithHttpMessagesAsync(billingAccountName, billingProfileName, invoiceSectionName, billingSubscriptionName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Lists billing subscriptions by billing account name. + /// Lists billing subscription by customer id. /// /// /// @@ -307,13 +479,13 @@ public static TransferBillingSubscriptionResult BeginTransfer(this IBillingSubsc /// /// The NextLink from the previous successful call to List operation. /// - public static IPage ListByBillingAccountNameNext(this IBillingSubscriptionsOperations operations, string nextPageLink) + public static IPage ListByCustomerNext(this IBillingSubscriptionsOperations operations, string nextPageLink) { - return operations.ListByBillingAccountNameNextAsync(nextPageLink).GetAwaiter().GetResult(); + return operations.ListByCustomerNextAsync(nextPageLink).GetAwaiter().GetResult(); } /// - /// Lists billing subscriptions by billing account name. + /// Lists billing subscription by customer id. /// /// /// @@ -325,9 +497,45 @@ public static IPage ListByBillingAccountNameNext(thi /// /// The cancellation token. /// - public static async Task> ListByBillingAccountNameNextAsync(this IBillingSubscriptionsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListByCustomerNextAsync(this IBillingSubscriptionsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByCustomerNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Lists billing subscriptions by billing account name. + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListByBillingAccountNext(this IBillingSubscriptionsOperations operations, string nextPageLink) + { + return operations.ListByBillingAccountNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists billing subscriptions by billing account name. + /// + /// + /// + /// 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 IBillingSubscriptionsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListByBillingAccountNameNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListByBillingAccountNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/CustomersOperations.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/CustomersOperations.cs new file mode 100644 index 000000000000..828e3e65281b --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/CustomersOperations.cs @@ -0,0 +1,989 @@ +// +// 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; + + /// + /// CustomersOperations operations. + /// + internal partial class CustomersOperations : IServiceOperations, ICustomersOperations + { + /// + /// Initializes a new instance of the CustomersOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal CustomersOperations(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 customers by billing profile which the current user can work with + /// on-behalf of a partner. + /// + /// + /// billing Account Id. + /// + /// + /// Billing Profile Id. + /// + /// + /// May be used to filter the list of customers. + /// + /// + /// Skiptoken is only used if a previous operation returned a partial result. + /// If a previous response contains a nextLink element, the value of the + /// nextLink element will include a skiptoken parameter that specifies a + /// starting point to use for subsequent calls. + /// + /// + /// 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 skiptoken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (billingAccountName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "billingAccountName"); + } + if (billingProfileName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "billingProfileName"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("billingAccountName", billingAccountName); + tracingParameters.Add("billingProfileName", billingProfileName); + tracingParameters.Add("filter", filter); + tracingParameters.Add("skiptoken", skiptoken); + 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}/customers").ToString(); + _url = _url.Replace("{billingAccountName}", System.Uri.EscapeDataString(billingAccountName)); + _url = _url.Replace("{billingProfileName}", System.Uri.EscapeDataString(billingProfileName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (filter != null) + { + _queryParameters.Add(string.Format("$filter={0}", System.Uri.EscapeDataString(filter))); + } + if (skiptoken != null) + { + _queryParameters.Add(string.Format("$skiptoken={0}", System.Uri.EscapeDataString(skiptoken))); + } + 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 customers which the current user can work with on-behalf of a + /// partner. + /// + /// + /// billing Account Id. + /// + /// + /// May be used to filter the list of customers. + /// + /// + /// Skiptoken is only used if a previous operation returned a partial result. + /// If a previous response contains a nextLink element, the value of the + /// nextLink element will include a skiptoken parameter that specifies a + /// starting point to use for subsequent calls. + /// + /// + /// 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 skiptoken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (billingAccountName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "billingAccountName"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("billingAccountName", billingAccountName); + tracingParameters.Add("filter", filter); + tracingParameters.Add("skiptoken", skiptoken); + 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}/customers").ToString(); + _url = _url.Replace("{billingAccountName}", System.Uri.EscapeDataString(billingAccountName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (filter != null) + { + _queryParameters.Add(string.Format("$filter={0}", System.Uri.EscapeDataString(filter))); + } + if (skiptoken != null) + { + _queryParameters.Add(string.Format("$skiptoken={0}", System.Uri.EscapeDataString(skiptoken))); + } + 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; + } + + /// + /// Gets a customer by its id. + /// + /// + /// billing Account Id. + /// + /// + /// Customer name. + /// + /// + /// May be used to expand enabledAzurePlans, resellers. + /// + /// + /// 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> GetWithHttpMessagesAsync(string billingAccountName, string customerName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (billingAccountName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "billingAccountName"); + } + if (customerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "customerName"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("billingAccountName", billingAccountName); + tracingParameters.Add("customerName", customerName); + tracingParameters.Add("expand", expand); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/customers/{customerName}").ToString(); + _url = _url.Replace("{billingAccountName}", System.Uri.EscapeDataString(billingAccountName)); + _url = _url.Replace("{customerName}", System.Uri.EscapeDataString(customerName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (expand != null) + { + _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand))); + } + 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 customers by billing profile which the current user can work with + /// on-behalf of a partner. + /// + /// + /// 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; + } + + /// + /// Lists customers which the current user can work with on-behalf of a + /// partner. + /// + /// + /// 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; + } + + } +} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/CustomersOperationsExtensions.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/CustomersOperationsExtensions.cs new file mode 100644 index 000000000000..e047020c0811 --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/CustomersOperationsExtensions.cs @@ -0,0 +1,257 @@ +// +// 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 CustomersOperations. + /// + public static partial class CustomersOperationsExtensions + { + /// + /// Lists customers by billing profile which the current user can work with + /// on-behalf of a partner. + /// + /// + /// The operations group for this extension method. + /// + /// + /// billing Account Id. + /// + /// + /// Billing Profile Id. + /// + /// + /// May be used to filter the list of customers. + /// + /// + /// Skiptoken is only used if a previous operation returned a partial result. + /// If a previous response contains a nextLink element, the value of the + /// nextLink element will include a skiptoken parameter that specifies a + /// starting point to use for subsequent calls. + /// + public static IPage ListByBillingProfile(this ICustomersOperations operations, string billingAccountName, string billingProfileName, string filter = default(string), string skiptoken = default(string)) + { + return operations.ListByBillingProfileAsync(billingAccountName, billingProfileName, filter, skiptoken).GetAwaiter().GetResult(); + } + + /// + /// Lists customers by billing profile which the current user can work with + /// on-behalf of a partner. + /// + /// + /// The operations group for this extension method. + /// + /// + /// billing Account Id. + /// + /// + /// Billing Profile Id. + /// + /// + /// May be used to filter the list of customers. + /// + /// + /// Skiptoken is only used if a previous operation returned a partial result. + /// If a previous response contains a nextLink element, the value of the + /// nextLink element will include a skiptoken parameter that specifies a + /// starting point to use for subsequent calls. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByBillingProfileAsync(this ICustomersOperations operations, string billingAccountName, string billingProfileName, string filter = default(string), string skiptoken = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByBillingProfileWithHttpMessagesAsync(billingAccountName, billingProfileName, filter, skiptoken, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Lists customers which the current user can work with on-behalf of a + /// partner. + /// + /// + /// The operations group for this extension method. + /// + /// + /// billing Account Id. + /// + /// + /// May be used to filter the list of customers. + /// + /// + /// Skiptoken is only used if a previous operation returned a partial result. + /// If a previous response contains a nextLink element, the value of the + /// nextLink element will include a skiptoken parameter that specifies a + /// starting point to use for subsequent calls. + /// + public static IPage ListByBillingAccount(this ICustomersOperations operations, string billingAccountName, string filter = default(string), string skiptoken = default(string)) + { + return operations.ListByBillingAccountAsync(billingAccountName, filter, skiptoken).GetAwaiter().GetResult(); + } + + /// + /// Lists customers which the current user can work with on-behalf of a + /// partner. + /// + /// + /// The operations group for this extension method. + /// + /// + /// billing Account Id. + /// + /// + /// May be used to filter the list of customers. + /// + /// + /// Skiptoken is only used if a previous operation returned a partial result. + /// If a previous response contains a nextLink element, the value of the + /// nextLink element will include a skiptoken parameter that specifies a + /// starting point to use for subsequent calls. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByBillingAccountAsync(this ICustomersOperations operations, string billingAccountName, string filter = default(string), string skiptoken = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByBillingAccountWithHttpMessagesAsync(billingAccountName, filter, skiptoken, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets a customer by its id. + /// + /// + /// The operations group for this extension method. + /// + /// + /// billing Account Id. + /// + /// + /// Customer name. + /// + /// + /// May be used to expand enabledAzurePlans, resellers. + /// + public static Customer Get(this ICustomersOperations operations, string billingAccountName, string customerName, string expand = default(string)) + { + return operations.GetAsync(billingAccountName, customerName, expand).GetAwaiter().GetResult(); + } + + /// + /// Gets a customer by its id. + /// + /// + /// The operations group for this extension method. + /// + /// + /// billing Account Id. + /// + /// + /// Customer name. + /// + /// + /// May be used to expand enabledAzurePlans, resellers. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this ICustomersOperations operations, string billingAccountName, string customerName, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(billingAccountName, customerName, expand, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Lists customers by billing profile which the current user can work with + /// on-behalf of a partner. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListByBillingProfileNext(this ICustomersOperations operations, string nextPageLink) + { + return operations.ListByBillingProfileNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists customers by billing profile which the current user can work with + /// on-behalf of a partner. + /// + /// + /// 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 ICustomersOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByBillingProfileNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Lists customers which the current user can work with on-behalf of a + /// partner. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListByBillingAccountNext(this ICustomersOperations operations, string nextPageLink) + { + return operations.ListByBillingAccountNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists customers which the current user can work with on-behalf of a + /// partner. + /// + /// + /// 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 ICustomersOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByBillingAccountNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IAddressOperations.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IAddressOperations.cs new file mode 100644 index 000000000000..0497e1cfd7e9 --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IAddressOperations.cs @@ -0,0 +1,48 @@ +// +// 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; + + /// + /// AddressOperations operations. + /// + public partial interface IAddressOperations + { + /// + /// Validates the address. + /// + /// + /// + /// + /// 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> ValidateWithHttpMessagesAsync(AddressDetails address, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IAgreementsOperations.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IAgreementsOperations.cs index ad1ad24644a8..8857e689506b 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IAgreementsOperations.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IAgreementsOperations.cs @@ -47,7 +47,7 @@ public partial interface IAgreementsOperations /// /// Thrown when a required parameter is null /// - Task> ListByBillingAccountNameWithHttpMessagesAsync(string billingAccountName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> ListByBillingAccountWithHttpMessagesAsync(string billingAccountName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Get the agreement by name. /// diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IBillingAccountsOperations.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IBillingAccountsOperations.cs index b35c31c7891e..29bb611aa91e 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IBillingAccountsOperations.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IBillingAccountsOperations.cs @@ -27,7 +27,8 @@ public partial interface IBillingAccountsOperations /// Lists all billing accounts for a user which he has access to. /// /// - /// May be used to expand the invoiceSections and billingProfiles. + /// May be used to expand the address, invoiceSections and + /// billingProfiles. /// /// /// The headers that will be added to request. @@ -52,7 +53,8 @@ public partial interface IBillingAccountsOperations /// billing Account Id. /// /// - /// May be used to expand the invoiceSections and billingProfiles. + /// May be used to expand the address, invoiceSections and + /// billingProfiles. /// /// /// The headers that will be added to request. @@ -70,5 +72,57 @@ public partial interface IBillingAccountsOperations /// Thrown when a required parameter is null /// Task> GetWithHttpMessagesAsync(string billingAccountName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// The operation to update a billing account. + /// + /// + /// billing Account Id. + /// + /// + /// Request parameters supplied to the update billing account + /// 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> UpdateWithHttpMessagesAsync(string billingAccountName, BillingAccountUpdateRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// The operation to update a billing account. + /// + /// + /// billing Account Id. + /// + /// + /// Request parameters supplied to the update billing account + /// 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> BeginUpdateWithHttpMessagesAsync(string billingAccountName, BillingAccountUpdateRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } 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 1a737016940c..171f2c18de7a 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IBillingManagementClient.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IBillingManagementClient.cs @@ -43,7 +43,7 @@ public partial interface IBillingManagementClient : System.IDisposable /// /// Version of the API to be used with the client request. The current - /// version is 2018-11-01-preview. + /// version is 2019-10-01-preview. /// string ApiVersion { get; } @@ -81,6 +81,11 @@ public partial interface IBillingManagementClient : System.IDisposable /// IPaymentMethodsOperations PaymentMethods { get; } + /// + /// Gets the IAddressOperations. + /// + IAddressOperations Address { get; } + /// /// Gets the IAvailableBalancesOperations. /// @@ -91,45 +96,55 @@ public partial interface IBillingManagementClient : System.IDisposable /// IBillingProfilesOperations BillingProfiles { get; } + /// + /// Gets the ICustomersOperations. + /// + ICustomersOperations Customers { get; } + /// /// Gets the IInvoiceSectionsOperations. /// IInvoiceSectionsOperations InvoiceSections { get; } /// - /// Gets the IDepartmentsOperations. + /// Gets the IBillingPermissionsOperations. /// - IDepartmentsOperations Departments { get; } + IBillingPermissionsOperations BillingPermissions { get; } /// - /// Gets the IEnrollmentAccountsOperations. + /// Gets the IBillingSubscriptionsOperations. /// - IEnrollmentAccountsOperations EnrollmentAccounts { get; } + IBillingSubscriptionsOperations BillingSubscriptions { get; } /// - /// Gets the IInvoicesOperations. + /// Gets the IProductsOperations. /// - IInvoicesOperations Invoices { get; } + IProductsOperations Products { get; } /// - /// Gets the IPriceSheetOperations. + /// Gets the ITransactionsOperations. /// - IPriceSheetOperations PriceSheet { get; } + ITransactionsOperations Transactions { get; } /// - /// Gets the IBillingSubscriptionsOperations. + /// Gets the IDepartmentsOperations. /// - IBillingSubscriptionsOperations BillingSubscriptions { get; } + IDepartmentsOperations Departments { get; } /// - /// Gets the IProductsOperations. + /// Gets the IEnrollmentAccountsOperations. /// - IProductsOperations Products { get; } + IEnrollmentAccountsOperations EnrollmentAccounts { get; } /// - /// Gets the ITransactionsOperations. + /// Gets the IInvoicesOperations. /// - ITransactionsOperations Transactions { get; } + IInvoicesOperations Invoices { get; } + + /// + /// Gets the IPriceSheetOperations. + /// + IPriceSheetOperations PriceSheet { get; } /// /// Gets the IPoliciesOperations. @@ -146,6 +161,16 @@ public partial interface IBillingManagementClient : System.IDisposable /// ITransfersOperations Transfers { get; } + /// + /// Gets the IPartnerTransfersOperations. + /// + IPartnerTransfersOperations PartnerTransfers { get; } + + /// + /// Gets the IPartnerTransfersTransfersOperations. + /// + IPartnerTransfersTransfersOperations PartnerTransfersTransfers { get; } + /// /// Gets the IRecipientTransfersOperations. /// @@ -156,11 +181,6 @@ public partial interface IBillingManagementClient : System.IDisposable /// IOperations Operations { get; } - /// - /// Gets the IBillingPermissionsOperations. - /// - IBillingPermissionsOperations BillingPermissions { get; } - /// /// Gets the IBillingRoleDefinitionsOperations. /// @@ -176,5 +196,10 @@ public partial interface IBillingManagementClient : System.IDisposable /// IAgreementsOperations Agreements { get; } + /// + /// Gets the ILineOfCreditsOperations. + /// + ILineOfCreditsOperations LineOfCredits { get; } + } } diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IBillingPermissionsOperations.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IBillingPermissionsOperations.cs index e0157246a966..13d471c026ea 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IBillingPermissionsOperations.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IBillingPermissionsOperations.cs @@ -23,6 +23,31 @@ namespace Microsoft.Azure.Management.Billing /// public partial interface IBillingPermissionsOperations { + /// + /// Lists all billing permissions the caller has for a customer. + /// + /// + /// billing Account Id. + /// + /// + /// Customer name. + /// + /// + /// 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> ListByCustomerWithHttpMessagesAsync(string billingAccountName, string customerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Lists all billing permissions for the caller under a billing /// account. @@ -52,6 +77,9 @@ public partial interface IBillingPermissionsOperations /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// @@ -70,10 +98,9 @@ public partial interface IBillingPermissionsOperations /// /// Thrown when a required parameter is null /// - Task> ListByInvoiceSectionsWithHttpMessagesAsync(string billingAccountName, string invoiceSectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> ListByInvoiceSectionsWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Lists all billingPermissions for the caller has for a billing - /// account. + /// Lists all billing permissions the caller has for a billing account. /// /// /// billing Account Id. diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IBillingProfilesOperations.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IBillingProfilesOperations.cs index 6ea9e0f19913..370ead878038 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IBillingProfilesOperations.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IBillingProfilesOperations.cs @@ -48,7 +48,7 @@ public partial interface IBillingProfilesOperations /// /// Thrown when a required parameter is null /// - Task> ListByBillingAccountNameWithHttpMessagesAsync(string billingAccountName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> ListByBillingAccountWithHttpMessagesAsync(string billingAccountName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Get the billing profile by id. /// @@ -78,6 +78,34 @@ public partial interface IBillingProfilesOperations /// Task> GetWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// The operation to create a BillingProfile. + /// + /// + /// billing Account Id. + /// + /// + /// Billing Profile Id. + /// + /// + /// Request parameters supplied to the Create BillingProfile 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> CreateWithHttpMessagesAsync(string billingAccountName, string billingProfileName, BillingProfileCreationRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// The operation to update a billing profile. /// /// @@ -87,7 +115,8 @@ public partial interface IBillingProfilesOperations /// Billing Profile Id. /// /// - /// Parameters supplied to the update billing profile operation. + /// Request parameters supplied to the update billing profile + /// operation. /// /// /// The headers that will be added to request. @@ -106,6 +135,34 @@ public partial interface IBillingProfilesOperations /// Task> UpdateWithHttpMessagesAsync(string billingAccountName, string billingProfileName, BillingProfile parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// The operation to create a BillingProfile. + /// + /// + /// billing Account Id. + /// + /// + /// Billing Profile Id. + /// + /// + /// Request parameters supplied to the Create BillingProfile 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> BeginCreateWithHttpMessagesAsync(string billingAccountName, string billingProfileName, BillingProfileCreationRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// The operation to update a billing profile. /// /// @@ -115,7 +172,8 @@ public partial interface IBillingProfilesOperations /// Billing Profile Id. /// /// - /// Parameters supplied to the update billing profile operation. + /// Request parameters supplied to the update billing profile + /// operation. /// /// /// The headers that will be added to request. diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IBillingPropertyOperations.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IBillingPropertyOperations.cs index 0c8a4329431b..71374d3abd1b 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IBillingPropertyOperations.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IBillingPropertyOperations.cs @@ -25,7 +25,7 @@ public partial interface IBillingPropertyOperations { /// /// Get billing property by subscription Id. - /// + /// /// /// /// The headers that will be added to request. diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IBillingRoleAssignmentsOperations.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IBillingRoleAssignmentsOperations.cs index e8dd336ace8a..dfd967c25418 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IBillingRoleAssignmentsOperations.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IBillingRoleAssignmentsOperations.cs @@ -72,13 +72,16 @@ public partial interface IBillingRoleAssignmentsOperations /// /// Thrown when a required parameter is null /// - Task> DeleteByBillingAccountNameWithHttpMessagesAsync(string billingAccountName, string billingRoleAssignmentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> DeleteByBillingAccountWithHttpMessagesAsync(string billingAccountName, string billingRoleAssignmentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Get the role assignment for the caller on the invoice Section /// /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// @@ -100,13 +103,16 @@ public partial interface IBillingRoleAssignmentsOperations /// /// Thrown when a required parameter is null /// - Task> GetByInvoiceSectionNameWithHttpMessagesAsync(string billingAccountName, string invoiceSectionName, string billingRoleAssignmentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetByInvoiceSectionWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, string billingRoleAssignmentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Delete the role assignment on the invoice Section /// /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// @@ -128,7 +134,7 @@ public partial interface IBillingRoleAssignmentsOperations /// /// Thrown when a required parameter is null /// - Task> DeleteByInvoiceSectionNameWithHttpMessagesAsync(string billingAccountName, string invoiceSectionName, string billingRoleAssignmentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> DeleteByInvoiceSectionWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, string billingRoleAssignmentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Get the role assignment for the caller on the Billing Profile /// @@ -156,7 +162,7 @@ public partial interface IBillingRoleAssignmentsOperations /// /// Thrown when a required parameter is null /// - Task> GetByBillingProfileNameWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string billingRoleAssignmentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetByBillingProfileWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string billingRoleAssignmentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Delete the role assignment on this Billing Profile /// @@ -184,7 +190,7 @@ public partial interface IBillingRoleAssignmentsOperations /// /// Thrown when a required parameter is null /// - Task> DeleteByBillingProfileNameWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string billingRoleAssignmentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> DeleteByBillingProfileWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string billingRoleAssignmentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Get the role assignments on the Billing Account /// @@ -206,13 +212,16 @@ public partial interface IBillingRoleAssignmentsOperations /// /// Thrown when a required parameter is null /// - Task> ListByBillingAccountNameWithHttpMessagesAsync(string billingAccountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> ListByBillingAccountWithHttpMessagesAsync(string billingAccountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// The operation to add a role assignment to a billing account. /// /// /// billing Account Id. /// + /// + /// Parameters supplied to add a role assignment. + /// /// /// The headers that will be added to request. /// @@ -228,13 +237,16 @@ public partial interface IBillingRoleAssignmentsOperations /// /// Thrown when a required parameter is null /// - Task> AddByBillingAccountNameWithHttpMessagesAsync(string billingAccountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> AddByBillingAccountWithHttpMessagesAsync(string billingAccountName, BillingRoleAssignmentPayload parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Get the role assignments on the invoice Section /// /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// @@ -253,16 +265,22 @@ public partial interface IBillingRoleAssignmentsOperations /// /// Thrown when a required parameter is null /// - Task> ListByInvoiceSectionNameWithHttpMessagesAsync(string billingAccountName, string invoiceSectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> ListByInvoiceSectionWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// The operation to add a role assignment to a invoice Section. /// /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// + /// + /// Parameters supplied to add a role assignment. + /// /// /// The headers that will be added to request. /// @@ -278,7 +296,7 @@ public partial interface IBillingRoleAssignmentsOperations /// /// Thrown when a required parameter is null /// - Task> AddByInvoiceSectionNameWithHttpMessagesAsync(string billingAccountName, string invoiceSectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> AddByInvoiceSectionWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, BillingRoleAssignmentPayload parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Get the role assignments on the Billing Profile /// @@ -303,7 +321,7 @@ public partial interface IBillingRoleAssignmentsOperations /// /// Thrown when a required parameter is null /// - Task> ListByBillingProfileNameWithHttpMessagesAsync(string billingAccountName, string billingProfileName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> ListByBillingProfileWithHttpMessagesAsync(string billingAccountName, string billingProfileName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// The operation to add a role assignment to a billing profile. /// @@ -313,6 +331,9 @@ public partial interface IBillingRoleAssignmentsOperations /// /// Billing Profile Id. /// + /// + /// Parameters supplied to add a role assignment. + /// /// /// The headers that will be added to request. /// @@ -328,6 +349,6 @@ public partial interface IBillingRoleAssignmentsOperations /// /// Thrown when a required parameter is null /// - Task> AddByBillingProfileNameWithHttpMessagesAsync(string billingAccountName, string billingProfileName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> AddByBillingProfileWithHttpMessagesAsync(string billingAccountName, string billingProfileName, BillingRoleAssignmentPayload parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IBillingRoleDefinitionsOperations.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IBillingRoleDefinitionsOperations.cs index 332b767d96dd..6de9603a2bcb 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IBillingRoleDefinitionsOperations.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IBillingRoleDefinitionsOperations.cs @@ -47,13 +47,16 @@ public partial interface IBillingRoleDefinitionsOperations /// /// Thrown when a required parameter is null /// - Task> GetByBillingAccountNameWithHttpMessagesAsync(string billingAccountName, string billingRoleDefinitionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetByBillingAccountWithHttpMessagesAsync(string billingAccountName, string billingRoleDefinitionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets the role definition for a role /// /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// @@ -75,7 +78,7 @@ public partial interface IBillingRoleDefinitionsOperations /// /// Thrown when a required parameter is null /// - Task> GetByInvoiceSectionNameWithHttpMessagesAsync(string billingAccountName, string invoiceSectionName, string billingRoleDefinitionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetByInvoiceSectionWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, string billingRoleDefinitionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets the role definition for a role /// @@ -103,7 +106,7 @@ public partial interface IBillingRoleDefinitionsOperations /// /// Thrown when a required parameter is null /// - Task> GetByBillingProfileNameWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string billingRoleDefinitionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetByBillingProfileWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string billingRoleDefinitionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Lists the role definition for a billing account /// @@ -125,13 +128,16 @@ public partial interface IBillingRoleDefinitionsOperations /// /// Thrown when a required parameter is null /// - Task> ListByBillingAccountNameWithHttpMessagesAsync(string billingAccountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> ListByBillingAccountWithHttpMessagesAsync(string billingAccountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Lists the role definition for an invoice Section /// /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// @@ -150,7 +156,7 @@ public partial interface IBillingRoleDefinitionsOperations /// /// Thrown when a required parameter is null /// - Task> ListByInvoiceSectionNameWithHttpMessagesAsync(string billingAccountName, string invoiceSectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> ListByInvoiceSectionWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Lists the role definition for a Billing Profile /// @@ -175,6 +181,6 @@ public partial interface IBillingRoleDefinitionsOperations /// /// Thrown when a required parameter is null /// - Task> ListByBillingProfileNameWithHttpMessagesAsync(string billingAccountName, string billingProfileName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> ListByBillingProfileWithHttpMessagesAsync(string billingAccountName, string billingProfileName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IBillingSubscriptionsOperations.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IBillingSubscriptionsOperations.cs index ca05ab3286ca..6f0f5e80e8ac 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IBillingSubscriptionsOperations.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IBillingSubscriptionsOperations.cs @@ -24,12 +24,15 @@ namespace Microsoft.Azure.Management.Billing public partial interface IBillingSubscriptionsOperations { /// - /// Lists billing subscriptions by billing account name. + /// Lists billing subscription by customer id. /// /// /// /// billing Account Id. /// + /// + /// Customer name. + /// /// /// The headers that will be added to request. /// @@ -45,14 +48,66 @@ public partial interface IBillingSubscriptionsOperations /// /// Thrown when a required parameter is null /// - Task>> ListByBillingAccountNameWithHttpMessagesAsync(string billingAccountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByCustomerWithHttpMessagesAsync(string billingAccountName, string customerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Lists billing subscriptions by billing profile name. + /// Get a single billing subscription by id. /// /// /// /// billing Account Id. /// + /// + /// Customer name. + /// + /// + /// Billing Subscription Id. + /// + /// + /// 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> GetByCustomerWithHttpMessagesAsync(string billingAccountName, string customerName, string billingSubscriptionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists billing subscriptions by billing account name. + /// + /// + /// + /// billing Account Id. + /// + /// + /// 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, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists billing subscriptions by billing profile name. + /// + /// + /// + /// billing Account Id. + /// /// /// Billing Profile Id. /// @@ -71,14 +126,17 @@ public partial interface IBillingSubscriptionsOperations /// /// Thrown when a required parameter is null /// - Task> ListByBillingProfileNameWithHttpMessagesAsync(string billingAccountName, string billingProfileName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> ListByBillingProfileWithHttpMessagesAsync(string billingAccountName, string billingProfileName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Lists billing subscription by invoice section name. - /// + /// /// /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// @@ -97,14 +155,17 @@ public partial interface IBillingSubscriptionsOperations /// /// Thrown when a required parameter is null /// - Task> ListByInvoiceSectionNameWithHttpMessagesAsync(string billingAccountName, string invoiceSectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> ListByInvoiceSectionWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Get a single billing subscription by name. - /// + /// /// /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// @@ -126,7 +187,7 @@ public partial interface IBillingSubscriptionsOperations /// /// Thrown when a required parameter is null /// - Task> GetWithHttpMessagesAsync(string billingAccountName, string invoiceSectionName, string billingSubscriptionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, string billingSubscriptionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Transfers the subscription from one invoice section to another /// within a billing account. @@ -134,6 +195,45 @@ public partial interface IBillingSubscriptionsOperations /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// + /// + /// InvoiceSection Id. + /// + /// + /// Billing Subscription Id. + /// + /// + /// Request parameters supplied to the Transfer Billing Subscription + /// 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> TransferWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, string billingSubscriptionName, TransferBillingSubscriptionRequestProperties parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Validates the transfer of billing subscriptions across invoice + /// sections. + /// + /// + /// billing Account Id. + /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// @@ -158,7 +258,7 @@ public partial interface IBillingSubscriptionsOperations /// /// Thrown when a required parameter is null /// - Task> TransferWithHttpMessagesAsync(string billingAccountName, string invoiceSectionName, string billingSubscriptionName, TransferBillingSubscriptionRequestProperties parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> ValidateTransferWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, string billingSubscriptionName, TransferBillingSubscriptionRequestProperties parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Transfers the subscription from one invoice section to another /// within a billing account. @@ -166,6 +266,9 @@ public partial interface IBillingSubscriptionsOperations /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// @@ -173,7 +276,8 @@ public partial interface IBillingSubscriptionsOperations /// Billing Subscription Id. /// /// - /// Parameters supplied to the Transfer Billing Subscription operation. + /// Request parameters supplied to the Transfer Billing Subscription + /// operation. /// /// /// The headers that will be added to request. @@ -190,9 +294,9 @@ public partial interface IBillingSubscriptionsOperations /// /// Thrown when a required parameter is null /// - Task> BeginTransferWithHttpMessagesAsync(string billingAccountName, string invoiceSectionName, string billingSubscriptionName, TransferBillingSubscriptionRequestProperties parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> BeginTransferWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, string billingSubscriptionName, TransferBillingSubscriptionRequestProperties parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Lists billing subscriptions by billing account name. + /// Lists billing subscription by customer id. /// /// /// @@ -213,6 +317,29 @@ public partial interface IBillingSubscriptionsOperations /// /// Thrown when a required parameter is null /// - Task>> ListByBillingAccountNameNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByCustomerNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists billing subscriptions by billing account name. + /// + /// + /// + /// 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)); } } diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/ICustomersOperations.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/ICustomersOperations.cs new file mode 100644 index 000000000000..127391a15393 --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/ICustomersOperations.cs @@ -0,0 +1,168 @@ +// +// 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; + + /// + /// CustomersOperations operations. + /// + public partial interface ICustomersOperations + { + /// + /// Lists customers by billing profile which the current user can work + /// with on-behalf of a partner. + /// + /// + /// billing Account Id. + /// + /// + /// Billing Profile Id. + /// + /// + /// May be used to filter the list of customers. + /// + /// + /// Skiptoken is only used if a previous operation returned a partial + /// result. If a previous response contains a nextLink element, the + /// value of the nextLink element will include a skiptoken parameter + /// that specifies a starting point to use for subsequent calls. + /// + /// + /// 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 skiptoken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists customers which the current user can work with on-behalf of a + /// partner. + /// + /// + /// billing Account Id. + /// + /// + /// May be used to filter the list of customers. + /// + /// + /// Skiptoken is only used if a previous operation returned a partial + /// result. If a previous response contains a nextLink element, the + /// value of the nextLink element will include a skiptoken parameter + /// that specifies a starting point to use for subsequent calls. + /// + /// + /// 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 skiptoken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets a customer by its id. + /// + /// + /// billing Account Id. + /// + /// + /// Customer name. + /// + /// + /// May be used to expand enabledAzurePlans, resellers. + /// + /// + /// 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> GetWithHttpMessagesAsync(string billingAccountName, string customerName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists customers by billing profile which the current user can work + /// with on-behalf of a partner. + /// + /// + /// 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)); + /// + /// Lists customers which the current user can work with on-behalf of a + /// partner. + /// + /// + /// 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)); + } +} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IInvoiceSectionsOperations.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IInvoiceSectionsOperations.cs index bd865c95b006..6fe7878c3644 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IInvoiceSectionsOperations.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IInvoiceSectionsOperations.cs @@ -29,33 +29,8 @@ public partial interface IInvoiceSectionsOperations /// /// billing Account Id. /// - /// - /// May be used to expand the billingProfiles. - /// - /// - /// 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> ListByBillingAccountNameWithHttpMessagesAsync(string billingAccountName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// The operation to create a InvoiceSection. - /// - /// - /// billing Account Id. - /// - /// - /// Parameters supplied to the Create InvoiceSection operation. + /// + /// Billing Profile Id. /// /// /// The headers that will be added to request. @@ -72,10 +47,9 @@ public partial interface IInvoiceSectionsOperations /// /// Thrown when a required parameter is null /// - Task> CreateWithHttpMessagesAsync(string billingAccountName, InvoiceSectionProperties parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> ListByBillingProfileWithHttpMessagesAsync(string billingAccountName, string billingProfileName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Lists all invoice sections under a billing profile for a user which - /// he has access to. + /// Get the InvoiceSection by id. /// /// /// billing Account Id. @@ -83,31 +57,8 @@ public partial interface IInvoiceSectionsOperations /// /// Billing Profile Id. /// - /// - /// 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> ListByBillingProfileNameWithHttpMessagesAsync(string billingAccountName, string billingProfileName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Lists all invoiceSections with create subscription permission for a - /// user. - /// - /// - /// billing Account Id. - /// - /// - /// May be used to expand the billingProfiles. + /// + /// InvoiceSection Id. /// /// /// The headers that will be added to request. @@ -124,18 +75,21 @@ public partial interface IInvoiceSectionsOperations /// /// Thrown when a required parameter is null /// - Task> ListByCreateSubscriptionPermissionWithHttpMessagesAsync(string billingAccountName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Get the InvoiceSection by id. + /// The operation to create an invoice section. /// /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// - /// - /// May be used to expand the billingProfiles. + /// + /// Request parameters supplied to the Create InvoiceSection operation. /// /// /// The headers that will be added to request. @@ -152,18 +106,21 @@ public partial interface IInvoiceSectionsOperations /// /// Thrown when a required parameter is null /// - Task> GetWithHttpMessagesAsync(string billingAccountName, string invoiceSectionName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CreateWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, InvoiceSectionCreationRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// The operation to update a InvoiceSection. /// /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// /// - /// Parameters supplied to the Create InvoiceSection operation. + /// Request parameters supplied to the Create InvoiceSection operation. /// /// /// The headers that will be added to request. @@ -180,13 +137,16 @@ public partial interface IInvoiceSectionsOperations /// /// Thrown when a required parameter is null /// - Task> UpdateWithHttpMessagesAsync(string billingAccountName, string invoiceSectionName, InvoiceSection parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> UpdateWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, InvoiceSection parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Elevates the caller's access to match their billing profile access. /// /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// @@ -202,15 +162,21 @@ public partial interface IInvoiceSectionsOperations /// /// Thrown when a required parameter is null /// - Task ElevateToBillingProfileWithHttpMessagesAsync(string billingAccountName, string invoiceSectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task ElevateToBillingProfileWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The operation to create a InvoiceSection. + /// The operation to create an invoice section. /// /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// + /// + /// InvoiceSection Id. + /// /// - /// Parameters supplied to the Create InvoiceSection operation. + /// Request parameters supplied to the Create InvoiceSection operation. /// /// /// The headers that will be added to request. @@ -227,18 +193,21 @@ public partial interface IInvoiceSectionsOperations /// /// Thrown when a required parameter is null /// - Task> BeginCreateWithHttpMessagesAsync(string billingAccountName, InvoiceSectionProperties parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> BeginCreateWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, InvoiceSectionCreationRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// The operation to update a InvoiceSection. /// /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// /// - /// Parameters supplied to the Create InvoiceSection operation. + /// Request parameters supplied to the Create InvoiceSection operation. /// /// /// The headers that will be added to request. @@ -255,6 +224,6 @@ public partial interface IInvoiceSectionsOperations /// /// Thrown when a required parameter is null /// - Task> BeginUpdateWithHttpMessagesAsync(string billingAccountName, string invoiceSectionName, InvoiceSection parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> BeginUpdateWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, InvoiceSection parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } 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 20a9710d6e67..92881627e14e 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IInvoicesOperations.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IInvoicesOperations.cs @@ -50,7 +50,7 @@ public partial interface IInvoicesOperations /// /// Thrown when a required parameter is null /// - Task> ListByBillingAccountNameWithHttpMessagesAsync(string billingAccountName, string periodStartDate, string periodEndDate, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> ListByBillingAccountWithHttpMessagesAsync(string billingAccountName, string periodStartDate, string periodEndDate, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// List of invoices for a billing profile. /// @@ -109,6 +109,6 @@ public partial interface IInvoicesOperations /// /// Thrown when a required parameter is null /// - Task> GetWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/ILineOfCreditsOperations.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/ILineOfCreditsOperations.cs new file mode 100644 index 000000000000..ba1c6ac5edbf --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/ILineOfCreditsOperations.cs @@ -0,0 +1,90 @@ +// +// 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; + + /// + /// LineOfCreditsOperations operations. + /// + public partial interface ILineOfCreditsOperations + { + /// + /// Get the current line of credit. + /// + /// + /// 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> GetWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Increase the current line of credit. + /// + /// + /// Parameters supplied to the increase line of credit 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> UpdateWithHttpMessagesAsync(LineOfCredit parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Increase the current line of credit. + /// + /// + /// Parameters supplied to the increase line of credit 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> BeginUpdateWithHttpMessagesAsync(LineOfCredit parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IPartnerTransfersOperations.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IPartnerTransfersOperations.cs new file mode 100644 index 000000000000..12424f279f60 --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IPartnerTransfersOperations.cs @@ -0,0 +1,120 @@ +// +// 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; + + /// + /// PartnerTransfersOperations operations. + /// + public partial interface IPartnerTransfersOperations + { + /// + /// Initiates the request to transfer the legacy subscriptions or RIs. + /// + /// + /// billing Account Id. + /// + /// + /// Billing Profile Id. + /// + /// + /// Customer name. + /// + /// + /// Parameters supplied to initiate the transfer. + /// + /// + /// 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> InitiateWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string customerName, InitiateTransferRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the transfer details for given transfer Id. + /// + /// + /// billing Account Id. + /// + /// + /// Billing Profile Id. + /// + /// + /// Customer name. + /// + /// + /// Transfer Name. + /// + /// + /// 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> GetWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string customerName, string transferName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Cancels the transfer for given transfer Id. + /// + /// + /// billing Account Id. + /// + /// + /// Billing Profile Id. + /// + /// + /// Customer name. + /// + /// + /// Transfer Name. + /// + /// + /// 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> CancelWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string customerName, string transferName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IPartnerTransfersTransfersOperations.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IPartnerTransfersTransfersOperations.cs new file mode 100644 index 000000000000..257b82644cfd --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IPartnerTransfersTransfersOperations.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 +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// PartnerTransfersTransfersOperations operations. + /// + public partial interface IPartnerTransfersTransfersOperations + { + /// + /// Lists all transfer's details initiated from given invoice section. + /// + /// + /// billing Account Id. + /// + /// + /// Billing Profile Id. + /// + /// + /// Customer name. + /// + /// + /// 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>> ListWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string customerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists all transfer's details initiated from given invoice section. + /// + /// + /// 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>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IPaymentMethodsOperations.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IPaymentMethodsOperations.cs index 3436d0cc3003..ed7a123da510 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IPaymentMethodsOperations.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IPaymentMethodsOperations.cs @@ -25,7 +25,7 @@ public partial interface IPaymentMethodsOperations { /// /// Lists the Payment Methods by billing account Id. - /// + /// /// /// /// billing Account Id. @@ -45,10 +45,10 @@ public partial interface IPaymentMethodsOperations /// /// Thrown when a required parameter is null /// - Task>> ListByBillingAccountNameWithHttpMessagesAsync(string billingAccountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByBillingAccountWithHttpMessagesAsync(string billingAccountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Lists the Payment Methods by billing profile Id. - /// + /// /// /// /// billing Account Id. @@ -71,10 +71,10 @@ public partial interface IPaymentMethodsOperations /// /// Thrown when a required parameter is null /// - Task>> ListByBillingProfileNameWithHttpMessagesAsync(string billingAccountName, string billingProfileName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByBillingProfileWithHttpMessagesAsync(string billingAccountName, string billingProfileName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Lists the Payment Methods by billing account Id. - /// + /// /// /// /// The NextLink from the previous successful call to List operation. @@ -94,10 +94,10 @@ public partial interface IPaymentMethodsOperations /// /// Thrown when a required parameter is null /// - Task>> ListByBillingAccountNameNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByBillingAccountNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Lists the Payment Methods by billing profile Id. - /// + /// /// /// /// The NextLink from the previous successful call to List operation. @@ -117,6 +117,6 @@ public partial interface IPaymentMethodsOperations /// /// Thrown when a required parameter is null /// - Task>> ListByBillingProfileNameNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByBillingProfileNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IPoliciesOperations.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IPoliciesOperations.cs index 093508b3467a..ce73bd4c9303 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IPoliciesOperations.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IPoliciesOperations.cs @@ -26,7 +26,7 @@ public partial interface IPoliciesOperations /// /// The policy for a given billing account name and billing profile /// name. - /// + /// /// /// /// billing Account Id. @@ -49,7 +49,7 @@ public partial interface IPoliciesOperations /// /// Thrown when a required parameter is null /// - Task> GetByBillingProfileNameWithHttpMessagesAsync(string billingAccountName, string billingProfileName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetByBillingProfileWithHttpMessagesAsync(string billingAccountName, string billingProfileName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// The operation to update a policy. /// diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IPriceSheetOperations.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IPriceSheetOperations.cs index 4dbbea4a1d6f..d86f10588980 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IPriceSheetOperations.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IPriceSheetOperations.cs @@ -27,10 +27,38 @@ public partial interface IPriceSheetOperations /// Download price sheet for an invoice. /// /// - /// Azure Billing Account ID. + /// billing Account Id. + /// + /// + /// Billing Profile Id. /// /// - /// The name of an invoice resource. + /// Invoice Id. + /// + /// + /// 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> DownloadWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Download price sheet for a billing profile. + /// + /// + /// billing Account Id. + /// + /// + /// Billing Profile Id. /// /// /// The headers that will be added to request. @@ -47,15 +75,43 @@ public partial interface IPriceSheetOperations /// /// Thrown when a required parameter is null /// - Task> DownloadWithHttpMessagesAsync(string billingAccountName, string invoiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> DownloadByBillingProfileWithHttpMessagesAsync(string billingAccountName, string billingProfileName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Download price sheet for an invoice. /// /// - /// Azure Billing Account ID. + /// billing Account Id. + /// + /// + /// Billing Profile Id. /// /// - /// The name of an invoice resource. + /// Invoice Id. + /// + /// + /// 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> BeginDownloadWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Download price sheet for a billing profile. + /// + /// + /// billing Account Id. + /// + /// + /// Billing Profile Id. /// /// /// The headers that will be added to request. @@ -72,6 +128,6 @@ public partial interface IPriceSheetOperations /// /// Thrown when a required parameter is null /// - Task> BeginDownloadWithHttpMessagesAsync(string billingAccountName, string invoiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> BeginDownloadByBillingProfileWithHttpMessagesAsync(string billingAccountName, string billingProfileName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IProductsOperations.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IProductsOperations.cs index 772e45896fea..02c1a7764872 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IProductsOperations.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IProductsOperations.cs @@ -23,9 +23,70 @@ namespace Microsoft.Azure.Management.Billing /// public partial interface IProductsOperations { + /// + /// Lists products by customer id. + /// + /// + /// + /// billing Account Id. + /// + /// + /// Customer name. + /// + /// + /// May be used to filter by product type. The filter supports 'eq', + /// 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support + /// 'ne', 'or', or 'not'. Tag filter is a key value pair string where + /// key and value is separated by a colon (:). + /// + /// + /// 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> ListByCustomerWithHttpMessagesAsync(string billingAccountName, string customerName, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Get a customer's product by name. + /// + /// + /// + /// billing Account Id. + /// + /// + /// Customer name. + /// + /// + /// Invoice Id. + /// + /// + /// 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> GetByCustomerWithHttpMessagesAsync(string billingAccountName, string customerName, string productName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Lists products by billing account name. - /// + /// /// /// /// billing Account Id. @@ -51,14 +112,17 @@ public partial interface IProductsOperations /// /// Thrown when a required parameter is null /// - Task>> ListByBillingAccountNameWithHttpMessagesAsync(string billingAccountName, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByBillingAccountWithHttpMessagesAsync(string billingAccountName, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Lists products by invoice section name. - /// + /// /// /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// @@ -83,14 +147,17 @@ public partial interface IProductsOperations /// /// Thrown when a required parameter is null /// - Task> ListByInvoiceSectionNameWithHttpMessagesAsync(string billingAccountName, string invoiceSectionName, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> ListByInvoiceSectionWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Get a single product by name. - /// + /// /// /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// @@ -112,13 +179,16 @@ public partial interface IProductsOperations /// /// Thrown when a required parameter is null /// - Task> GetWithHttpMessagesAsync(string billingAccountName, string invoiceSectionName, string productName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, string productName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// The operation to transfer a Product to another invoice section. /// /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// @@ -143,7 +213,41 @@ public partial interface IProductsOperations /// /// Thrown when a required parameter is null /// - Task> TransferWithHttpMessagesAsync(string billingAccountName, string invoiceSectionName, string productName, TransferProductRequestProperties parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> TransferWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, string productName, TransferProductRequestProperties parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Validates the transfer of products across invoice sections. + /// + /// + /// billing Account Id. + /// + /// + /// Billing Profile Id. + /// + /// + /// InvoiceSection Id. + /// + /// + /// Invoice Id. + /// + /// + /// Parameters supplied to the Transfer Products 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> ValidateTransferWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, string productName, TransferProductRequestProperties parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Cancel auto renew for product by product id and billing account /// name @@ -172,7 +276,7 @@ public partial interface IProductsOperations /// /// Thrown when a required parameter is null /// - Task> UpdateAutoRenewByBillingAccountNameWithHttpMessagesAsync(string billingAccountName, string productName, UpdateAutoRenewRequest body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> UpdateAutoRenewByBillingAccountWithHttpMessagesAsync(string billingAccountName, string productName, UpdateAutoRenewRequest body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Cancel auto renew for product by product id and invoice section /// name @@ -180,6 +284,9 @@ public partial interface IProductsOperations /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// @@ -204,10 +311,10 @@ public partial interface IProductsOperations /// /// Thrown when a required parameter is null /// - Task> UpdateAutoRenewByInvoiceSectionNameWithHttpMessagesAsync(string billingAccountName, string invoiceSectionName, string productName, UpdateAutoRenewRequest body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> UpdateAutoRenewByInvoiceSectionWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, string productName, UpdateAutoRenewRequest body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Lists products by billing account name. - /// + /// /// /// /// The NextLink from the previous successful call to List operation. @@ -227,6 +334,6 @@ public partial interface IProductsOperations /// /// Thrown when a required parameter is null /// - Task>> ListByBillingAccountNameNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByBillingAccountNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IRecipientTransfersOperations.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IRecipientTransfersOperations.cs index bf6c68b38fd2..814c7e69e1e6 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IRecipientTransfersOperations.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IRecipientTransfersOperations.cs @@ -29,8 +29,8 @@ public partial interface IRecipientTransfersOperations /// /// Transfer Name. /// - /// - /// Accept transfer parameters. + /// + /// Parameters supplied to accept the transfer. /// /// /// The headers that will be added to request. @@ -47,7 +47,33 @@ public partial interface IRecipientTransfersOperations /// /// Thrown when a required parameter is null /// - Task> AcceptWithHttpMessagesAsync(string transferName, AcceptTransferRequest body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> AcceptWithHttpMessagesAsync(string transferName, AcceptTransferRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Validates if the products can be transferred in the context of the + /// given transfer name. + /// + /// + /// Transfer Name. + /// + /// + /// Parameters supplied to validate the transfer. + /// + /// + /// 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> ValidateWithHttpMessagesAsync(string transferName, AcceptTransferRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Declines the transfer with given transfer Id. /// diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/ITransactionsOperations.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/ITransactionsOperations.cs index c4c94779273c..6d4fe16f1332 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/ITransactionsOperations.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/ITransactionsOperations.cs @@ -23,10 +23,49 @@ namespace Microsoft.Azure.Management.Billing /// public partial interface ITransactionsOperations { + /// + /// Lists the transactions by customer id for given start date and end + /// date. + /// + /// + /// + /// billing Account Id. + /// + /// + /// Customer name. + /// + /// + /// Start date + /// + /// + /// End date + /// + /// + /// May be used to filter by transaction kind. The filter supports + /// 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently + /// support 'ne', 'or', or 'not'. Tag filter is a key value pair string + /// where key and value is separated by a colon (:). + /// + /// + /// 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>> ListByCustomerWithHttpMessagesAsync(string billingAccountName, string customerName, string startDate, string endDate, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Lists the transactions by billing account name for given start and /// end date. - /// + /// /// /// /// billing Account Id. @@ -58,11 +97,11 @@ public partial interface ITransactionsOperations /// /// Thrown when a required parameter is null /// - Task>> ListByBillingAccountNameWithHttpMessagesAsync(string billingAccountName, string startDate, string endDate, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByBillingAccountWithHttpMessagesAsync(string billingAccountName, string startDate, string endDate, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Lists the transactions by billing profile name for given start date /// and end date. - /// + /// /// /// /// billing Account Id. @@ -97,15 +136,18 @@ public partial interface ITransactionsOperations /// /// Thrown when a required parameter is null /// - Task> ListByBillingProfileNameWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string startDate, string endDate, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> ListByBillingProfileWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string startDate, string endDate, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Lists the transactions by invoice section name for given start date /// and end date. - /// + /// /// /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// @@ -136,11 +178,70 @@ public partial interface ITransactionsOperations /// /// Thrown when a required parameter is null /// - Task> ListByInvoiceSectionNameWithHttpMessagesAsync(string billingAccountName, string invoiceSectionName, string startDate, string endDate, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> ListByInvoiceSectionWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, string startDate, string endDate, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Get the transaction. + /// + /// + /// + /// billing Account Id. + /// + /// + /// Billing Profile Id. + /// + /// + /// Transaction name. + /// + /// + /// Start date + /// + /// + /// End date + /// + /// + /// 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> GetWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string transactionName, string startDate, string endDate, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists the transactions by customer id for given start date and end + /// date. + /// + /// + /// + /// 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>> ListByCustomerNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Lists the transactions by billing account name for given start and /// end date. - /// + /// /// /// /// The NextLink from the previous successful call to List operation. @@ -160,6 +261,6 @@ public partial interface ITransactionsOperations /// /// Thrown when a required parameter is null /// - Task>> ListByBillingAccountNameNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByBillingAccountNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/ITransfersOperations.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/ITransfersOperations.cs index 32cf8b3bff6b..181fdf9757ef 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/ITransfersOperations.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/ITransfersOperations.cs @@ -29,11 +29,14 @@ public partial interface ITransfersOperations /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// - /// - /// Initiate transfer parameters. + /// + /// Parameters supplied to initiate the transfer. /// /// /// The headers that will be added to request. @@ -50,13 +53,16 @@ public partial interface ITransfersOperations /// /// Thrown when a required parameter is null /// - Task> InitiateWithHttpMessagesAsync(string billingAccountName, string invoiceSectionName, InitiateTransferRequest body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> InitiateWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, InitiateTransferRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets the transfer details for given transfer Id. /// /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// @@ -78,13 +84,16 @@ public partial interface ITransfersOperations /// /// Thrown when a required parameter is null /// - Task> GetWithHttpMessagesAsync(string billingAccountName, string invoiceSectionName, string transferName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, string transferName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Cancels the transfer for given transfer Id. /// /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// @@ -106,13 +115,16 @@ public partial interface ITransfersOperations /// /// Thrown when a required parameter is null /// - Task> CancelWithHttpMessagesAsync(string billingAccountName, string invoiceSectionName, string transferName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CancelWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, string transferName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Lists all transfer's details initiated from given invoice section. /// /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// @@ -131,7 +143,7 @@ public partial interface ITransfersOperations /// /// Thrown when a required parameter is null /// - Task>> ListWithHttpMessagesAsync(string billingAccountName, string invoiceSectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Lists all transfer's details initiated from given invoice section. /// diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/InvoiceSectionsOperations.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/InvoiceSectionsOperations.cs index 578c38188985..4812e4c4443d 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/InvoiceSectionsOperations.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/InvoiceSectionsOperations.cs @@ -56,214 +56,6 @@ internal InvoiceSectionsOperations(BillingManagementClient client) /// /// billing Account Id. /// - /// - /// May be used to expand the billingProfiles. - /// - /// - /// 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> ListByBillingAccountNameWithHttpMessagesAsync(string billingAccountName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (billingAccountName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "billingAccountName"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("billingAccountName", billingAccountName); - tracingParameters.Add("expand", expand); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByBillingAccountName", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections").ToString(); - _url = _url.Replace("{billingAccountName}", System.Uri.EscapeDataString(billingAccountName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (expand != null) - { - _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand))); - } - 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; - } - - /// - /// The operation to create a InvoiceSection. - /// - /// - /// billing Account Id. - /// - /// - /// Parameters supplied to the Create InvoiceSection operation. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> CreateWithHttpMessagesAsync(string billingAccountName, InvoiceSectionProperties parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginCreateWithHttpMessagesAsync(billingAccountName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Lists all invoice sections under a billing profile for a user which he has - /// access to. - /// - /// - /// billing Account Id. - /// /// /// Billing Profile Id. /// @@ -288,7 +80,7 @@ internal InvoiceSectionsOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListByBillingProfileNameWithHttpMessagesAsync(string billingAccountName, string billingProfileName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListByBillingProfileWithHttpMessagesAsync(string billingAccountName, string billingProfileName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.ApiVersion == null) { @@ -312,7 +104,7 @@ internal InvoiceSectionsOperations(BillingManagementClient client) tracingParameters.Add("billingAccountName", billingAccountName); tracingParameters.Add("billingProfileName", billingProfileName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByBillingProfileName", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListByBillingProfile", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -445,13 +237,16 @@ internal InvoiceSectionsOperations(BillingManagementClient client) } /// - /// Lists all invoiceSections with create subscription permission for a user. + /// Get the InvoiceSection by id. /// /// /// billing Account Id. /// - /// - /// May be used to expand the billingProfiles. + /// + /// Billing Profile Id. + /// + /// + /// InvoiceSection Id. /// /// /// Headers that will be added to request. @@ -474,7 +269,7 @@ internal InvoiceSectionsOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListByCreateSubscriptionPermissionWithHttpMessagesAsync(string billingAccountName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.ApiVersion == null) { @@ -484,6 +279,14 @@ internal InvoiceSectionsOperations(BillingManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "billingAccountName"); } + if (billingProfileName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "billingProfileName"); + } + if (invoiceSectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "invoiceSectionName"); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -492,23 +295,22 @@ internal InvoiceSectionsOperations(BillingManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("billingAccountName", billingAccountName); - tracingParameters.Add("expand", expand); + tracingParameters.Add("billingProfileName", billingProfileName); + tracingParameters.Add("invoiceSectionName", invoiceSectionName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByCreateSubscriptionPermission", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/listInvoiceSectionsWithCreateSubscriptionPermission").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}").ToString(); _url = _url.Replace("{billingAccountName}", System.Uri.EscapeDataString(billingAccountName)); + _url = _url.Replace("{billingProfileName}", System.Uri.EscapeDataString(billingProfileName)); + _url = _url.Replace("{invoiceSectionName}", System.Uri.EscapeDataString(invoiceSectionName)); List _queryParameters = new List(); if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } - if (expand != null) - { - _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand))); - } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); @@ -597,7 +399,7 @@ internal InvoiceSectionsOperations(BillingManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -610,7 +412,7 @@ internal InvoiceSectionsOperations(BillingManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -630,197 +432,31 @@ internal InvoiceSectionsOperations(BillingManagementClient client) } /// - /// Get the InvoiceSection by id. + /// The operation to create an invoice section. /// /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// - /// - /// May be used to expand the billingProfiles. + /// + /// Request parameters supplied to the Create InvoiceSection operation. /// /// - /// Headers that will be added to request. + /// 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 - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task> GetWithHttpMessagesAsync(string billingAccountName, string invoiceSectionName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, InvoiceSectionCreationRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (billingAccountName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "billingAccountName"); - } - if (invoiceSectionName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "invoiceSectionName"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("billingAccountName", billingAccountName); - tracingParameters.Add("invoiceSectionName", invoiceSectionName); - tracingParameters.Add("expand", expand); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}").ToString(); - _url = _url.Replace("{billingAccountName}", System.Uri.EscapeDataString(billingAccountName)); - _url = _url.Replace("{invoiceSectionName}", System.Uri.EscapeDataString(invoiceSectionName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (expand != null) - { - _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand))); - } - 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; + AzureOperationResponse _response = await BeginCreateWithHttpMessagesAsync(billingAccountName, billingProfileName, invoiceSectionName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -829,11 +465,14 @@ internal InvoiceSectionsOperations(BillingManagementClient client) /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// /// - /// Parameters supplied to the Create InvoiceSection operation. + /// Request parameters supplied to the Create InvoiceSection operation. /// /// /// The headers that will be added to request. @@ -841,10 +480,10 @@ internal InvoiceSectionsOperations(BillingManagementClient client) /// /// The cancellation token. /// - public async Task> UpdateWithHttpMessagesAsync(string billingAccountName, string invoiceSectionName, InvoiceSection parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, InvoiceSection parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { // Send Request - AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(billingAccountName, invoiceSectionName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(billingAccountName, billingProfileName, invoiceSectionName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } @@ -854,6 +493,9 @@ internal InvoiceSectionsOperations(BillingManagementClient client) /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// @@ -875,12 +517,16 @@ internal InvoiceSectionsOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task ElevateToBillingProfileWithHttpMessagesAsync(string billingAccountName, string invoiceSectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task ElevateToBillingProfileWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, 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"); + } if (invoiceSectionName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "invoiceSectionName"); @@ -893,14 +539,16 @@ internal InvoiceSectionsOperations(BillingManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("billingAccountName", billingAccountName); + tracingParameters.Add("billingProfileName", billingProfileName); tracingParameters.Add("invoiceSectionName", invoiceSectionName); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ElevateToBillingProfile", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/elevate").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/elevate").ToString(); _url = _url.Replace("{billingAccountName}", System.Uri.EscapeDataString(billingAccountName)); + _url = _url.Replace("{billingProfileName}", System.Uri.EscapeDataString(billingProfileName)); _url = _url.Replace("{invoiceSectionName}", System.Uri.EscapeDataString(invoiceSectionName)); List _queryParameters = new List(); if (_queryParameters.Count > 0) @@ -1006,13 +654,19 @@ internal InvoiceSectionsOperations(BillingManagementClient client) } /// - /// The operation to create a InvoiceSection. + /// The operation to create an invoice section. /// /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// + /// + /// InvoiceSection Id. + /// /// - /// Parameters supplied to the Create InvoiceSection operation. + /// Request parameters supplied to the Create InvoiceSection operation. /// /// /// Headers that will be added to request. @@ -1035,7 +689,7 @@ internal InvoiceSectionsOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateWithHttpMessagesAsync(string billingAccountName, InvoiceSectionProperties parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginCreateWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, InvoiceSectionCreationRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.ApiVersion == null) { @@ -1045,6 +699,14 @@ internal InvoiceSectionsOperations(BillingManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "billingAccountName"); } + if (billingProfileName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "billingProfileName"); + } + if (invoiceSectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "invoiceSectionName"); + } if (parameters == null) { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); @@ -1057,14 +719,18 @@ internal InvoiceSectionsOperations(BillingManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("billingAccountName", billingAccountName); + tracingParameters.Add("billingProfileName", billingProfileName); + tracingParameters.Add("invoiceSectionName", invoiceSectionName); tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginCreate", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}").ToString(); _url = _url.Replace("{billingAccountName}", System.Uri.EscapeDataString(billingAccountName)); + _url = _url.Replace("{billingProfileName}", System.Uri.EscapeDataString(billingProfileName)); + _url = _url.Replace("{invoiceSectionName}", System.Uri.EscapeDataString(invoiceSectionName)); List _queryParameters = new List(); if (Client.ApiVersion != null) { @@ -1077,7 +743,7 @@ internal InvoiceSectionsOperations(BillingManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1215,11 +881,14 @@ internal InvoiceSectionsOperations(BillingManagementClient client) /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// /// - /// Parameters supplied to the Create InvoiceSection operation. + /// Request parameters supplied to the Create InvoiceSection operation. /// /// /// Headers that will be added to request. @@ -1242,7 +911,7 @@ internal InvoiceSectionsOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginUpdateWithHttpMessagesAsync(string billingAccountName, string invoiceSectionName, InvoiceSection parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginUpdateWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, InvoiceSection parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.ApiVersion == null) { @@ -1252,6 +921,10 @@ internal InvoiceSectionsOperations(BillingManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "billingAccountName"); } + if (billingProfileName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "billingProfileName"); + } if (invoiceSectionName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "invoiceSectionName"); @@ -1268,6 +941,7 @@ internal InvoiceSectionsOperations(BillingManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("billingAccountName", billingAccountName); + tracingParameters.Add("billingProfileName", billingProfileName); tracingParameters.Add("invoiceSectionName", invoiceSectionName); tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); @@ -1275,8 +949,9 @@ internal InvoiceSectionsOperations(BillingManagementClient client) } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}").ToString(); _url = _url.Replace("{billingAccountName}", System.Uri.EscapeDataString(billingAccountName)); + _url = _url.Replace("{billingProfileName}", System.Uri.EscapeDataString(billingProfileName)); _url = _url.Replace("{invoiceSectionName}", System.Uri.EscapeDataString(invoiceSectionName)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -1290,7 +965,7 @@ internal InvoiceSectionsOperations(BillingManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/InvoiceSectionsOperationsExtensions.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/InvoiceSectionsOperationsExtensions.cs index 1de0c2211554..4052f5850ba4 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/InvoiceSectionsOperationsExtensions.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/InvoiceSectionsOperationsExtensions.cs @@ -30,12 +30,12 @@ public static partial class InvoiceSectionsOperationsExtensions /// /// billing Account Id. /// - /// - /// May be used to expand the billingProfiles. + /// + /// Billing Profile Id. /// - public static InvoiceSectionListResult ListByBillingAccountName(this IInvoiceSectionsOperations operations, string billingAccountName, string expand = default(string)) + public static InvoiceSectionListResult ListByBillingProfile(this IInvoiceSectionsOperations operations, string billingAccountName, string billingProfileName) { - return operations.ListByBillingAccountNameAsync(billingAccountName, expand).GetAwaiter().GetResult(); + return operations.ListByBillingProfileAsync(billingAccountName, billingProfileName).GetAwaiter().GetResult(); } /// @@ -47,63 +47,22 @@ public static partial class InvoiceSectionsOperationsExtensions /// /// billing Account Id. /// - /// - /// May be used to expand the billingProfiles. - /// - /// - /// The cancellation token. - /// - public static async Task ListByBillingAccountNameAsync(this IInvoiceSectionsOperations operations, string billingAccountName, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByBillingAccountNameWithHttpMessagesAsync(billingAccountName, expand, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// The operation to create a InvoiceSection. - /// - /// - /// The operations group for this extension method. - /// - /// - /// billing Account Id. - /// - /// - /// Parameters supplied to the Create InvoiceSection operation. - /// - public static InvoiceSection Create(this IInvoiceSectionsOperations operations, string billingAccountName, InvoiceSectionProperties parameters) - { - return operations.CreateAsync(billingAccountName, parameters).GetAwaiter().GetResult(); - } - - /// - /// The operation to create a InvoiceSection. - /// - /// - /// The operations group for this extension method. - /// - /// - /// billing Account Id. - /// - /// - /// Parameters supplied to the Create InvoiceSection operation. + /// + /// Billing Profile Id. /// /// /// The cancellation token. /// - public static async Task CreateAsync(this IInvoiceSectionsOperations operations, string billingAccountName, InvoiceSectionProperties parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task ListByBillingProfileAsync(this IInvoiceSectionsOperations operations, string billingAccountName, string billingProfileName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.CreateWithHttpMessagesAsync(billingAccountName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListByBillingProfileWithHttpMessagesAsync(billingAccountName, billingProfileName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Lists all invoice sections under a billing profile for a user which he has - /// access to. + /// Get the InvoiceSection by id. /// /// /// The operations group for this extension method. @@ -114,14 +73,16 @@ public static InvoiceSection Create(this IInvoiceSectionsOperations operations, /// /// Billing Profile Id. /// - public static InvoiceSectionListResult ListByBillingProfileName(this IInvoiceSectionsOperations operations, string billingAccountName, string billingProfileName) + /// + /// InvoiceSection Id. + /// + public static InvoiceSection Get(this IInvoiceSectionsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName) { - return operations.ListByBillingProfileNameAsync(billingAccountName, billingProfileName).GetAwaiter().GetResult(); + return operations.GetAsync(billingAccountName, billingProfileName, invoiceSectionName).GetAwaiter().GetResult(); } /// - /// Lists all invoice sections under a billing profile for a user which he has - /// access to. + /// Get the InvoiceSection by id. /// /// /// The operations group for this extension method. @@ -132,59 +93,22 @@ public static InvoiceSectionListResult ListByBillingProfileName(this IInvoiceSec /// /// Billing Profile Id. /// - /// - /// The cancellation token. - /// - public static async Task ListByBillingProfileNameAsync(this IInvoiceSectionsOperations operations, string billingAccountName, string billingProfileName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByBillingProfileNameWithHttpMessagesAsync(billingAccountName, billingProfileName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Lists all invoiceSections with create subscription permission for a user. - /// - /// - /// The operations group for this extension method. - /// - /// - /// billing Account Id. - /// - /// - /// May be used to expand the billingProfiles. - /// - public static InvoiceSectionListResult ListByCreateSubscriptionPermission(this IInvoiceSectionsOperations operations, string billingAccountName, string expand = default(string)) - { - return operations.ListByCreateSubscriptionPermissionAsync(billingAccountName, expand).GetAwaiter().GetResult(); - } - - /// - /// Lists all invoiceSections with create subscription permission for a user. - /// - /// - /// The operations group for this extension method. - /// - /// - /// billing Account Id. - /// - /// - /// May be used to expand the billingProfiles. + /// + /// InvoiceSection Id. /// /// /// The cancellation token. /// - public static async Task ListByCreateSubscriptionPermissionAsync(this IInvoiceSectionsOperations operations, string billingAccountName, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetAsync(this IInvoiceSectionsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListByCreateSubscriptionPermissionWithHttpMessagesAsync(billingAccountName, expand, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetWithHttpMessagesAsync(billingAccountName, billingProfileName, invoiceSectionName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Get the InvoiceSection by id. + /// The operation to create an invoice section. /// /// /// The operations group for this extension method. @@ -192,19 +116,22 @@ public static InvoiceSectionListResult ListByBillingProfileName(this IInvoiceSec /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// - /// - /// May be used to expand the billingProfiles. + /// + /// Request parameters supplied to the Create InvoiceSection operation. /// - public static InvoiceSection Get(this IInvoiceSectionsOperations operations, string billingAccountName, string invoiceSectionName, string expand = default(string)) + public static InvoiceSection Create(this IInvoiceSectionsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, InvoiceSectionCreationRequest parameters) { - return operations.GetAsync(billingAccountName, invoiceSectionName, expand).GetAwaiter().GetResult(); + return operations.CreateAsync(billingAccountName, billingProfileName, invoiceSectionName, parameters).GetAwaiter().GetResult(); } /// - /// Get the InvoiceSection by id. + /// The operation to create an invoice section. /// /// /// The operations group for this extension method. @@ -212,18 +139,21 @@ public static InvoiceSectionListResult ListByBillingProfileName(this IInvoiceSec /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// - /// - /// May be used to expand the billingProfiles. + /// + /// Request parameters supplied to the Create InvoiceSection operation. /// /// /// The cancellation token. /// - public static async Task GetAsync(this IInvoiceSectionsOperations operations, string billingAccountName, string invoiceSectionName, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CreateAsync(this IInvoiceSectionsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, InvoiceSectionCreationRequest parameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(billingAccountName, invoiceSectionName, expand, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CreateWithHttpMessagesAsync(billingAccountName, billingProfileName, invoiceSectionName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -238,15 +168,18 @@ public static InvoiceSectionListResult ListByBillingProfileName(this IInvoiceSec /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// /// - /// Parameters supplied to the Create InvoiceSection operation. + /// Request parameters supplied to the Create InvoiceSection operation. /// - public static InvoiceSection Update(this IInvoiceSectionsOperations operations, string billingAccountName, string invoiceSectionName, InvoiceSection parameters) + public static InvoiceSection Update(this IInvoiceSectionsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, InvoiceSection parameters) { - return operations.UpdateAsync(billingAccountName, invoiceSectionName, parameters).GetAwaiter().GetResult(); + return operations.UpdateAsync(billingAccountName, billingProfileName, invoiceSectionName, parameters).GetAwaiter().GetResult(); } /// @@ -258,18 +191,21 @@ public static InvoiceSection Update(this IInvoiceSectionsOperations operations, /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// /// - /// Parameters supplied to the Create InvoiceSection operation. + /// Request parameters supplied to the Create InvoiceSection operation. /// /// /// The cancellation token. /// - public static async Task UpdateAsync(this IInvoiceSectionsOperations operations, string billingAccountName, string invoiceSectionName, InvoiceSection parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task UpdateAsync(this IInvoiceSectionsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, InvoiceSection parameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.UpdateWithHttpMessagesAsync(billingAccountName, invoiceSectionName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.UpdateWithHttpMessagesAsync(billingAccountName, billingProfileName, invoiceSectionName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -284,12 +220,15 @@ public static InvoiceSection Update(this IInvoiceSectionsOperations operations, /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// - public static void ElevateToBillingProfile(this IInvoiceSectionsOperations operations, string billingAccountName, string invoiceSectionName) + public static void ElevateToBillingProfile(this IInvoiceSectionsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName) { - operations.ElevateToBillingProfileAsync(billingAccountName, invoiceSectionName).GetAwaiter().GetResult(); + operations.ElevateToBillingProfileAsync(billingAccountName, billingProfileName, invoiceSectionName).GetAwaiter().GetResult(); } /// @@ -301,19 +240,22 @@ public static void ElevateToBillingProfile(this IInvoiceSectionsOperations opera /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// /// /// The cancellation token. /// - public static async Task ElevateToBillingProfileAsync(this IInvoiceSectionsOperations operations, string billingAccountName, string invoiceSectionName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task ElevateToBillingProfileAsync(this IInvoiceSectionsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.ElevateToBillingProfileWithHttpMessagesAsync(billingAccountName, invoiceSectionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + (await operations.ElevateToBillingProfileWithHttpMessagesAsync(billingAccountName, billingProfileName, invoiceSectionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// - /// The operation to create a InvoiceSection. + /// The operation to create an invoice section. /// /// /// The operations group for this extension method. @@ -321,16 +263,22 @@ public static void ElevateToBillingProfile(this IInvoiceSectionsOperations opera /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// + /// + /// InvoiceSection Id. + /// /// - /// Parameters supplied to the Create InvoiceSection operation. + /// Request parameters supplied to the Create InvoiceSection operation. /// - public static InvoiceSection BeginCreate(this IInvoiceSectionsOperations operations, string billingAccountName, InvoiceSectionProperties parameters) + public static InvoiceSection BeginCreate(this IInvoiceSectionsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, InvoiceSectionCreationRequest parameters) { - return operations.BeginCreateAsync(billingAccountName, parameters).GetAwaiter().GetResult(); + return operations.BeginCreateAsync(billingAccountName, billingProfileName, invoiceSectionName, parameters).GetAwaiter().GetResult(); } /// - /// The operation to create a InvoiceSection. + /// The operation to create an invoice section. /// /// /// The operations group for this extension method. @@ -338,15 +286,21 @@ public static InvoiceSection BeginCreate(this IInvoiceSectionsOperations operati /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// + /// + /// InvoiceSection Id. + /// /// - /// Parameters supplied to the Create InvoiceSection operation. + /// Request parameters supplied to the Create InvoiceSection operation. /// /// /// The cancellation token. /// - public static async Task BeginCreateAsync(this IInvoiceSectionsOperations operations, string billingAccountName, InvoiceSectionProperties parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginCreateAsync(this IInvoiceSectionsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, InvoiceSectionCreationRequest parameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.BeginCreateWithHttpMessagesAsync(billingAccountName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginCreateWithHttpMessagesAsync(billingAccountName, billingProfileName, invoiceSectionName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -361,15 +315,18 @@ public static InvoiceSection BeginCreate(this IInvoiceSectionsOperations operati /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// /// - /// Parameters supplied to the Create InvoiceSection operation. + /// Request parameters supplied to the Create InvoiceSection operation. /// - public static InvoiceSection BeginUpdate(this IInvoiceSectionsOperations operations, string billingAccountName, string invoiceSectionName, InvoiceSection parameters) + public static InvoiceSection BeginUpdate(this IInvoiceSectionsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, InvoiceSection parameters) { - return operations.BeginUpdateAsync(billingAccountName, invoiceSectionName, parameters).GetAwaiter().GetResult(); + return operations.BeginUpdateAsync(billingAccountName, billingProfileName, invoiceSectionName, parameters).GetAwaiter().GetResult(); } /// @@ -381,18 +338,21 @@ public static InvoiceSection BeginUpdate(this IInvoiceSectionsOperations operati /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// /// - /// Parameters supplied to the Create InvoiceSection operation. + /// Request parameters supplied to the Create InvoiceSection operation. /// /// /// The cancellation token. /// - public static async Task BeginUpdateAsync(this IInvoiceSectionsOperations operations, string billingAccountName, string invoiceSectionName, InvoiceSection parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginUpdateAsync(this IInvoiceSectionsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, InvoiceSection parameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(billingAccountName, invoiceSectionName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(billingAccountName, billingProfileName, invoiceSectionName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } 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 67850201bfbf..4dd00b21b1b9 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/InvoicesOperations.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/InvoicesOperations.cs @@ -83,7 +83,7 @@ internal InvoicesOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListByBillingAccountNameWithHttpMessagesAsync(string billingAccountName, string periodStartDate, string periodEndDate, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListByBillingAccountWithHttpMessagesAsync(string billingAccountName, string periodStartDate, string periodEndDate, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.ApiVersion == null) { @@ -112,7 +112,7 @@ internal InvoicesOperations(BillingManagementClient client) tracingParameters.Add("periodStartDate", periodStartDate); tracingParameters.Add("periodEndDate", periodEndDate); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByBillingAccountName", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListByBillingAccount", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -494,7 +494,7 @@ internal InvoicesOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.ApiVersion == null) { @@ -624,7 +624,7 @@ internal InvoicesOperations(BillingManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -637,7 +637,7 @@ internal InvoicesOperations(BillingManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { 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 78ac2e59664b..550178ea1e1a 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/InvoicesOperationsExtensions.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/InvoicesOperationsExtensions.cs @@ -36,9 +36,9 @@ public static partial class InvoicesOperationsExtensions /// /// Invoice period end date. /// - public static InvoiceListResult ListByBillingAccountName(this IInvoicesOperations operations, string billingAccountName, string periodStartDate, string periodEndDate) + public static InvoiceListResult ListByBillingAccount(this IInvoicesOperations operations, string billingAccountName, string periodStartDate, string periodEndDate) { - return operations.ListByBillingAccountNameAsync(billingAccountName, periodStartDate, periodEndDate).GetAwaiter().GetResult(); + return operations.ListByBillingAccountAsync(billingAccountName, periodStartDate, periodEndDate).GetAwaiter().GetResult(); } /// @@ -59,9 +59,9 @@ public static InvoiceListResult ListByBillingAccountName(this IInvoicesOperation /// /// The cancellation token. /// - public static async Task ListByBillingAccountNameAsync(this IInvoicesOperations operations, string billingAccountName, string periodStartDate, string periodEndDate, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task ListByBillingAccountAsync(this IInvoicesOperations operations, string billingAccountName, string periodStartDate, string periodEndDate, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListByBillingAccountNameWithHttpMessagesAsync(billingAccountName, periodStartDate, periodEndDate, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListByBillingAccountWithHttpMessagesAsync(billingAccountName, periodStartDate, periodEndDate, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -134,7 +134,7 @@ public static InvoiceListResult ListByBillingProfile(this IInvoicesOperations op /// /// Invoice Id. /// - public static InvoiceSummary Get(this IInvoicesOperations operations, string billingAccountName, string billingProfileName, string invoiceName) + public static Invoice Get(this IInvoicesOperations operations, string billingAccountName, string billingProfileName, string invoiceName) { return operations.GetAsync(billingAccountName, billingProfileName, invoiceName).GetAwaiter().GetResult(); } @@ -157,7 +157,7 @@ public static InvoiceSummary Get(this IInvoicesOperations operations, string bil /// /// The cancellation token. /// - public static async Task GetAsync(this IInvoicesOperations operations, string billingAccountName, string billingProfileName, string invoiceName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetAsync(this IInvoicesOperations operations, string billingAccountName, string billingProfileName, string invoiceName, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.GetWithHttpMessagesAsync(billingAccountName, billingProfileName, invoiceName, null, cancellationToken).ConfigureAwait(false)) { diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/LineOfCreditsOperations.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/LineOfCreditsOperations.cs new file mode 100644 index 000000000000..68d32a7ccb16 --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/LineOfCreditsOperations.cs @@ -0,0 +1,446 @@ +// +// 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; + + /// + /// LineOfCreditsOperations operations. + /// + internal partial class LineOfCreditsOperations : IServiceOperations, ILineOfCreditsOperations + { + /// + /// Initializes a new instance of the LineOfCreditsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal LineOfCreditsOperations(BillingManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the BillingManagementClient + /// + public BillingManagementClient Client { get; private set; } + + /// + /// Get the current line of credit. + /// + /// + /// 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> GetWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Billing/billingAccounts/default/lineOfCredit/default").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.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("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; + } + + /// + /// Increase the current line of credit. + /// + /// + /// Parameters supplied to the increase line of credit operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> UpdateWithHttpMessagesAsync(LineOfCredit parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Increase the current line of credit. + /// + /// + /// Parameters supplied to the increase line of credit 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> BeginUpdateWithHttpMessagesAsync(LineOfCredit parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Billing/billingAccounts/default/lineOfCredit/default").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.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("PUT"); + _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(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, 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; + } + + } +} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/LineOfCreditsOperationsExtensions.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/LineOfCreditsOperationsExtensions.cs new file mode 100644 index 000000000000..748cf35fc8fa --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/LineOfCreditsOperationsExtensions.cs @@ -0,0 +1,121 @@ +// +// 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 LineOfCreditsOperations. + /// + public static partial class LineOfCreditsOperationsExtensions + { + /// + /// Get the current line of credit. + /// + /// + /// The operations group for this extension method. + /// + public static LineOfCredit Get(this ILineOfCreditsOperations operations) + { + return operations.GetAsync().GetAwaiter().GetResult(); + } + + /// + /// Get the current line of credit. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this ILineOfCreditsOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Increase the current line of credit. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Parameters supplied to the increase line of credit operation. + /// + public static LineOfCredit Update(this ILineOfCreditsOperations operations, LineOfCredit parameters) + { + return operations.UpdateAsync(parameters).GetAwaiter().GetResult(); + } + + /// + /// Increase the current line of credit. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Parameters supplied to the increase line of credit operation. + /// + /// + /// The cancellation token. + /// + public static async Task UpdateAsync(this ILineOfCreditsOperations operations, LineOfCredit parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Increase the current line of credit. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Parameters supplied to the increase line of credit operation. + /// + public static LineOfCredit BeginUpdate(this ILineOfCreditsOperations operations, LineOfCredit parameters) + { + return operations.BeginUpdateAsync(parameters).GetAwaiter().GetResult(); + } + + /// + /// Increase the current line of credit. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Parameters supplied to the increase line of credit operation. + /// + /// + /// The cancellation token. + /// + public static async Task BeginUpdateAsync(this ILineOfCreditsOperations operations, LineOfCredit parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Address.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/AddressDetails.cs similarity index 86% rename from sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Address.cs rename to sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/AddressDetails.cs index 1dc77e0f9a1a..82031e2a89f4 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Address.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/AddressDetails.cs @@ -16,18 +16,18 @@ namespace Microsoft.Azure.Management.Billing.Models /// /// Address details. /// - public partial class Address + public partial class AddressDetails { /// - /// Initializes a new instance of the Address class. + /// Initializes a new instance of the AddressDetails class. /// - public Address() + public AddressDetails() { CustomInit(); } /// - /// Initializes a new instance of the Address class. + /// Initializes a new instance of the AddressDetails class. /// /// First Name. /// Last Name. @@ -40,7 +40,7 @@ public Address() /// Country code uses ISO2, 2-digit /// format. /// Address Postal Code. - public Address(string firstName = default(string), string lastName = default(string), string companyName = default(string), string addressLine1 = default(string), string addressLine2 = default(string), string addressLine3 = default(string), string city = default(string), string region = default(string), string country = default(string), string postalCode = default(string)) + public AddressDetails(string firstName = default(string), string lastName = default(string), string companyName = default(string), string addressLine1 = default(string), string addressLine2 = default(string), string addressLine3 = default(string), string city = default(string), string region = default(string), string country = default(string), string postalCode = default(string)) { FirstName = firstName; LastName = lastName; diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/AddressValidationStatus.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/AddressValidationStatus.cs new file mode 100644 index 000000000000..41d215933e7e --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/AddressValidationStatus.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 AddressValidationStatus. + /// + public static class AddressValidationStatus + { + public const string Valid = "Valid"; + public const string Invalid = "Invalid"; + } +} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/AgreementType.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/AgreementType.cs new file mode 100644 index 000000000000..69fd15d0737a --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/AgreementType.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 AgreementType. + /// + public static class AgreementType + { + public const string MicrosoftCustomerAgreement = "MicrosoftCustomerAgreement"; + public const string EnterpriseAgreement = "EnterpriseAgreement"; + public const string MicrosoftOnlineServicesProgram = "MicrosoftOnlineServicesProgram"; + } +} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Amount.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Amount.cs index 49d2c7a5582b..c82d4c302b30 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Amount.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Amount.cs @@ -50,10 +50,10 @@ public Amount() public string Currency { get; private set; } /// - /// Gets amount value. + /// Gets or sets amount value. /// [JsonProperty(PropertyName = "value")] - public double? Value { get; private set; } + public double? Value { get; set; } } } diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/EnabledAzureSKUs.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/AzurePlan.cs similarity index 75% rename from sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/EnabledAzureSKUs.cs rename to sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/AzurePlan.cs index fae4b953ef60..0c6c4ae3a058 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/EnabledAzureSKUs.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/AzurePlan.cs @@ -14,24 +14,24 @@ namespace Microsoft.Azure.Management.Billing.Models using System.Linq; /// - /// Details about the enabled azure sku. + /// Details about the azure plan. /// - public partial class EnabledAzureSKUs + public partial class AzurePlan { /// - /// Initializes a new instance of the EnabledAzureSKUs class. + /// Initializes a new instance of the AzurePlan class. /// - public EnabledAzureSKUs() + public AzurePlan() { CustomInit(); } /// - /// Initializes a new instance of the EnabledAzureSKUs class. + /// Initializes a new instance of the AzurePlan class. /// /// The sku id. /// The sku description. - public EnabledAzureSKUs(string skuId = default(string), string skuDescription = default(string)) + public AzurePlan(string skuId = default(string), string skuDescription = default(string)) { SkuId = skuId; SkuDescription = skuDescription; @@ -44,10 +44,10 @@ public EnabledAzureSKUs() partial void CustomInit(); /// - /// Gets the sku id. + /// Gets or sets the sku id. /// [JsonProperty(PropertyName = "skuId")] - public string SkuId { get; private set; } + public string SkuId { get; set; } /// /// Gets the sku description. 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 8a12514385a0..b45f714a6d00 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 @@ -38,15 +38,13 @@ public BillingAccount() /// Resource name. /// Resource type. /// The billing account name. - /// The billing account Type. Possible values - /// include: 'Organization', 'Enrollment' /// The address associated with billing /// account. - /// Company Name. - /// Country Name. - /// The invoice sections associated to - /// the billing account. By default this is not populated, unless it's - /// specified in $expand. + /// The type of agreement. Possible values + /// include: 'MicrosoftCustomerAgreement', 'EnterpriseAgreement', + /// 'MicrosoftOnlineServicesProgram' + /// The type of customer. Possible values + /// include: 'Enterprise', 'Individual', 'Partner' /// The billing profiles associated to /// the billing account. By default this is not populated, unless it's /// specified in $expand. @@ -57,22 +55,19 @@ public BillingAccount() /// enrollment. /// The accounts associated to the /// enrollment. - /// Specifies whether the user has read - /// access on billing account. - public BillingAccount(string id = default(string), string name = default(string), string type = default(string), string displayName = default(string), string accountType = default(string), Address address = default(Address), string company = default(string), string country = default(string), IList invoiceSections = default(IList), IList billingProfiles = default(IList), Enrollment enrollmentDetails = default(Enrollment), IList departments = default(IList), IList enrollmentAccounts = default(IList), bool? hasReadAccess = default(bool?)) + /// Organization id. + public BillingAccount(string id = default(string), string name = default(string), string type = default(string), string displayName = default(string), AddressDetails address = default(AddressDetails), string agreementType = default(string), string customerType = default(string), IList billingProfiles = default(IList), Enrollment enrollmentDetails = default(Enrollment), IList departments = default(IList), IList enrollmentAccounts = default(IList), string organizationId = default(string)) : base(id, name, type) { DisplayName = displayName; - AccountType = accountType; Address = address; - Company = company; - Country = country; - InvoiceSections = invoiceSections; + AgreementType = agreementType; + CustomerType = customerType; BillingProfiles = billingProfiles; EnrollmentDetails = enrollmentDetails; Departments = departments; EnrollmentAccounts = enrollmentAccounts; - HasReadAccess = hasReadAccess; + OrganizationId = organizationId; CustomInit(); } @@ -87,38 +82,26 @@ public BillingAccount() [JsonProperty(PropertyName = "properties.displayName")] public string DisplayName { get; private set; } - /// - /// Gets the billing account Type. Possible values include: - /// 'Organization', 'Enrollment' - /// - [JsonProperty(PropertyName = "properties.accountType")] - public string AccountType { get; private set; } - /// /// Gets or sets the address associated with billing account. /// [JsonProperty(PropertyName = "properties.address")] - public Address Address { get; set; } + public AddressDetails Address { get; set; } /// - /// Gets company Name. + /// Gets the type of agreement. Possible values include: + /// 'MicrosoftCustomerAgreement', 'EnterpriseAgreement', + /// 'MicrosoftOnlineServicesProgram' /// - [JsonProperty(PropertyName = "properties.company")] - public string Company { get; private set; } + [JsonProperty(PropertyName = "properties.agreementType")] + public string AgreementType { get; private set; } /// - /// Gets country Name. - /// - [JsonProperty(PropertyName = "properties.country")] - public string Country { get; private set; } - - /// - /// Gets or sets the invoice sections associated to the billing - /// account. By default this is not populated, unless it's specified in - /// $expand. + /// Gets the type of customer. Possible values include: 'Enterprise', + /// 'Individual', 'Partner' /// - [JsonProperty(PropertyName = "properties.invoiceSections")] - public IList InvoiceSections { get; set; } + [JsonProperty(PropertyName = "properties.customerType")] + public string CustomerType { get; private set; } /// /// Gets or sets the billing profiles associated to the billing @@ -148,10 +131,10 @@ public BillingAccount() public IList EnrollmentAccounts { get; set; } /// - /// Gets specifies whether the user has read access on billing account. + /// Gets organization id. /// - [JsonProperty(PropertyName = "properties.hasReadAccess")] - public bool? HasReadAccess { get; private set; } + [JsonProperty(PropertyName = "properties.organizationId")] + public string OrganizationId { get; private set; } } } 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 new file mode 100644 index 000000000000..5caf62f1da02 --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingAccountUpdateRequest.cs @@ -0,0 +1,138 @@ +// +// 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 request properties of the billing account that can be updated. + /// + [Rest.Serialization.JsonTransformation] + public partial class BillingAccountUpdateRequest + { + /// + /// Initializes a new instance of the BillingAccountUpdateRequest + /// class. + /// + public BillingAccountUpdateRequest() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the BillingAccountUpdateRequest + /// class. + /// + /// The billing account name. + /// The address associated with billing + /// account. + /// The type of agreement. Possible values + /// include: 'MicrosoftCustomerAgreement', 'EnterpriseAgreement', + /// 'MicrosoftOnlineServicesProgram' + /// The type of customer. Possible values + /// include: 'Enterprise', 'Individual', 'Partner' + /// The billing profiles associated to + /// the billing account. By default this is not populated, unless it's + /// specified in $expand. + /// The details about the associated + /// legacy enrollment. By default this is not populated, unless it's + /// specified in $expand. + /// The departments associated to the + /// enrollment. + /// The accounts associated to the + /// enrollment. + /// Organization id. + public BillingAccountUpdateRequest(string displayName = default(string), AddressDetails address = default(AddressDetails), string agreementType = default(string), string customerType = default(string), IList billingProfiles = default(IList), Enrollment enrollmentDetails = default(Enrollment), IList departments = default(IList), IList enrollmentAccounts = default(IList), string organizationId = default(string)) + { + DisplayName = displayName; + Address = address; + AgreementType = agreementType; + CustomerType = customerType; + BillingProfiles = billingProfiles; + EnrollmentDetails = enrollmentDetails; + Departments = departments; + EnrollmentAccounts = enrollmentAccounts; + OrganizationId = organizationId; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the billing account name. + /// + [JsonProperty(PropertyName = "properties.displayName")] + public string DisplayName { get; private set; } + + /// + /// Gets or sets the address associated with billing account. + /// + [JsonProperty(PropertyName = "properties.address")] + public AddressDetails Address { get; set; } + + /// + /// Gets the type of agreement. Possible values include: + /// 'MicrosoftCustomerAgreement', 'EnterpriseAgreement', + /// 'MicrosoftOnlineServicesProgram' + /// + [JsonProperty(PropertyName = "properties.agreementType")] + public string AgreementType { get; private set; } + + /// + /// Gets the type of customer. Possible values include: 'Enterprise', + /// 'Individual', 'Partner' + /// + [JsonProperty(PropertyName = "properties.customerType")] + public string CustomerType { get; private set; } + + /// + /// Gets or sets the billing profiles associated to the billing + /// account. By default this is not populated, unless it's specified in + /// $expand. + /// + [JsonProperty(PropertyName = "properties.billingProfiles")] + public IList BillingProfiles { get; set; } + + /// + /// Gets the details about the associated legacy enrollment. By default + /// this is not populated, unless it's specified in $expand. + /// + [JsonProperty(PropertyName = "properties.enrollmentDetails")] + public Enrollment EnrollmentDetails { get; private set; } + + /// + /// Gets or sets the departments associated to the enrollment. + /// + [JsonProperty(PropertyName = "properties.departments")] + public IList Departments { get; set; } + + /// + /// Gets or sets the accounts associated to the enrollment. + /// + [JsonProperty(PropertyName = "properties.enrollmentAccounts")] + public IList EnrollmentAccounts { get; set; } + + /// + /// Gets organization id. + /// + [JsonProperty(PropertyName = "properties.organizationId")] + public string OrganizationId { get; private set; } + + } +} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingPermissionsListResult.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingPermissionsListResult.cs index 38424b54e002..a1408e2c7373 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingPermissionsListResult.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingPermissionsListResult.cs @@ -33,7 +33,7 @@ public BillingPermissionsListResult() /// Initializes a new instance of the BillingPermissionsListResult /// class. /// - /// The list OF billingPermissions a caller has on + /// The list of billingPermissions a caller has on /// a billing account. public BillingPermissionsListResult(IList value = default(IList)) { @@ -47,7 +47,7 @@ public BillingPermissionsListResult() partial void CustomInit(); /// - /// Gets the list OF billingPermissions a caller has on a billing + /// Gets the list of billingPermissions a caller has on a billing /// account. /// [JsonProperty(PropertyName = "value")] 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 04f9ea67f8c2..2dc671dc0b30 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 @@ -42,26 +42,23 @@ public BillingProfile() /// Billing address. /// If the billing profile is opted in /// to receive invoices via email. - /// Is OMS bootstrapped billing - /// profile. /// Invoice day. /// The currency associated with the billing /// profile. - /// Information about the - /// product. + /// Information about the enabled azure + /// plans. /// The invoice sections associated to /// the billing profile. - public BillingProfile(string id = default(string), string name = default(string), string type = default(string), string displayName = default(string), string poNumber = default(string), Address address = default(Address), bool? invoiceEmailOptIn = default(bool?), bool? isClassic = default(bool?), int? invoiceDay = default(int?), string currency = default(string), IList enabledAzureSKUs = default(IList), IList invoiceSections = default(IList)) + public BillingProfile(string id = default(string), string name = default(string), string type = default(string), string displayName = default(string), string poNumber = default(string), AddressDetails address = default(AddressDetails), bool? invoiceEmailOptIn = default(bool?), int? invoiceDay = default(int?), string currency = default(string), IList enabledAzurePlans = default(IList), IList invoiceSections = default(IList)) : base(id, name, type) { DisplayName = displayName; PoNumber = poNumber; Address = address; InvoiceEmailOptIn = invoiceEmailOptIn; - IsClassic = isClassic; InvoiceDay = invoiceDay; Currency = currency; - EnabledAzureSKUs = enabledAzureSKUs; + EnabledAzurePlans = enabledAzurePlans; InvoiceSections = invoiceSections; CustomInit(); } @@ -87,7 +84,7 @@ public BillingProfile() /// Gets or sets billing address. /// [JsonProperty(PropertyName = "properties.address")] - public Address Address { get; set; } + public AddressDetails Address { get; set; } /// /// Gets if the billing profile is opted in to receive invoices via @@ -96,12 +93,6 @@ public BillingProfile() [JsonProperty(PropertyName = "properties.invoiceEmailOptIn")] public bool? InvoiceEmailOptIn { get; private set; } - /// - /// Gets is OMS bootstrapped billing profile. - /// - [JsonProperty(PropertyName = "properties.isClassic")] - public bool? IsClassic { get; private set; } - /// /// Gets invoice day. /// @@ -115,10 +106,10 @@ public BillingProfile() public string Currency { get; private set; } /// - /// Gets or sets information about the product. + /// Gets or sets information about the enabled azure plans. /// - [JsonProperty(PropertyName = "properties.enabledAzureSKUs")] - public IList EnabledAzureSKUs { get; set; } + [JsonProperty(PropertyName = "properties.enabledAzurePlans")] + public IList EnabledAzurePlans { get; set; } /// /// Gets or sets the invoice sections associated to the billing diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingProfileCreationRequest.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingProfileCreationRequest.cs new file mode 100644 index 000000000000..3286aade2336 --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingProfileCreationRequest.cs @@ -0,0 +1,90 @@ +// +// 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 request parameters for creating a new billing profile. + /// + public partial class BillingProfileCreationRequest + { + /// + /// Initializes a new instance of the BillingProfileCreationRequest + /// class. + /// + public BillingProfileCreationRequest() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the BillingProfileCreationRequest + /// class. + /// + /// The billing profile name. + /// Purchase order number. + /// Billing address. + /// If the billing profile is opted in + /// to receive invoices via email. + /// Enabled azure plans for this + /// billing profile. + public BillingProfileCreationRequest(string displayName = default(string), string poNumber = default(string), AddressDetails address = default(AddressDetails), bool? invoiceEmailOptIn = default(bool?), IList enabledAzurePlans = default(IList)) + { + DisplayName = displayName; + PoNumber = poNumber; + Address = address; + InvoiceEmailOptIn = invoiceEmailOptIn; + EnabledAzurePlans = enabledAzurePlans; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the billing profile name. + /// + [JsonProperty(PropertyName = "displayName")] + public string DisplayName { get; set; } + + /// + /// Gets or sets purchase order number. + /// + [JsonProperty(PropertyName = "poNumber")] + public string PoNumber { get; set; } + + /// + /// Gets or sets billing address. + /// + [JsonProperty(PropertyName = "address")] + public AddressDetails Address { get; set; } + + /// + /// Gets or sets if the billing profile is opted in to receive invoices + /// via email. + /// + [JsonProperty(PropertyName = "invoiceEmailOptIn")] + public bool? InvoiceEmailOptIn { get; set; } + + /// + /// Gets or sets enabled azure plans for this billing profile. + /// + [JsonProperty(PropertyName = "enabledAzurePlans")] + public IList EnabledAzurePlans { get; set; } + + } +} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingProfilesCreateHeaders.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingProfilesCreateHeaders.cs new file mode 100644 index 000000000000..c5888737ec7d --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingProfilesCreateHeaders.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 Newtonsoft.Json; + using System.Linq; + + /// + /// Defines headers for Create operation. + /// + public partial class BillingProfilesCreateHeaders + { + /// + /// Initializes a new instance of the BillingProfilesCreateHeaders + /// class. + /// + public BillingProfilesCreateHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the BillingProfilesCreateHeaders + /// class. + /// + /// Location URI to poll for result + /// Recommends the retryable time after + /// receiving this. + public BillingProfilesCreateHeaders(string location = default(string), int? retryAfter = default(int?)) + { + Location = location; + RetryAfter = retryAfter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets location URI to poll for result + /// + [JsonProperty(PropertyName = "Location")] + public string Location { get; set; } + + /// + /// Gets or sets recommends the retryable time after receiving this. + /// + [JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter { get; set; } + + } +} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingProperty.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingProperty.cs index 899f2827f887..088d08242916 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingProperty.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingProperty.cs @@ -37,27 +37,30 @@ public BillingProperty() /// Resource type. /// Billing tenant Id. /// Billing account Id. - /// Billing account name. + /// Billing account display + /// name. /// Billing profile Id. - /// Billing profile name. + /// Billing profile display + /// name. /// Cost center name. /// Invoice Section Id. - /// Invoice Section name. + /// Invoice Section display + /// name. /// Product Id. /// Product name. /// SKU Id. /// SKU description. - public BillingProperty(string id = default(string), string name = default(string), string type = default(string), string billingTenantId = default(string), string billingAccountId = default(string), string billingAccountName = default(string), string billingProfileId = default(string), string billingProfileName = default(string), string costCenter = default(string), string invoiceSectionId = default(string), string invoiceSectionName = default(string), string productId = default(string), string productName = default(string), string skuId = default(string), string skuDescription = default(string)) + public BillingProperty(string id = default(string), string name = default(string), string type = default(string), string billingTenantId = default(string), string billingAccountId = default(string), string billingAccountDisplayName = default(string), string billingProfileId = default(string), string billingProfileDisplayName = default(string), string costCenter = default(string), string invoiceSectionId = default(string), string invoiceSectionDisplayName = default(string), string productId = default(string), string productName = default(string), string skuId = default(string), string skuDescription = default(string)) : base(id, name, type) { BillingTenantId = billingTenantId; BillingAccountId = billingAccountId; - BillingAccountName = billingAccountName; + BillingAccountDisplayName = billingAccountDisplayName; BillingProfileId = billingProfileId; - BillingProfileName = billingProfileName; + BillingProfileDisplayName = billingProfileDisplayName; CostCenter = costCenter; InvoiceSectionId = invoiceSectionId; - InvoiceSectionName = invoiceSectionName; + InvoiceSectionDisplayName = invoiceSectionDisplayName; ProductId = productId; ProductName = productName; SkuId = skuId; @@ -83,10 +86,10 @@ public BillingProperty() public string BillingAccountId { get; private set; } /// - /// Gets billing account name. + /// Gets billing account display name. /// - [JsonProperty(PropertyName = "properties.billingAccountName")] - public string BillingAccountName { get; private set; } + [JsonProperty(PropertyName = "properties.billingAccountDisplayName")] + public string BillingAccountDisplayName { get; private set; } /// /// Gets billing profile Id. @@ -95,10 +98,10 @@ public BillingProperty() public string BillingProfileId { get; private set; } /// - /// Gets billing profile name. + /// Gets billing profile display name. /// - [JsonProperty(PropertyName = "properties.billingProfileName")] - public string BillingProfileName { get; private set; } + [JsonProperty(PropertyName = "properties.billingProfileDisplayName")] + public string BillingProfileDisplayName { get; private set; } /// /// Gets cost center name. @@ -113,10 +116,10 @@ public BillingProperty() public string InvoiceSectionId { get; private set; } /// - /// Gets invoice Section name. + /// Gets invoice Section display name. /// - [JsonProperty(PropertyName = "properties.invoiceSectionName")] - public string InvoiceSectionName { get; private set; } + [JsonProperty(PropertyName = "properties.invoiceSectionDisplayName")] + public string InvoiceSectionDisplayName { get; private set; } /// /// Gets product Id. diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingRoleAssignmentPayload.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingRoleAssignmentPayload.cs index 9fc63badaf94..74d64a4af330 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingRoleAssignmentPayload.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingRoleAssignmentPayload.cs @@ -33,12 +33,12 @@ public BillingRoleAssignmentPayload() /// /// The user's principal id that the role /// gets assigned to - /// The role definition + /// The role definition /// id - public BillingRoleAssignmentPayload(string principalId = default(string), string billingRoleDefinitionName = default(string)) + public BillingRoleAssignmentPayload(string principalId = default(string), string billingRoleDefinitionId = default(string)) { PrincipalId = principalId; - BillingRoleDefinitionName = billingRoleDefinitionName; + BillingRoleDefinitionId = billingRoleDefinitionId; CustomInit(); } @@ -48,16 +48,16 @@ public BillingRoleAssignmentPayload() partial void CustomInit(); /// - /// Gets the user's principal id that the role gets assigned to + /// Gets or sets the user's principal id that the role gets assigned to /// [JsonProperty(PropertyName = "principalId")] - public string PrincipalId { get; private set; } + public string PrincipalId { get; set; } /// - /// Gets the role definition id + /// Gets or sets the role definition id /// - [JsonProperty(PropertyName = "billingRoleDefinitionName")] - public string BillingRoleDefinitionName { get; private set; } + [JsonProperty(PropertyName = "billingRoleDefinitionId")] + public string BillingRoleDefinitionId { get; set; } } } diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingRoleDefinition.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingRoleDefinition.cs index 1ab8f7a72fef..1d8e57c0f051 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingRoleDefinition.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingRoleDefinition.cs @@ -38,7 +38,7 @@ public BillingRoleDefinition() /// Resource name. /// Resource type. /// The role description - /// The list OF billingPermissions a caller has on + /// The list of billingPermissions a caller has on /// a billing account. /// The name of the role public BillingRoleDefinition(string id = default(string), string name = default(string), string type = default(string), string description = default(string), IList value = default(IList), string roleName = default(string)) @@ -62,7 +62,7 @@ public BillingRoleDefinition() public string Description { get; private set; } /// - /// Gets the list OF billingPermissions a caller has on a billing + /// Gets the list of billingPermissions a caller has on a billing /// account. /// [JsonProperty(PropertyName = "properties.permissions.value")] diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingSubscriptionSummary.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingSubscription.cs similarity index 62% rename from sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingSubscriptionSummary.cs rename to sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingSubscription.cs index af34cba8b4b7..0d8e1dc1a2cc 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingSubscriptionSummary.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingSubscription.cs @@ -16,21 +16,21 @@ namespace Microsoft.Azure.Management.Billing.Models using System.Linq; /// - /// A billing Subscription summary resource. + /// A billing Subscription resource. /// [Rest.Serialization.JsonTransformation] - public partial class BillingSubscriptionSummary : Resource + public partial class BillingSubscription : Resource { /// - /// Initializes a new instance of the BillingSubscriptionSummary class. + /// Initializes a new instance of the BillingSubscription class. /// - public BillingSubscriptionSummary() + public BillingSubscription() { CustomInit(); } /// - /// Initializes a new instance of the BillingSubscriptionSummary class. + /// Initializes a new instance of the BillingSubscription class. /// /// Resource Id. /// Resource name. @@ -44,15 +44,20 @@ public BillingSubscriptionSummary() /// Month to date charges. /// Billing Profile id to which this /// product belongs. - /// Billing Profile name to which this - /// product belongs. + /// Billing Profile display + /// name to which this product belongs. + /// Customer id to which this product + /// belongs. + /// Display name of customer to which + /// this product belongs. /// Invoice section id to which this /// product belongs. - /// Invoice section name to which this - /// product belongs. + /// Invoice section display + /// name to which this product belongs. + /// Reseller for this subscription. /// The sku id. /// The sku description. - public BillingSubscriptionSummary(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 billingProfileName = default(string), string invoiceSectionId = default(string), string invoiceSectionName = default(string), string skuId = default(string), string skuDescription = default(string)) + 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 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)) : base(id, name, type) { DisplayName = displayName; @@ -61,9 +66,12 @@ public BillingSubscriptionSummary() LastMonthCharges = lastMonthCharges; MonthToDateCharges = monthToDateCharges; BillingProfileId = billingProfileId; - BillingProfileName = billingProfileName; + BillingProfileDisplayName = billingProfileDisplayName; + CustomerId = customerId; + CustomerDisplayName = customerDisplayName; InvoiceSectionId = invoiceSectionId; - InvoiceSectionName = invoiceSectionName; + InvoiceSectionDisplayName = invoiceSectionDisplayName; + Reseller = reseller; SkuId = skuId; SkuDescription = skuDescription; CustomInit(); @@ -112,10 +120,22 @@ public BillingSubscriptionSummary() public string BillingProfileId { get; private set; } /// - /// Gets billing Profile name to which this product belongs. + /// Gets billing Profile display name to which this product belongs. + /// + [JsonProperty(PropertyName = "properties.billingProfileDisplayName")] + public string BillingProfileDisplayName { get; private set; } + + /// + /// Gets customer id to which this product belongs. /// - [JsonProperty(PropertyName = "properties.billingProfileName")] - public string BillingProfileName { get; private set; } + [JsonProperty(PropertyName = "properties.customerId")] + public string CustomerId { get; private set; } + + /// + /// Gets display name of customer to which this product belongs. + /// + [JsonProperty(PropertyName = "properties.customerDisplayName")] + public string CustomerDisplayName { get; private set; } /// /// Gets invoice section id to which this product belongs. @@ -124,10 +144,16 @@ public BillingSubscriptionSummary() public string InvoiceSectionId { get; private set; } /// - /// Gets invoice section name to which this product belongs. + /// Gets invoice section display name to which this product belongs. + /// + [JsonProperty(PropertyName = "properties.invoiceSectionDisplayName")] + public string InvoiceSectionDisplayName { get; private set; } + + /// + /// Gets reseller for this subscription. /// - [JsonProperty(PropertyName = "properties.invoiceSectionName")] - public string InvoiceSectionName { get; private set; } + [JsonProperty(PropertyName = "properties.reseller")] + public Reseller Reseller { get; private set; } /// /// Gets or sets the sku id. diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingSubscriptionsListResult.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingSubscriptionsListResult.cs index 4b5829c166b0..65f02e801fef 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingSubscriptionsListResult.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingSubscriptionsListResult.cs @@ -16,7 +16,7 @@ namespace Microsoft.Azure.Management.Billing.Models using System.Linq; /// - /// Result of listing billing subscriptions summary. + /// Result of listing billing subscriptions. /// public partial class BillingSubscriptionsListResult { @@ -33,11 +33,10 @@ public BillingSubscriptionsListResult() /// Initializes a new instance of the BillingSubscriptionsListResult /// class. /// - /// The list of billing subscriptions - /// summary. + /// The list of billing subscriptions. /// The link (url) to the next page of /// results. - public BillingSubscriptionsListResult(IList value = default(IList), string nextLink = default(string)) + public BillingSubscriptionsListResult(IList value = default(IList), string nextLink = default(string)) { Value = value; NextLink = nextLink; @@ -50,10 +49,10 @@ public BillingSubscriptionsListResult() partial void CustomInit(); /// - /// Gets the list of billing subscriptions summary. + /// Gets the list of billing subscriptions. /// [JsonProperty(PropertyName = "value")] - public IList Value { get; private set; } + public IList Value { get; private set; } /// /// Gets the link (url) to the next page of results. diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingSubscriptionsTransferHeaders.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingSubscriptionsTransferHeaders.cs index 582e08544f7f..253d7ba5b08d 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingSubscriptionsTransferHeaders.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingSubscriptionsTransferHeaders.cs @@ -34,13 +34,10 @@ public BillingSubscriptionsTransferHeaders() /// Location URI to poll for result. /// Recommends the retryable time after /// receiving this. - /// URI to poll for the operation - /// status - public BillingSubscriptionsTransferHeaders(string location = default(string), int? retryAfter = default(int?), string azureAsyncOperation = default(string)) + public BillingSubscriptionsTransferHeaders(string location = default(string), int? retryAfter = default(int?)) { Location = location; RetryAfter = retryAfter; - AzureAsyncOperation = azureAsyncOperation; CustomInit(); } @@ -61,11 +58,5 @@ public BillingSubscriptionsTransferHeaders() [JsonProperty(PropertyName = "Retry-After")] public int? RetryAfter { get; set; } - /// - /// Gets or sets URI to poll for the operation status - /// - [JsonProperty(PropertyName = "Azure-AsyncOperation")] - public string AzureAsyncOperation { get; set; } - } } diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Customer.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Customer.cs new file mode 100644 index 000000000000..89c7ab63b4cf --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Customer.cs @@ -0,0 +1,79 @@ +// +// 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; + + /// + /// A partner's customer. + /// + [Rest.Serialization.JsonTransformation] + public partial class Customer : Resource + { + /// + /// Initializes a new instance of the Customer class. + /// + public Customer() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Customer class. + /// + /// Resource Id. + /// Resource name. + /// Resource type. + /// The name of the customer. + /// Information about the + /// product. + /// The resellers which are allowed to provide + /// service to this customer. + public Customer(string id = default(string), string name = default(string), string type = default(string), string displayName = default(string), IList enabledAzurePlans = default(IList), IList resellers = default(IList)) + : base(id, name, type) + { + DisplayName = displayName; + EnabledAzurePlans = enabledAzurePlans; + Resellers = resellers; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the name of the customer. + /// + [JsonProperty(PropertyName = "properties.displayName")] + public string DisplayName { get; set; } + + /// + /// Gets or sets information about the product. + /// + [JsonProperty(PropertyName = "properties.enabledAzurePlans")] + public IList EnabledAzurePlans { get; set; } + + /// + /// Gets or sets the resellers which are allowed to provide service to + /// this customer. + /// + [JsonProperty(PropertyName = "properties.resellers")] + public IList Resellers { get; set; } + + } +} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/CustomerType.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/CustomerType.cs new file mode 100644 index 000000000000..f3aa34eb0848 --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/CustomerType.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 CustomerType. + /// + public static class CustomerType + { + public const string Enterprise = "Enterprise"; + public const string Individual = "Individual"; + public const string Partner = "Partner"; + } +} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/DownloadProperties.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Document.cs similarity index 83% rename from sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/DownloadProperties.cs rename to sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Document.cs index f91a65dcf1cb..36f973b7dd43 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/DownloadProperties.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Document.cs @@ -16,23 +16,23 @@ namespace Microsoft.Azure.Management.Billing.Models /// /// The properties of the invoice download. /// - public partial class DownloadProperties + public partial class Document { /// - /// Initializes a new instance of the DownloadProperties class. + /// Initializes a new instance of the Document class. /// - public DownloadProperties() + public Document() { CustomInit(); } /// - /// Initializes a new instance of the DownloadProperties class. + /// Initializes a new instance of the Document class. /// /// Document type. Possible values include: /// 'Invoice', 'VoidNote', 'Receipt', 'CreditNote' /// Document URL. - public DownloadProperties(string kind = default(string), string url = default(string)) + public Document(string kind = default(string), string url = default(string)) { Kind = kind; Url = url; diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/DocumentType.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/DocumentType.cs new file mode 100644 index 000000000000..6a75ed670068 --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/DocumentType.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 DocumentType. + /// + public static class DocumentType + { + public const string Invoice = "Invoice"; + public const string VoidNote = "VoidNote"; + public const string Receipt = "Receipt"; + public const string CreditNote = "CreditNote"; + } +} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/InitiateTransferRequest.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/InitiateTransferRequest.cs index a16b7c341e08..00b981362f05 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/InitiateTransferRequest.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/InitiateTransferRequest.cs @@ -32,14 +32,13 @@ public InitiateTransferRequest() /// /// Initializes a new instance of the InitiateTransferRequest class. /// - /// Target Usage context for devTest - /// subscriptions. /// Email Id of recipient for /// transfer. - public InitiateTransferRequest(string billingProfileId = default(string), string recipientEmailId = default(string)) + /// Optional reseller Id for transfer. + public InitiateTransferRequest(string recipientEmailId = default(string), string resellerId = default(string)) { - BillingProfileId = billingProfileId; RecipientEmailId = recipientEmailId; + ResellerId = resellerId; CustomInit(); } @@ -48,17 +47,17 @@ public InitiateTransferRequest() /// partial void CustomInit(); - /// - /// Gets or sets target Usage context for devTest subscriptions. - /// - [JsonProperty(PropertyName = "properties.billingProfileId")] - public string BillingProfileId { get; set; } - /// /// Gets or sets email Id of recipient for transfer. /// [JsonProperty(PropertyName = "properties.recipientEmailId")] public string RecipientEmailId { get; set; } + /// + /// Gets or sets optional reseller Id for transfer. + /// + [JsonProperty(PropertyName = "properties.resellerId")] + public string ResellerId { get; set; } + } } diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/InvoiceSummary.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Invoice.cs similarity index 73% rename from sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/InvoiceSummary.cs rename to sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Invoice.cs index ffd2e631cc45..21725e4db657 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/InvoiceSummary.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Invoice.cs @@ -21,18 +21,18 @@ namespace Microsoft.Azure.Management.Billing.Models /// An invoice resource. /// [Rest.Serialization.JsonTransformation] - public partial class InvoiceSummary : Resource + public partial class Invoice : Resource { /// - /// Initializes a new instance of the InvoiceSummary class. + /// Initializes a new instance of the Invoice class. /// - public InvoiceSummary() + public Invoice() { CustomInit(); } /// - /// Initializes a new instance of the InvoiceSummary class. + /// Initializes a new instance of the Invoice class. /// /// Resource Id. /// Resource name. @@ -50,14 +50,14 @@ public InvoiceSummary() /// period. /// The billing profile id this invoice /// belongs to. - /// The profile name this invoice - /// belongs to. + /// The billing profile display + /// name this invoice belongs to. /// The purchase identifier for the /// invoice. - /// List of document urls available to - /// download including invoice and tax documents. + /// List of documents available to download + /// including invoice and tax documents. /// List of payments. - public InvoiceSummary(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 billedAmount = default(Amount), System.DateTime? invoicePeriodStartDate = default(System.DateTime?), System.DateTime? invoicePeriodEndDate = default(System.DateTime?), string billingProfileId = default(string), string billingProfileName = default(string), string purchaseOrderNumber = default(string), IList documentUrls = default(IList), IList payments = default(IList)) + 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 billedAmount = default(Amount), System.DateTime? invoicePeriodStartDate = default(System.DateTime?), System.DateTime? invoicePeriodEndDate = default(System.DateTime?), string billingProfileId = default(string), string billingProfileDisplayName = default(string), string purchaseOrderNumber = default(string), IList documents = default(IList), IList payments = default(IList)) : base(id, name, type) { DueDate = dueDate; @@ -68,9 +68,9 @@ public InvoiceSummary() InvoicePeriodStartDate = invoicePeriodStartDate; InvoicePeriodEndDate = invoicePeriodEndDate; BillingProfileId = billingProfileId; - BillingProfileName = billingProfileName; + BillingProfileDisplayName = billingProfileDisplayName; PurchaseOrderNumber = purchaseOrderNumber; - DocumentUrls = documentUrls; + Documents = documents; Payments = payments; CustomInit(); } @@ -130,10 +130,10 @@ public InvoiceSummary() public string BillingProfileId { get; private set; } /// - /// Gets the profile name this invoice belongs to. + /// Gets the billing profile display name this invoice belongs to. /// - [JsonProperty(PropertyName = "properties.billingProfileName")] - public string BillingProfileName { get; private set; } + [JsonProperty(PropertyName = "properties.billingProfileDisplayName")] + public string BillingProfileDisplayName { get; private set; } /// /// Gets the purchase identifier for the invoice. @@ -142,11 +142,11 @@ public InvoiceSummary() public string PurchaseOrderNumber { get; private set; } /// - /// Gets list of document urls available to download including invoice - /// and tax documents. + /// Gets list of documents available to download including invoice and + /// tax documents. /// - [JsonProperty(PropertyName = "properties.documentUrls")] - public IList DocumentUrls { get; private set; } + [JsonProperty(PropertyName = "properties.documents")] + public IList Documents { get; private set; } /// /// Gets list of payments. diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/InvoiceListResult.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/InvoiceListResult.cs index 3d3d9d8b41ae..29686c43e46f 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/InvoiceListResult.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/InvoiceListResult.cs @@ -34,7 +34,7 @@ public InvoiceListResult() /// The list of invoices. /// The link (url) to the next page of /// results. - public InvoiceListResult(IList value = default(IList), string nextLink = default(string)) + public InvoiceListResult(IList value = default(IList), string nextLink = default(string)) { Value = value; NextLink = nextLink; @@ -50,7 +50,7 @@ public InvoiceListResult() /// Gets the list of invoices. /// [JsonProperty(PropertyName = "value")] - public IList Value { get; private set; } + public IList Value { get; private set; } /// /// Gets the link (url) to the next page of results. 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 2c83b9f016f6..7d0e4e64e6d7 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 @@ -13,8 +13,6 @@ 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; /// @@ -38,13 +36,10 @@ public InvoiceSection() /// Resource name. /// Resource type. /// The name of the InvoiceSection. - /// The billing profiles associated to - /// the billing account. - public InvoiceSection(string id = default(string), string name = default(string), string type = default(string), string displayName = default(string), IList billingProfiles = default(IList)) + public InvoiceSection(string id = default(string), string name = default(string), string type = default(string), string displayName = default(string)) : base(id, name, type) { DisplayName = displayName; - BillingProfiles = billingProfiles; CustomInit(); } @@ -59,12 +54,5 @@ public InvoiceSection() [JsonProperty(PropertyName = "properties.displayName")] public string DisplayName { get; set; } - /// - /// Gets or sets the billing profiles associated to the billing - /// account. - /// - [JsonProperty(PropertyName = "properties.billingProfiles")] - public IList BillingProfiles { get; set; } - } } diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/InvoiceSectionProperties.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/InvoiceSectionCreationRequest.cs similarity index 57% rename from sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/InvoiceSectionProperties.cs rename to sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/InvoiceSectionCreationRequest.cs index 0d524e480a90..63666bada0da 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/InvoiceSectionProperties.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/InvoiceSectionCreationRequest.cs @@ -11,33 +11,30 @@ namespace Microsoft.Azure.Management.Billing.Models { using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// The properties of an InvoiceSection. /// - public partial class InvoiceSectionProperties + public partial class InvoiceSectionCreationRequest { /// - /// Initializes a new instance of the InvoiceSectionProperties class. + /// Initializes a new instance of the InvoiceSectionCreationRequest + /// class. /// - public InvoiceSectionProperties() + public InvoiceSectionCreationRequest() { CustomInit(); } /// - /// Initializes a new instance of the InvoiceSectionProperties class. + /// Initializes a new instance of the InvoiceSectionCreationRequest + /// class. /// /// The name of the InvoiceSection. - /// The billing profiles associated to - /// the billing account. - public InvoiceSectionProperties(string displayName = default(string), IList billingProfiles = default(IList)) + public InvoiceSectionCreationRequest(string displayName = default(string)) { DisplayName = displayName; - BillingProfiles = billingProfiles; CustomInit(); } @@ -52,12 +49,5 @@ public InvoiceSectionProperties() [JsonProperty(PropertyName = "displayName")] public string DisplayName { get; set; } - /// - /// Gets or sets the billing profiles associated to the billing - /// account. - /// - [JsonProperty(PropertyName = "billingProfiles")] - public IList BillingProfiles { get; set; } - } } diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/InvoiceSectionsCreateHeaders.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/InvoiceSectionsCreateHeaders.cs index 035ba83f811e..347073d3b7c4 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/InvoiceSectionsCreateHeaders.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/InvoiceSectionsCreateHeaders.cs @@ -34,13 +34,10 @@ public InvoiceSectionsCreateHeaders() /// Location URI to poll for result /// Recommends the retryable time after /// receiving this. - /// URI to poll for the operation - /// status - public InvoiceSectionsCreateHeaders(string location = default(string), int? retryAfter = default(int?), string azureAsyncOperation = default(string)) + public InvoiceSectionsCreateHeaders(string location = default(string), int? retryAfter = default(int?)) { Location = location; RetryAfter = retryAfter; - AzureAsyncOperation = azureAsyncOperation; CustomInit(); } @@ -61,11 +58,5 @@ public InvoiceSectionsCreateHeaders() [JsonProperty(PropertyName = "Retry-After")] public int? RetryAfter { get; set; } - /// - /// Gets or sets URI to poll for the operation status - /// - [JsonProperty(PropertyName = "Azure-AsyncOperation")] - public string AzureAsyncOperation { get; set; } - } } 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 new file mode 100644 index 000000000000..3ed93022c055 --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/InvoiceStatus.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 InvoiceStatus. + /// + public static class InvoiceStatus + { + public const string PastDue = "PastDue"; + public const string Due = "Due"; + public const string Paid = "Paid"; + public const string Void = "Void"; + } +} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/LineOfCredit.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/LineOfCredit.cs new file mode 100644 index 000000000000..69722dbd5433 --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/LineOfCredit.cs @@ -0,0 +1,85 @@ +// +// 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.Linq; + + /// + /// Line of credit resource. + /// + [Rest.Serialization.JsonTransformation] + public partial class LineOfCredit : Resource + { + /// + /// Initializes a new instance of the LineOfCredit class. + /// + public LineOfCredit() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the LineOfCredit class. + /// + /// Resource Id. + /// Resource name. + /// Resource type. + /// The current credit limit. + /// The reason for the line of credit status when + /// not approved. + /// Remaining balance. + /// The line of credit status. Possible values + /// include: 'Approved', 'Rejected' + public LineOfCredit(string id = default(string), string name = default(string), string type = default(string), Amount creditLimit = default(Amount), string reason = default(string), Amount remainingBalance = default(Amount), string status = default(string)) + : base(id, name, type) + { + CreditLimit = creditLimit; + Reason = reason; + RemainingBalance = remainingBalance; + Status = status; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the current credit limit. + /// + [JsonProperty(PropertyName = "properties.creditLimit")] + public Amount CreditLimit { get; set; } + + /// + /// Gets the reason for the line of credit status when not approved. + /// + [JsonProperty(PropertyName = "properties.reason")] + public string Reason { get; private set; } + + /// + /// Gets remaining balance. + /// + [JsonProperty(PropertyName = "properties.remainingBalance")] + public Amount RemainingBalance { get; private set; } + + /// + /// Gets or sets the line of credit status. Possible values include: + /// 'Approved', 'Rejected' + /// + [JsonProperty(PropertyName = "properties.status")] + public string Status { get; set; } + + } +} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/LineOfCreditsUpdateHeaders.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/LineOfCreditsUpdateHeaders.cs new file mode 100644 index 000000000000..11328f1778e5 --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/LineOfCreditsUpdateHeaders.cs @@ -0,0 +1,60 @@ +// +// 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 Update operation. + /// + public partial class LineOfCreditsUpdateHeaders + { + /// + /// Initializes a new instance of the LineOfCreditsUpdateHeaders class. + /// + public LineOfCreditsUpdateHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the LineOfCreditsUpdateHeaders class. + /// + /// Location URI to poll for result. + /// Recommends the retryable time after + /// receiving this. + public LineOfCreditsUpdateHeaders(string location = default(string), int? retryAfter = default(int?)) + { + Location = location; + RetryAfter = retryAfter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets location URI to poll for result. + /// + [JsonProperty(PropertyName = "Location")] + public string Location { get; set; } + + /// + /// Gets or sets recommends the retryable time after receiving this. + /// + [JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter { get; set; } + + } +} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/MarketplacePurchasesPolicy.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/MarketplacePurchasesPolicy.cs new file mode 100644 index 000000000000..b9b51871a589 --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/MarketplacePurchasesPolicy.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 MarketplacePurchasesPolicy. + /// + public static class MarketplacePurchasesPolicy + { + public const string AllAllowed = "AllAllowed"; + public const string FreeAllowed = "FreeAllowed"; + public const string NotAllowed = "NotAllowed"; + } +} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/OperationStatus.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/OperationStatus.cs deleted file mode 100644 index 26a84a70ab38..000000000000 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/OperationStatus.cs +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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; - - /// - /// status of the Billing POST/PUT operation. - /// - public partial class OperationStatus - { - /// - /// Initializes a new instance of the OperationStatus class. - /// - public OperationStatus() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the OperationStatus class. - /// - /// The operation Id. - /// Status of the pending operation - /// Status Detail of the pending - /// operation - public OperationStatus(string id = default(string), string status = default(string), string statusDetail = default(string)) - { - Id = id; - Status = status; - StatusDetail = statusDetail; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets the operation Id. - /// - [JsonProperty(PropertyName = "id")] - public string Id { get; private set; } - - /// - /// Gets or sets status of the pending operation - /// - [JsonProperty(PropertyName = "status")] - public string Status { get; set; } - - /// - /// Gets or sets status Detail of the pending operation - /// - [JsonProperty(PropertyName = "statusDetail")] - public string StatusDetail { get; set; } - - } -} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/PaymentMethod.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/PaymentMethod.cs index 5cf71f943c91..02fb87d8c3d0 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/PaymentMethod.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/PaymentMethod.cs @@ -38,10 +38,10 @@ public PaymentMethod() /// Payment method type. Possible /// values include: 'Credits', 'ChequeWire' /// Details about the payment method. - /// Expiration date. + /// Expiration month and year. /// The currency associated with the payment /// method. - public PaymentMethod(string id = default(string), string name = default(string), string type = default(string), string paymentMethodType = default(string), string details = default(string), System.DateTime? expiration = default(System.DateTime?), string currency = default(string)) + public PaymentMethod(string id = default(string), string name = default(string), string type = default(string), string paymentMethodType = default(string), string details = default(string), string expiration = default(string), string currency = default(string)) : base(id, name, type) { PaymentMethodType = paymentMethodType; @@ -70,10 +70,10 @@ public PaymentMethod() public string Details { get; private set; } /// - /// Gets expiration date. + /// Gets expiration month and year. /// [JsonProperty(PropertyName = "properties.expiration")] - public System.DateTime? Expiration { get; private set; } + public string Expiration { get; private set; } /// /// Gets the currency associated with the payment method. diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Policy.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Policy.cs index 1e3f633436fe..85de382160ac 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Policy.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Policy.cs @@ -35,18 +35,20 @@ public Policy() /// Resource Id. /// Resource name. /// Resource type. - /// The - /// marketplacePurchasesAllowed flag. - /// The - /// reservationPurchasesAllowed flag. - /// The - /// subscriptionOwnerCanViewCharges flag. - public Policy(string id = default(string), string name = default(string), string type = default(string), bool? marketplacePurchasesAllowed = default(bool?), bool? reservationPurchasesAllowed = default(bool?), bool? subscriptionOwnerCanViewCharges = default(bool?)) + /// The marketplace purchases are + /// free, allowed or not allowed. Possible values include: + /// 'AllAllowed', 'FreeAllowed', 'NotAllowed' + /// The reservation purchases + /// allowed or not. Possible values include: 'Allowed', + /// 'NotAllowed' + /// Who can view charges. Possible values + /// include: 'None', 'SubscriptionOwner' + public Policy(string id = default(string), string name = default(string), string type = default(string), string marketplacePurchases = default(string), string reservationPurchases = default(string), string viewCharges = default(string)) : base(id, name, type) { - MarketplacePurchasesAllowed = marketplacePurchasesAllowed; - ReservationPurchasesAllowed = reservationPurchasesAllowed; - SubscriptionOwnerCanViewCharges = subscriptionOwnerCanViewCharges; + MarketplacePurchases = marketplacePurchases; + ReservationPurchases = reservationPurchases; + ViewCharges = viewCharges; CustomInit(); } @@ -56,22 +58,26 @@ public Policy() partial void CustomInit(); /// - /// Gets or sets the marketplacePurchasesAllowed flag. + /// Gets or sets the marketplace purchases are free, allowed or not + /// allowed. Possible values include: 'AllAllowed', 'FreeAllowed', + /// 'NotAllowed' /// - [JsonProperty(PropertyName = "properties.marketplacePurchasesAllowed")] - public bool? MarketplacePurchasesAllowed { get; set; } + [JsonProperty(PropertyName = "properties.marketplacePurchases")] + public string MarketplacePurchases { get; set; } /// - /// Gets or sets the reservationPurchasesAllowed flag. + /// Gets or sets the reservation purchases allowed or not. Possible + /// values include: 'Allowed', 'NotAllowed' /// - [JsonProperty(PropertyName = "properties.reservationPurchasesAllowed")] - public bool? ReservationPurchasesAllowed { get; set; } + [JsonProperty(PropertyName = "properties.reservationPurchases")] + public string ReservationPurchases { get; set; } /// - /// Gets or sets the subscriptionOwnerCanViewCharges flag. + /// Gets or sets who can view charges. Possible values include: 'None', + /// 'SubscriptionOwner' /// - [JsonProperty(PropertyName = "properties.subscriptionOwnerCanViewCharges")] - public bool? SubscriptionOwnerCanViewCharges { get; set; } + [JsonProperty(PropertyName = "properties.viewCharges")] + public string ViewCharges { get; set; } } } diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/PriceSheetDownloadByBillingProfileHeaders.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/PriceSheetDownloadByBillingProfileHeaders.cs new file mode 100644 index 000000000000..47a7dd2a5b11 --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/PriceSheetDownloadByBillingProfileHeaders.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; + + /// + /// Defines headers for DownloadByBillingProfile operation. + /// + public partial class PriceSheetDownloadByBillingProfileHeaders + { + /// + /// Initializes a new instance of the + /// PriceSheetDownloadByBillingProfileHeaders class. + /// + public PriceSheetDownloadByBillingProfileHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// PriceSheetDownloadByBillingProfileHeaders 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. + /// The operation entity Id GUID. + public PriceSheetDownloadByBillingProfileHeaders(string location = default(string), string retryAfter = default(string), string oDataEntityId = default(string)) + { + Location = location; + RetryAfter = retryAfter; + ODataEntityId = oDataEntityId; + 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; } + + /// + /// Gets or sets the operation entity Id GUID. + /// + [JsonProperty(PropertyName = "OData-EntityId")] + public string ODataEntityId { get; set; } + + } +} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/PriceSheetDownloadHeaders.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/PriceSheetDownloadHeaders.cs index d01435a680a8..29f758def14c 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/PriceSheetDownloadHeaders.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/PriceSheetDownloadHeaders.cs @@ -34,15 +34,11 @@ public PriceSheetDownloadHeaders() /// The amount of delay to use while the /// status of the operation is checked. The value is expressed in /// seconds. - /// To get the progress of the - /// operation, call GET operation on the URL in Azure-AsyncOperation - /// header field. /// The operation entity Id GUID. - public PriceSheetDownloadHeaders(string location = default(string), string retryAfter = default(string), string azureAsyncOperation = default(string), string oDataEntityId = default(string)) + public PriceSheetDownloadHeaders(string location = default(string), string retryAfter = default(string), string oDataEntityId = default(string)) { Location = location; RetryAfter = retryAfter; - AzureAsyncOperation = azureAsyncOperation; ODataEntityId = oDataEntityId; CustomInit(); } @@ -66,13 +62,6 @@ public PriceSheetDownloadHeaders() [JsonProperty(PropertyName = "Retry-After")] public string RetryAfter { get; set; } - /// - /// Gets or sets to get the progress of the operation, call GET - /// operation on the URL in Azure-AsyncOperation header field. - /// - [JsonProperty(PropertyName = "Azure-AsyncOperation")] - public string AzureAsyncOperation { get; set; } - /// /// Gets or sets the operation entity Id GUID. /// diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ProductSummary.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Product.cs similarity index 70% rename from sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ProductSummary.cs rename to sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Product.cs index 7b824db3a0c1..4b60b0b0a8e9 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ProductSummary.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Product.cs @@ -16,21 +16,21 @@ namespace Microsoft.Azure.Management.Billing.Models using System.Linq; /// - /// A product summary resource. + /// A product resource. /// [Rest.Serialization.JsonTransformation] - public partial class ProductSummary : Resource + public partial class Product : Resource { /// - /// Initializes a new instance of the ProductSummary class. + /// Initializes a new instance of the Product class. /// - public ProductSummary() + public Product() { CustomInit(); } /// - /// Initializes a new instance of the ProductSummary class. + /// Initializes a new instance of the Product class. /// /// Resource Id. /// Resource name. @@ -54,13 +54,17 @@ public ProductSummary() /// Parent Product Id. /// Invoice section id to which this /// product belongs. - /// Invoice section name to which this - /// product belongs. + /// Invoice section display + /// name to which this product belongs. /// Billing Profile id to which this /// product belongs. - /// Billing Profile name to which this - /// product belongs. - public ProductSummary(string id = default(string), string name = default(string), string type = default(string), string displayName = default(string), System.DateTime? purchaseDate = default(System.DateTime?), string productTypeId = default(string), string productType = default(string), string status = default(string), System.DateTime? endDate = default(System.DateTime?), string billingFrequency = default(string), Amount lastCharge = default(Amount), System.DateTime? lastChargeDate = default(System.DateTime?), double? quantity = default(double?), string skuId = default(string), string skuDescription = default(string), string availabilityId = default(string), string parentProductId = default(string), string invoiceSectionId = default(string), string invoiceSectionName = default(string), string billingProfileId = default(string), string billingProfileName = default(string)) + /// Billing Profile display + /// name to which this product belongs. + /// Customer id to which this product + /// belongs. + /// Display name of customer to which + /// this product belongs. + public Product(string id = default(string), string name = default(string), string type = default(string), string displayName = default(string), System.DateTime? purchaseDate = default(System.DateTime?), string productTypeId = default(string), string productType = default(string), string status = default(string), System.DateTime? endDate = default(System.DateTime?), string billingFrequency = default(string), Amount lastCharge = default(Amount), System.DateTime? lastChargeDate = default(System.DateTime?), double? quantity = default(double?), string skuId = default(string), string skuDescription = default(string), string availabilityId = default(string), string parentProductId = default(string), string invoiceSectionId = default(string), string invoiceSectionDisplayName = default(string), string billingProfileId = default(string), string billingProfileDisplayName = default(string), string customerId = default(string), string customerDisplayName = default(string)) : base(id, name, type) { DisplayName = displayName; @@ -78,9 +82,11 @@ public ProductSummary() AvailabilityId = availabilityId; ParentProductId = parentProductId; InvoiceSectionId = invoiceSectionId; - InvoiceSectionName = invoiceSectionName; + InvoiceSectionDisplayName = invoiceSectionDisplayName; BillingProfileId = billingProfileId; - BillingProfileName = billingProfileName; + BillingProfileDisplayName = billingProfileDisplayName; + CustomerId = customerId; + CustomerDisplayName = customerDisplayName; CustomInit(); } @@ -183,10 +189,10 @@ public ProductSummary() public string InvoiceSectionId { get; private set; } /// - /// Gets invoice section name to which this product belongs. + /// Gets invoice section display name to which this product belongs. /// - [JsonProperty(PropertyName = "properties.invoiceSectionName")] - public string InvoiceSectionName { get; private set; } + [JsonProperty(PropertyName = "properties.invoiceSectionDisplayName")] + public string InvoiceSectionDisplayName { get; private set; } /// /// Gets billing Profile id to which this product belongs. @@ -195,10 +201,22 @@ public ProductSummary() public string BillingProfileId { get; private set; } /// - /// Gets billing Profile name to which this product belongs. + /// Gets billing Profile display name to which this product belongs. + /// + [JsonProperty(PropertyName = "properties.billingProfileDisplayName")] + public string BillingProfileDisplayName { get; private set; } + + /// + /// Gets customer id to which this product belongs. + /// + [JsonProperty(PropertyName = "properties.customerId")] + public string CustomerId { get; private set; } + + /// + /// Gets display name of customer to which this product belongs. /// - [JsonProperty(PropertyName = "properties.billingProfileName")] - public string BillingProfileName { get; private set; } + [JsonProperty(PropertyName = "properties.customerDisplayName")] + public string CustomerDisplayName { get; private set; } } } diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ProductTransferValidationErrorCode.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ProductTransferValidationErrorCode.cs new file mode 100644 index 000000000000..b2aa3eff7e27 --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ProductTransferValidationErrorCode.cs @@ -0,0 +1,29 @@ +// +// 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 ProductTransferValidationErrorCode. + /// + public static class ProductTransferValidationErrorCode + { + public const string InvalidSource = "InvalidSource"; + public const string ProductNotActive = "ProductNotActive"; + public const string InsufficientPermissionOnSource = "InsufficientPermissionOnSource"; + public const string InsufficientPermissionOnDestination = "InsufficientPermissionOnDestination"; + public const string DestinationBillingProfilePastDue = "DestinationBillingProfilePastDue"; + public const string ProductTypeNotSupported = "ProductTypeNotSupported"; + public const string CrossBillingAccountNotAllowed = "CrossBillingAccountNotAllowed"; + public const string NotAvailableForDestinationMarket = "NotAvailableForDestinationMarket"; + public const string OneTimePurchaseProductTransferNotAllowed = "OneTimePurchaseProductTransferNotAllowed"; + } +} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ProductsListResult.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ProductsListResult.cs index f32c04aec14b..90a6ed7c54f0 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ProductsListResult.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ProductsListResult.cs @@ -16,8 +16,8 @@ namespace Microsoft.Azure.Management.Billing.Models using System.Linq; /// - /// Result of listing products summary. It contains a list of available - /// products summaries in reverse chronological order by purchase date. + /// Result of listing products. It contains a list of available products + /// summaries in reverse chronological order by purchase date. /// public partial class ProductsListResult { @@ -32,10 +32,10 @@ public ProductsListResult() /// /// Initializes a new instance of the ProductsListResult class. /// - /// The list of products summary. + /// The list of products. /// The link (url) to the next page of /// results. - public ProductsListResult(IList value = default(IList), string nextLink = default(string)) + public ProductsListResult(IList value = default(IList), string nextLink = default(string)) { Value = value; NextLink = nextLink; @@ -48,10 +48,10 @@ public ProductsListResult() partial void CustomInit(); /// - /// Gets the list of products summary. + /// Gets the list of products. /// [JsonProperty(PropertyName = "value")] - public IList Value { get; private set; } + public IList Value { get; private set; } /// /// Gets the link (url) to the next page of results. diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ProductsTransferHeaders.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ProductsTransferHeaders.cs index d0cadf2b0d55..2440f6d2f2f0 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ProductsTransferHeaders.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ProductsTransferHeaders.cs @@ -32,13 +32,10 @@ public ProductsTransferHeaders() /// Location URI to poll for result /// Recommends the retryable time after /// receiving this. - /// URI to poll for the operation - /// status - public ProductsTransferHeaders(string location = default(string), int? retryAfter = default(int?), string azureAsyncOperation = default(string)) + public ProductsTransferHeaders(string location = default(string), int? retryAfter = default(int?)) { Location = location; RetryAfter = retryAfter; - AzureAsyncOperation = azureAsyncOperation; CustomInit(); } @@ -59,11 +56,5 @@ public ProductsTransferHeaders() [JsonProperty(PropertyName = "Retry-After")] public int? RetryAfter { get; set; } - /// - /// Gets or sets URI to poll for the operation status - /// - [JsonProperty(PropertyName = "Azure-AsyncOperation")] - public string AzureAsyncOperation { get; set; } - } } diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/RecipientTransferDetails.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/RecipientTransferDetails.cs index a451ae984fb1..c4dddcb9ca96 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/RecipientTransferDetails.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/RecipientTransferDetails.cs @@ -45,13 +45,17 @@ public RecipientTransferDetails() /// transfer. /// Email Id of initiator of /// transfer. + /// Reseller Id for transfer. + /// Reseller name for transfer. + /// Customer type of the + /// initiator. /// Email Id who user canceled the /// transfer. /// Transfer last modification /// time. /// Detailed transfer /// status. - public RecipientTransferDetails(System.DateTime? creationTime = default(System.DateTime?), System.DateTime? expirationTime = default(System.DateTime?), IList allowedProductType = default(IList), string transferStatus = default(string), string recipientEmailId = default(string), string initiatorEmailId = default(string), string canceledBy = default(string), System.DateTime? lastModifiedTime = default(System.DateTime?), IList detailedTransferStatus = default(IList)) + public RecipientTransferDetails(System.DateTime? creationTime = default(System.DateTime?), System.DateTime? expirationTime = default(System.DateTime?), IList allowedProductType = default(IList), string transferStatus = default(string), string recipientEmailId = default(string), string initiatorEmailId = default(string), string resellerId = default(string), string resellerName = default(string), string initiatorCustomerType = default(string), string canceledBy = default(string), System.DateTime? lastModifiedTime = default(System.DateTime?), IList detailedTransferStatus = default(IList)) { CreationTime = creationTime; ExpirationTime = expirationTime; @@ -59,6 +63,9 @@ public RecipientTransferDetails() TransferStatus = transferStatus; RecipientEmailId = recipientEmailId; InitiatorEmailId = initiatorEmailId; + ResellerId = resellerId; + ResellerName = resellerName; + InitiatorCustomerType = initiatorCustomerType; CanceledBy = canceledBy; LastModifiedTime = lastModifiedTime; DetailedTransferStatus = detailedTransferStatus; @@ -108,6 +115,24 @@ public RecipientTransferDetails() [JsonProperty(PropertyName = "properties.initiatorEmailId")] public string InitiatorEmailId { get; private set; } + /// + /// Gets reseller Id for transfer. + /// + [JsonProperty(PropertyName = "properties.resellerId")] + public string ResellerId { get; private set; } + + /// + /// Gets reseller name for transfer. + /// + [JsonProperty(PropertyName = "properties.resellerName")] + public string ResellerName { get; private set; } + + /// + /// Gets customer type of the initiator. + /// + [JsonProperty(PropertyName = "properties.initiatorCustomerType")] + public string InitiatorCustomerType { get; private set; } + /// /// Gets email Id who user canceled the transfer. /// diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Reseller.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Reseller.cs new file mode 100644 index 000000000000..5efc6c6fcde2 --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Reseller.cs @@ -0,0 +1,59 @@ +// +// 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 a reseller. + /// + public partial class Reseller + { + /// + /// Initializes a new instance of the Reseller class. + /// + public Reseller() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Reseller class. + /// + /// The reseller id. + /// A description of the reseller. + public Reseller(string resellerId = default(string), string description = default(string)) + { + ResellerId = resellerId; + Description = description; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the reseller id. + /// + [JsonProperty(PropertyName = "resellerId")] + public string ResellerId { get; private set; } + + /// + /// Gets a description of the reseller. + /// + [JsonProperty(PropertyName = "description")] + public string Description { get; private set; } + + } +} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ReservationPurchasesPolicy.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ReservationPurchasesPolicy.cs new file mode 100644 index 000000000000..a41293d8b273 --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ReservationPurchasesPolicy.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 ReservationPurchasesPolicy. + /// + public static class ReservationPurchasesPolicy + { + public const string Allowed = "Allowed"; + public const string NotAllowed = "NotAllowed"; + } +} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Status.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Status.cs new file mode 100644 index 000000000000..c0910b803733 --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Status.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 Status. + /// + public static class Status + { + public const string Approved = "Approved"; + public const string Rejected = "Rejected"; + } +} 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 new file mode 100644 index 000000000000..128d487ef129 --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/SubscriptionTransferValidationErrorCode.cs @@ -0,0 +1,28 @@ +// +// 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 SubscriptionTransferValidationErrorCode. + /// + public static class SubscriptionTransferValidationErrorCode + { + public const string InvalidSource = "InvalidSource"; + 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/TransactionsSummary.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Transaction.cs similarity index 70% rename from sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/TransactionsSummary.cs rename to sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Transaction.cs index 97e3617a5a09..41adddc53bee 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/TransactionsSummary.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Transaction.cs @@ -16,21 +16,21 @@ namespace Microsoft.Azure.Management.Billing.Models using System.Linq; /// - /// A reservation transaction summary resource. + /// A reservation transaction resource. /// [Rest.Serialization.JsonTransformation] - public partial class TransactionsSummary : Resource + public partial class Transaction : Resource { /// - /// Initializes a new instance of the TransactionsSummary class. + /// Initializes a new instance of the Transaction class. /// - public TransactionsSummary() + public Transaction() { CustomInit(); } /// - /// Initializes a new instance of the TransactionsSummary class. + /// Initializes a new instance of the Transaction class. /// /// Resource Id. /// Resource name. @@ -53,15 +53,19 @@ public TransactionsSummary() /// Purchase quantity. /// Invoice section id to which this /// product belongs. - /// Invoice section name to which this - /// product belongs. + /// Invoice section display + /// name to which this product belongs. /// Billing Profile id to which this /// product belongs. - /// Billing Profile name to which this - /// product belongs. + /// Billing Profile display + /// name to which this product belongs. + /// Customer id to which this product + /// belongs. + /// Display name of customer to which + /// this product belongs. /// The subscription id. /// The subscription name. - public TransactionsSummary(string id = default(string), string name = default(string), string type = default(string), string kind = default(string), System.DateTime? date = default(System.DateTime?), string invoice = default(string), string orderId = default(string), string orderName = default(string), string productFamily = default(string), string productTypeId = default(string), string productType = default(string), string productDescription = default(string), string transactionType = default(string), Amount transactionAmount = default(Amount), int? quantity = default(int?), string invoiceSectionId = default(string), string invoiceSectionName = default(string), string billingProfileId = default(string), string billingProfileName = default(string), string subscriptionId = default(string), string subscriptionName = default(string)) + public Transaction(string id = default(string), string name = default(string), string type = default(string), string kind = default(string), System.DateTime? date = default(System.DateTime?), string invoice = default(string), string orderId = default(string), string orderName = default(string), string productFamily = default(string), string productTypeId = default(string), string productType = default(string), string productDescription = default(string), string transactionType = default(string), Amount transactionAmount = default(Amount), int? quantity = default(int?), string invoiceSectionId = default(string), string invoiceSectionDisplayName = default(string), string billingProfileId = default(string), string billingProfileDisplayName = default(string), string customerId = default(string), string customerDisplayName = default(string), string subscriptionId = default(string), string subscriptionName = default(string)) : base(id, name, type) { Kind = kind; @@ -77,9 +81,11 @@ public TransactionsSummary() TransactionAmount = transactionAmount; Quantity = quantity; InvoiceSectionId = invoiceSectionId; - InvoiceSectionName = invoiceSectionName; + InvoiceSectionDisplayName = invoiceSectionDisplayName; BillingProfileId = billingProfileId; - BillingProfileName = billingProfileName; + BillingProfileDisplayName = billingProfileDisplayName; + CustomerId = customerId; + CustomerDisplayName = customerDisplayName; SubscriptionId = subscriptionId; SubscriptionName = subscriptionName; CustomInit(); @@ -171,10 +177,10 @@ public TransactionsSummary() public string InvoiceSectionId { get; private set; } /// - /// Gets invoice section name to which this product belongs. + /// Gets invoice section display name to which this product belongs. /// - [JsonProperty(PropertyName = "properties.invoiceSectionName")] - public string InvoiceSectionName { get; private set; } + [JsonProperty(PropertyName = "properties.invoiceSectionDisplayName")] + public string InvoiceSectionDisplayName { get; private set; } /// /// Gets billing Profile id to which this product belongs. @@ -183,10 +189,22 @@ public TransactionsSummary() public string BillingProfileId { get; private set; } /// - /// Gets billing Profile name to which this product belongs. + /// Gets billing Profile display name to which this product belongs. + /// + [JsonProperty(PropertyName = "properties.billingProfileDisplayName")] + public string BillingProfileDisplayName { get; private set; } + + /// + /// Gets customer id to which this product belongs. + /// + [JsonProperty(PropertyName = "properties.customerId")] + public string CustomerId { get; private set; } + + /// + /// Gets display name of customer to which this product belongs. /// - [JsonProperty(PropertyName = "properties.billingProfileName")] - public string BillingProfileName { get; private set; } + [JsonProperty(PropertyName = "properties.customerDisplayName")] + public string CustomerDisplayName { get; private set; } /// /// Gets the subscription id. diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/TransactionsListResult.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/TransactionListResult.cs similarity index 70% rename from sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/TransactionsListResult.cs rename to sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/TransactionListResult.cs index 0698ce1fb2e6..b38f7aa05616 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/TransactionsListResult.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/TransactionListResult.cs @@ -16,26 +16,25 @@ namespace Microsoft.Azure.Management.Billing.Models using System.Linq; /// - /// Result of listing reservation transactions summary. + /// Result of listing reservation transactions. /// - public partial class TransactionsListResult + public partial class TransactionListResult { /// - /// Initializes a new instance of the TransactionsListResult class. + /// Initializes a new instance of the TransactionListResult class. /// - public TransactionsListResult() + public TransactionListResult() { CustomInit(); } /// - /// Initializes a new instance of the TransactionsListResult class. + /// Initializes a new instance of the TransactionListResult class. /// - /// The list of reservation transactions - /// summary. + /// The list of reservation transactions. /// The link (url) to the next page of /// results. - public TransactionsListResult(IList value = default(IList), string nextLink = default(string)) + public TransactionListResult(IList value = default(IList), string nextLink = default(string)) { Value = value; NextLink = nextLink; @@ -48,10 +47,10 @@ public TransactionsListResult() partial void CustomInit(); /// - /// Gets the list of reservation transactions summary. + /// Gets the list of reservation transactions. /// [JsonProperty(PropertyName = "value")] - public IList Value { get; private set; } + public IList Value { get; private set; } /// /// Gets the link (url) to the next page of results. diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/TransferBillingSubscriptionRequest.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/TransferBillingSubscriptionRequest.cs index 73356f7165b6..caee5a03f332 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/TransferBillingSubscriptionRequest.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/TransferBillingSubscriptionRequest.cs @@ -36,9 +36,12 @@ public TransferBillingSubscriptionRequest() /// /// The destination invoice /// section id. - public TransferBillingSubscriptionRequest(string destinationInvoiceSectionId = default(string)) + /// The destination billing + /// profile id. + public TransferBillingSubscriptionRequest(string destinationInvoiceSectionId = default(string), string destinationBillingProfileId = default(string)) { DestinationInvoiceSectionId = destinationInvoiceSectionId; + DestinationBillingProfileId = destinationBillingProfileId; CustomInit(); } @@ -53,5 +56,11 @@ public TransferBillingSubscriptionRequest() [JsonProperty(PropertyName = "properties.destinationInvoiceSectionId")] public string DestinationInvoiceSectionId { get; set; } + /// + /// Gets or sets the destination billing profile id. + /// + [JsonProperty(PropertyName = "properties.destinationBillingProfileId")] + public string DestinationBillingProfileId { get; set; } + } } diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/TransferBillingSubscriptionRequestProperties.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/TransferBillingSubscriptionRequestProperties.cs index 1de9174f58fd..c441d309ce65 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/TransferBillingSubscriptionRequestProperties.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/TransferBillingSubscriptionRequestProperties.cs @@ -33,9 +33,12 @@ public TransferBillingSubscriptionRequestProperties() /// /// The destination invoice /// section id. - public TransferBillingSubscriptionRequestProperties(string destinationInvoiceSectionId = default(string)) + /// The destination billing + /// profile id. + public TransferBillingSubscriptionRequestProperties(string destinationInvoiceSectionId = default(string), string destinationBillingProfileId = default(string)) { DestinationInvoiceSectionId = destinationInvoiceSectionId; + DestinationBillingProfileId = destinationBillingProfileId; CustomInit(); } @@ -50,5 +53,11 @@ public TransferBillingSubscriptionRequestProperties() [JsonProperty(PropertyName = "destinationInvoiceSectionId")] public string DestinationInvoiceSectionId { get; set; } + /// + /// Gets or sets the destination billing profile id. + /// + [JsonProperty(PropertyName = "destinationBillingProfileId")] + public string DestinationBillingProfileId { get; set; } + } } diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/TransferDetails.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/TransferDetails.cs index ea1d76fa501e..293d805691c8 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/TransferDetails.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/TransferDetails.cs @@ -38,6 +38,11 @@ public TransferDetails() /// Transfer expiration time. /// Target invoice section Id. /// Target billing account Id. + /// Reseller Id for transfer. + /// Reseller name for transfer. + /// Customer type of the + /// initiator. + /// Target billing profile Id. /// Overall transfer status. Possible /// values include: 'Pending', 'InProgress', 'Completed', /// 'CompletedWithErrors', 'Failed', 'Canceled', 'Declined' @@ -51,12 +56,16 @@ public TransferDetails() /// time. /// Detailed transfer /// status. - public TransferDetails(System.DateTime? creationTime = default(System.DateTime?), System.DateTime? expirationTime = default(System.DateTime?), string invoiceSectionId = default(string), string billingAccountId = default(string), string transferStatus = default(string), string recipientEmailId = default(string), string initiatorEmailId = default(string), string canceledBy = default(string), System.DateTime? lastModifiedTime = default(System.DateTime?), IList detailedTransferStatus = default(IList)) + public TransferDetails(System.DateTime? creationTime = default(System.DateTime?), System.DateTime? expirationTime = default(System.DateTime?), string invoiceSectionId = default(string), string billingAccountId = default(string), string resellerId = default(string), string resellerName = default(string), string initiatorCustomerType = default(string), string billingProfileId = default(string), string transferStatus = default(string), string recipientEmailId = default(string), string initiatorEmailId = default(string), string canceledBy = default(string), System.DateTime? lastModifiedTime = default(System.DateTime?), IList detailedTransferStatus = default(IList)) { CreationTime = creationTime; ExpirationTime = expirationTime; InvoiceSectionId = invoiceSectionId; BillingAccountId = billingAccountId; + ResellerId = resellerId; + ResellerName = resellerName; + InitiatorCustomerType = initiatorCustomerType; + BillingProfileId = billingProfileId; TransferStatus = transferStatus; RecipientEmailId = recipientEmailId; InitiatorEmailId = initiatorEmailId; @@ -95,6 +104,30 @@ public TransferDetails() [JsonProperty(PropertyName = "properties.billingAccountId")] public string BillingAccountId { get; private set; } + /// + /// Gets reseller Id for transfer. + /// + [JsonProperty(PropertyName = "properties.resellerId")] + public string ResellerId { get; private set; } + + /// + /// Gets reseller name for transfer. + /// + [JsonProperty(PropertyName = "properties.resellerName")] + public string ResellerName { get; private set; } + + /// + /// Gets customer type of the initiator. + /// + [JsonProperty(PropertyName = "properties.initiatorCustomerType")] + public string InitiatorCustomerType { get; private set; } + + /// + /// Gets target billing profile Id. + /// + [JsonProperty(PropertyName = "properties.billingProfileId")] + public string BillingProfileId { get; private set; } + /// /// Gets overall transfer status. Possible values include: 'Pending', /// 'InProgress', 'Completed', 'CompletedWithErrors', 'Failed', diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/TransferProductRequestProperties.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/TransferProductRequestProperties.cs index dab785ca787c..76f21e33a9eb 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/TransferProductRequestProperties.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/TransferProductRequestProperties.cs @@ -31,11 +31,14 @@ public TransferProductRequestProperties() /// Initializes a new instance of the TransferProductRequestProperties /// class. /// - /// Destination invoice + /// The destination invoice /// section id. - public TransferProductRequestProperties(string destinationInvoiceSectionId = default(string)) + /// The destination billing + /// profile id. + public TransferProductRequestProperties(string destinationInvoiceSectionId = default(string), string destinationBillingProfileId = default(string)) { DestinationInvoiceSectionId = destinationInvoiceSectionId; + DestinationBillingProfileId = destinationBillingProfileId; CustomInit(); } @@ -45,10 +48,16 @@ public TransferProductRequestProperties() partial void CustomInit(); /// - /// Gets or sets destination invoice section id. + /// Gets or sets the destination invoice section id. /// [JsonProperty(PropertyName = "destinationInvoiceSectionId")] public string DestinationInvoiceSectionId { get; set; } + /// + /// Gets or sets the destination billing profile id. + /// + [JsonProperty(PropertyName = "destinationBillingProfileId")] + public string DestinationBillingProfileId { get; set; } + } } diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/UpdateAutoRenewOperationSummary.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/UpdateAutoRenewOperation.cs similarity index 84% rename from sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/UpdateAutoRenewOperationSummary.cs rename to sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/UpdateAutoRenewOperation.cs index 7df5ea8e5aca..d30e817542b0 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/UpdateAutoRenewOperationSummary.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/UpdateAutoRenewOperation.cs @@ -19,23 +19,21 @@ namespace Microsoft.Azure.Management.Billing.Models /// Summary of cancel product operation /// [Rest.Serialization.JsonTransformation] - public partial class UpdateAutoRenewOperationSummary + public partial class UpdateAutoRenewOperation { /// - /// Initializes a new instance of the UpdateAutoRenewOperationSummary - /// class. + /// Initializes a new instance of the UpdateAutoRenewOperation class. /// - public UpdateAutoRenewOperationSummary() + public UpdateAutoRenewOperation() { CustomInit(); } /// - /// Initializes a new instance of the UpdateAutoRenewOperationSummary - /// class. + /// Initializes a new instance of the UpdateAutoRenewOperation class. /// /// The end date of this asset - public UpdateAutoRenewOperationSummary(System.DateTime? endDate = default(System.DateTime?)) + public UpdateAutoRenewOperation(System.DateTime? endDate = default(System.DateTime?)) { EndDate = endDate; CustomInit(); diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ValidateAddressResponse.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ValidateAddressResponse.cs new file mode 100644 index 000000000000..076c6728e33d --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ValidateAddressResponse.cs @@ -0,0 +1,72 @@ +// +// 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; + + /// + /// Result of the address validation + /// + public partial class ValidateAddressResponse + { + /// + /// Initializes a new instance of the ValidateAddressResponse class. + /// + public ValidateAddressResponse() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ValidateAddressResponse class. + /// + /// status of the address validation. Possible + /// values include: 'Valid', 'Invalid' + /// list of suggested + /// addresses. + /// Validation error message. + public ValidateAddressResponse(string status = default(string), IList suggestedAddresses = default(IList), string validationMessage = default(string)) + { + Status = status; + SuggestedAddresses = suggestedAddresses; + ValidationMessage = validationMessage; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets status of the address validation. Possible values + /// include: 'Valid', 'Invalid' + /// + [JsonProperty(PropertyName = "status")] + public string Status { get; set; } + + /// + /// Gets or sets list of suggested addresses. + /// + [JsonProperty(PropertyName = "suggestedAddresses")] + public IList SuggestedAddresses { get; set; } + + /// + /// Gets or sets validation error message. + /// + [JsonProperty(PropertyName = "validationMessage")] + public string ValidationMessage { get; set; } + + } +} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ValidateProductTransferEligibilityError.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ValidateProductTransferEligibilityError.cs new file mode 100644 index 000000000000..6d06b5bcc559 --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ValidateProductTransferEligibilityError.cs @@ -0,0 +1,84 @@ +// +// 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 details of the product transfer eligibility validation. + /// + public partial class ValidateProductTransferEligibilityError + { + /// + /// Initializes a new instance of the + /// ValidateProductTransferEligibilityError class. + /// + public ValidateProductTransferEligibilityError() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// ValidateProductTransferEligibilityError class. + /// + /// Error code for the product transfer validation. + /// Possible values include: 'InvalidSource', 'ProductNotActive', + /// 'InsufficientPermissionOnSource', + /// 'InsufficientPermissionOnDestination', + /// 'DestinationBillingProfilePastDue', 'ProductTypeNotSupported', + /// 'CrossBillingAccountNotAllowed', + /// 'NotAvailableForDestinationMarket', + /// 'OneTimePurchaseProductTransferNotAllowed' + /// The error message. + /// Detailed error message explaining the + /// error. + public ValidateProductTransferEligibilityError(string code = default(string), string message = default(string), string details = default(string)) + { + Code = code; + Message = message; + Details = details; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets error code for the product transfer validation. + /// Possible values include: 'InvalidSource', 'ProductNotActive', + /// 'InsufficientPermissionOnSource', + /// 'InsufficientPermissionOnDestination', + /// 'DestinationBillingProfilePastDue', 'ProductTypeNotSupported', + /// 'CrossBillingAccountNotAllowed', + /// 'NotAvailableForDestinationMarket', + /// 'OneTimePurchaseProductTransferNotAllowed' + /// + [JsonProperty(PropertyName = "code")] + public string Code { get; set; } + + /// + /// Gets or sets the error message. + /// + [JsonProperty(PropertyName = "message")] + public string Message { get; set; } + + /// + /// Gets or sets detailed error message explaining the error. + /// + [JsonProperty(PropertyName = "details")] + public string Details { get; set; } + + } +} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ValidateProductTransferEligibilityResult.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ValidateProductTransferEligibilityResult.cs new file mode 100644 index 000000000000..20546dd70c0f --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ValidateProductTransferEligibilityResult.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 Newtonsoft.Json; + using System.Linq; + + /// + /// Result of the product transfer eligibility validation. + /// + public partial class ValidateProductTransferEligibilityResult + { + /// + /// Initializes a new instance of the + /// ValidateProductTransferEligibilityResult class. + /// + public ValidateProductTransferEligibilityResult() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// ValidateProductTransferEligibilityResult class. + /// + /// Specifies whether the transfer is + /// eligible or not. + /// Validation error details. + public ValidateProductTransferEligibilityResult(bool? isTransferEligible = default(bool?), ValidateProductTransferEligibilityError errorDetails = default(ValidateProductTransferEligibilityError)) + { + IsTransferEligible = isTransferEligible; + ErrorDetails = errorDetails; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets specifies whether the transfer is eligible or not. + /// + [JsonProperty(PropertyName = "isTransferEligible")] + public bool? IsTransferEligible { get; private set; } + + /// + /// Gets or sets validation error details. + /// + [JsonProperty(PropertyName = "errorDetails")] + public ValidateProductTransferEligibilityError ErrorDetails { get; set; } + + } +} 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 new file mode 100644 index 000000000000..93b4696ea517 --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ValidateSubscriptionTransferEligibilityError.cs @@ -0,0 +1,81 @@ +// +// 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 details of the transfer eligibility validation + /// + public partial class ValidateSubscriptionTransferEligibilityError + { + /// + /// Initializes a new instance of the + /// ValidateSubscriptionTransferEligibilityError class. + /// + public ValidateSubscriptionTransferEligibilityError() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// ValidateSubscriptionTransferEligibilityError class. + /// + /// Error code for the product transfer validation. + /// Possible values include: 'InvalidSource', 'SubscriptionNotActive', + /// 'InsufficientPermissionOnSource', + /// 'InsufficientPermissionOnDestination', + /// 'DestinationBillingProfilePastDue', 'SubscriptionTypeNotSupported', + /// 'CrossBillingAccountNotAllowed', + /// 'NotAvailableForDestinationMarket' + /// The error message. + /// Detailed error message explaining the + /// error. + public ValidateSubscriptionTransferEligibilityError(string code = default(string), string message = default(string), string details = default(string)) + { + Code = code; + Message = message; + Details = details; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets error code for the product transfer validation. + /// Possible values include: 'InvalidSource', 'SubscriptionNotActive', + /// 'InsufficientPermissionOnSource', + /// 'InsufficientPermissionOnDestination', + /// 'DestinationBillingProfilePastDue', 'SubscriptionTypeNotSupported', + /// 'CrossBillingAccountNotAllowed', 'NotAvailableForDestinationMarket' + /// + [JsonProperty(PropertyName = "code")] + public string Code { get; set; } + + /// + /// Gets or sets the error message. + /// + [JsonProperty(PropertyName = "message")] + public string Message { get; set; } + + /// + /// Gets or sets detailed error message explaining the error. + /// + [JsonProperty(PropertyName = "details")] + public string Details { get; set; } + + } +} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ValidateSubscriptionTransferEligibilityResult.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ValidateSubscriptionTransferEligibilityResult.cs new file mode 100644 index 000000000000..d467475793ba --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ValidateSubscriptionTransferEligibilityResult.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 Newtonsoft.Json; + using System.Linq; + + /// + /// Result of the transfer eligibility validation. + /// + public partial class ValidateSubscriptionTransferEligibilityResult + { + /// + /// Initializes a new instance of the + /// ValidateSubscriptionTransferEligibilityResult class. + /// + public ValidateSubscriptionTransferEligibilityResult() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// ValidateSubscriptionTransferEligibilityResult class. + /// + /// Specifies whether the transfer is + /// eligible or not. + /// Validation error details. + public ValidateSubscriptionTransferEligibilityResult(bool? isTransferEligible = default(bool?), ValidateSubscriptionTransferEligibilityError errorDetails = default(ValidateSubscriptionTransferEligibilityError)) + { + IsTransferEligible = isTransferEligible; + ErrorDetails = errorDetails; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets specifies whether the transfer is eligible or not. + /// + [JsonProperty(PropertyName = "isTransferEligible")] + public bool? IsTransferEligible { get; private set; } + + /// + /// Gets or sets validation error details. + /// + [JsonProperty(PropertyName = "errorDetails")] + public ValidateSubscriptionTransferEligibilityError ErrorDetails { get; set; } + + } +} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ValidateTransferListResponse.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ValidateTransferListResponse.cs new file mode 100644 index 000000000000..de0740ec9920 --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ValidateTransferListResponse.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; + + /// + /// Result of transfer validation. + /// + public partial class ValidateTransferListResponse + { + /// + /// Initializes a new instance of the ValidateTransferListResponse + /// class. + /// + public ValidateTransferListResponse() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ValidateTransferListResponse + /// class. + /// + /// The list of transfer validation + /// results. + /// The link (url) to the next page of + /// results. + public ValidateTransferListResponse(IList value = default(IList), string nextLink = default(string)) + { + Value = value; + NextLink = nextLink; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the list of transfer validation results. + /// + [JsonProperty(PropertyName = "value")] + public IList Value { get; private set; } + + /// + /// Gets the link (url) to the next page of results. + /// + [JsonProperty(PropertyName = "nextLink")] + public string NextLink { get; private set; } + + } +} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ValidateTransferResponse.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ValidateTransferResponse.cs new file mode 100644 index 000000000000..e5ff705c05b1 --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ValidateTransferResponse.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 Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Transfer validation response. + /// + [Rest.Serialization.JsonTransformation] + public partial class ValidateTransferResponse + { + /// + /// Initializes a new instance of the ValidateTransferResponse class. + /// + public ValidateTransferResponse() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ValidateTransferResponse class. + /// + /// The status of validation + /// The product id for which this result + /// applies. + /// Array of validation results. + public ValidateTransferResponse(string status = default(string), string productId = default(string), IList results = default(IList)) + { + Status = status; + ProductId = productId; + Results = results; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the status of validation + /// + [JsonProperty(PropertyName = "properties.status")] + public string Status { get; private set; } + + /// + /// Gets the product id for which this result applies. + /// + [JsonProperty(PropertyName = "properties.productId")] + public string ProductId { get; private set; } + + /// + /// Gets or sets array of validation results. + /// + [JsonProperty(PropertyName = "properties.results")] + public IList Results { get; set; } + + } +} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ValidationResultProperties.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ValidationResultProperties.cs new file mode 100644 index 000000000000..5f59a5f39c39 --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ValidationResultProperties.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; + + /// + /// The properties of the validation result. + /// + public partial class ValidationResultProperties + { + /// + /// Initializes a new instance of the ValidationResultProperties class. + /// + public ValidationResultProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ValidationResultProperties class. + /// + /// Result Level. + /// Result Code. + /// The validation message. + public ValidationResultProperties(string level = default(string), string code = default(string), string message = default(string)) + { + Level = level; + Code = code; + Message = message; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets result Level. + /// + [JsonProperty(PropertyName = "level")] + public string Level { get; private set; } + + /// + /// Gets result Code. + /// + [JsonProperty(PropertyName = "code")] + public string Code { get; private set; } + + /// + /// Gets the validation message. + /// + [JsonProperty(PropertyName = "message")] + public string Message { get; private set; } + + } +} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ViewChargesPolicy.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ViewChargesPolicy.cs new file mode 100644 index 000000000000..7b579b67e345 --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ViewChargesPolicy.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 ViewChargesPolicy. + /// + public static class ViewChargesPolicy + { + public const string None = "None"; + public const string SubscriptionOwner = "SubscriptionOwner"; + } +} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/PartnerTransfersOperations.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/PartnerTransfersOperations.cs new file mode 100644 index 000000000000..84085899e0d6 --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/PartnerTransfersOperations.cs @@ -0,0 +1,647 @@ +// +// 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; + + /// + /// PartnerTransfersOperations operations. + /// + internal partial class PartnerTransfersOperations : IServiceOperations, IPartnerTransfersOperations + { + /// + /// Initializes a new instance of the PartnerTransfersOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal PartnerTransfersOperations(BillingManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the BillingManagementClient + /// + public BillingManagementClient Client { get; private set; } + + /// + /// Initiates the request to transfer the legacy subscriptions or RIs. + /// + /// + /// billing Account Id. + /// + /// + /// Billing Profile Id. + /// + /// + /// Customer name. + /// + /// + /// Parameters supplied to initiate the transfer. + /// + /// + /// 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> InitiateWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string customerName, InitiateTransferRequest parameters, 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"); + } + if (customerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "customerName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("billingAccountName", billingAccountName); + tracingParameters.Add("billingProfileName", billingProfileName); + tracingParameters.Add("customerName", customerName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Initiate", 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}/customers/{customerName}/initiateTransfer").ToString(); + _url = _url.Replace("{billingAccountName}", System.Uri.EscapeDataString(billingAccountName)); + _url = _url.Replace("{billingProfileName}", System.Uri.EscapeDataString(billingProfileName)); + _url = _url.Replace("{customerName}", System.Uri.EscapeDataString(customerName)); + 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("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(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, 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) + { + 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; + } + + /// + /// Gets the transfer details for given transfer Id. + /// + /// + /// billing Account Id. + /// + /// + /// Billing Profile Id. + /// + /// + /// Customer name. + /// + /// + /// Transfer Name. + /// + /// + /// 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> GetWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string customerName, string transferName, 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"); + } + if (customerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "customerName"); + } + if (transferName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "transferName"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("billingAccountName", billingAccountName); + tracingParameters.Add("billingProfileName", billingProfileName); + tracingParameters.Add("customerName", customerName); + tracingParameters.Add("transferName", transferName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", 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}/customers/{customerName}/transfers/{transferName}").ToString(); + _url = _url.Replace("{billingAccountName}", System.Uri.EscapeDataString(billingAccountName)); + _url = _url.Replace("{billingProfileName}", System.Uri.EscapeDataString(billingProfileName)); + _url = _url.Replace("{customerName}", System.Uri.EscapeDataString(customerName)); + _url = _url.Replace("{transferName}", System.Uri.EscapeDataString(transferName)); + 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; + } + + /// + /// Cancels the transfer for given transfer Id. + /// + /// + /// billing Account Id. + /// + /// + /// Billing Profile Id. + /// + /// + /// Customer name. + /// + /// + /// Transfer Name. + /// + /// + /// 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> CancelWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string customerName, string transferName, 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"); + } + if (customerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "customerName"); + } + if (transferName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "transferName"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("billingAccountName", billingAccountName); + tracingParameters.Add("billingProfileName", billingProfileName); + tracingParameters.Add("customerName", customerName); + tracingParameters.Add("transferName", transferName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Cancel", 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}/customers/{customerName}/transfers/{transferName}").ToString(); + _url = _url.Replace("{billingAccountName}", System.Uri.EscapeDataString(billingAccountName)); + _url = _url.Replace("{billingProfileName}", System.Uri.EscapeDataString(billingProfileName)); + _url = _url.Replace("{customerName}", System.Uri.EscapeDataString(customerName)); + _url = _url.Replace("{transferName}", System.Uri.EscapeDataString(transferName)); + 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("DELETE"); + _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/PartnerTransfersOperationsExtensions.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/PartnerTransfersOperationsExtensions.cs new file mode 100644 index 000000000000..8860052a15e9 --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/PartnerTransfersOperationsExtensions.cs @@ -0,0 +1,181 @@ +// +// 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 PartnerTransfersOperations. + /// + public static partial class PartnerTransfersOperationsExtensions + { + /// + /// Initiates the request to transfer the legacy subscriptions or RIs. + /// + /// + /// The operations group for this extension method. + /// + /// + /// billing Account Id. + /// + /// + /// Billing Profile Id. + /// + /// + /// Customer name. + /// + /// + /// Parameters supplied to initiate the transfer. + /// + public static TransferDetails Initiate(this IPartnerTransfersOperations operations, string billingAccountName, string billingProfileName, string customerName, InitiateTransferRequest parameters) + { + return operations.InitiateAsync(billingAccountName, billingProfileName, customerName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Initiates the request to transfer the legacy subscriptions or RIs. + /// + /// + /// The operations group for this extension method. + /// + /// + /// billing Account Id. + /// + /// + /// Billing Profile Id. + /// + /// + /// Customer name. + /// + /// + /// Parameters supplied to initiate the transfer. + /// + /// + /// The cancellation token. + /// + public static async Task InitiateAsync(this IPartnerTransfersOperations operations, string billingAccountName, string billingProfileName, string customerName, InitiateTransferRequest parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.InitiateWithHttpMessagesAsync(billingAccountName, billingProfileName, customerName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets the transfer details for given transfer Id. + /// + /// + /// The operations group for this extension method. + /// + /// + /// billing Account Id. + /// + /// + /// Billing Profile Id. + /// + /// + /// Customer name. + /// + /// + /// Transfer Name. + /// + public static TransferDetails Get(this IPartnerTransfersOperations operations, string billingAccountName, string billingProfileName, string customerName, string transferName) + { + return operations.GetAsync(billingAccountName, billingProfileName, customerName, transferName).GetAwaiter().GetResult(); + } + + /// + /// Gets the transfer details for given transfer Id. + /// + /// + /// The operations group for this extension method. + /// + /// + /// billing Account Id. + /// + /// + /// Billing Profile Id. + /// + /// + /// Customer name. + /// + /// + /// Transfer Name. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IPartnerTransfersOperations operations, string billingAccountName, string billingProfileName, string customerName, string transferName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(billingAccountName, billingProfileName, customerName, transferName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Cancels the transfer for given transfer Id. + /// + /// + /// The operations group for this extension method. + /// + /// + /// billing Account Id. + /// + /// + /// Billing Profile Id. + /// + /// + /// Customer name. + /// + /// + /// Transfer Name. + /// + public static TransferDetails Cancel(this IPartnerTransfersOperations operations, string billingAccountName, string billingProfileName, string customerName, string transferName) + { + return operations.CancelAsync(billingAccountName, billingProfileName, customerName, transferName).GetAwaiter().GetResult(); + } + + /// + /// Cancels the transfer for given transfer Id. + /// + /// + /// The operations group for this extension method. + /// + /// + /// billing Account Id. + /// + /// + /// Billing Profile Id. + /// + /// + /// Customer name. + /// + /// + /// Transfer Name. + /// + /// + /// The cancellation token. + /// + public static async Task CancelAsync(this IPartnerTransfersOperations operations, string billingAccountName, string billingProfileName, string customerName, string transferName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CancelWithHttpMessagesAsync(billingAccountName, billingProfileName, customerName, transferName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/PartnerTransfersTransfersOperations.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/PartnerTransfersTransfersOperations.cs new file mode 100644 index 000000000000..76b9b237a451 --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/PartnerTransfersTransfersOperations.cs @@ -0,0 +1,409 @@ +// +// 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; + + /// + /// PartnerTransfersTransfersOperations operations. + /// + internal partial class PartnerTransfersTransfersOperations : IServiceOperations, IPartnerTransfersTransfersOperations + { + /// + /// Initializes a new instance of the PartnerTransfersTransfersOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal PartnerTransfersTransfersOperations(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 all transfer's details initiated from given invoice section. + /// + /// + /// billing Account Id. + /// + /// + /// Billing Profile Id. + /// + /// + /// Customer name. + /// + /// + /// 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>> ListWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string customerName, 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"); + } + if (customerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "customerName"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("billingAccountName", billingAccountName); + tracingParameters.Add("billingProfileName", billingProfileName); + tracingParameters.Add("customerName", customerName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", 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}/customers/{customerName}/transfers").ToString(); + _url = _url.Replace("{billingAccountName}", System.Uri.EscapeDataString(billingAccountName)); + _url = _url.Replace("{billingProfileName}", System.Uri.EscapeDataString(billingProfileName)); + _url = _url.Replace("{customerName}", System.Uri.EscapeDataString(customerName)); + 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 all transfer's details initiated from given invoice section. + /// + /// + /// 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>> ListNextWithHttpMessagesAsync(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, "ListNext", 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/PartnerTransfersTransfersOperationsExtensions.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/PartnerTransfersTransfersOperationsExtensions.cs new file mode 100644 index 000000000000..92744de0099d --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/PartnerTransfersTransfersOperationsExtensions.cs @@ -0,0 +1,105 @@ +// +// 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 PartnerTransfersTransfersOperations. + /// + public static partial class PartnerTransfersTransfersOperationsExtensions + { + /// + /// Lists all transfer's details initiated from given invoice section. + /// + /// + /// The operations group for this extension method. + /// + /// + /// billing Account Id. + /// + /// + /// Billing Profile Id. + /// + /// + /// Customer name. + /// + public static IPage List(this IPartnerTransfersTransfersOperations operations, string billingAccountName, string billingProfileName, string customerName) + { + return operations.ListAsync(billingAccountName, billingProfileName, customerName).GetAwaiter().GetResult(); + } + + /// + /// Lists all transfer's details initiated from given invoice section. + /// + /// + /// The operations group for this extension method. + /// + /// + /// billing Account Id. + /// + /// + /// Billing Profile Id. + /// + /// + /// Customer name. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IPartnerTransfersTransfersOperations operations, string billingAccountName, string billingProfileName, string customerName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(billingAccountName, billingProfileName, customerName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Lists all transfer's details initiated from given invoice section. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListNext(this IPartnerTransfersTransfersOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists all transfer's details initiated from given invoice section. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListNextAsync(this IPartnerTransfersTransfersOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/PaymentMethodsOperations.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/PaymentMethodsOperations.cs index 374230e3d8d2..e624b752ef7a 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/PaymentMethodsOperations.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/PaymentMethodsOperations.cs @@ -52,7 +52,7 @@ internal PaymentMethodsOperations(BillingManagementClient client) /// /// Lists the Payment Methods by billing account Id. - /// + /// /// /// /// billing Account Id. @@ -78,7 +78,7 @@ internal PaymentMethodsOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByBillingAccountNameWithHttpMessagesAsync(string billingAccountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListByBillingAccountWithHttpMessagesAsync(string billingAccountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (billingAccountName == null) { @@ -97,7 +97,7 @@ internal PaymentMethodsOperations(BillingManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("billingAccountName", billingAccountName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByBillingAccountName", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListByBillingAccount", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -230,7 +230,7 @@ internal PaymentMethodsOperations(BillingManagementClient client) /// /// Lists the Payment Methods by billing profile Id. - /// + /// /// /// /// billing Account Id. @@ -259,7 +259,7 @@ internal PaymentMethodsOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByBillingProfileNameWithHttpMessagesAsync(string billingAccountName, string billingProfileName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListByBillingProfileWithHttpMessagesAsync(string billingAccountName, string billingProfileName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (billingAccountName == null) { @@ -283,7 +283,7 @@ internal PaymentMethodsOperations(BillingManagementClient client) tracingParameters.Add("billingAccountName", billingAccountName); tracingParameters.Add("billingProfileName", billingProfileName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByBillingProfileName", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListByBillingProfile", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -417,7 +417,7 @@ internal PaymentMethodsOperations(BillingManagementClient client) /// /// Lists the Payment Methods by billing account Id. - /// + /// /// /// /// The NextLink from the previous successful call to List operation. @@ -443,7 +443,7 @@ internal PaymentMethodsOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByBillingAccountNameNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListByBillingAccountNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -458,7 +458,7 @@ internal PaymentMethodsOperations(BillingManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByBillingAccountNameNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListByBillingAccountNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -586,7 +586,7 @@ internal PaymentMethodsOperations(BillingManagementClient client) /// /// Lists the Payment Methods by billing profile Id. - /// + /// /// /// /// The NextLink from the previous successful call to List operation. @@ -612,7 +612,7 @@ internal PaymentMethodsOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByBillingProfileNameNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListByBillingProfileNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -627,7 +627,7 @@ internal PaymentMethodsOperations(BillingManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByBillingProfileNameNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListByBillingProfileNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/PaymentMethodsOperationsExtensions.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/PaymentMethodsOperationsExtensions.cs index f68d86f732f4..8f13960e5ac3 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/PaymentMethodsOperationsExtensions.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/PaymentMethodsOperationsExtensions.cs @@ -23,7 +23,7 @@ public static partial class PaymentMethodsOperationsExtensions { /// /// Lists the Payment Methods by billing account Id. - /// + /// /// /// /// The operations group for this extension method. @@ -31,14 +31,14 @@ public static partial class PaymentMethodsOperationsExtensions /// /// billing Account Id. /// - public static IPage ListByBillingAccountName(this IPaymentMethodsOperations operations, string billingAccountName) + public static IPage ListByBillingAccount(this IPaymentMethodsOperations operations, string billingAccountName) { - return operations.ListByBillingAccountNameAsync(billingAccountName).GetAwaiter().GetResult(); + return operations.ListByBillingAccountAsync(billingAccountName).GetAwaiter().GetResult(); } /// /// Lists the Payment Methods by billing account Id. - /// + /// /// /// /// The operations group for this extension method. @@ -49,9 +49,9 @@ public static IPage ListByBillingAccountName(this IPaymentMethods /// /// The cancellation token. /// - public static async Task> ListByBillingAccountNameAsync(this IPaymentMethodsOperations operations, string billingAccountName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListByBillingAccountAsync(this IPaymentMethodsOperations operations, string billingAccountName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListByBillingAccountNameWithHttpMessagesAsync(billingAccountName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListByBillingAccountWithHttpMessagesAsync(billingAccountName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -59,7 +59,7 @@ public static IPage ListByBillingAccountName(this IPaymentMethods /// /// Lists the Payment Methods by billing profile Id. - /// + /// /// /// /// The operations group for this extension method. @@ -70,14 +70,14 @@ public static IPage ListByBillingAccountName(this IPaymentMethods /// /// Billing Profile Id. /// - public static IPage ListByBillingProfileName(this IPaymentMethodsOperations operations, string billingAccountName, string billingProfileName) + public static IPage ListByBillingProfile(this IPaymentMethodsOperations operations, string billingAccountName, string billingProfileName) { - return operations.ListByBillingProfileNameAsync(billingAccountName, billingProfileName).GetAwaiter().GetResult(); + return operations.ListByBillingProfileAsync(billingAccountName, billingProfileName).GetAwaiter().GetResult(); } /// /// Lists the Payment Methods by billing profile Id. - /// + /// /// /// /// The operations group for this extension method. @@ -91,9 +91,9 @@ public static IPage ListByBillingProfileName(this IPaymentMethods /// /// The cancellation token. /// - public static async Task> ListByBillingProfileNameAsync(this IPaymentMethodsOperations operations, string billingAccountName, string billingProfileName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListByBillingProfileAsync(this IPaymentMethodsOperations operations, string billingAccountName, string billingProfileName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListByBillingProfileNameWithHttpMessagesAsync(billingAccountName, billingProfileName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListByBillingProfileWithHttpMessagesAsync(billingAccountName, billingProfileName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -101,7 +101,7 @@ public static IPage ListByBillingProfileName(this IPaymentMethods /// /// Lists the Payment Methods by billing account Id. - /// + /// /// /// /// The operations group for this extension method. @@ -109,14 +109,14 @@ public static IPage ListByBillingProfileName(this IPaymentMethods /// /// The NextLink from the previous successful call to List operation. /// - public static IPage ListByBillingAccountNameNext(this IPaymentMethodsOperations operations, string nextPageLink) + public static IPage ListByBillingAccountNext(this IPaymentMethodsOperations operations, string nextPageLink) { - return operations.ListByBillingAccountNameNextAsync(nextPageLink).GetAwaiter().GetResult(); + return operations.ListByBillingAccountNextAsync(nextPageLink).GetAwaiter().GetResult(); } /// /// Lists the Payment Methods by billing account Id. - /// + /// /// /// /// The operations group for this extension method. @@ -127,9 +127,9 @@ public static IPage ListByBillingAccountNameNext(this IPaymentMet /// /// The cancellation token. /// - public static async Task> ListByBillingAccountNameNextAsync(this IPaymentMethodsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListByBillingAccountNextAsync(this IPaymentMethodsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListByBillingAccountNameNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListByBillingAccountNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -137,7 +137,7 @@ public static IPage ListByBillingAccountNameNext(this IPaymentMet /// /// Lists the Payment Methods by billing profile Id. - /// + /// /// /// /// The operations group for this extension method. @@ -145,14 +145,14 @@ public static IPage ListByBillingAccountNameNext(this IPaymentMet /// /// The NextLink from the previous successful call to List operation. /// - public static IPage ListByBillingProfileNameNext(this IPaymentMethodsOperations operations, string nextPageLink) + public static IPage ListByBillingProfileNext(this IPaymentMethodsOperations operations, string nextPageLink) { - return operations.ListByBillingProfileNameNextAsync(nextPageLink).GetAwaiter().GetResult(); + return operations.ListByBillingProfileNextAsync(nextPageLink).GetAwaiter().GetResult(); } /// /// Lists the Payment Methods by billing profile Id. - /// + /// /// /// /// The operations group for this extension method. @@ -163,9 +163,9 @@ public static IPage ListByBillingProfileNameNext(this IPaymentMet /// /// The cancellation token. /// - public static async Task> ListByBillingProfileNameNextAsync(this IPaymentMethodsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListByBillingProfileNextAsync(this IPaymentMethodsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListByBillingProfileNameNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + 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/PoliciesOperations.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/PoliciesOperations.cs index 0e0efa6ab96f..85836ea30bec 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/PoliciesOperations.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/PoliciesOperations.cs @@ -52,7 +52,7 @@ internal PoliciesOperations(BillingManagementClient client) /// /// The policy for a given billing account name and billing profile name. - /// + /// /// /// /// billing Account Id. @@ -81,7 +81,7 @@ internal PoliciesOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetByBillingProfileNameWithHttpMessagesAsync(string billingAccountName, string billingProfileName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetByBillingProfileWithHttpMessagesAsync(string billingAccountName, string billingProfileName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (billingAccountName == null) { @@ -105,7 +105,7 @@ internal PoliciesOperations(BillingManagementClient client) tracingParameters.Add("billingAccountName", billingAccountName); tracingParameters.Add("billingProfileName", billingProfileName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetByBillingProfileName", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetByBillingProfile", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/PoliciesOperationsExtensions.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/PoliciesOperationsExtensions.cs index 15938b36e44c..7ac8cdb86572 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/PoliciesOperationsExtensions.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/PoliciesOperationsExtensions.cs @@ -23,7 +23,7 @@ public static partial class PoliciesOperationsExtensions { /// /// The policy for a given billing account name and billing profile name. - /// + /// /// /// /// The operations group for this extension method. @@ -34,14 +34,14 @@ public static partial class PoliciesOperationsExtensions /// /// Billing Profile Id. /// - public static Policy GetByBillingProfileName(this IPoliciesOperations operations, string billingAccountName, string billingProfileName) + public static Policy GetByBillingProfile(this IPoliciesOperations operations, string billingAccountName, string billingProfileName) { - return operations.GetByBillingProfileNameAsync(billingAccountName, billingProfileName).GetAwaiter().GetResult(); + return operations.GetByBillingProfileAsync(billingAccountName, billingProfileName).GetAwaiter().GetResult(); } /// /// The policy for a given billing account name and billing profile name. - /// + /// /// /// /// The operations group for this extension method. @@ -55,9 +55,9 @@ public static Policy GetByBillingProfileName(this IPoliciesOperations operations /// /// The cancellation token. /// - public static async Task GetByBillingProfileNameAsync(this IPoliciesOperations operations, string billingAccountName, string billingProfileName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetByBillingProfileAsync(this IPoliciesOperations operations, string billingAccountName, string billingProfileName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetByBillingProfileNameWithHttpMessagesAsync(billingAccountName, billingProfileName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetByBillingProfileWithHttpMessagesAsync(billingAccountName, billingProfileName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/PriceSheetOperations.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/PriceSheetOperations.cs index 1169c16a7a45..73c97053b8c6 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/PriceSheetOperations.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/PriceSheetOperations.cs @@ -54,10 +54,35 @@ internal PriceSheetOperations(BillingManagementClient client) /// Download price sheet for an invoice. /// /// - /// Azure Billing Account ID. + /// billing Account Id. + /// + /// + /// Billing Profile Id. /// /// - /// The name of an invoice resource. + /// Invoice Id. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> DownloadWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDownloadWithHttpMessagesAsync(billingAccountName, billingProfileName, invoiceName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Download price sheet for a billing profile. + /// + /// + /// billing Account Id. + /// + /// + /// Billing Profile Id. /// /// /// The headers that will be added to request. @@ -65,10 +90,10 @@ internal PriceSheetOperations(BillingManagementClient client) /// /// The cancellation token. /// - public async Task> DownloadWithHttpMessagesAsync(string billingAccountName, string invoiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> DownloadByBillingProfileWithHttpMessagesAsync(string billingAccountName, string billingProfileName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { // Send request - AzureOperationResponse _response = await BeginDownloadWithHttpMessagesAsync(billingAccountName, invoiceName, customHeaders, cancellationToken).ConfigureAwait(false); + AzureOperationResponse _response = await BeginDownloadByBillingProfileWithHttpMessagesAsync(billingAccountName, billingProfileName, customHeaders, cancellationToken).ConfigureAwait(false); return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } @@ -76,10 +101,13 @@ internal PriceSheetOperations(BillingManagementClient client) /// Download price sheet for an invoice. /// /// - /// Azure Billing Account ID. + /// billing Account Id. + /// + /// + /// Billing Profile Id. /// /// - /// The name of an invoice resource. + /// Invoice Id. /// /// /// Headers that will be added to request. @@ -102,7 +130,7 @@ internal PriceSheetOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginDownloadWithHttpMessagesAsync(string billingAccountName, string invoiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginDownloadWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.ApiVersion == null) { @@ -112,6 +140,10 @@ internal PriceSheetOperations(BillingManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "billingAccountName"); } + if (billingProfileName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "billingProfileName"); + } if (invoiceName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "invoiceName"); @@ -124,14 +156,16 @@ internal PriceSheetOperations(BillingManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("billingAccountName", billingAccountName); + tracingParameters.Add("billingProfileName", billingProfileName); tracingParameters.Add("invoiceName", invoiceName); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginDownload", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/{invoiceName}/pricesheet/default/download").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoices/{invoiceName}/pricesheet/default/download").ToString(); _url = _url.Replace("{billingAccountName}", System.Uri.EscapeDataString(billingAccountName)); + _url = _url.Replace("{billingProfileName}", System.Uri.EscapeDataString(billingProfileName)); _url = _url.Replace("{invoiceName}", System.Uri.EscapeDataString(invoiceName)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -271,5 +305,204 @@ internal PriceSheetOperations(BillingManagementClient client) return _result; } + /// + /// Download price sheet for a billing profile. + /// + /// + /// billing Account Id. + /// + /// + /// Billing Profile Id. + /// + /// + /// 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> BeginDownloadByBillingProfileWithHttpMessagesAsync(string billingAccountName, string billingProfileName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (billingAccountName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "billingAccountName"); + } + if (billingProfileName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "billingProfileName"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("billingAccountName", billingAccountName); + tracingParameters.Add("billingProfileName", billingProfileName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginDownloadByBillingProfile", 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}/pricesheet/default/download").ToString(); + _url = _url.Replace("{billingAccountName}", System.Uri.EscapeDataString(billingAccountName)); + _url = _url.Replace("{billingProfileName}", System.Uri.EscapeDataString(billingProfileName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.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; + // 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; + } + } } diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/PriceSheetOperationsExtensions.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/PriceSheetOperationsExtensions.cs index 44adaa29634e..a1be5f407ad0 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/PriceSheetOperationsExtensions.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/PriceSheetOperationsExtensions.cs @@ -28,14 +28,17 @@ public static partial class PriceSheetOperationsExtensions /// The operations group for this extension method. /// /// - /// Azure Billing Account ID. + /// billing Account Id. + /// + /// + /// Billing Profile Id. /// /// - /// The name of an invoice resource. + /// Invoice Id. /// - public static DownloadUrl Download(this IPriceSheetOperations operations, string billingAccountName, string invoiceName) + public static DownloadUrl Download(this IPriceSheetOperations operations, string billingAccountName, string billingProfileName, string invoiceName) { - return operations.DownloadAsync(billingAccountName, invoiceName).GetAwaiter().GetResult(); + return operations.DownloadAsync(billingAccountName, billingProfileName, invoiceName).GetAwaiter().GetResult(); } /// @@ -45,17 +48,60 @@ public static DownloadUrl Download(this IPriceSheetOperations operations, string /// The operations group for this extension method. /// /// - /// Azure Billing Account ID. + /// billing Account Id. + /// + /// + /// Billing Profile Id. /// /// - /// The name of an invoice resource. + /// Invoice Id. + /// + /// + /// The cancellation token. + /// + public static async Task DownloadAsync(this IPriceSheetOperations operations, string billingAccountName, string billingProfileName, string invoiceName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.DownloadWithHttpMessagesAsync(billingAccountName, billingProfileName, invoiceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Download price sheet for a billing profile. + /// + /// + /// The operations group for this extension method. + /// + /// + /// billing Account Id. + /// + /// + /// Billing Profile Id. + /// + public static DownloadUrl DownloadByBillingProfile(this IPriceSheetOperations operations, string billingAccountName, string billingProfileName) + { + return operations.DownloadByBillingProfileAsync(billingAccountName, billingProfileName).GetAwaiter().GetResult(); + } + + /// + /// Download price sheet for a billing profile. + /// + /// + /// The operations group for this extension method. + /// + /// + /// billing Account Id. + /// + /// + /// Billing Profile Id. /// /// /// The cancellation token. /// - public static async Task DownloadAsync(this IPriceSheetOperations operations, string billingAccountName, string invoiceName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task DownloadByBillingProfileAsync(this IPriceSheetOperations operations, string billingAccountName, string billingProfileName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.DownloadWithHttpMessagesAsync(billingAccountName, invoiceName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.DownloadByBillingProfileWithHttpMessagesAsync(billingAccountName, billingProfileName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -68,14 +114,17 @@ public static DownloadUrl Download(this IPriceSheetOperations operations, string /// The operations group for this extension method. /// /// - /// Azure Billing Account ID. + /// billing Account Id. + /// + /// + /// Billing Profile Id. /// /// - /// The name of an invoice resource. + /// Invoice Id. /// - public static DownloadUrl BeginDownload(this IPriceSheetOperations operations, string billingAccountName, string invoiceName) + public static DownloadUrl BeginDownload(this IPriceSheetOperations operations, string billingAccountName, string billingProfileName, string invoiceName) { - return operations.BeginDownloadAsync(billingAccountName, invoiceName).GetAwaiter().GetResult(); + return operations.BeginDownloadAsync(billingAccountName, billingProfileName, invoiceName).GetAwaiter().GetResult(); } /// @@ -85,17 +134,60 @@ public static DownloadUrl BeginDownload(this IPriceSheetOperations operations, s /// The operations group for this extension method. /// /// - /// Azure Billing Account ID. + /// billing Account Id. + /// + /// + /// Billing Profile Id. /// /// - /// The name of an invoice resource. + /// Invoice Id. + /// + /// + /// The cancellation token. + /// + public static async Task BeginDownloadAsync(this IPriceSheetOperations operations, string billingAccountName, string billingProfileName, string invoiceName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginDownloadWithHttpMessagesAsync(billingAccountName, billingProfileName, invoiceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Download price sheet for a billing profile. + /// + /// + /// The operations group for this extension method. + /// + /// + /// billing Account Id. + /// + /// + /// Billing Profile Id. + /// + public static DownloadUrl BeginDownloadByBillingProfile(this IPriceSheetOperations operations, string billingAccountName, string billingProfileName) + { + return operations.BeginDownloadByBillingProfileAsync(billingAccountName, billingProfileName).GetAwaiter().GetResult(); + } + + /// + /// Download price sheet for a billing profile. + /// + /// + /// The operations group for this extension method. + /// + /// + /// billing Account Id. + /// + /// + /// Billing Profile Id. /// /// /// The cancellation token. /// - public static async Task BeginDownloadAsync(this IPriceSheetOperations operations, string billingAccountName, string invoiceName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginDownloadByBillingProfileAsync(this IPriceSheetOperations operations, string billingAccountName, string billingProfileName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.BeginDownloadWithHttpMessagesAsync(billingAccountName, invoiceName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginDownloadByBillingProfileWithHttpMessagesAsync(billingAccountName, billingProfileName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/ProductsOperations.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/ProductsOperations.cs index f6745ea37bcc..1425cc87381d 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/ProductsOperations.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/ProductsOperations.cs @@ -50,9 +50,403 @@ internal ProductsOperations(BillingManagementClient client) /// public BillingManagementClient Client { get; private set; } + /// + /// Lists products by customer id. + /// + /// + /// + /// billing Account Id. + /// + /// + /// Customer name. + /// + /// + /// May be used to filter by product type. The filter supports 'eq', 'lt', + /// 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or + /// 'not'. Tag filter is a key value pair string where key and value is + /// separated by a colon (:). + /// + /// + /// 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> ListByCustomerWithHttpMessagesAsync(string billingAccountName, string customerName, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (billingAccountName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "billingAccountName"); + } + if (customerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "customerName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("billingAccountName", billingAccountName); + tracingParameters.Add("customerName", customerName); + tracingParameters.Add("filter", filter); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByCustomer", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/customers/{customerName}/products").ToString(); + _url = _url.Replace("{billingAccountName}", System.Uri.EscapeDataString(billingAccountName)); + _url = _url.Replace("{customerName}", System.Uri.EscapeDataString(customerName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (filter != null) + { + _queryParameters.Add(string.Format("$filter={0}", System.Uri.EscapeDataString(filter))); + } + 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; + } + + /// + /// Get a customer's product by name. + /// + /// + /// + /// billing Account Id. + /// + /// + /// Customer name. + /// + /// + /// Invoice Id. + /// + /// + /// 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> GetByCustomerWithHttpMessagesAsync(string billingAccountName, string customerName, string productName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (billingAccountName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "billingAccountName"); + } + if (customerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "customerName"); + } + if (productName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "productName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("billingAccountName", billingAccountName); + tracingParameters.Add("customerName", customerName); + tracingParameters.Add("productName", productName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetByCustomer", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/customers/{customerName}/products/{productName}").ToString(); + _url = _url.Replace("{billingAccountName}", System.Uri.EscapeDataString(billingAccountName)); + _url = _url.Replace("{customerName}", System.Uri.EscapeDataString(customerName)); + _url = _url.Replace("{productName}", System.Uri.EscapeDataString(productName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.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("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 products by billing account name. - /// + /// /// /// /// billing Account Id. @@ -84,7 +478,7 @@ internal ProductsOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByBillingAccountNameWithHttpMessagesAsync(string billingAccountName, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListByBillingAccountWithHttpMessagesAsync(string billingAccountName, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (billingAccountName == null) { @@ -104,7 +498,7 @@ internal ProductsOperations(BillingManagementClient client) tracingParameters.Add("billingAccountName", billingAccountName); tracingParameters.Add("filter", filter); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByBillingAccountName", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListByBillingAccount", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -207,7 +601,7 @@ internal ProductsOperations(BillingManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -220,7 +614,7 @@ internal ProductsOperations(BillingManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -241,11 +635,14 @@ internal ProductsOperations(BillingManagementClient client) /// /// Lists products by invoice section name. - /// + /// /// /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// @@ -276,12 +673,16 @@ internal ProductsOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListByInvoiceSectionNameWithHttpMessagesAsync(string billingAccountName, string invoiceSectionName, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListByInvoiceSectionWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, string filter = 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"); + } if (invoiceSectionName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "invoiceSectionName"); @@ -298,15 +699,17 @@ internal ProductsOperations(BillingManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("billingAccountName", billingAccountName); + tracingParameters.Add("billingProfileName", billingProfileName); tracingParameters.Add("invoiceSectionName", invoiceSectionName); tracingParameters.Add("filter", filter); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByInvoiceSectionName", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListByInvoiceSection", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/products").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/products").ToString(); _url = _url.Replace("{billingAccountName}", System.Uri.EscapeDataString(billingAccountName)); + _url = _url.Replace("{billingProfileName}", System.Uri.EscapeDataString(billingProfileName)); _url = _url.Replace("{invoiceSectionName}", System.Uri.EscapeDataString(invoiceSectionName)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -439,11 +842,14 @@ internal ProductsOperations(BillingManagementClient client) /// /// Get a single product by name. - /// + /// /// /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// @@ -471,12 +877,16 @@ internal ProductsOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string billingAccountName, string invoiceSectionName, string productName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, string productName, 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"); + } if (invoiceSectionName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "invoiceSectionName"); @@ -497,6 +907,7 @@ internal ProductsOperations(BillingManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("billingAccountName", billingAccountName); + tracingParameters.Add("billingProfileName", billingProfileName); tracingParameters.Add("invoiceSectionName", invoiceSectionName); tracingParameters.Add("productName", productName); tracingParameters.Add("cancellationToken", cancellationToken); @@ -504,8 +915,9 @@ internal ProductsOperations(BillingManagementClient client) } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/products/{productName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/products/{productName}").ToString(); _url = _url.Replace("{billingAccountName}", System.Uri.EscapeDataString(billingAccountName)); + _url = _url.Replace("{billingProfileName}", System.Uri.EscapeDataString(billingProfileName)); _url = _url.Replace("{invoiceSectionName}", System.Uri.EscapeDataString(invoiceSectionName)); _url = _url.Replace("{productName}", System.Uri.EscapeDataString(productName)); List _queryParameters = new List(); @@ -601,7 +1013,7 @@ internal ProductsOperations(BillingManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -614,7 +1026,7 @@ internal ProductsOperations(BillingManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -639,6 +1051,9 @@ internal ProductsOperations(BillingManagementClient client) /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// @@ -669,12 +1084,16 @@ internal ProductsOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> TransferWithHttpMessagesAsync(string billingAccountName, string invoiceSectionName, string productName, TransferProductRequestProperties parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> TransferWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, string productName, TransferProductRequestProperties parameters, 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"); + } if (invoiceSectionName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "invoiceSectionName"); @@ -699,6 +1118,7 @@ internal ProductsOperations(BillingManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("billingAccountName", billingAccountName); + tracingParameters.Add("billingProfileName", billingProfileName); tracingParameters.Add("invoiceSectionName", invoiceSectionName); tracingParameters.Add("productName", productName); tracingParameters.Add("parameters", parameters); @@ -707,8 +1127,9 @@ internal ProductsOperations(BillingManagementClient client) } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/products/{productName}/transfer").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/products/{productName}/transfer").ToString(); _url = _url.Replace("{billingAccountName}", System.Uri.EscapeDataString(billingAccountName)); + _url = _url.Replace("{billingProfileName}", System.Uri.EscapeDataString(billingProfileName)); _url = _url.Replace("{invoiceSectionName}", System.Uri.EscapeDataString(invoiceSectionName)); _url = _url.Replace("{productName}", System.Uri.EscapeDataString(productName)); List _queryParameters = new List(); @@ -810,7 +1231,7 @@ internal ProductsOperations(BillingManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -823,7 +1244,7 @@ internal ProductsOperations(BillingManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -855,6 +1276,216 @@ internal ProductsOperations(BillingManagementClient client) return _result; } + /// + /// Validates the transfer of products across invoice sections. + /// + /// + /// billing Account Id. + /// + /// + /// Billing Profile Id. + /// + /// + /// InvoiceSection Id. + /// + /// + /// Invoice Id. + /// + /// + /// Parameters supplied to the Transfer Products 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> ValidateTransferWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, string productName, TransferProductRequestProperties parameters, 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"); + } + if (invoiceSectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "invoiceSectionName"); + } + if (productName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "productName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("billingAccountName", billingAccountName); + tracingParameters.Add("billingProfileName", billingProfileName); + tracingParameters.Add("invoiceSectionName", invoiceSectionName); + tracingParameters.Add("productName", productName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ValidateTransfer", 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}/invoiceSections/{invoiceSectionName}/products/{productName}/validateTransferEligibility").ToString(); + _url = _url.Replace("{billingAccountName}", System.Uri.EscapeDataString(billingAccountName)); + _url = _url.Replace("{billingProfileName}", System.Uri.EscapeDataString(billingProfileName)); + _url = _url.Replace("{invoiceSectionName}", System.Uri.EscapeDataString(invoiceSectionName)); + _url = _url.Replace("{productName}", System.Uri.EscapeDataString(productName)); + 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("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(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, 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) + { + 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; + } + /// /// Cancel auto renew for product by product id and billing account name /// @@ -888,7 +1519,7 @@ internal ProductsOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateAutoRenewByBillingAccountNameWithHttpMessagesAsync(string billingAccountName, string productName, UpdateAutoRenewRequest body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateAutoRenewByBillingAccountWithHttpMessagesAsync(string billingAccountName, string productName, UpdateAutoRenewRequest body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (billingAccountName == null) { @@ -917,7 +1548,7 @@ internal ProductsOperations(BillingManagementClient client) tracingParameters.Add("productName", productName); tracingParameters.Add("body", body); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateAutoRenewByBillingAccountName", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateAutoRenewByBillingAccount", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -1023,7 +1654,7 @@ internal ProductsOperations(BillingManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1036,7 +1667,7 @@ internal ProductsOperations(BillingManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -1061,6 +1692,9 @@ internal ProductsOperations(BillingManagementClient client) /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// @@ -1091,12 +1725,16 @@ internal ProductsOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateAutoRenewByInvoiceSectionNameWithHttpMessagesAsync(string billingAccountName, string invoiceSectionName, string productName, UpdateAutoRenewRequest body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateAutoRenewByInvoiceSectionWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, string productName, UpdateAutoRenewRequest body, 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"); + } if (invoiceSectionName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "invoiceSectionName"); @@ -1121,16 +1759,18 @@ internal ProductsOperations(BillingManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("billingAccountName", billingAccountName); + tracingParameters.Add("billingProfileName", billingProfileName); tracingParameters.Add("invoiceSectionName", invoiceSectionName); tracingParameters.Add("productName", productName); tracingParameters.Add("body", body); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateAutoRenewByInvoiceSectionName", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateAutoRenewByInvoiceSection", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/products/{productName}/updateAutoRenew").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/products/{productName}/updateAutoRenew").ToString(); _url = _url.Replace("{billingAccountName}", System.Uri.EscapeDataString(billingAccountName)); + _url = _url.Replace("{billingProfileName}", System.Uri.EscapeDataString(billingProfileName)); _url = _url.Replace("{invoiceSectionName}", System.Uri.EscapeDataString(invoiceSectionName)); _url = _url.Replace("{productName}", System.Uri.EscapeDataString(productName)); List _queryParameters = new List(); @@ -1232,7 +1872,7 @@ internal ProductsOperations(BillingManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1245,7 +1885,7 @@ internal ProductsOperations(BillingManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -1266,7 +1906,7 @@ internal ProductsOperations(BillingManagementClient client) /// /// Lists products by billing account name. - /// + /// /// /// /// The NextLink from the previous successful call to List operation. @@ -1292,7 +1932,7 @@ internal ProductsOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByBillingAccountNameNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListByBillingAccountNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -1307,7 +1947,7 @@ internal ProductsOperations(BillingManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByBillingAccountNameNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListByBillingAccountNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -1401,7 +2041,7 @@ internal ProductsOperations(BillingManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1414,7 +2054,7 @@ internal ProductsOperations(BillingManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/ProductsOperationsExtensions.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/ProductsOperationsExtensions.cs index d8574bf10be0..3389be778b58 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/ProductsOperationsExtensions.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/ProductsOperationsExtensions.cs @@ -21,9 +21,111 @@ namespace Microsoft.Azure.Management.Billing /// public static partial class ProductsOperationsExtensions { + /// + /// Lists products by customer id. + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// billing Account Id. + /// + /// + /// Customer name. + /// + /// + /// May be used to filter by product type. The filter supports 'eq', 'lt', + /// 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or + /// 'not'. Tag filter is a key value pair string where key and value is + /// separated by a colon (:). + /// + public static ProductsListResult ListByCustomer(this IProductsOperations operations, string billingAccountName, string customerName, string filter = default(string)) + { + return operations.ListByCustomerAsync(billingAccountName, customerName, filter).GetAwaiter().GetResult(); + } + + /// + /// Lists products by customer id. + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// billing Account Id. + /// + /// + /// Customer name. + /// + /// + /// May be used to filter by product type. The filter supports 'eq', 'lt', + /// 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or + /// 'not'. Tag filter is a key value pair string where key and value is + /// separated by a colon (:). + /// + /// + /// The cancellation token. + /// + public static async Task ListByCustomerAsync(this IProductsOperations operations, string billingAccountName, string customerName, string filter = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByCustomerWithHttpMessagesAsync(billingAccountName, customerName, filter, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Get a customer's product by name. + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// billing Account Id. + /// + /// + /// Customer name. + /// + /// + /// Invoice Id. + /// + public static Product GetByCustomer(this IProductsOperations operations, string billingAccountName, string customerName, string productName) + { + return operations.GetByCustomerAsync(billingAccountName, customerName, productName).GetAwaiter().GetResult(); + } + + /// + /// Get a customer's product by name. + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// billing Account Id. + /// + /// + /// Customer name. + /// + /// + /// Invoice Id. + /// + /// + /// The cancellation token. + /// + public static async Task GetByCustomerAsync(this IProductsOperations operations, string billingAccountName, string customerName, string productName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetByCustomerWithHttpMessagesAsync(billingAccountName, customerName, productName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Lists products by billing account name. - /// + /// /// /// /// The operations group for this extension method. @@ -37,14 +139,14 @@ public static partial class ProductsOperationsExtensions /// 'not'. Tag filter is a key value pair string where key and value is /// separated by a colon (:). /// - public static IPage ListByBillingAccountName(this IProductsOperations operations, string billingAccountName, string filter = default(string)) + public static IPage ListByBillingAccount(this IProductsOperations operations, string billingAccountName, string filter = default(string)) { - return operations.ListByBillingAccountNameAsync(billingAccountName, filter).GetAwaiter().GetResult(); + return operations.ListByBillingAccountAsync(billingAccountName, filter).GetAwaiter().GetResult(); } /// /// Lists products by billing account name. - /// + /// /// /// /// The operations group for this extension method. @@ -61,9 +163,9 @@ public static partial class ProductsOperationsExtensions /// /// The cancellation token. /// - public static async Task> ListByBillingAccountNameAsync(this IProductsOperations operations, string billingAccountName, string filter = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListByBillingAccountAsync(this IProductsOperations operations, string billingAccountName, string filter = default(string), CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListByBillingAccountNameWithHttpMessagesAsync(billingAccountName, filter, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListByBillingAccountWithHttpMessagesAsync(billingAccountName, filter, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -71,7 +173,7 @@ public static partial class ProductsOperationsExtensions /// /// Lists products by invoice section name. - /// + /// /// /// /// The operations group for this extension method. @@ -79,6 +181,9 @@ public static partial class ProductsOperationsExtensions /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// @@ -88,14 +193,14 @@ public static partial class ProductsOperationsExtensions /// 'not'. Tag filter is a key value pair string where key and value is /// separated by a colon (:). /// - public static ProductsListResult ListByInvoiceSectionName(this IProductsOperations operations, string billingAccountName, string invoiceSectionName, string filter = default(string)) + public static ProductsListResult ListByInvoiceSection(this IProductsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, string filter = default(string)) { - return operations.ListByInvoiceSectionNameAsync(billingAccountName, invoiceSectionName, filter).GetAwaiter().GetResult(); + return operations.ListByInvoiceSectionAsync(billingAccountName, billingProfileName, invoiceSectionName, filter).GetAwaiter().GetResult(); } /// /// Lists products by invoice section name. - /// + /// /// /// /// The operations group for this extension method. @@ -103,6 +208,9 @@ public static partial class ProductsOperationsExtensions /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// @@ -115,9 +223,9 @@ public static partial class ProductsOperationsExtensions /// /// The cancellation token. /// - public static async Task ListByInvoiceSectionNameAsync(this IProductsOperations operations, string billingAccountName, string invoiceSectionName, string filter = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task ListByInvoiceSectionAsync(this IProductsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, string filter = default(string), CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListByInvoiceSectionNameWithHttpMessagesAsync(billingAccountName, invoiceSectionName, filter, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListByInvoiceSectionWithHttpMessagesAsync(billingAccountName, billingProfileName, invoiceSectionName, filter, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -125,7 +233,7 @@ public static partial class ProductsOperationsExtensions /// /// Get a single product by name. - /// + /// /// /// /// The operations group for this extension method. @@ -133,20 +241,23 @@ public static partial class ProductsOperationsExtensions /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// /// /// Invoice Id. /// - public static ProductSummary Get(this IProductsOperations operations, string billingAccountName, string invoiceSectionName, string productName) + public static Product Get(this IProductsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, string productName) { - return operations.GetAsync(billingAccountName, invoiceSectionName, productName).GetAwaiter().GetResult(); + return operations.GetAsync(billingAccountName, billingProfileName, invoiceSectionName, productName).GetAwaiter().GetResult(); } /// /// Get a single product by name. - /// + /// /// /// /// The operations group for this extension method. @@ -154,6 +265,9 @@ public static ProductSummary Get(this IProductsOperations operations, string bil /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// @@ -163,9 +277,9 @@ public static ProductSummary Get(this IProductsOperations operations, string bil /// /// The cancellation token. /// - public static async Task GetAsync(this IProductsOperations operations, string billingAccountName, string invoiceSectionName, string productName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetAsync(this IProductsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, string productName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(billingAccountName, invoiceSectionName, productName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetWithHttpMessagesAsync(billingAccountName, billingProfileName, invoiceSectionName, productName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -180,6 +294,9 @@ public static ProductSummary Get(this IProductsOperations operations, string bil /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// @@ -189,9 +306,9 @@ public static ProductSummary Get(this IProductsOperations operations, string bil /// /// Parameters supplied to the Transfer Product operation. /// - public static ProductSummary Transfer(this IProductsOperations operations, string billingAccountName, string invoiceSectionName, string productName, TransferProductRequestProperties parameters) + public static Product Transfer(this IProductsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, string productName, TransferProductRequestProperties parameters) { - return operations.TransferAsync(billingAccountName, invoiceSectionName, productName, parameters).GetAwaiter().GetResult(); + return operations.TransferAsync(billingAccountName, billingProfileName, invoiceSectionName, productName, parameters).GetAwaiter().GetResult(); } /// @@ -203,6 +320,9 @@ public static ProductSummary Transfer(this IProductsOperations operations, strin /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// @@ -215,9 +335,67 @@ public static ProductSummary Transfer(this IProductsOperations operations, strin /// /// The cancellation token. /// - public static async Task TransferAsync(this IProductsOperations operations, string billingAccountName, string invoiceSectionName, string productName, TransferProductRequestProperties parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task TransferAsync(this IProductsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, string productName, TransferProductRequestProperties parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.TransferWithHttpMessagesAsync(billingAccountName, billingProfileName, invoiceSectionName, productName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Validates the transfer of products across invoice sections. + /// + /// + /// The operations group for this extension method. + /// + /// + /// billing Account Id. + /// + /// + /// Billing Profile Id. + /// + /// + /// InvoiceSection Id. + /// + /// + /// Invoice Id. + /// + /// + /// Parameters supplied to the Transfer Products operation. + /// + public static ValidateProductTransferEligibilityResult ValidateTransfer(this IProductsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, string productName, TransferProductRequestProperties parameters) + { + return operations.ValidateTransferAsync(billingAccountName, billingProfileName, invoiceSectionName, productName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Validates the transfer of products across invoice sections. + /// + /// + /// The operations group for this extension method. + /// + /// + /// billing Account Id. + /// + /// + /// Billing Profile Id. + /// + /// + /// InvoiceSection Id. + /// + /// + /// Invoice Id. + /// + /// + /// Parameters supplied to the Transfer Products operation. + /// + /// + /// The cancellation token. + /// + public static async Task ValidateTransferAsync(this IProductsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, string productName, TransferProductRequestProperties parameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.TransferWithHttpMessagesAsync(billingAccountName, invoiceSectionName, productName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ValidateTransferWithHttpMessagesAsync(billingAccountName, billingProfileName, invoiceSectionName, productName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -238,9 +416,9 @@ public static ProductSummary Transfer(this IProductsOperations operations, strin /// /// Update auto renew request parameters. /// - public static UpdateAutoRenewOperationSummary UpdateAutoRenewByBillingAccountName(this IProductsOperations operations, string billingAccountName, string productName, UpdateAutoRenewRequest body) + public static UpdateAutoRenewOperation UpdateAutoRenewByBillingAccount(this IProductsOperations operations, string billingAccountName, string productName, UpdateAutoRenewRequest body) { - return operations.UpdateAutoRenewByBillingAccountNameAsync(billingAccountName, productName, body).GetAwaiter().GetResult(); + return operations.UpdateAutoRenewByBillingAccountAsync(billingAccountName, productName, body).GetAwaiter().GetResult(); } /// @@ -261,9 +439,9 @@ public static UpdateAutoRenewOperationSummary UpdateAutoRenewByBillingAccountNam /// /// The cancellation token. /// - public static async Task UpdateAutoRenewByBillingAccountNameAsync(this IProductsOperations operations, string billingAccountName, string productName, UpdateAutoRenewRequest body, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task UpdateAutoRenewByBillingAccountAsync(this IProductsOperations operations, string billingAccountName, string productName, UpdateAutoRenewRequest body, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.UpdateAutoRenewByBillingAccountNameWithHttpMessagesAsync(billingAccountName, productName, body, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.UpdateAutoRenewByBillingAccountWithHttpMessagesAsync(billingAccountName, productName, body, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -278,6 +456,9 @@ public static UpdateAutoRenewOperationSummary UpdateAutoRenewByBillingAccountNam /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// @@ -287,9 +468,9 @@ public static UpdateAutoRenewOperationSummary UpdateAutoRenewByBillingAccountNam /// /// Update auto renew request parameters. /// - public static UpdateAutoRenewOperationSummary UpdateAutoRenewByInvoiceSectionName(this IProductsOperations operations, string billingAccountName, string invoiceSectionName, string productName, UpdateAutoRenewRequest body) + public static UpdateAutoRenewOperation UpdateAutoRenewByInvoiceSection(this IProductsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, string productName, UpdateAutoRenewRequest body) { - return operations.UpdateAutoRenewByInvoiceSectionNameAsync(billingAccountName, invoiceSectionName, productName, body).GetAwaiter().GetResult(); + return operations.UpdateAutoRenewByInvoiceSectionAsync(billingAccountName, billingProfileName, invoiceSectionName, productName, body).GetAwaiter().GetResult(); } /// @@ -301,6 +482,9 @@ public static UpdateAutoRenewOperationSummary UpdateAutoRenewByInvoiceSectionNam /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// @@ -313,9 +497,9 @@ public static UpdateAutoRenewOperationSummary UpdateAutoRenewByInvoiceSectionNam /// /// The cancellation token. /// - public static async Task UpdateAutoRenewByInvoiceSectionNameAsync(this IProductsOperations operations, string billingAccountName, string invoiceSectionName, string productName, UpdateAutoRenewRequest body, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task UpdateAutoRenewByInvoiceSectionAsync(this IProductsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, string productName, UpdateAutoRenewRequest body, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.UpdateAutoRenewByInvoiceSectionNameWithHttpMessagesAsync(billingAccountName, invoiceSectionName, productName, body, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.UpdateAutoRenewByInvoiceSectionWithHttpMessagesAsync(billingAccountName, billingProfileName, invoiceSectionName, productName, body, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -323,7 +507,7 @@ public static UpdateAutoRenewOperationSummary UpdateAutoRenewByInvoiceSectionNam /// /// Lists products by billing account name. - /// + /// /// /// /// The operations group for this extension method. @@ -331,14 +515,14 @@ public static UpdateAutoRenewOperationSummary UpdateAutoRenewByInvoiceSectionNam /// /// The NextLink from the previous successful call to List operation. /// - public static IPage ListByBillingAccountNameNext(this IProductsOperations operations, string nextPageLink) + public static IPage ListByBillingAccountNext(this IProductsOperations operations, string nextPageLink) { - return operations.ListByBillingAccountNameNextAsync(nextPageLink).GetAwaiter().GetResult(); + return operations.ListByBillingAccountNextAsync(nextPageLink).GetAwaiter().GetResult(); } /// /// Lists products by billing account name. - /// + /// /// /// /// The operations group for this extension method. @@ -349,9 +533,9 @@ public static IPage ListByBillingAccountNameNext(this IProductsO /// /// The cancellation token. /// - public static async Task> ListByBillingAccountNameNextAsync(this IProductsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListByBillingAccountNextAsync(this IProductsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListByBillingAccountNameNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListByBillingAccountNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/RecipientTransfersOperations.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/RecipientTransfersOperations.cs index 379141cc8125..a37dd849bf00 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/RecipientTransfersOperations.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/RecipientTransfersOperations.cs @@ -56,8 +56,8 @@ internal RecipientTransfersOperations(BillingManagementClient client) /// /// Transfer Name. /// - /// - /// Accept transfer parameters. + /// + /// Parameters supplied to accept the transfer. /// /// /// Headers that will be added to request. @@ -80,15 +80,15 @@ internal RecipientTransfersOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> AcceptWithHttpMessagesAsync(string transferName, AcceptTransferRequest body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> AcceptWithHttpMessagesAsync(string transferName, AcceptTransferRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (transferName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "transferName"); } - if (body == null) + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "body"); + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -98,7 +98,7 @@ internal RecipientTransfersOperations(BillingManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("transferName", transferName); - tracingParameters.Add("body", body); + tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Accept", tracingParameters); } @@ -145,9 +145,9 @@ internal RecipientTransfersOperations(BillingManagementClient client) // Serialize Request string _requestContent = null; - if(body != null) + if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(body, Client.SerializationSettings); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, 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"); } @@ -233,6 +233,190 @@ internal RecipientTransfersOperations(BillingManagementClient client) return _result; } + /// + /// Validates if the products can be transferred in the context of the given + /// transfer name. + /// + /// + /// Transfer Name. + /// + /// + /// Parameters supplied to validate the transfer. + /// + /// + /// 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> ValidateWithHttpMessagesAsync(string transferName, AcceptTransferRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (transferName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "transferName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("transferName", transferName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Validate", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/transfers/{transferName}/validateTransfer").ToString(); + _url = _url.Replace("{transferName}", System.Uri.EscapeDataString(transferName)); + 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("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(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, 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) + { + 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; + } + /// /// Declines the transfer with given transfer Id. /// @@ -448,7 +632,7 @@ internal RecipientTransfersOperations(BillingManagementClient client) } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/transfers/{transferName}/").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/transfers/{transferName}").ToString(); _url = _url.Replace("{transferName}", System.Uri.EscapeDataString(transferName)); List _queryParameters = new List(); if (_queryParameters.Count > 0) diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/RecipientTransfersOperationsExtensions.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/RecipientTransfersOperationsExtensions.cs index bd0c5678ac0a..f12f304aba5f 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/RecipientTransfersOperationsExtensions.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/RecipientTransfersOperationsExtensions.cs @@ -30,12 +30,12 @@ public static partial class RecipientTransfersOperationsExtensions /// /// Transfer Name. /// - /// - /// Accept transfer parameters. + /// + /// Parameters supplied to accept the transfer. /// - public static RecipientTransferDetails Accept(this IRecipientTransfersOperations operations, string transferName, AcceptTransferRequest body) + public static RecipientTransferDetails Accept(this IRecipientTransfersOperations operations, string transferName, AcceptTransferRequest parameters) { - return operations.AcceptAsync(transferName, body).GetAwaiter().GetResult(); + return operations.AcceptAsync(transferName, parameters).GetAwaiter().GetResult(); } /// @@ -47,15 +47,57 @@ public static RecipientTransferDetails Accept(this IRecipientTransfersOperations /// /// Transfer Name. /// - /// - /// Accept transfer parameters. + /// + /// Parameters supplied to accept the transfer. /// /// /// The cancellation token. /// - public static async Task AcceptAsync(this IRecipientTransfersOperations operations, string transferName, AcceptTransferRequest body, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task AcceptAsync(this IRecipientTransfersOperations operations, string transferName, AcceptTransferRequest parameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.AcceptWithHttpMessagesAsync(transferName, body, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.AcceptWithHttpMessagesAsync(transferName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Validates if the products can be transferred in the context of the given + /// transfer name. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Transfer Name. + /// + /// + /// Parameters supplied to validate the transfer. + /// + public static ValidateTransferListResponse Validate(this IRecipientTransfersOperations operations, string transferName, AcceptTransferRequest parameters) + { + return operations.ValidateAsync(transferName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Validates if the products can be transferred in the context of the given + /// transfer name. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Transfer Name. + /// + /// + /// Parameters supplied to validate the transfer. + /// + /// + /// The cancellation token. + /// + public static async Task ValidateAsync(this IRecipientTransfersOperations operations, string transferName, AcceptTransferRequest parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ValidateWithHttpMessagesAsync(transferName, parameters, 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 ea1bcebcf0bd..df921c36912f 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 @@ -19,27 +19,32 @@ public static IEnumerable> ApiInfo_BillingManageme { return new Tuple[] { - new Tuple("Billing", "Agreements", "2018-11-01-preview"), - new Tuple("Billing", "AvailableBalances", "2018-11-01-preview"), - new Tuple("Billing", "BillingAccounts", "2018-11-01-preview"), - new Tuple("Billing", "BillingPermissions", "2018-11-01-preview"), - new Tuple("Billing", "BillingProfiles", "2018-11-01-preview"), - new Tuple("Billing", "BillingProperty", "2018-11-01-preview"), - new Tuple("Billing", "BillingRoleAssignments", "2018-11-01-preview"), - new Tuple("Billing", "BillingRoleDefinitions", "2018-11-01-preview"), - new Tuple("Billing", "BillingSubscriptions", "2018-11-01-preview"), - new Tuple("Billing", "Departments", "2018-11-01-preview"), - new Tuple("Billing", "EnrollmentAccounts", "2018-11-01-preview"), - new Tuple("Billing", "InvoiceSections", "2018-11-01-preview"), - new Tuple("Billing", "Invoices", "2018-11-01-preview"), - new Tuple("Billing", "Operations", "2018-11-01-preview"), - new Tuple("Billing", "PaymentMethods", "2018-11-01-preview"), - new Tuple("Billing", "Policies", "2018-11-01-preview"), - new Tuple("Billing", "PriceSheet", "2018-11-01-preview"), - new Tuple("Billing", "Products", "2018-11-01-preview"), - new Tuple("Billing", "RecipientTransfers", "2018-11-01-preview"), - new Tuple("Billing", "Transactions", "2018-11-01-preview"), - new Tuple("Billing", "Transfers", "2018-11-01-preview"), + new Tuple("Billing", "Address", "2019-10-01-preview"), + new Tuple("Billing", "Agreements", "2019-10-01-preview"), + new Tuple("Billing", "AvailableBalances", "2019-10-01-preview"), + new Tuple("Billing", "BillingAccounts", "2019-10-01-preview"), + new Tuple("Billing", "BillingPermissions", "2019-10-01-preview"), + new Tuple("Billing", "BillingProfiles", "2019-10-01-preview"), + new Tuple("Billing", "BillingProperty", "2019-10-01-preview"), + new Tuple("Billing", "BillingRoleAssignments", "2019-10-01-preview"), + new Tuple("Billing", "BillingRoleDefinitions", "2019-10-01-preview"), + new Tuple("Billing", "BillingSubscriptions", "2019-10-01-preview"), + new Tuple("Billing", "Customers", "2019-10-01-preview"), + new Tuple("Billing", "Departments", "2019-10-01-preview"), + new Tuple("Billing", "EnrollmentAccounts", "2019-10-01-preview"), + new Tuple("Billing", "InvoiceSections", "2019-10-01-preview"), + new Tuple("Billing", "Invoices", "2019-10-01-preview"), + new Tuple("Billing", "LineOfCredits", "2019-10-01-preview"), + new Tuple("Billing", "Operations", "2019-10-01-preview"), + new Tuple("Billing", "PartnerTransfers", "2019-10-01-preview"), + new Tuple("Billing", "PartnerTransfersTransfers", "2019-10-01-preview"), + new Tuple("Billing", "PaymentMethods", "2019-10-01-preview"), + new Tuple("Billing", "Policies", "2019-10-01-preview"), + new Tuple("Billing", "PriceSheet", "2019-10-01-preview"), + new Tuple("Billing", "Products", "2019-10-01-preview"), + new Tuple("Billing", "RecipientTransfers", "2019-10-01-preview"), + new Tuple("Billing", "Transactions", "2019-10-01-preview"), + new Tuple("Billing", "Transfers", "2019-10-01-preview"), }.AsEnumerable(); } } diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/TransactionsOperations.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/TransactionsOperations.cs index 15c25c43a851..af4f49332675 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/TransactionsOperations.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/TransactionsOperations.cs @@ -50,10 +50,232 @@ internal TransactionsOperations(BillingManagementClient client) /// public BillingManagementClient Client { get; private set; } + /// + /// Lists the transactions by customer id for given start date and end date. + /// + /// + /// + /// billing Account Id. + /// + /// + /// Customer name. + /// + /// + /// Start date + /// + /// + /// End date + /// + /// + /// May be used to filter by transaction kind. The filter supports 'eq', 'lt', + /// 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or + /// 'not'. Tag filter is a key value pair string where key and value is + /// separated by a colon (:). + /// + /// + /// 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>> ListByCustomerWithHttpMessagesAsync(string billingAccountName, string customerName, string startDate, string endDate, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (billingAccountName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "billingAccountName"); + } + if (customerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "customerName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (startDate == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "startDate"); + } + if (endDate == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "endDate"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("billingAccountName", billingAccountName); + tracingParameters.Add("customerName", customerName); + tracingParameters.Add("startDate", startDate); + tracingParameters.Add("endDate", endDate); + tracingParameters.Add("filter", filter); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByCustomer", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/customers/{customerName}/transactions").ToString(); + _url = _url.Replace("{billingAccountName}", System.Uri.EscapeDataString(billingAccountName)); + _url = _url.Replace("{customerName}", System.Uri.EscapeDataString(customerName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (startDate != null) + { + _queryParameters.Add(string.Format("startDate={0}", System.Uri.EscapeDataString(startDate))); + } + if (endDate != null) + { + _queryParameters.Add(string.Format("endDate={0}", System.Uri.EscapeDataString(endDate))); + } + if (filter != null) + { + _queryParameters.Add(string.Format("$filter={0}", System.Uri.EscapeDataString(filter))); + } + 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 transactions by billing account name for given start and end /// date. - /// + /// /// /// /// billing Account Id. @@ -91,7 +313,7 @@ internal TransactionsOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByBillingAccountNameWithHttpMessagesAsync(string billingAccountName, string startDate, string endDate, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListByBillingAccountWithHttpMessagesAsync(string billingAccountName, string startDate, string endDate, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (billingAccountName == null) { @@ -121,7 +343,7 @@ internal TransactionsOperations(BillingManagementClient client) tracingParameters.Add("endDate", endDate); tracingParameters.Add("filter", filter); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByBillingAccountName", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListByBillingAccount", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -232,7 +454,7 @@ internal TransactionsOperations(BillingManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -245,7 +467,7 @@ internal TransactionsOperations(BillingManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -267,7 +489,7 @@ internal TransactionsOperations(BillingManagementClient client) /// /// Lists the transactions by billing profile name for given start date and end /// date. - /// + /// /// /// /// billing Account Id. @@ -308,7 +530,7 @@ internal TransactionsOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListByBillingProfileNameWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string startDate, string endDate, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListByBillingProfileWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string startDate, string endDate, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (billingAccountName == null) { @@ -343,7 +565,7 @@ internal TransactionsOperations(BillingManagementClient client) tracingParameters.Add("endDate", endDate); tracingParameters.Add("filter", filter); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByBillingProfileName", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListByBillingProfile", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -455,7 +677,7 @@ internal TransactionsOperations(BillingManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -468,7 +690,7 @@ internal TransactionsOperations(BillingManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -490,11 +712,14 @@ internal TransactionsOperations(BillingManagementClient client) /// /// Lists the transactions by invoice section name for given start date and end /// date. - /// + /// /// /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// @@ -531,12 +756,16 @@ internal TransactionsOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListByInvoiceSectionNameWithHttpMessagesAsync(string billingAccountName, string invoiceSectionName, string startDate, string endDate, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListByInvoiceSectionWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, string startDate, string endDate, string filter = 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"); + } if (invoiceSectionName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "invoiceSectionName"); @@ -561,17 +790,19 @@ internal TransactionsOperations(BillingManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("billingAccountName", billingAccountName); + tracingParameters.Add("billingProfileName", billingProfileName); tracingParameters.Add("invoiceSectionName", invoiceSectionName); tracingParameters.Add("startDate", startDate); tracingParameters.Add("endDate", endDate); tracingParameters.Add("filter", filter); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByInvoiceSectionName", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListByInvoiceSection", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/transactions").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/transactions").ToString(); _url = _url.Replace("{billingAccountName}", System.Uri.EscapeDataString(billingAccountName)); + _url = _url.Replace("{billingProfileName}", System.Uri.EscapeDataString(billingProfileName)); _url = _url.Replace("{invoiceSectionName}", System.Uri.EscapeDataString(invoiceSectionName)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -678,7 +909,7 @@ internal TransactionsOperations(BillingManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -691,7 +922,7 @@ internal TransactionsOperations(BillingManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -711,9 +942,398 @@ internal TransactionsOperations(BillingManagementClient client) } /// - /// Lists the transactions by billing account name for given start and end - /// date. - /// + /// Get the transaction. + /// + /// + /// + /// billing Account Id. + /// + /// + /// Billing Profile Id. + /// + /// + /// Transaction name. + /// + /// + /// Start date + /// + /// + /// End date + /// + /// + /// 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> GetWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string transactionName, string startDate, string endDate, 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"); + } + if (transactionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "transactionName"); + } + if (startDate == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "startDate"); + } + if (endDate == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "endDate"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("billingAccountName", billingAccountName); + tracingParameters.Add("billingProfileName", billingProfileName); + tracingParameters.Add("transactionName", transactionName); + tracingParameters.Add("startDate", startDate); + tracingParameters.Add("endDate", endDate); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", 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}/transactions/{transactionName}").ToString(); + _url = _url.Replace("{billingAccountName}", System.Uri.EscapeDataString(billingAccountName)); + _url = _url.Replace("{billingProfileName}", System.Uri.EscapeDataString(billingProfileName)); + _url = _url.Replace("{transactionName}", System.Uri.EscapeDataString(transactionName)); + List _queryParameters = new List(); + if (startDate != null) + { + _queryParameters.Add(string.Format("startDate={0}", System.Uri.EscapeDataString(startDate))); + } + if (endDate != null) + { + _queryParameters.Add(string.Format("endDate={0}", System.Uri.EscapeDataString(endDate))); + } + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.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("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 transactions by customer id for given start date and end date. + /// + /// + /// + /// 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>> ListByCustomerNextWithHttpMessagesAsync(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, "ListByCustomerNext", 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 transactions by billing account name for given start and end + /// date. + /// /// /// /// The NextLink from the previous successful call to List operation. @@ -739,7 +1359,7 @@ internal TransactionsOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByBillingAccountNameNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListByBillingAccountNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -754,7 +1374,7 @@ internal TransactionsOperations(BillingManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByBillingAccountNameNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListByBillingAccountNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -848,7 +1468,7 @@ internal TransactionsOperations(BillingManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -861,7 +1481,7 @@ internal TransactionsOperations(BillingManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/TransactionsOperationsExtensions.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/TransactionsOperationsExtensions.cs index b688c5fd9120..c94b794fd62b 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/TransactionsOperationsExtensions.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/TransactionsOperationsExtensions.cs @@ -21,10 +21,76 @@ namespace Microsoft.Azure.Management.Billing /// public static partial class TransactionsOperationsExtensions { + /// + /// Lists the transactions by customer id for given start date and end date. + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// billing Account Id. + /// + /// + /// Customer name. + /// + /// + /// Start date + /// + /// + /// End date + /// + /// + /// May be used to filter by transaction kind. The filter supports 'eq', 'lt', + /// 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or + /// 'not'. Tag filter is a key value pair string where key and value is + /// separated by a colon (:). + /// + public static IPage ListByCustomer(this ITransactionsOperations operations, string billingAccountName, string customerName, string startDate, string endDate, string filter = default(string)) + { + return operations.ListByCustomerAsync(billingAccountName, customerName, startDate, endDate, filter).GetAwaiter().GetResult(); + } + + /// + /// Lists the transactions by customer id for given start date and end date. + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// billing Account Id. + /// + /// + /// Customer name. + /// + /// + /// Start date + /// + /// + /// End date + /// + /// + /// May be used to filter by transaction kind. The filter supports 'eq', 'lt', + /// 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or + /// 'not'. Tag filter is a key value pair string where key and value is + /// separated by a colon (:). + /// + /// + /// The cancellation token. + /// + public static async Task> ListByCustomerAsync(this ITransactionsOperations operations, string billingAccountName, string customerName, string startDate, string endDate, string filter = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByCustomerWithHttpMessagesAsync(billingAccountName, customerName, startDate, endDate, filter, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Lists the transactions by billing account name for given start and end /// date. - /// + /// /// /// /// The operations group for this extension method. @@ -44,15 +110,15 @@ public static partial class TransactionsOperationsExtensions /// 'not'. Tag filter is a key value pair string where key and value is /// separated by a colon (:). /// - public static IPage ListByBillingAccountName(this ITransactionsOperations operations, string billingAccountName, string startDate, string endDate, string filter = default(string)) + public static IPage ListByBillingAccount(this ITransactionsOperations operations, string billingAccountName, string startDate, string endDate, string filter = default(string)) { - return operations.ListByBillingAccountNameAsync(billingAccountName, startDate, endDate, filter).GetAwaiter().GetResult(); + return operations.ListByBillingAccountAsync(billingAccountName, startDate, endDate, filter).GetAwaiter().GetResult(); } /// /// Lists the transactions by billing account name for given start and end /// date. - /// + /// /// /// /// The operations group for this extension method. @@ -75,9 +141,9 @@ public static partial class TransactionsOperationsExtensions /// /// The cancellation token. /// - public static async Task> ListByBillingAccountNameAsync(this ITransactionsOperations operations, string billingAccountName, string startDate, string endDate, string filter = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListByBillingAccountAsync(this ITransactionsOperations operations, string billingAccountName, string startDate, string endDate, string filter = default(string), CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListByBillingAccountNameWithHttpMessagesAsync(billingAccountName, startDate, endDate, filter, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListByBillingAccountWithHttpMessagesAsync(billingAccountName, startDate, endDate, filter, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -86,7 +152,7 @@ public static partial class TransactionsOperationsExtensions /// /// Lists the transactions by billing profile name for given start date and end /// date. - /// + /// /// /// /// The operations group for this extension method. @@ -109,15 +175,15 @@ public static partial class TransactionsOperationsExtensions /// 'not'. Tag filter is a key value pair string where key and value is /// separated by a colon (:). /// - public static TransactionsListResult ListByBillingProfileName(this ITransactionsOperations operations, string billingAccountName, string billingProfileName, string startDate, string endDate, string filter = default(string)) + public static TransactionListResult ListByBillingProfile(this ITransactionsOperations operations, string billingAccountName, string billingProfileName, string startDate, string endDate, string filter = default(string)) { - return operations.ListByBillingProfileNameAsync(billingAccountName, billingProfileName, startDate, endDate, filter).GetAwaiter().GetResult(); + return operations.ListByBillingProfileAsync(billingAccountName, billingProfileName, startDate, endDate, filter).GetAwaiter().GetResult(); } /// /// Lists the transactions by billing profile name for given start date and end /// date. - /// + /// /// /// /// The operations group for this extension method. @@ -143,9 +209,9 @@ public static partial class TransactionsOperationsExtensions /// /// The cancellation token. /// - public static async Task ListByBillingProfileNameAsync(this ITransactionsOperations operations, string billingAccountName, string billingProfileName, string startDate, string endDate, string filter = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task ListByBillingProfileAsync(this ITransactionsOperations operations, string billingAccountName, string billingProfileName, string startDate, string endDate, string filter = default(string), CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListByBillingProfileNameWithHttpMessagesAsync(billingAccountName, billingProfileName, startDate, endDate, filter, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListByBillingProfileWithHttpMessagesAsync(billingAccountName, billingProfileName, startDate, endDate, filter, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -154,7 +220,7 @@ public static partial class TransactionsOperationsExtensions /// /// Lists the transactions by invoice section name for given start date and end /// date. - /// + /// /// /// /// The operations group for this extension method. @@ -162,6 +228,9 @@ public static partial class TransactionsOperationsExtensions /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// @@ -177,15 +246,15 @@ public static partial class TransactionsOperationsExtensions /// 'not'. Tag filter is a key value pair string where key and value is /// separated by a colon (:). /// - public static TransactionsListResult ListByInvoiceSectionName(this ITransactionsOperations operations, string billingAccountName, string invoiceSectionName, string startDate, string endDate, string filter = default(string)) + public static TransactionListResult ListByInvoiceSection(this ITransactionsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, string startDate, string endDate, string filter = default(string)) { - return operations.ListByInvoiceSectionNameAsync(billingAccountName, invoiceSectionName, startDate, endDate, filter).GetAwaiter().GetResult(); + return operations.ListByInvoiceSectionAsync(billingAccountName, billingProfileName, invoiceSectionName, startDate, endDate, filter).GetAwaiter().GetResult(); } /// /// Lists the transactions by invoice section name for given start date and end /// date. - /// + /// /// /// /// The operations group for this extension method. @@ -193,6 +262,9 @@ public static partial class TransactionsOperationsExtensions /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// @@ -211,9 +283,105 @@ public static partial class TransactionsOperationsExtensions /// /// The cancellation token. /// - public static async Task ListByInvoiceSectionNameAsync(this ITransactionsOperations operations, string billingAccountName, string invoiceSectionName, string startDate, string endDate, string filter = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task ListByInvoiceSectionAsync(this ITransactionsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, string startDate, string endDate, string filter = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByInvoiceSectionWithHttpMessagesAsync(billingAccountName, billingProfileName, invoiceSectionName, startDate, endDate, filter, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Get the transaction. + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// billing Account Id. + /// + /// + /// Billing Profile Id. + /// + /// + /// Transaction name. + /// + /// + /// Start date + /// + /// + /// End date + /// + public static Transaction Get(this ITransactionsOperations operations, string billingAccountName, string billingProfileName, string transactionName, string startDate, string endDate) + { + return operations.GetAsync(billingAccountName, billingProfileName, transactionName, startDate, endDate).GetAwaiter().GetResult(); + } + + /// + /// Get the transaction. + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// billing Account Id. + /// + /// + /// Billing Profile Id. + /// + /// + /// Transaction name. + /// + /// + /// Start date + /// + /// + /// End date + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this ITransactionsOperations operations, string billingAccountName, string billingProfileName, string transactionName, string startDate, string endDate, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListByInvoiceSectionNameWithHttpMessagesAsync(billingAccountName, invoiceSectionName, startDate, endDate, filter, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetWithHttpMessagesAsync(billingAccountName, billingProfileName, transactionName, startDate, endDate, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Lists the transactions by customer id for given start date and end date. + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListByCustomerNext(this ITransactionsOperations operations, string nextPageLink) + { + return operations.ListByCustomerNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists the transactions by customer id for given start date and end date. + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByCustomerNextAsync(this ITransactionsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByCustomerNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -222,7 +390,7 @@ public static partial class TransactionsOperationsExtensions /// /// Lists the transactions by billing account name for given start and end /// date. - /// + /// /// /// /// The operations group for this extension method. @@ -230,15 +398,15 @@ public static partial class TransactionsOperationsExtensions /// /// The NextLink from the previous successful call to List operation. /// - public static IPage ListByBillingAccountNameNext(this ITransactionsOperations operations, string nextPageLink) + public static IPage ListByBillingAccountNext(this ITransactionsOperations operations, string nextPageLink) { - return operations.ListByBillingAccountNameNextAsync(nextPageLink).GetAwaiter().GetResult(); + return operations.ListByBillingAccountNextAsync(nextPageLink).GetAwaiter().GetResult(); } /// /// Lists the transactions by billing account name for given start and end /// date. - /// + /// /// /// /// The operations group for this extension method. @@ -249,9 +417,9 @@ public static IPage ListByBillingAccountNameNext(this ITran /// /// The cancellation token. /// - public static async Task> ListByBillingAccountNameNextAsync(this ITransactionsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListByBillingAccountNextAsync(this ITransactionsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListByBillingAccountNameNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListByBillingAccountNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/TransfersOperations.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/TransfersOperations.cs index 9bd562f3cebd..7a42f150f109 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/TransfersOperations.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/TransfersOperations.cs @@ -56,11 +56,14 @@ internal TransfersOperations(BillingManagementClient client) /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// - /// - /// Initiate transfer parameters. + /// + /// Parameters supplied to initiate the transfer. /// /// /// Headers that will be added to request. @@ -83,19 +86,23 @@ internal TransfersOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> InitiateWithHttpMessagesAsync(string billingAccountName, string invoiceSectionName, InitiateTransferRequest body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> InitiateWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, InitiateTransferRequest parameters, 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"); + } if (invoiceSectionName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "invoiceSectionName"); } - if (body == null) + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "body"); + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -105,15 +112,17 @@ internal TransfersOperations(BillingManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("billingAccountName", billingAccountName); + tracingParameters.Add("billingProfileName", billingProfileName); tracingParameters.Add("invoiceSectionName", invoiceSectionName); - tracingParameters.Add("body", body); + tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Initiate", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/initiateTransfer").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/initiateTransfer").ToString(); _url = _url.Replace("{billingAccountName}", System.Uri.EscapeDataString(billingAccountName)); + _url = _url.Replace("{billingProfileName}", System.Uri.EscapeDataString(billingProfileName)); _url = _url.Replace("{invoiceSectionName}", System.Uri.EscapeDataString(invoiceSectionName)); List _queryParameters = new List(); if (_queryParameters.Count > 0) @@ -154,9 +163,9 @@ internal TransfersOperations(BillingManagementClient client) // Serialize Request string _requestContent = null; - if(body != null) + if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(body, Client.SerializationSettings); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, 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"); } @@ -248,6 +257,9 @@ internal TransfersOperations(BillingManagementClient client) /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// @@ -275,12 +287,16 @@ internal TransfersOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string billingAccountName, string invoiceSectionName, string transferName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, string transferName, 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"); + } if (invoiceSectionName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "invoiceSectionName"); @@ -297,6 +313,7 @@ internal TransfersOperations(BillingManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("billingAccountName", billingAccountName); + tracingParameters.Add("billingProfileName", billingProfileName); tracingParameters.Add("invoiceSectionName", invoiceSectionName); tracingParameters.Add("transferName", transferName); tracingParameters.Add("cancellationToken", cancellationToken); @@ -304,8 +321,9 @@ internal TransfersOperations(BillingManagementClient client) } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/transfers/{transferName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/transfers/{transferName}").ToString(); _url = _url.Replace("{billingAccountName}", System.Uri.EscapeDataString(billingAccountName)); + _url = _url.Replace("{billingProfileName}", System.Uri.EscapeDataString(billingProfileName)); _url = _url.Replace("{invoiceSectionName}", System.Uri.EscapeDataString(invoiceSectionName)); _url = _url.Replace("{transferName}", System.Uri.EscapeDataString(transferName)); List _queryParameters = new List(); @@ -435,6 +453,9 @@ internal TransfersOperations(BillingManagementClient client) /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// @@ -462,12 +483,16 @@ internal TransfersOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CancelWithHttpMessagesAsync(string billingAccountName, string invoiceSectionName, string transferName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CancelWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, string transferName, 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"); + } if (invoiceSectionName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "invoiceSectionName"); @@ -484,6 +509,7 @@ internal TransfersOperations(BillingManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("billingAccountName", billingAccountName); + tracingParameters.Add("billingProfileName", billingProfileName); tracingParameters.Add("invoiceSectionName", invoiceSectionName); tracingParameters.Add("transferName", transferName); tracingParameters.Add("cancellationToken", cancellationToken); @@ -491,8 +517,9 @@ internal TransfersOperations(BillingManagementClient client) } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/transfers/{transferName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/transfers/{transferName}").ToString(); _url = _url.Replace("{billingAccountName}", System.Uri.EscapeDataString(billingAccountName)); + _url = _url.Replace("{billingProfileName}", System.Uri.EscapeDataString(billingProfileName)); _url = _url.Replace("{invoiceSectionName}", System.Uri.EscapeDataString(invoiceSectionName)); _url = _url.Replace("{transferName}", System.Uri.EscapeDataString(transferName)); List _queryParameters = new List(); @@ -622,6 +649,9 @@ internal TransfersOperations(BillingManagementClient client) /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// @@ -646,12 +676,16 @@ internal TransfersOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string billingAccountName, string invoiceSectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, 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"); + } if (invoiceSectionName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "invoiceSectionName"); @@ -664,14 +698,16 @@ internal TransfersOperations(BillingManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("billingAccountName", billingAccountName); + tracingParameters.Add("billingProfileName", billingProfileName); tracingParameters.Add("invoiceSectionName", invoiceSectionName); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/transfers").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/transfers").ToString(); _url = _url.Replace("{billingAccountName}", System.Uri.EscapeDataString(billingAccountName)); + _url = _url.Replace("{billingProfileName}", System.Uri.EscapeDataString(billingProfileName)); _url = _url.Replace("{invoiceSectionName}", System.Uri.EscapeDataString(invoiceSectionName)); List _queryParameters = new List(); if (_queryParameters.Count > 0) diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/TransfersOperationsExtensions.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/TransfersOperationsExtensions.cs index fc89c4ca02b4..3b529a83a0c3 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/TransfersOperationsExtensions.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/TransfersOperationsExtensions.cs @@ -30,15 +30,18 @@ public static partial class TransfersOperationsExtensions /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// - /// - /// Initiate transfer parameters. + /// + /// Parameters supplied to initiate the transfer. /// - public static TransferDetails Initiate(this ITransfersOperations operations, string billingAccountName, string invoiceSectionName, InitiateTransferRequest body) + public static TransferDetails Initiate(this ITransfersOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, InitiateTransferRequest parameters) { - return operations.InitiateAsync(billingAccountName, invoiceSectionName, body).GetAwaiter().GetResult(); + return operations.InitiateAsync(billingAccountName, billingProfileName, invoiceSectionName, parameters).GetAwaiter().GetResult(); } /// @@ -50,18 +53,21 @@ public static TransferDetails Initiate(this ITransfersOperations operations, str /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// - /// - /// Initiate transfer parameters. + /// + /// Parameters supplied to initiate the transfer. /// /// /// The cancellation token. /// - public static async Task InitiateAsync(this ITransfersOperations operations, string billingAccountName, string invoiceSectionName, InitiateTransferRequest body, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task InitiateAsync(this ITransfersOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, InitiateTransferRequest parameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.InitiateWithHttpMessagesAsync(billingAccountName, invoiceSectionName, body, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.InitiateWithHttpMessagesAsync(billingAccountName, billingProfileName, invoiceSectionName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -76,15 +82,18 @@ public static TransferDetails Initiate(this ITransfersOperations operations, str /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// /// /// Transfer Name. /// - public static TransferDetails Get(this ITransfersOperations operations, string billingAccountName, string invoiceSectionName, string transferName) + public static TransferDetails Get(this ITransfersOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, string transferName) { - return operations.GetAsync(billingAccountName, invoiceSectionName, transferName).GetAwaiter().GetResult(); + return operations.GetAsync(billingAccountName, billingProfileName, invoiceSectionName, transferName).GetAwaiter().GetResult(); } /// @@ -96,6 +105,9 @@ public static TransferDetails Get(this ITransfersOperations operations, string b /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// @@ -105,9 +117,9 @@ public static TransferDetails Get(this ITransfersOperations operations, string b /// /// The cancellation token. /// - public static async Task GetAsync(this ITransfersOperations operations, string billingAccountName, string invoiceSectionName, string transferName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetAsync(this ITransfersOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, string transferName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(billingAccountName, invoiceSectionName, transferName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetWithHttpMessagesAsync(billingAccountName, billingProfileName, invoiceSectionName, transferName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -122,15 +134,18 @@ public static TransferDetails Get(this ITransfersOperations operations, string b /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// /// /// Transfer Name. /// - public static TransferDetails Cancel(this ITransfersOperations operations, string billingAccountName, string invoiceSectionName, string transferName) + public static TransferDetails Cancel(this ITransfersOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, string transferName) { - return operations.CancelAsync(billingAccountName, invoiceSectionName, transferName).GetAwaiter().GetResult(); + return operations.CancelAsync(billingAccountName, billingProfileName, invoiceSectionName, transferName).GetAwaiter().GetResult(); } /// @@ -142,6 +157,9 @@ public static TransferDetails Cancel(this ITransfersOperations operations, strin /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// @@ -151,9 +169,9 @@ public static TransferDetails Cancel(this ITransfersOperations operations, strin /// /// The cancellation token. /// - public static async Task CancelAsync(this ITransfersOperations operations, string billingAccountName, string invoiceSectionName, string transferName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CancelAsync(this ITransfersOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, string transferName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.CancelWithHttpMessagesAsync(billingAccountName, invoiceSectionName, transferName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CancelWithHttpMessagesAsync(billingAccountName, billingProfileName, invoiceSectionName, transferName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -168,12 +186,15 @@ public static TransferDetails Cancel(this ITransfersOperations operations, strin /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// - public static IPage List(this ITransfersOperations operations, string billingAccountName, string invoiceSectionName) + public static IPage List(this ITransfersOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName) { - return operations.ListAsync(billingAccountName, invoiceSectionName).GetAwaiter().GetResult(); + return operations.ListAsync(billingAccountName, billingProfileName, invoiceSectionName).GetAwaiter().GetResult(); } /// @@ -185,15 +206,18 @@ public static IPage List(this ITransfersOperations operations, /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// /// /// The cancellation token. /// - public static async Task> ListAsync(this ITransfersOperations operations, string billingAccountName, string invoiceSectionName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListAsync(this ITransfersOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListWithHttpMessagesAsync(billingAccountName, invoiceSectionName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListWithHttpMessagesAsync(billingAccountName, billingProfileName, invoiceSectionName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VirtualMachine.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VirtualMachine.cs index e4c03c9a52a5..65586a9afa72 100644 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VirtualMachine.cs +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VirtualMachine.cs @@ -71,7 +71,18 @@ public VirtualMachine() /// Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) /// <br><br> Currently, a VM can only be added to /// availability set at creation time. An existing VM cannot be added - /// to an availability set. + /// to an availability set. <br><br>This property cannot + /// exist along with a non-null properties.virtualMachineScaleSet + /// reference. + /// Specifies information about + /// the virtual machine scale set that the virtual machine should be + /// assigned to. Virtual machines specified in the same virtual machine + /// scale set are allocated to different nodes to maximize + /// availability. Currently, a VM can only be added to virtual machine + /// scale set at creation time. An existing VM cannot be added to a + /// virtual machine scale set. <br><br>This property cannot + /// exist along with a non-null properties.availabilitySet reference. + /// <br><br>Minimum api‐version: 2019‐03‐01 /// Specifies information about /// the proximity placement group that the virtual machine should be /// assigned to. <br><br>Minimum api-version: @@ -102,7 +113,7 @@ public VirtualMachine() /// The identity of the virtual machine, if /// configured. /// The virtual machine zones. - public VirtualMachine(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), Plan plan = default(Plan), HardwareProfile hardwareProfile = default(HardwareProfile), StorageProfile storageProfile = default(StorageProfile), AdditionalCapabilities additionalCapabilities = default(AdditionalCapabilities), OSProfile osProfile = default(OSProfile), NetworkProfile networkProfile = default(NetworkProfile), DiagnosticsProfile diagnosticsProfile = default(DiagnosticsProfile), SubResource availabilitySet = default(SubResource), SubResource proximityPlacementGroup = default(SubResource), SubResource host = default(SubResource), string provisioningState = default(string), VirtualMachineInstanceView instanceView = default(VirtualMachineInstanceView), string licenseType = default(string), string vmId = default(string), IList resources = default(IList), VirtualMachineIdentity identity = default(VirtualMachineIdentity), IList zones = default(IList)) + public VirtualMachine(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), Plan plan = default(Plan), HardwareProfile hardwareProfile = default(HardwareProfile), StorageProfile storageProfile = default(StorageProfile), AdditionalCapabilities additionalCapabilities = default(AdditionalCapabilities), OSProfile osProfile = default(OSProfile), NetworkProfile networkProfile = default(NetworkProfile), DiagnosticsProfile diagnosticsProfile = default(DiagnosticsProfile), SubResource availabilitySet = default(SubResource), SubResource virtualMachineScaleSet = default(SubResource), SubResource proximityPlacementGroup = default(SubResource), SubResource host = default(SubResource), string provisioningState = default(string), VirtualMachineInstanceView instanceView = default(VirtualMachineInstanceView), string licenseType = default(string), string vmId = default(string), IList resources = default(IList), VirtualMachineIdentity identity = default(VirtualMachineIdentity), IList zones = default(IList)) : base(location, id, name, type, tags) { Plan = plan; @@ -113,6 +124,7 @@ public VirtualMachine() NetworkProfile = networkProfile; DiagnosticsProfile = diagnosticsProfile; AvailabilitySet = availabilitySet; + VirtualMachineScaleSet = virtualMachineScaleSet; ProximityPlacementGroup = proximityPlacementGroup; Host = host; ProvisioningState = provisioningState; @@ -199,10 +211,26 @@ public VirtualMachine() /// &lt;br&gt;&lt;br&gt; Currently, a VM can only be /// added to availability set at creation time. An existing VM cannot /// be added to an availability set. + /// &lt;br&gt;&lt;br&gt;This property cannot exist + /// along with a non-null properties.virtualMachineScaleSet reference. /// [JsonProperty(PropertyName = "properties.availabilitySet")] public SubResource AvailabilitySet { get; set; } + /// + /// Gets or sets specifies information about the virtual machine scale + /// set that the virtual machine should be assigned to. Virtual + /// machines specified in the same virtual machine scale set are + /// allocated to different nodes to maximize availability. Currently, a + /// VM can only be added to virtual machine scale set at creation time. + /// An existing VM cannot be added to a virtual machine scale set. + /// &lt;br&gt;&lt;br&gt;This property cannot exist + /// along with a non-null properties.availabilitySet reference. + /// &lt;br&gt;&lt;br&gt;Minimum api‐version: 2019‐03‐01 + /// + [JsonProperty(PropertyName = "properties.virtualMachineScaleSet")] + public SubResource VirtualMachineScaleSet { get; set; } + /// /// Gets or sets specifies information about the proximity placement /// group that the virtual machine should be assigned to. diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VirtualMachineUpdate.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VirtualMachineUpdate.cs index 329014b3d5b3..61edc6c3856e 100644 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VirtualMachineUpdate.cs +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VirtualMachineUpdate.cs @@ -67,7 +67,18 @@ public VirtualMachineUpdate() /// Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) /// <br><br> Currently, a VM can only be added to /// availability set at creation time. An existing VM cannot be added - /// to an availability set. + /// to an availability set. <br><br>This property cannot + /// exist along with a non-null properties.virtualMachineScaleSet + /// reference. + /// Specifies information about + /// the virtual machine scale set that the virtual machine should be + /// assigned to. Virtual machines specified in the same virtual machine + /// scale set are allocated to different nodes to maximize + /// availability. Currently, a VM can only be added to virtual machine + /// scale set at creation time. An existing VM cannot be added to a + /// virtual machine scale set. <br><br>This property cannot + /// exist along with a non-null properties.availabilitySet reference. + /// <br><br>Minimum api‐version: 2019‐03‐01 /// Specifies information about /// the proximity placement group that the virtual machine should be /// assigned to. <br><br>Minimum api-version: @@ -96,7 +107,7 @@ public VirtualMachineUpdate() /// The identity of the virtual machine, if /// configured. /// The virtual machine zones. - public VirtualMachineUpdate(IDictionary tags = default(IDictionary), Plan plan = default(Plan), HardwareProfile hardwareProfile = default(HardwareProfile), StorageProfile storageProfile = default(StorageProfile), AdditionalCapabilities additionalCapabilities = default(AdditionalCapabilities), OSProfile osProfile = default(OSProfile), NetworkProfile networkProfile = default(NetworkProfile), DiagnosticsProfile diagnosticsProfile = default(DiagnosticsProfile), SubResource availabilitySet = default(SubResource), SubResource proximityPlacementGroup = default(SubResource), SubResource host = default(SubResource), string provisioningState = default(string), VirtualMachineInstanceView instanceView = default(VirtualMachineInstanceView), string licenseType = default(string), string vmId = default(string), VirtualMachineIdentity identity = default(VirtualMachineIdentity), IList zones = default(IList)) + public VirtualMachineUpdate(IDictionary tags = default(IDictionary), Plan plan = default(Plan), HardwareProfile hardwareProfile = default(HardwareProfile), StorageProfile storageProfile = default(StorageProfile), AdditionalCapabilities additionalCapabilities = default(AdditionalCapabilities), OSProfile osProfile = default(OSProfile), NetworkProfile networkProfile = default(NetworkProfile), DiagnosticsProfile diagnosticsProfile = default(DiagnosticsProfile), SubResource availabilitySet = default(SubResource), SubResource virtualMachineScaleSet = default(SubResource), SubResource proximityPlacementGroup = default(SubResource), SubResource host = default(SubResource), string provisioningState = default(string), VirtualMachineInstanceView instanceView = default(VirtualMachineInstanceView), string licenseType = default(string), string vmId = default(string), VirtualMachineIdentity identity = default(VirtualMachineIdentity), IList zones = default(IList)) : base(tags) { Plan = plan; @@ -107,6 +118,7 @@ public VirtualMachineUpdate() NetworkProfile = networkProfile; DiagnosticsProfile = diagnosticsProfile; AvailabilitySet = availabilitySet; + VirtualMachineScaleSet = virtualMachineScaleSet; ProximityPlacementGroup = proximityPlacementGroup; Host = host; ProvisioningState = provisioningState; @@ -192,10 +204,26 @@ public VirtualMachineUpdate() /// &lt;br&gt;&lt;br&gt; Currently, a VM can only be /// added to availability set at creation time. An existing VM cannot /// be added to an availability set. + /// &lt;br&gt;&lt;br&gt;This property cannot exist + /// along with a non-null properties.virtualMachineScaleSet reference. /// [JsonProperty(PropertyName = "properties.availabilitySet")] public SubResource AvailabilitySet { get; set; } + /// + /// Gets or sets specifies information about the virtual machine scale + /// set that the virtual machine should be assigned to. Virtual + /// machines specified in the same virtual machine scale set are + /// allocated to different nodes to maximize availability. Currently, a + /// VM can only be added to virtual machine scale set at creation time. + /// An existing VM cannot be added to a virtual machine scale set. + /// &lt;br&gt;&lt;br&gt;This property cannot exist + /// along with a non-null properties.availabilitySet reference. + /// &lt;br&gt;&lt;br&gt;Minimum api‐version: 2019‐03‐01 + /// + [JsonProperty(PropertyName = "properties.virtualMachineScaleSet")] + public SubResource VirtualMachineScaleSet { get; set; } + /// /// Gets or sets specifies information about the proximity placement /// group that the virtual machine should be assigned to. diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/SdkInfo_ComputeManagementClient.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/SdkInfo_ComputeManagementClient.cs index b417fa233ea5..cc2f60fa637f 100644 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/SdkInfo_ComputeManagementClient.cs +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/SdkInfo_ComputeManagementClient.cs @@ -49,16 +49,5 @@ public static IEnumerable> ApiInfo_ComputeManageme }.AsEnumerable(); } } - // BEGIN: Code Generation Metadata Section - public static readonly String AutoRestVersion = "latest"; - public static readonly String AutoRestBootStrapperVersion = "autorest@2.0.4283"; - public static readonly String AutoRestCmdExecuted = "cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/compute/resource-manager/readme.md --csharp --version=latest --reflect-api-versions --csharp-sdks-folder=E:\\hylee-sdk\\august\\sdk"; - public static readonly String GithubForkName = "Azure"; - public static readonly String GithubBranchName = "master"; - public static readonly String GithubCommidId = "397e41997764b35729dd4f39ec80a0f98c4456eb"; - public static readonly String CodeGenerationErrors = ""; - public static readonly String GithubRepoName = "azure-rest-api-specs"; - // END: Code Generation Metadata Section } } - diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/AgentPoolsOperations.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/AgentPoolsOperations.cs index 50bf7e4b6b92..1d911abb78e4 100644 --- a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/AgentPoolsOperations.cs +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/AgentPoolsOperations.cs @@ -120,7 +120,7 @@ internal AgentPoolsOperations(ContainerServiceClient client) throw new ValidationException(ValidationRules.Pattern, "resourceName", "^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$"); } } - string apiVersion = "2019-04-01"; + string apiVersion = "2019-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -346,7 +346,7 @@ internal AgentPoolsOperations(ContainerServiceClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "agentPoolName"); } - string apiVersion = "2019-04-01"; + string apiVersion = "2019-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -557,6 +557,463 @@ internal AgentPoolsOperations(ContainerServiceClient client) return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } + /// + /// Gets upgrade profile for an agent pool. + /// + /// + /// Gets the details of the upgrade profile for an agent pool with a specified + /// resource group and managed cluster name. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the managed cluster resource. + /// + /// + /// The name of the agent pool. + /// + /// + /// 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> GetUpgradeProfileWithHttpMessagesAsync(string resourceGroupName, string resourceName, string agentPoolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (resourceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); + } + if (resourceName != null) + { + if (resourceName.Length > 63) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceName", 63); + } + if (resourceName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceName, "^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceName", "^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$"); + } + } + if (agentPoolName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "agentPoolName"); + } + string apiVersion = "2019-08-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("resourceGroupName", resourceGroupName); + tracingParameters.Add("resourceName", resourceName); + tracingParameters.Add("agentPoolName", agentPoolName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetUpgradeProfile", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); + _url = _url.Replace("{agentPoolName}", System.Uri.EscapeDataString(agentPoolName)); + 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("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 CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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; + } + + /// + /// Gets a list of supported versions for the specified agent pool. + /// + /// + /// Gets a list of supported versions for the specified agent pool. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the managed cluster resource. + /// + /// + /// The name of the agent pool. + /// + /// + /// 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> GetAvailableAgentPoolVersionsWithHttpMessagesAsync(string resourceGroupName, string resourceName, string agentPoolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (resourceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); + } + if (resourceName != null) + { + if (resourceName.Length > 63) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceName", 63); + } + if (resourceName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceName, "^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceName", "^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$"); + } + } + if (agentPoolName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "agentPoolName"); + } + string apiVersion = "2019-08-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("resourceGroupName", resourceGroupName); + tracingParameters.Add("resourceName", resourceName); + tracingParameters.Add("agentPoolName", agentPoolName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetAvailableAgentPoolVersions", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/availableAgentPoolVersions").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); + _url = _url.Replace("{agentPoolName}", System.Uri.EscapeDataString(agentPoolName)); + 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("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 CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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; + } + /// /// Creates or updates an agent pool. /// @@ -644,7 +1101,7 @@ internal AgentPoolsOperations(ContainerServiceClient client) { parameters.Validate(); } - string apiVersion = "2019-04-01"; + string apiVersion = "2019-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -894,7 +1351,7 @@ internal AgentPoolsOperations(ContainerServiceClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "agentPoolName"); } - string apiVersion = "2019-04-01"; + string apiVersion = "2019-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/AgentPoolsOperationsExtensions.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/AgentPoolsOperationsExtensions.cs index 333bc9802a1a..e9bab4e54b14 100644 --- a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/AgentPoolsOperationsExtensions.cs +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/AgentPoolsOperationsExtensions.cs @@ -228,6 +228,112 @@ public static void Delete(this IAgentPoolsOperations operations, string resource (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, resourceName, agentPoolName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } + /// + /// Gets upgrade profile for an agent pool. + /// + /// + /// Gets the details of the upgrade profile for an agent pool with a specified + /// resource group and managed cluster name. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the managed cluster resource. + /// + /// + /// The name of the agent pool. + /// + public static AgentPoolUpgradeProfile GetUpgradeProfile(this IAgentPoolsOperations operations, string resourceGroupName, string resourceName, string agentPoolName) + { + return operations.GetUpgradeProfileAsync(resourceGroupName, resourceName, agentPoolName).GetAwaiter().GetResult(); + } + + /// + /// Gets upgrade profile for an agent pool. + /// + /// + /// Gets the details of the upgrade profile for an agent pool with a specified + /// resource group and managed cluster name. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the managed cluster resource. + /// + /// + /// The name of the agent pool. + /// + /// + /// The cancellation token. + /// + public static async Task GetUpgradeProfileAsync(this IAgentPoolsOperations operations, string resourceGroupName, string resourceName, string agentPoolName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetUpgradeProfileWithHttpMessagesAsync(resourceGroupName, resourceName, agentPoolName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets a list of supported versions for the specified agent pool. + /// + /// + /// Gets a list of supported versions for the specified agent pool. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the managed cluster resource. + /// + /// + /// The name of the agent pool. + /// + public static AgentPoolAvailableVersions GetAvailableAgentPoolVersions(this IAgentPoolsOperations operations, string resourceGroupName, string resourceName, string agentPoolName) + { + return operations.GetAvailableAgentPoolVersionsAsync(resourceGroupName, resourceName, agentPoolName).GetAwaiter().GetResult(); + } + + /// + /// Gets a list of supported versions for the specified agent pool. + /// + /// + /// Gets a list of supported versions for the specified agent pool. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the managed cluster resource. + /// + /// + /// The name of the agent pool. + /// + /// + /// The cancellation token. + /// + public static async Task GetAvailableAgentPoolVersionsAsync(this IAgentPoolsOperations operations, string resourceGroupName, string resourceName, string agentPoolName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetAvailableAgentPoolVersionsWithHttpMessagesAsync(resourceGroupName, resourceName, agentPoolName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Creates or updates an agent pool. /// diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/ContainerServicesOperations.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/ContainerServicesOperations.cs index b8ec9621329d..564aab684620 100644 --- a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/ContainerServicesOperations.cs +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/ContainerServicesOperations.cs @@ -735,7 +735,7 @@ internal ContainerServicesOperations(ContainerServiceClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "location"); } - string apiVersion = "2019-04-01"; + string apiVersion = "2019-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/IAgentPoolsOperations.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/IAgentPoolsOperations.cs index fe31c66be91b..e496ec668ace 100644 --- a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/IAgentPoolsOperations.cs +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/IAgentPoolsOperations.cs @@ -148,6 +148,69 @@ public partial interface IAgentPoolsOperations /// Task DeleteWithHttpMessagesAsync(string resourceGroupName, string resourceName, string agentPoolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Gets upgrade profile for an agent pool. + /// + /// + /// Gets the details of the upgrade profile for an agent pool with a + /// specified resource group and managed cluster name. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the managed cluster resource. + /// + /// + /// The name of the agent pool. + /// + /// + /// 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> GetUpgradeProfileWithHttpMessagesAsync(string resourceGroupName, string resourceName, string agentPoolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets a list of supported versions for the specified agent pool. + /// + /// + /// Gets a list of supported versions for the specified agent pool. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the managed cluster resource. + /// + /// + /// The name of the agent pool. + /// + /// + /// 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> GetAvailableAgentPoolVersionsWithHttpMessagesAsync(string resourceGroupName, string resourceName, string agentPoolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Creates or updates an agent pool. /// /// diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/ManagedClustersOperations.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/ManagedClustersOperations.cs index b42496c1c241..f4c6fb41f833 100644 --- a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/ManagedClustersOperations.cs +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/ManagedClustersOperations.cs @@ -84,7 +84,7 @@ internal ManagedClustersOperations(ContainerServiceClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-04-01"; + string apiVersion = "2019-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -278,7 +278,7 @@ internal ManagedClustersOperations(ContainerServiceClient client) throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } } - string apiVersion = "2019-04-01"; + string apiVersion = "2019-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -496,7 +496,7 @@ internal ManagedClustersOperations(ContainerServiceClient client) throw new ValidationException(ValidationRules.Pattern, "resourceName", "^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$"); } } - string apiVersion = "2019-04-01"; + string apiVersion = "2019-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -723,7 +723,7 @@ internal ManagedClustersOperations(ContainerServiceClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "roleName"); } - string apiVersion = "2019-04-01"; + string apiVersion = "2019-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -945,7 +945,7 @@ internal ManagedClustersOperations(ContainerServiceClient client) throw new ValidationException(ValidationRules.Pattern, "resourceName", "^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$"); } } - string apiVersion = "2019-04-01"; + string apiVersion = "2019-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1165,7 +1165,7 @@ internal ManagedClustersOperations(ContainerServiceClient client) throw new ValidationException(ValidationRules.Pattern, "resourceName", "^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$"); } } - string apiVersion = "2019-04-01"; + string apiVersion = "2019-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1385,7 +1385,7 @@ internal ManagedClustersOperations(ContainerServiceClient client) throw new ValidationException(ValidationRules.Pattern, "resourceName", "^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$"); } } - string apiVersion = "2019-04-01"; + string apiVersion = "2019-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1756,7 +1756,7 @@ internal ManagedClustersOperations(ContainerServiceClient client) { parameters.Validate(); } - string apiVersion = "2019-04-01"; + string apiVersion = "2019-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2003,7 +2003,7 @@ internal ManagedClustersOperations(ContainerServiceClient client) throw new ValidationException(ValidationRules.Pattern, "resourceName", "^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$"); } } - string apiVersion = "2019-04-01"; + string apiVersion = "2019-08-01"; TagsObject parameters = new TagsObject(); if (tags != null) { @@ -2231,7 +2231,7 @@ internal ManagedClustersOperations(ContainerServiceClient client) throw new ValidationException(ValidationRules.Pattern, "resourceName", "^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$"); } } - string apiVersion = "2019-04-01"; + string apiVersion = "2019-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2441,7 +2441,7 @@ internal ManagedClustersOperations(ContainerServiceClient client) { parameters.Validate(); } - string apiVersion = "2019-04-01"; + string apiVersion = "2019-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2658,7 +2658,7 @@ internal ManagedClustersOperations(ContainerServiceClient client) { parameters.Validate(); } - string apiVersion = "2019-04-01"; + string apiVersion = "2019-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/AgentPool.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/AgentPool.cs index 62d800ddd453..17ca5dc61071 100644 --- a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/AgentPool.cs +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/AgentPool.cs @@ -123,7 +123,17 @@ public AgentPool() /// provisioning state, which only appears in the response. /// (PREVIEW) Availability zones for /// nodes. Must use VirtualMachineScaleSets AgentPoolType. - public AgentPool(int count, string vmSize, string id = default(string), string name = default(string), string type = default(string), int? osDiskSizeGB = default(int?), string vnetSubnetID = default(string), int? maxPods = default(int?), string osType = default(string), int? maxCount = default(int?), int? minCount = default(int?), bool? enableAutoScaling = default(bool?), string agentPoolType = default(string), string orchestratorVersion = default(string), string provisioningState = default(string), IList availabilityZones = default(IList)) + /// Enable public IP for nodes + /// ScaleSetPriority to be used to + /// specify virtual machine scale set priority. Default to regular. + /// Possible values include: 'Low', 'Regular' + /// ScaleSetEvictionPolicy to be + /// used to specify eviction policy for low priority virtual machine + /// scale set. Default to Delete. Possible values include: 'Delete', + /// 'Deallocate' + /// Taints added to new nodes during node pool + /// create and scale. For example, key=value:NoSchedule. + public AgentPool(int count, string vmSize, string id = default(string), string name = default(string), string type = default(string), int? osDiskSizeGB = default(int?), string vnetSubnetID = default(string), int? maxPods = default(int?), string osType = default(string), int? maxCount = default(int?), int? minCount = default(int?), bool? enableAutoScaling = default(bool?), string agentPoolType = default(string), string orchestratorVersion = default(string), string provisioningState = default(string), IList availabilityZones = default(IList), bool? enableNodePublicIP = default(bool?), string scaleSetPriority = default(string), string scaleSetEvictionPolicy = default(string), IList nodeTaints = default(IList)) : base(id, name, type) { Count = count; @@ -139,6 +149,10 @@ public AgentPool() OrchestratorVersion = orchestratorVersion; ProvisioningState = provisioningState; AvailabilityZones = availabilityZones; + EnableNodePublicIP = enableNodePublicIP; + ScaleSetPriority = scaleSetPriority; + ScaleSetEvictionPolicy = scaleSetEvictionPolicy; + NodeTaints = nodeTaints; CustomInit(); } @@ -291,6 +305,35 @@ public AgentPool() [JsonProperty(PropertyName = "properties.availabilityZones")] public IList AvailabilityZones { get; set; } + /// + /// Gets or sets enable public IP for nodes + /// + [JsonProperty(PropertyName = "properties.enableNodePublicIP")] + public bool? EnableNodePublicIP { get; set; } + + /// + /// Gets or sets scaleSetPriority to be used to specify virtual machine + /// scale set priority. Default to regular. Possible values include: + /// 'Low', 'Regular' + /// + [JsonProperty(PropertyName = "properties.scaleSetPriority")] + public string ScaleSetPriority { get; set; } + + /// + /// Gets or sets scaleSetEvictionPolicy to be used to specify eviction + /// policy for low priority virtual machine scale set. Default to + /// Delete. Possible values include: 'Delete', 'Deallocate' + /// + [JsonProperty(PropertyName = "properties.scaleSetEvictionPolicy")] + public string ScaleSetEvictionPolicy { get; set; } + + /// + /// Gets or sets taints added to new nodes during node pool create and + /// scale. For example, key=value:NoSchedule. + /// + [JsonProperty(PropertyName = "properties.nodeTaints")] + public IList NodeTaints { get; set; } + /// /// Validate the object. /// diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/AgentPoolAvailableVersions.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/AgentPoolAvailableVersions.cs new file mode 100644 index 000000000000..aef063574593 --- /dev/null +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/AgentPoolAvailableVersions.cs @@ -0,0 +1,83 @@ +// +// 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.ContainerService.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The list of available versions for an agent pool. + /// + [Rest.Serialization.JsonTransformation] + public partial class AgentPoolAvailableVersions + { + /// + /// Initializes a new instance of the AgentPoolAvailableVersions class. + /// + public AgentPoolAvailableVersions() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AgentPoolAvailableVersions class. + /// + /// Id of the agent pool available versions. + /// Name of the agent pool available + /// versions. + /// Type of the agent pool available + /// versions. + /// List of versions available for + /// agent pool. + public AgentPoolAvailableVersions(string id = default(string), string name = default(string), string type = default(string), IList agentPoolVersions = default(IList)) + { + Id = id; + Name = name; + Type = type; + AgentPoolVersions = agentPoolVersions; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets id of the agent pool available versions. + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; private set; } + + /// + /// Gets name of the agent pool available versions. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets type of the agent pool available versions. + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } + + /// + /// Gets or sets list of versions available for agent pool. + /// + [JsonProperty(PropertyName = "properties.agentPoolVersions")] + public IList AgentPoolVersions { get; set; } + + } +} diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem.cs new file mode 100644 index 000000000000..8642c1dbda4c --- /dev/null +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem.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.ContainerService.Models +{ + using Newtonsoft.Json; + using System.Linq; + + public partial class AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem + { + /// + /// Initializes a new instance of the + /// AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem class. + /// + public AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem class. + /// + /// Whether this version is the default + /// agent pool version. + /// Kubernetes version (major, minor, + /// patch). + /// Whether Kubernetes version is currently in + /// preview. + public AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem(bool? defaultProperty = default(bool?), string kubernetesVersion = default(string), bool? isPreview = default(bool?)) + { + DefaultProperty = defaultProperty; + KubernetesVersion = kubernetesVersion; + IsPreview = isPreview; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets whether this version is the default agent pool + /// version. + /// + [JsonProperty(PropertyName = "default")] + public bool? DefaultProperty { get; set; } + + /// + /// Gets or sets kubernetes version (major, minor, patch). + /// + [JsonProperty(PropertyName = "kubernetesVersion")] + public string KubernetesVersion { get; set; } + + /// + /// Gets or sets whether Kubernetes version is currently in preview. + /// + [JsonProperty(PropertyName = "isPreview")] + public bool? IsPreview { get; set; } + + } +} diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/AgentPoolUpgradeProfile.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/AgentPoolUpgradeProfile.cs new file mode 100644 index 000000000000..7e876988de79 --- /dev/null +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/AgentPoolUpgradeProfile.cs @@ -0,0 +1,120 @@ +// +// 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.ContainerService.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The list of available upgrades for an agent pool. + /// + [Rest.Serialization.JsonTransformation] + public partial class AgentPoolUpgradeProfile + { + /// + /// Initializes a new instance of the AgentPoolUpgradeProfile class. + /// + public AgentPoolUpgradeProfile() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AgentPoolUpgradeProfile class. + /// + /// Kubernetes version (major, minor, + /// patch). + /// OsType to be used to specify os type. Choose + /// from Linux and Windows. Default to Linux. Possible values include: + /// 'Linux', 'Windows' + /// Id of the agent pool upgrade profile. + /// Name of the agent pool upgrade profile. + /// Type of the agent pool upgrade profile. + /// List of orchestrator types and versions + /// available for upgrade. + public AgentPoolUpgradeProfile(string kubernetesVersion, string osType, string id = default(string), string name = default(string), string type = default(string), IList upgrades = default(IList)) + { + Id = id; + Name = name; + Type = type; + KubernetesVersion = kubernetesVersion; + OsType = osType; + Upgrades = upgrades; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets id of the agent pool upgrade profile. + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; private set; } + + /// + /// Gets name of the agent pool upgrade profile. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets type of the agent pool upgrade profile. + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } + + /// + /// Gets or sets kubernetes version (major, minor, patch). + /// + [JsonProperty(PropertyName = "properties.kubernetesVersion")] + public string KubernetesVersion { get; set; } + + /// + /// Gets or sets osType to be used to specify os type. Choose from + /// Linux and Windows. Default to Linux. Possible values include: + /// 'Linux', 'Windows' + /// + [JsonProperty(PropertyName = "properties.osType")] + public string OsType { get; set; } + + /// + /// Gets or sets list of orchestrator types and versions available for + /// upgrade. + /// + [JsonProperty(PropertyName = "properties.upgrades")] + public IList Upgrades { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (KubernetesVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "KubernetesVersion"); + } + if (OsType == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "OsType"); + } + } + } +} diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/AgentPoolUpgradeProfilePropertiesUpgradesItem.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/AgentPoolUpgradeProfilePropertiesUpgradesItem.cs new file mode 100644 index 000000000000..e449e974e445 --- /dev/null +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/AgentPoolUpgradeProfilePropertiesUpgradesItem.cs @@ -0,0 +1,60 @@ +// +// 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.ContainerService.Models +{ + using Newtonsoft.Json; + using System.Linq; + + public partial class AgentPoolUpgradeProfilePropertiesUpgradesItem + { + /// + /// Initializes a new instance of the + /// AgentPoolUpgradeProfilePropertiesUpgradesItem class. + /// + public AgentPoolUpgradeProfilePropertiesUpgradesItem() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// AgentPoolUpgradeProfilePropertiesUpgradesItem class. + /// + /// Kubernetes version (major, minor, + /// patch). + /// Whether Kubernetes version is currently in + /// preview. + public AgentPoolUpgradeProfilePropertiesUpgradesItem(string kubernetesVersion = default(string), bool? isPreview = default(bool?)) + { + KubernetesVersion = kubernetesVersion; + IsPreview = isPreview; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets kubernetes version (major, minor, patch). + /// + [JsonProperty(PropertyName = "kubernetesVersion")] + public string KubernetesVersion { get; set; } + + /// + /// Gets or sets whether Kubernetes version is currently in preview. + /// + [JsonProperty(PropertyName = "isPreview")] + public bool? IsPreview { get; set; } + + } +} diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ContainerServiceNetworkProfile.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ContainerServiceNetworkProfile.cs index 311110d17c1a..0d1e3604982b 100644 --- a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ContainerServiceNetworkProfile.cs +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ContainerServiceNetworkProfile.cs @@ -51,7 +51,9 @@ public ContainerServiceNetworkProfile() /// ranges or the Kubernetes service address range. /// The load balancer sku for the managed /// cluster. Possible values include: 'standard', 'basic' - public ContainerServiceNetworkProfile(string networkPlugin = default(string), string networkPolicy = default(string), string podCidr = default(string), string serviceCidr = default(string), string dnsServiceIP = default(string), string dockerBridgeCidr = default(string), string loadBalancerSku = default(string)) + /// Profile of the cluster load + /// balancer. + public ContainerServiceNetworkProfile(string networkPlugin = default(string), string networkPolicy = default(string), string podCidr = default(string), string serviceCidr = default(string), string dnsServiceIP = default(string), string dockerBridgeCidr = default(string), string loadBalancerSku = default(string), ManagedClusterLoadBalancerProfile loadBalancerProfile = default(ManagedClusterLoadBalancerProfile)) { NetworkPlugin = networkPlugin; NetworkPolicy = networkPolicy; @@ -60,6 +62,7 @@ public ContainerServiceNetworkProfile() DnsServiceIP = dnsServiceIP; DockerBridgeCidr = dockerBridgeCidr; LoadBalancerSku = loadBalancerSku; + LoadBalancerProfile = loadBalancerProfile; CustomInit(); } @@ -119,6 +122,12 @@ public ContainerServiceNetworkProfile() [JsonProperty(PropertyName = "loadBalancerSku")] public string LoadBalancerSku { get; set; } + /// + /// Gets or sets profile of the cluster load balancer. + /// + [JsonProperty(PropertyName = "loadBalancerProfile")] + public ManagedClusterLoadBalancerProfile LoadBalancerProfile { get; set; } + /// /// Validate the object. /// @@ -155,6 +164,10 @@ public virtual void Validate() throw new ValidationException(ValidationRules.Pattern, "DockerBridgeCidr", "^([0-9]{1,3}\\.){3}[0-9]{1,3}(\\/([0-9]|[1-2][0-9]|3[0-2]))?$"); } } + if (LoadBalancerProfile != null) + { + LoadBalancerProfile.Validate(); + } } } } diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedCluster.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedCluster.cs index 7a4181186b42..7fa8fc43785a 100644 --- a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedCluster.cs +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedCluster.cs @@ -69,11 +69,11 @@ public ManagedCluster() /// configuration. /// Profile of Azure Active Directory /// configuration. - /// (PREVIEW) Authorized IP - /// Ranges to kubernetes API server. + /// Access profile for managed + /// cluster API server. /// The identity of the managed cluster, if /// configured. - public ManagedCluster(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string provisioningState = default(string), int? maxAgentPools = default(int?), string kubernetesVersion = default(string), string dnsPrefix = default(string), string fqdn = default(string), IList agentPoolProfiles = default(IList), ContainerServiceLinuxProfile linuxProfile = default(ContainerServiceLinuxProfile), ManagedClusterWindowsProfile windowsProfile = default(ManagedClusterWindowsProfile), ManagedClusterServicePrincipalProfile servicePrincipalProfile = default(ManagedClusterServicePrincipalProfile), IDictionary addonProfiles = default(IDictionary), string nodeResourceGroup = default(string), bool? enableRBAC = default(bool?), bool? enablePodSecurityPolicy = default(bool?), ContainerServiceNetworkProfile networkProfile = default(ContainerServiceNetworkProfile), ManagedClusterAADProfile aadProfile = default(ManagedClusterAADProfile), IList apiServerAuthorizedIPRanges = default(IList), ManagedClusterIdentity identity = default(ManagedClusterIdentity)) + public ManagedCluster(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string provisioningState = default(string), int? maxAgentPools = default(int?), string kubernetesVersion = default(string), string dnsPrefix = default(string), string fqdn = default(string), IList agentPoolProfiles = default(IList), ContainerServiceLinuxProfile linuxProfile = default(ContainerServiceLinuxProfile), ManagedClusterWindowsProfile windowsProfile = default(ManagedClusterWindowsProfile), ManagedClusterServicePrincipalProfile servicePrincipalProfile = default(ManagedClusterServicePrincipalProfile), IDictionary addonProfiles = default(IDictionary), string nodeResourceGroup = default(string), bool? enableRBAC = default(bool?), bool? enablePodSecurityPolicy = default(bool?), ContainerServiceNetworkProfile networkProfile = default(ContainerServiceNetworkProfile), ManagedClusterAADProfile aadProfile = default(ManagedClusterAADProfile), ManagedClusterAPIServerAccessProfile apiServerAccessProfile = default(ManagedClusterAPIServerAccessProfile), ManagedClusterIdentity identity = default(ManagedClusterIdentity)) : base(location, id, name, type, tags) { ProvisioningState = provisioningState; @@ -91,7 +91,7 @@ public ManagedCluster() EnablePodSecurityPolicy = enablePodSecurityPolicy; NetworkProfile = networkProfile; AadProfile = aadProfile; - ApiServerAuthorizedIPRanges = apiServerAuthorizedIPRanges; + ApiServerAccessProfile = apiServerAccessProfile; Identity = identity; CustomInit(); } @@ -201,11 +201,10 @@ public ManagedCluster() public ManagedClusterAADProfile AadProfile { get; set; } /// - /// Gets or sets (PREVIEW) Authorized IP Ranges to kubernetes API - /// server. + /// Gets or sets access profile for managed cluster API server. /// - [JsonProperty(PropertyName = "properties.apiServerAuthorizedIPRanges")] - public IList ApiServerAuthorizedIPRanges { get; set; } + [JsonProperty(PropertyName = "properties.apiServerAccessProfile")] + public ManagedClusterAPIServerAccessProfile ApiServerAccessProfile { get; set; } /// /// Gets or sets the identity of the managed cluster, if configured. diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterAPIServerAccessProfile.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterAPIServerAccessProfile.cs new file mode 100644 index 000000000000..a950f33365d1 --- /dev/null +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterAPIServerAccessProfile.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.ContainerService.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Access profile for managed cluster API server. + /// + public partial class ManagedClusterAPIServerAccessProfile + { + /// + /// Initializes a new instance of the + /// ManagedClusterAPIServerAccessProfile class. + /// + public ManagedClusterAPIServerAccessProfile() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// ManagedClusterAPIServerAccessProfile class. + /// + /// Authorized IP Ranges to kubernetes + /// API server. + /// Whether to create the cluster as + /// a private cluster or not. + public ManagedClusterAPIServerAccessProfile(IList authorizedIPRanges = default(IList), bool? enablePrivateCluster = default(bool?)) + { + AuthorizedIPRanges = authorizedIPRanges; + EnablePrivateCluster = enablePrivateCluster; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets authorized IP Ranges to kubernetes API server. + /// + [JsonProperty(PropertyName = "authorizedIPRanges")] + public IList AuthorizedIPRanges { get; set; } + + /// + /// Gets or sets whether to create the cluster as a private cluster or + /// not. + /// + [JsonProperty(PropertyName = "enablePrivateCluster")] + public bool? EnablePrivateCluster { get; set; } + + } +} diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterAgentPoolProfile.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterAgentPoolProfile.cs index 357545428fe3..107edfb3be3d 100644 --- a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterAgentPoolProfile.cs +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterAgentPoolProfile.cs @@ -120,8 +120,18 @@ public ManagedClusterAgentPoolProfile() /// provisioning state, which only appears in the response. /// (PREVIEW) Availability zones for /// nodes. Must use VirtualMachineScaleSets AgentPoolType. - public ManagedClusterAgentPoolProfile(int count, string vmSize, string name, int? osDiskSizeGB = default(int?), string vnetSubnetID = default(string), int? maxPods = default(int?), string osType = default(string), int? maxCount = default(int?), int? minCount = default(int?), bool? enableAutoScaling = default(bool?), string type = default(string), string orchestratorVersion = default(string), string provisioningState = default(string), IList availabilityZones = default(IList)) - : base(count, vmSize, osDiskSizeGB, vnetSubnetID, maxPods, osType, maxCount, minCount, enableAutoScaling, type, orchestratorVersion, provisioningState, availabilityZones) + /// Enable public IP for nodes + /// ScaleSetPriority to be used to + /// specify virtual machine scale set priority. Default to regular. + /// Possible values include: 'Low', 'Regular' + /// ScaleSetEvictionPolicy to be + /// used to specify eviction policy for low priority virtual machine + /// scale set. Default to Delete. Possible values include: 'Delete', + /// 'Deallocate' + /// Taints added to new nodes during node pool + /// create and scale. For example, key=value:NoSchedule. + public ManagedClusterAgentPoolProfile(int count, string vmSize, string name, int? osDiskSizeGB = default(int?), string vnetSubnetID = default(string), int? maxPods = default(int?), string osType = default(string), int? maxCount = default(int?), int? minCount = default(int?), bool? enableAutoScaling = default(bool?), string type = default(string), string orchestratorVersion = default(string), string provisioningState = default(string), IList availabilityZones = default(IList), bool? enableNodePublicIP = default(bool?), string scaleSetPriority = default(string), string scaleSetEvictionPolicy = default(string), IList nodeTaints = default(IList)) + : base(count, vmSize, osDiskSizeGB, vnetSubnetID, maxPods, osType, maxCount, minCount, enableAutoScaling, type, orchestratorVersion, provisioningState, availabilityZones, enableNodePublicIP, scaleSetPriority, scaleSetEvictionPolicy, nodeTaints) { Name = name; CustomInit(); diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterAgentPoolProfileProperties.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterAgentPoolProfileProperties.cs index 6e86f0cc9df6..a99b90999b08 100644 --- a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterAgentPoolProfileProperties.cs +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterAgentPoolProfileProperties.cs @@ -118,7 +118,17 @@ public ManagedClusterAgentPoolProfileProperties() /// provisioning state, which only appears in the response. /// (PREVIEW) Availability zones for /// nodes. Must use VirtualMachineScaleSets AgentPoolType. - public ManagedClusterAgentPoolProfileProperties(int count, string vmSize, int? osDiskSizeGB = default(int?), string vnetSubnetID = default(string), int? maxPods = default(int?), string osType = default(string), int? maxCount = default(int?), int? minCount = default(int?), bool? enableAutoScaling = default(bool?), string type = default(string), string orchestratorVersion = default(string), string provisioningState = default(string), IList availabilityZones = default(IList)) + /// Enable public IP for nodes + /// ScaleSetPriority to be used to + /// specify virtual machine scale set priority. Default to regular. + /// Possible values include: 'Low', 'Regular' + /// ScaleSetEvictionPolicy to be + /// used to specify eviction policy for low priority virtual machine + /// scale set. Default to Delete. Possible values include: 'Delete', + /// 'Deallocate' + /// Taints added to new nodes during node pool + /// create and scale. For example, key=value:NoSchedule. + public ManagedClusterAgentPoolProfileProperties(int count, string vmSize, int? osDiskSizeGB = default(int?), string vnetSubnetID = default(string), int? maxPods = default(int?), string osType = default(string), int? maxCount = default(int?), int? minCount = default(int?), bool? enableAutoScaling = default(bool?), string type = default(string), string orchestratorVersion = default(string), string provisioningState = default(string), IList availabilityZones = default(IList), bool? enableNodePublicIP = default(bool?), string scaleSetPriority = default(string), string scaleSetEvictionPolicy = default(string), IList nodeTaints = default(IList)) { Count = count; VmSize = vmSize; @@ -133,6 +143,10 @@ public ManagedClusterAgentPoolProfileProperties() OrchestratorVersion = orchestratorVersion; ProvisioningState = provisioningState; AvailabilityZones = availabilityZones; + EnableNodePublicIP = enableNodePublicIP; + ScaleSetPriority = scaleSetPriority; + ScaleSetEvictionPolicy = scaleSetEvictionPolicy; + NodeTaints = nodeTaints; CustomInit(); } @@ -285,6 +299,35 @@ public ManagedClusterAgentPoolProfileProperties() [JsonProperty(PropertyName = "availabilityZones")] public IList AvailabilityZones { get; set; } + /// + /// Gets or sets enable public IP for nodes + /// + [JsonProperty(PropertyName = "enableNodePublicIP")] + public bool? EnableNodePublicIP { get; set; } + + /// + /// Gets or sets scaleSetPriority to be used to specify virtual machine + /// scale set priority. Default to regular. Possible values include: + /// 'Low', 'Regular' + /// + [JsonProperty(PropertyName = "scaleSetPriority")] + public string ScaleSetPriority { get; set; } + + /// + /// Gets or sets scaleSetEvictionPolicy to be used to specify eviction + /// policy for low priority virtual machine scale set. Default to + /// Delete. Possible values include: 'Delete', 'Deallocate' + /// + [JsonProperty(PropertyName = "scaleSetEvictionPolicy")] + public string ScaleSetEvictionPolicy { get; set; } + + /// + /// Gets or sets taints added to new nodes during node pool create and + /// scale. For example, key=value:NoSchedule. + /// + [JsonProperty(PropertyName = "nodeTaints")] + public IList NodeTaints { get; set; } + /// /// Validate the object. /// diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfile.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfile.cs new file mode 100644 index 000000000000..2c9728a8cd0d --- /dev/null +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfile.cs @@ -0,0 +1,100 @@ +// +// 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.ContainerService.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Profile of the managed cluster load balancer + /// + public partial class ManagedClusterLoadBalancerProfile + { + /// + /// Initializes a new instance of the ManagedClusterLoadBalancerProfile + /// class. + /// + public ManagedClusterLoadBalancerProfile() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ManagedClusterLoadBalancerProfile + /// class. + /// + /// Desired managed outbound IPs for + /// the cluster load balancer. + /// Desired outbound IP Prefix + /// resources for the cluster load balancer. + /// Desired outbound IP resources for the + /// cluster load balancer. + /// The effective outbound IP + /// resources of the cluster load balancer. + public ManagedClusterLoadBalancerProfile(ManagedClusterLoadBalancerProfileManagedOutboundIPs managedOutboundIPs = default(ManagedClusterLoadBalancerProfileManagedOutboundIPs), ManagedClusterLoadBalancerProfileOutboundIPPrefixes outboundIPPrefixes = default(ManagedClusterLoadBalancerProfileOutboundIPPrefixes), ManagedClusterLoadBalancerProfileOutboundIPs outboundIPs = default(ManagedClusterLoadBalancerProfileOutboundIPs), IList effectiveOutboundIPs = default(IList)) + { + ManagedOutboundIPs = managedOutboundIPs; + OutboundIPPrefixes = outboundIPPrefixes; + OutboundIPs = outboundIPs; + EffectiveOutboundIPs = effectiveOutboundIPs; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets desired managed outbound IPs for the cluster load + /// balancer. + /// + [JsonProperty(PropertyName = "managedOutboundIPs")] + public ManagedClusterLoadBalancerProfileManagedOutboundIPs ManagedOutboundIPs { get; set; } + + /// + /// Gets or sets desired outbound IP Prefix resources for the cluster + /// load balancer. + /// + [JsonProperty(PropertyName = "outboundIPPrefixes")] + public ManagedClusterLoadBalancerProfileOutboundIPPrefixes OutboundIPPrefixes { get; set; } + + /// + /// Gets or sets desired outbound IP resources for the cluster load + /// balancer. + /// + [JsonProperty(PropertyName = "outboundIPs")] + public ManagedClusterLoadBalancerProfileOutboundIPs OutboundIPs { get; set; } + + /// + /// Gets or sets the effective outbound IP resources of the cluster + /// load balancer. + /// + [JsonProperty(PropertyName = "effectiveOutboundIPs")] + public IList EffectiveOutboundIPs { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (ManagedOutboundIPs != null) + { + ManagedOutboundIPs.Validate(); + } + } + } +} diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfileManagedOutboundIPs.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfileManagedOutboundIPs.cs new file mode 100644 index 000000000000..d72f7f793e37 --- /dev/null +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfileManagedOutboundIPs.cs @@ -0,0 +1,75 @@ +// +// 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.ContainerService.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Desired managed outbound IPs for the cluster load balancer. + /// + public partial class ManagedClusterLoadBalancerProfileManagedOutboundIPs + { + /// + /// Initializes a new instance of the + /// ManagedClusterLoadBalancerProfileManagedOutboundIPs class. + /// + public ManagedClusterLoadBalancerProfileManagedOutboundIPs() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// ManagedClusterLoadBalancerProfileManagedOutboundIPs class. + /// + /// Desired number of outbound IP created/managed + /// by Azure for the cluster load balancer. Allowed values must be in + /// the range of 1 to 100 (inclusive). The default value is 1. + public ManagedClusterLoadBalancerProfileManagedOutboundIPs(int? count = default(int?)) + { + Count = count; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets desired number of outbound IP created/managed by Azure + /// for the cluster load balancer. Allowed values must be in the range + /// of 1 to 100 (inclusive). The default value is 1. + /// + [JsonProperty(PropertyName = "count")] + public int? Count { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Count > 100) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "Count", 100); + } + if (Count < 1) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "Count", 1); + } + } + } +} diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfileOutboundIPPrefixes.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfileOutboundIPPrefixes.cs new file mode 100644 index 000000000000..e4220de6974b --- /dev/null +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfileOutboundIPPrefixes.cs @@ -0,0 +1,56 @@ +// +// 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.ContainerService.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Desired outbound IP Prefix resources for the cluster load balancer. + /// + public partial class ManagedClusterLoadBalancerProfileOutboundIPPrefixes + { + /// + /// Initializes a new instance of the + /// ManagedClusterLoadBalancerProfileOutboundIPPrefixes class. + /// + public ManagedClusterLoadBalancerProfileOutboundIPPrefixes() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// ManagedClusterLoadBalancerProfileOutboundIPPrefixes class. + /// + /// A list of public IP prefix + /// resources. + public ManagedClusterLoadBalancerProfileOutboundIPPrefixes(IList publicIPPrefixes = default(IList)) + { + PublicIPPrefixes = publicIPPrefixes; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets a list of public IP prefix resources. + /// + [JsonProperty(PropertyName = "publicIPPrefixes")] + public IList PublicIPPrefixes { get; set; } + + } +} diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfileOutboundIPs.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfileOutboundIPs.cs new file mode 100644 index 000000000000..8c6863afa7cb --- /dev/null +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfileOutboundIPs.cs @@ -0,0 +1,55 @@ +// +// 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.ContainerService.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Desired outbound IP resources for the cluster load balancer. + /// + public partial class ManagedClusterLoadBalancerProfileOutboundIPs + { + /// + /// Initializes a new instance of the + /// ManagedClusterLoadBalancerProfileOutboundIPs class. + /// + public ManagedClusterLoadBalancerProfileOutboundIPs() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// ManagedClusterLoadBalancerProfileOutboundIPs class. + /// + /// A list of public IP resources. + public ManagedClusterLoadBalancerProfileOutboundIPs(IList publicIPs = default(IList)) + { + PublicIPs = publicIPs; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets a list of public IP resources. + /// + [JsonProperty(PropertyName = "publicIPs")] + public IList PublicIPs { get; set; } + + } +} diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ResourceReference.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ResourceReference.cs new file mode 100644 index 000000000000..d272c94add12 --- /dev/null +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ResourceReference.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.ContainerService.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// A reference to an Azure resource. + /// + public partial class ResourceReference + { + /// + /// Initializes a new instance of the ResourceReference class. + /// + public ResourceReference() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ResourceReference class. + /// + /// The fully qualified Azure resource id. + public ResourceReference(string id = default(string)) + { + Id = id; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the fully qualified Azure resource id. + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; set; } + + } +} diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ScaleSetEvictionPolicy.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ScaleSetEvictionPolicy.cs new file mode 100644 index 000000000000..25bd3db49c44 --- /dev/null +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ScaleSetEvictionPolicy.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.ContainerService.Models +{ + + /// + /// Defines values for ScaleSetEvictionPolicy. + /// + public static class ScaleSetEvictionPolicy + { + public const string Delete = "Delete"; + public const string Deallocate = "Deallocate"; + } +} diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ScaleSetPriority.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ScaleSetPriority.cs new file mode 100644 index 000000000000..5edcae14e830 --- /dev/null +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ScaleSetPriority.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.ContainerService.Models +{ + + /// + /// Defines values for ScaleSetPriority. + /// + public static class ScaleSetPriority + { + public const string Low = "Low"; + public const string Regular = "Regular"; + } +} diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Operations.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Operations.cs index ec90823197fa..33c25ec737fe 100644 --- a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Operations.cs +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Operations.cs @@ -70,7 +70,7 @@ internal Operations(ContainerServiceClient client) /// public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - string apiVersion = "2019-04-01"; + string apiVersion = "2019-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/SdkInfo_ContainerServiceClient.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/SdkInfo_ContainerServiceClient.cs index e35757d72020..2330060e78a7 100644 --- a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/SdkInfo_ContainerServiceClient.cs +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/SdkInfo_ContainerServiceClient.cs @@ -19,12 +19,12 @@ public static IEnumerable> ApiInfo_ContainerServic { return new Tuple[] { - new Tuple("ContainerService", "AgentPools", "2019-04-01"), + new Tuple("ContainerService", "AgentPools", "2019-08-01"), new Tuple("ContainerService", "ContainerServices", "2017-07-01"), - new Tuple("ContainerService", "ContainerServices", "2019-04-01"), - new Tuple("ContainerService", "ManagedClusters", "2019-04-01"), + new Tuple("ContainerService", "ContainerServices", "2019-08-01"), + new Tuple("ContainerService", "ManagedClusters", "2019-08-01"), new Tuple("ContainerService", "OpenShiftManagedClusters", "2019-04-30"), - new Tuple("ContainerService", "Operations", "2019-04-01"), + new Tuple("ContainerService", "Operations", "2019-08-01"), }.AsEnumerable(); } } diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/DataFactoryManagementClient.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/DataFactoryManagementClient.cs index 9766686b44ba..29123f6f8b6d 100644 --- a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/DataFactoryManagementClient.cs +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/DataFactoryManagementClient.cs @@ -461,6 +461,8 @@ private void Initialize() DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("type")); SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("authorizationType")); DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("authorizationType")); + SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("type")); + DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("type")); SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("type")); DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("type")); CustomInitialize(); diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/ITriggersOperations.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/ITriggersOperations.cs index 638fc80b41a1..62dd32263d05 100644 --- a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/ITriggersOperations.cs +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/ITriggersOperations.cs @@ -143,6 +143,90 @@ public partial interface ITriggersOperations /// Task DeleteWithHttpMessagesAsync(string resourceGroupName, string factoryName, string triggerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Subscribe event trigger to events. + /// + /// + /// The resource group name. + /// + /// + /// The factory name. + /// + /// + /// The trigger name. + /// + /// + /// 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> SubscribeToEventsWithHttpMessagesAsync(string resourceGroupName, string factoryName, string triggerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Get a trigger's event subscription status. + /// + /// + /// The resource group name. + /// + /// + /// The factory name. + /// + /// + /// The trigger name. + /// + /// + /// 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> GetEventSubscriptionStatusWithHttpMessagesAsync(string resourceGroupName, string factoryName, string triggerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Unsubscribe event trigger from events. + /// + /// + /// The resource group name. + /// + /// + /// The factory name. + /// + /// + /// The trigger name. + /// + /// + /// 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> UnsubscribeFromEventsWithHttpMessagesAsync(string resourceGroupName, string factoryName, string triggerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Starts a trigger. /// /// @@ -193,6 +277,62 @@ public partial interface ITriggersOperations /// Task StopWithHttpMessagesAsync(string resourceGroupName, string factoryName, string triggerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Subscribe event trigger to events. + /// + /// + /// The resource group name. + /// + /// + /// The factory name. + /// + /// + /// The trigger name. + /// + /// + /// 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> BeginSubscribeToEventsWithHttpMessagesAsync(string resourceGroupName, string factoryName, string triggerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Unsubscribe event trigger from events. + /// + /// + /// The resource group name. + /// + /// + /// The factory name. + /// + /// + /// The trigger name. + /// + /// + /// 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> BeginUnsubscribeFromEventsWithHttpMessagesAsync(string resourceGroupName, string factoryName, string triggerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Starts a trigger. /// /// diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/AvroSink.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/AvroSink.cs index 674850039188..9274f1e6ce64 100644 --- a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/AvroSink.cs +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/AvroSink.cs @@ -46,10 +46,13 @@ public AvroSink() /// The maximum concurrent /// connection count for the sink data store. Type: integer (or /// Expression with resultType integer). + /// The option to handle sink table, such as + /// autoCreate. For now only 'autoCreate' value is supported. Type: + /// string (or Expression with resultType string). /// Avro store settings. /// Avro format settings. - public AvroSink(IDictionary additionalProperties = default(IDictionary), object writeBatchSize = default(object), object writeBatchTimeout = default(object), object sinkRetryCount = default(object), object sinkRetryWait = default(object), object maxConcurrentConnections = default(object), StoreWriteSettings storeSettings = default(StoreWriteSettings), AvroWriteSettings formatSettings = default(AvroWriteSettings)) - : base(additionalProperties, writeBatchSize, writeBatchTimeout, sinkRetryCount, sinkRetryWait, maxConcurrentConnections) + public AvroSink(IDictionary additionalProperties = default(IDictionary), object writeBatchSize = default(object), object writeBatchTimeout = default(object), object sinkRetryCount = default(object), object sinkRetryWait = default(object), object maxConcurrentConnections = default(object), object tableOption = default(object), StoreWriteSettings storeSettings = default(StoreWriteSettings), AvroWriteSettings formatSettings = default(AvroWriteSettings)) + : base(additionalProperties, writeBatchSize, writeBatchTimeout, sinkRetryCount, sinkRetryWait, maxConcurrentConnections, tableOption) { StoreSettings = storeSettings; FormatSettings = formatSettings; diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/AzureBlobFSSink.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/AzureBlobFSSink.cs index 587c3c7c0b67..b37f7384f30b 100644 --- a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/AzureBlobFSSink.cs +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/AzureBlobFSSink.cs @@ -46,10 +46,13 @@ public AzureBlobFSSink() /// The maximum concurrent /// connection count for the sink data store. Type: integer (or /// Expression with resultType integer). + /// The option to handle sink table, such as + /// autoCreate. For now only 'autoCreate' value is supported. Type: + /// string (or Expression with resultType string). /// The type of copy behavior for copy /// sink. - public AzureBlobFSSink(IDictionary additionalProperties = default(IDictionary), object writeBatchSize = default(object), object writeBatchTimeout = default(object), object sinkRetryCount = default(object), object sinkRetryWait = default(object), object maxConcurrentConnections = default(object), object copyBehavior = default(object)) - : base(additionalProperties, writeBatchSize, writeBatchTimeout, sinkRetryCount, sinkRetryWait, maxConcurrentConnections) + public AzureBlobFSSink(IDictionary additionalProperties = default(IDictionary), object writeBatchSize = default(object), object writeBatchTimeout = default(object), object sinkRetryCount = default(object), object sinkRetryWait = default(object), object maxConcurrentConnections = default(object), object tableOption = default(object), object copyBehavior = default(object)) + : base(additionalProperties, writeBatchSize, writeBatchTimeout, sinkRetryCount, sinkRetryWait, maxConcurrentConnections, tableOption) { CopyBehavior = copyBehavior; CustomInit(); diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/AzureDataExplorerSink.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/AzureDataExplorerSink.cs index c0cd48667b9d..9eaf14918f16 100644 --- a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/AzureDataExplorerSink.cs +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/AzureDataExplorerSink.cs @@ -46,6 +46,9 @@ public AzureDataExplorerSink() /// The maximum concurrent /// connection count for the sink data store. Type: integer (or /// Expression with resultType integer). + /// The option to handle sink table, such as + /// autoCreate. For now only 'autoCreate' value is supported. Type: + /// string (or Expression with resultType string). /// A name of a pre-created csv /// mapping that was defined on the target Kusto table. Type: /// string. @@ -53,8 +56,8 @@ public AzureDataExplorerSink() /// description provided in a json format. Type: string. /// If set to true, any aggregation will /// be skipped. Default is false. Type: boolean. - public AzureDataExplorerSink(IDictionary additionalProperties = default(IDictionary), object writeBatchSize = default(object), object writeBatchTimeout = default(object), object sinkRetryCount = default(object), object sinkRetryWait = default(object), object maxConcurrentConnections = default(object), object ingestionMappingName = default(object), object ingestionMappingAsJson = default(object), object flushImmediately = default(object)) - : base(additionalProperties, writeBatchSize, writeBatchTimeout, sinkRetryCount, sinkRetryWait, maxConcurrentConnections) + public AzureDataExplorerSink(IDictionary additionalProperties = default(IDictionary), object writeBatchSize = default(object), object writeBatchTimeout = default(object), object sinkRetryCount = default(object), object sinkRetryWait = default(object), object maxConcurrentConnections = default(object), object tableOption = default(object), object ingestionMappingName = default(object), object ingestionMappingAsJson = default(object), object flushImmediately = default(object)) + : base(additionalProperties, writeBatchSize, writeBatchTimeout, sinkRetryCount, sinkRetryWait, maxConcurrentConnections, tableOption) { IngestionMappingName = ingestionMappingName; IngestionMappingAsJson = ingestionMappingAsJson; diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/AzureDataLakeStoreSink.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/AzureDataLakeStoreSink.cs index 0760f01ffd36..cfea28c077cc 100644 --- a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/AzureDataLakeStoreSink.cs +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/AzureDataLakeStoreSink.cs @@ -46,12 +46,15 @@ public AzureDataLakeStoreSink() /// The maximum concurrent /// connection count for the sink data store. Type: integer (or /// Expression with resultType integer). + /// The option to handle sink table, such as + /// autoCreate. For now only 'autoCreate' value is supported. Type: + /// string (or Expression with resultType string). /// The type of copy behavior for copy /// sink. /// Single File /// Parallel. - public AzureDataLakeStoreSink(IDictionary additionalProperties = default(IDictionary), object writeBatchSize = default(object), object writeBatchTimeout = default(object), object sinkRetryCount = default(object), object sinkRetryWait = default(object), object maxConcurrentConnections = default(object), object copyBehavior = default(object), object enableAdlsSingleFileParallel = default(object)) - : base(additionalProperties, writeBatchSize, writeBatchTimeout, sinkRetryCount, sinkRetryWait, maxConcurrentConnections) + public AzureDataLakeStoreSink(IDictionary additionalProperties = default(IDictionary), object writeBatchSize = default(object), object writeBatchTimeout = default(object), object sinkRetryCount = default(object), object sinkRetryWait = default(object), object maxConcurrentConnections = default(object), object tableOption = default(object), object copyBehavior = default(object), object enableAdlsSingleFileParallel = default(object)) + : base(additionalProperties, writeBatchSize, writeBatchTimeout, sinkRetryCount, sinkRetryWait, maxConcurrentConnections, tableOption) { CopyBehavior = copyBehavior; EnableAdlsSingleFileParallel = enableAdlsSingleFileParallel; diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/AzureMySqlSink.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/AzureMySqlSink.cs index 833052d405ae..9b42ad79a764 100644 --- a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/AzureMySqlSink.cs +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/AzureMySqlSink.cs @@ -46,10 +46,13 @@ public AzureMySqlSink() /// The maximum concurrent /// connection count for the sink data store. Type: integer (or /// Expression with resultType integer). + /// The option to handle sink table, such as + /// autoCreate. For now only 'autoCreate' value is supported. Type: + /// string (or Expression with resultType string). /// A query to execute before starting the /// copy. Type: string (or Expression with resultType string). - public AzureMySqlSink(IDictionary additionalProperties = default(IDictionary), object writeBatchSize = default(object), object writeBatchTimeout = default(object), object sinkRetryCount = default(object), object sinkRetryWait = default(object), object maxConcurrentConnections = default(object), object preCopyScript = default(object)) - : base(additionalProperties, writeBatchSize, writeBatchTimeout, sinkRetryCount, sinkRetryWait, maxConcurrentConnections) + public AzureMySqlSink(IDictionary additionalProperties = default(IDictionary), object writeBatchSize = default(object), object writeBatchTimeout = default(object), object sinkRetryCount = default(object), object sinkRetryWait = default(object), object maxConcurrentConnections = default(object), object tableOption = default(object), object preCopyScript = default(object)) + : base(additionalProperties, writeBatchSize, writeBatchTimeout, sinkRetryCount, sinkRetryWait, maxConcurrentConnections, tableOption) { PreCopyScript = preCopyScript; CustomInit(); diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/AzurePostgreSqlSink.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/AzurePostgreSqlSink.cs index b7948c955b27..f1d8cbfe3e79 100644 --- a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/AzurePostgreSqlSink.cs +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/AzurePostgreSqlSink.cs @@ -46,10 +46,13 @@ public AzurePostgreSqlSink() /// The maximum concurrent /// connection count for the sink data store. Type: integer (or /// Expression with resultType integer). + /// The option to handle sink table, such as + /// autoCreate. For now only 'autoCreate' value is supported. Type: + /// string (or Expression with resultType string). /// A query to execute before starting the /// copy. Type: string (or Expression with resultType string). - public AzurePostgreSqlSink(IDictionary additionalProperties = default(IDictionary), object writeBatchSize = default(object), object writeBatchTimeout = default(object), object sinkRetryCount = default(object), object sinkRetryWait = default(object), object maxConcurrentConnections = default(object), object preCopyScript = default(object)) - : base(additionalProperties, writeBatchSize, writeBatchTimeout, sinkRetryCount, sinkRetryWait, maxConcurrentConnections) + public AzurePostgreSqlSink(IDictionary additionalProperties = default(IDictionary), object writeBatchSize = default(object), object writeBatchTimeout = default(object), object sinkRetryCount = default(object), object sinkRetryWait = default(object), object maxConcurrentConnections = default(object), object tableOption = default(object), object preCopyScript = default(object)) + : base(additionalProperties, writeBatchSize, writeBatchTimeout, sinkRetryCount, sinkRetryWait, maxConcurrentConnections, tableOption) { PreCopyScript = preCopyScript; CustomInit(); diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/AzureQueueSink.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/AzureQueueSink.cs index a3412d7745c0..8813cafc55c1 100644 --- a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/AzureQueueSink.cs +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/AzureQueueSink.cs @@ -45,8 +45,11 @@ public AzureQueueSink() /// The maximum concurrent /// connection count for the sink data store. Type: integer (or /// Expression with resultType integer). - public AzureQueueSink(IDictionary additionalProperties = default(IDictionary), object writeBatchSize = default(object), object writeBatchTimeout = default(object), object sinkRetryCount = default(object), object sinkRetryWait = default(object), object maxConcurrentConnections = default(object)) - : base(additionalProperties, writeBatchSize, writeBatchTimeout, sinkRetryCount, sinkRetryWait, maxConcurrentConnections) + /// The option to handle sink table, such as + /// autoCreate. For now only 'autoCreate' value is supported. Type: + /// string (or Expression with resultType string). + public AzureQueueSink(IDictionary additionalProperties = default(IDictionary), object writeBatchSize = default(object), object writeBatchTimeout = default(object), object sinkRetryCount = default(object), object sinkRetryWait = default(object), object maxConcurrentConnections = default(object), object tableOption = default(object)) + : base(additionalProperties, writeBatchSize, writeBatchTimeout, sinkRetryCount, sinkRetryWait, maxConcurrentConnections, tableOption) { CustomInit(); } diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/AzureSearchIndexSink.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/AzureSearchIndexSink.cs index cc1483ddc136..2845ca9f5a76 100644 --- a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/AzureSearchIndexSink.cs +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/AzureSearchIndexSink.cs @@ -46,11 +46,14 @@ public AzureSearchIndexSink() /// The maximum concurrent /// connection count for the sink data store. Type: integer (or /// Expression with resultType integer). + /// The option to handle sink table, such as + /// autoCreate. For now only 'autoCreate' value is supported. Type: + /// string (or Expression with resultType string). /// Specify the write behavior when /// upserting documents into Azure Search Index. Possible values /// include: 'Merge', 'Upload' - public AzureSearchIndexSink(IDictionary additionalProperties = default(IDictionary), object writeBatchSize = default(object), object writeBatchTimeout = default(object), object sinkRetryCount = default(object), object sinkRetryWait = default(object), object maxConcurrentConnections = default(object), string writeBehavior = default(string)) - : base(additionalProperties, writeBatchSize, writeBatchTimeout, sinkRetryCount, sinkRetryWait, maxConcurrentConnections) + public AzureSearchIndexSink(IDictionary additionalProperties = default(IDictionary), object writeBatchSize = default(object), object writeBatchTimeout = default(object), object sinkRetryCount = default(object), object sinkRetryWait = default(object), object maxConcurrentConnections = default(object), object tableOption = default(object), string writeBehavior = default(string)) + : base(additionalProperties, writeBatchSize, writeBatchTimeout, sinkRetryCount, sinkRetryWait, maxConcurrentConnections, tableOption) { WriteBehavior = writeBehavior; CustomInit(); diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/AzureSqlSink.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/AzureSqlSink.cs index 50290e3179d8..69746f19d8e7 100644 --- a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/AzureSqlSink.cs +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/AzureSqlSink.cs @@ -46,6 +46,9 @@ public AzureSqlSink() /// The maximum concurrent /// connection count for the sink data store. Type: integer (or /// Expression with resultType integer). + /// The option to handle sink table, such as + /// autoCreate. For now only 'autoCreate' value is supported. Type: + /// string (or Expression with resultType string). /// SQL writer stored /// procedure name. Type: string (or Expression with resultType /// string). @@ -58,8 +61,8 @@ public AzureSqlSink() /// The stored /// procedure parameter name of the table type. Type: string (or /// Expression with resultType string). - public AzureSqlSink(IDictionary additionalProperties = default(IDictionary), object writeBatchSize = default(object), object writeBatchTimeout = default(object), object sinkRetryCount = default(object), object sinkRetryWait = default(object), object maxConcurrentConnections = default(object), object sqlWriterStoredProcedureName = default(object), object sqlWriterTableType = default(object), object preCopyScript = default(object), IDictionary storedProcedureParameters = default(IDictionary), object storedProcedureTableTypeParameterName = default(object)) - : base(additionalProperties, writeBatchSize, writeBatchTimeout, sinkRetryCount, sinkRetryWait, maxConcurrentConnections) + public AzureSqlSink(IDictionary additionalProperties = default(IDictionary), object writeBatchSize = default(object), object writeBatchTimeout = default(object), object sinkRetryCount = default(object), object sinkRetryWait = default(object), object maxConcurrentConnections = default(object), object tableOption = default(object), object sqlWriterStoredProcedureName = default(object), object sqlWriterTableType = default(object), object preCopyScript = default(object), IDictionary storedProcedureParameters = default(IDictionary), object storedProcedureTableTypeParameterName = default(object)) + : base(additionalProperties, writeBatchSize, writeBatchTimeout, sinkRetryCount, sinkRetryWait, maxConcurrentConnections, tableOption) { SqlWriterStoredProcedureName = sqlWriterStoredProcedureName; SqlWriterTableType = sqlWriterTableType; diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/AzureTableSink.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/AzureTableSink.cs index 3700867f3ad8..63f7cb275dda 100644 --- a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/AzureTableSink.cs +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/AzureTableSink.cs @@ -46,6 +46,9 @@ public AzureTableSink() /// The maximum concurrent /// connection count for the sink data store. Type: integer (or /// Expression with resultType integer). + /// The option to handle sink table, such as + /// autoCreate. For now only 'autoCreate' value is supported. Type: + /// string (or Expression with resultType string). /// Azure Table /// default partition key value. Type: string (or Expression with /// resultType string). @@ -55,8 +58,8 @@ public AzureTableSink() /// string (or Expression with resultType string). /// Azure Table insert type. Type: /// string (or Expression with resultType string). - public AzureTableSink(IDictionary additionalProperties = default(IDictionary), object writeBatchSize = default(object), object writeBatchTimeout = default(object), object sinkRetryCount = default(object), object sinkRetryWait = default(object), object maxConcurrentConnections = default(object), object azureTableDefaultPartitionKeyValue = default(object), object azureTablePartitionKeyName = default(object), object azureTableRowKeyName = default(object), object azureTableInsertType = default(object)) - : base(additionalProperties, writeBatchSize, writeBatchTimeout, sinkRetryCount, sinkRetryWait, maxConcurrentConnections) + public AzureTableSink(IDictionary additionalProperties = default(IDictionary), object writeBatchSize = default(object), object writeBatchTimeout = default(object), object sinkRetryCount = default(object), object sinkRetryWait = default(object), object maxConcurrentConnections = default(object), object tableOption = default(object), object azureTableDefaultPartitionKeyValue = default(object), object azureTablePartitionKeyName = default(object), object azureTableRowKeyName = default(object), object azureTableInsertType = default(object)) + : base(additionalProperties, writeBatchSize, writeBatchTimeout, sinkRetryCount, sinkRetryWait, maxConcurrentConnections, tableOption) { AzureTableDefaultPartitionKeyValue = azureTableDefaultPartitionKeyValue; AzureTablePartitionKeyName = azureTablePartitionKeyName; diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/BinarySink.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/BinarySink.cs index 46e9928c924c..fa827814e6bb 100644 --- a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/BinarySink.cs +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/BinarySink.cs @@ -46,9 +46,12 @@ public BinarySink() /// The maximum concurrent /// connection count for the sink data store. Type: integer (or /// Expression with resultType integer). + /// The option to handle sink table, such as + /// autoCreate. For now only 'autoCreate' value is supported. Type: + /// string (or Expression with resultType string). /// Binary store settings. - public BinarySink(IDictionary additionalProperties = default(IDictionary), object writeBatchSize = default(object), object writeBatchTimeout = default(object), object sinkRetryCount = default(object), object sinkRetryWait = default(object), object maxConcurrentConnections = default(object), StoreReadSettings storeSettings = default(StoreReadSettings)) - : base(additionalProperties, writeBatchSize, writeBatchTimeout, sinkRetryCount, sinkRetryWait, maxConcurrentConnections) + public BinarySink(IDictionary additionalProperties = default(IDictionary), object writeBatchSize = default(object), object writeBatchTimeout = default(object), object sinkRetryCount = default(object), object sinkRetryWait = default(object), object maxConcurrentConnections = default(object), object tableOption = default(object), StoreWriteSettings storeSettings = default(StoreWriteSettings)) + : base(additionalProperties, writeBatchSize, writeBatchTimeout, sinkRetryCount, sinkRetryWait, maxConcurrentConnections, tableOption) { StoreSettings = storeSettings; CustomInit(); @@ -63,7 +66,7 @@ public BinarySink() /// Gets or sets binary store settings. /// [JsonProperty(PropertyName = "storeSettings")] - public StoreReadSettings StoreSettings { get; set; } + public StoreWriteSettings StoreSettings { get; set; } /// /// Validate the object. diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/BlobSink.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/BlobSink.cs index ff85b921f5a5..426e9f94f571 100644 --- a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/BlobSink.cs +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/BlobSink.cs @@ -46,6 +46,9 @@ public BlobSink() /// The maximum concurrent /// connection count for the sink data store. Type: integer (or /// Expression with resultType integer). + /// The option to handle sink table, such as + /// autoCreate. For now only 'autoCreate' value is supported. Type: + /// string (or Expression with resultType string). /// Blob writer overwrite files. /// Type: boolean (or Expression with resultType boolean). /// Blob writer date time @@ -55,8 +58,8 @@ public BlobSink() /// boolean (or Expression with resultType boolean). /// The type of copy behavior for copy /// sink. - public BlobSink(IDictionary additionalProperties = default(IDictionary), object writeBatchSize = default(object), object writeBatchTimeout = default(object), object sinkRetryCount = default(object), object sinkRetryWait = default(object), object maxConcurrentConnections = default(object), object blobWriterOverwriteFiles = default(object), object blobWriterDateTimeFormat = default(object), object blobWriterAddHeader = default(object), object copyBehavior = default(object)) - : base(additionalProperties, writeBatchSize, writeBatchTimeout, sinkRetryCount, sinkRetryWait, maxConcurrentConnections) + public BlobSink(IDictionary additionalProperties = default(IDictionary), object writeBatchSize = default(object), object writeBatchTimeout = default(object), object sinkRetryCount = default(object), object sinkRetryWait = default(object), object maxConcurrentConnections = default(object), object tableOption = default(object), object blobWriterOverwriteFiles = default(object), object blobWriterDateTimeFormat = default(object), object blobWriterAddHeader = default(object), object copyBehavior = default(object)) + : base(additionalProperties, writeBatchSize, writeBatchTimeout, sinkRetryCount, sinkRetryWait, maxConcurrentConnections, tableOption) { BlobWriterOverwriteFiles = blobWriterOverwriteFiles; BlobWriterDateTimeFormat = blobWriterDateTimeFormat; diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/CmdkeySetup.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/CmdkeySetup.cs new file mode 100644 index 000000000000..45d119702566 --- /dev/null +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/CmdkeySetup.cs @@ -0,0 +1,92 @@ +// +// 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.DataFactory.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// The custom setup of running cmdkey commands. + /// + [Rest.Serialization.JsonTransformation] + public partial class CmdkeySetup : CustomSetupBase + { + /// + /// Initializes a new instance of the CmdkeySetup class. + /// + public CmdkeySetup() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the CmdkeySetup class. + /// + /// The server name of data source + /// access. + /// The user name of data source access. + /// The password of data source access. + public CmdkeySetup(object targetName, object userName, SecretBase password) + { + TargetName = targetName; + UserName = userName; + Password = password; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the server name of data source access. + /// + [JsonProperty(PropertyName = "typeProperties.targetName")] + public object TargetName { get; set; } + + /// + /// Gets or sets the user name of data source access. + /// + [JsonProperty(PropertyName = "typeProperties.userName")] + public object UserName { get; set; } + + /// + /// Gets or sets the password of data source access. + /// + [JsonProperty(PropertyName = "typeProperties.password")] + public SecretBase Password { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (TargetName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "TargetName"); + } + if (UserName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "UserName"); + } + if (Password == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Password"); + } + } + } +} diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/CommonDataServiceForAppsSink.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/CommonDataServiceForAppsSink.cs index 3d2ecc7c8606..81baff60460c 100644 --- a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/CommonDataServiceForAppsSink.cs +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/CommonDataServiceForAppsSink.cs @@ -48,12 +48,15 @@ public CommonDataServiceForAppsSink() /// The maximum concurrent /// connection count for the sink data store. Type: integer (or /// Expression with resultType integer). + /// The option to handle sink table, such as + /// autoCreate. For now only 'autoCreate' value is supported. Type: + /// string (or Expression with resultType string). /// The flag indicating whether to /// ignore null values from input dataset (except key fields) during /// write operation. Default is false. Type: boolean (or Expression /// with resultType boolean). - public CommonDataServiceForAppsSink(IDictionary additionalProperties = default(IDictionary), object writeBatchSize = default(object), object writeBatchTimeout = default(object), object sinkRetryCount = default(object), object sinkRetryWait = default(object), object maxConcurrentConnections = default(object), object ignoreNullValues = default(object)) - : base(additionalProperties, writeBatchSize, writeBatchTimeout, sinkRetryCount, sinkRetryWait, maxConcurrentConnections) + public CommonDataServiceForAppsSink(IDictionary additionalProperties = default(IDictionary), object writeBatchSize = default(object), object writeBatchTimeout = default(object), object sinkRetryCount = default(object), object sinkRetryWait = default(object), object maxConcurrentConnections = default(object), object tableOption = default(object), object ignoreNullValues = default(object)) + : base(additionalProperties, writeBatchSize, writeBatchTimeout, sinkRetryCount, sinkRetryWait, maxConcurrentConnections, tableOption) { IgnoreNullValues = ignoreNullValues; CustomInit(); diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/ComponentSetup.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/ComponentSetup.cs new file mode 100644 index 000000000000..ac77e7b741ae --- /dev/null +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/ComponentSetup.cs @@ -0,0 +1,81 @@ +// +// 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.DataFactory.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// The custom setup of installing 3rd party components. + /// + [Rest.Serialization.JsonTransformation] + public partial class ComponentSetup : CustomSetupBase + { + /// + /// Initializes a new instance of the ComponentSetup class. + /// + public ComponentSetup() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ComponentSetup class. + /// + /// The name of the 3rd party + /// component. + /// The license key to activate the + /// component. + public ComponentSetup(string componentName, SecretBase licenseKey) + { + ComponentName = componentName; + LicenseKey = licenseKey; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the name of the 3rd party component. + /// + [JsonProperty(PropertyName = "typeProperties.componentName")] + public string ComponentName { get; set; } + + /// + /// Gets or sets the license key to activate the component. + /// + [JsonProperty(PropertyName = "typeProperties.licenseKey")] + public SecretBase LicenseKey { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (ComponentName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ComponentName"); + } + if (LicenseKey == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "LicenseKey"); + } + } + } +} diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/CopySink.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/CopySink.cs index ac2f9e17465e..e0419e79400a 100644 --- a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/CopySink.cs +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/CopySink.cs @@ -46,7 +46,10 @@ public CopySink() /// The maximum concurrent /// connection count for the sink data store. Type: integer (or /// Expression with resultType integer). - public CopySink(IDictionary additionalProperties = default(IDictionary), object writeBatchSize = default(object), object writeBatchTimeout = default(object), object sinkRetryCount = default(object), object sinkRetryWait = default(object), object maxConcurrentConnections = default(object)) + /// The option to handle sink table, such as + /// autoCreate. For now only 'autoCreate' value is supported. Type: + /// string (or Expression with resultType string). + public CopySink(IDictionary additionalProperties = default(IDictionary), object writeBatchSize = default(object), object writeBatchTimeout = default(object), object sinkRetryCount = default(object), object sinkRetryWait = default(object), object maxConcurrentConnections = default(object), object tableOption = default(object)) { AdditionalProperties = additionalProperties; WriteBatchSize = writeBatchSize; @@ -54,6 +57,7 @@ public CopySink() SinkRetryCount = sinkRetryCount; SinkRetryWait = sinkRetryWait; MaxConcurrentConnections = maxConcurrentConnections; + TableOption = tableOption; CustomInit(); } @@ -106,5 +110,13 @@ public CopySink() [JsonProperty(PropertyName = "maxConcurrentConnections")] public object MaxConcurrentConnections { get; set; } + /// + /// Gets or sets the option to handle sink table, such as autoCreate. + /// For now only 'autoCreate' value is supported. Type: string (or + /// Expression with resultType string). + /// + [JsonProperty(PropertyName = "tableOption")] + public object TableOption { get; set; } + } } diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/CosmosDbMongoDbApiSink.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/CosmosDbMongoDbApiSink.cs index 396dec19b3c1..8f120b788ec2 100644 --- a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/CosmosDbMongoDbApiSink.cs +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/CosmosDbMongoDbApiSink.cs @@ -46,13 +46,16 @@ public CosmosDbMongoDbApiSink() /// The maximum concurrent /// connection count for the sink data store. Type: integer (or /// Expression with resultType integer). + /// The option to handle sink table, such as + /// autoCreate. For now only 'autoCreate' value is supported. Type: + /// string (or Expression with resultType string). /// Specifies whether the document with /// same key to be overwritten (upsert) rather than throw exception /// (insert). The default value is "insert". Type: string (or /// Expression with resultType string). Type: string (or Expression /// with resultType string). - public CosmosDbMongoDbApiSink(IDictionary additionalProperties = default(IDictionary), object writeBatchSize = default(object), object writeBatchTimeout = default(object), object sinkRetryCount = default(object), object sinkRetryWait = default(object), object maxConcurrentConnections = default(object), object writeBehavior = default(object)) - : base(additionalProperties, writeBatchSize, writeBatchTimeout, sinkRetryCount, sinkRetryWait, maxConcurrentConnections) + public CosmosDbMongoDbApiSink(IDictionary additionalProperties = default(IDictionary), object writeBatchSize = default(object), object writeBatchTimeout = default(object), object sinkRetryCount = default(object), object sinkRetryWait = default(object), object maxConcurrentConnections = default(object), object tableOption = default(object), object writeBehavior = default(object)) + : base(additionalProperties, writeBatchSize, writeBatchTimeout, sinkRetryCount, sinkRetryWait, maxConcurrentConnections, tableOption) { WriteBehavior = writeBehavior; CustomInit(); diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/CustomSetupBase.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/CustomSetupBase.cs new file mode 100644 index 000000000000..eb4d7b084004 --- /dev/null +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/CustomSetupBase.cs @@ -0,0 +1,35 @@ +// +// 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.DataFactory.Models +{ + using System.Linq; + + /// + /// The base definition of the custom setup. + /// + public partial class CustomSetupBase + { + /// + /// Initializes a new instance of the CustomSetupBase class. + /// + public CustomSetupBase() + { + CustomInit(); + } + + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DelimitedTextSink.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DelimitedTextSink.cs index 48aa6c4a5e6d..77247684a5f5 100644 --- a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DelimitedTextSink.cs +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DelimitedTextSink.cs @@ -46,10 +46,13 @@ public DelimitedTextSink() /// The maximum concurrent /// connection count for the sink data store. Type: integer (or /// Expression with resultType integer). + /// The option to handle sink table, such as + /// autoCreate. For now only 'autoCreate' value is supported. Type: + /// string (or Expression with resultType string). /// DelimitedText store settings. /// DelimitedText format settings. - public DelimitedTextSink(IDictionary additionalProperties = default(IDictionary), object writeBatchSize = default(object), object writeBatchTimeout = default(object), object sinkRetryCount = default(object), object sinkRetryWait = default(object), object maxConcurrentConnections = default(object), StoreWriteSettings storeSettings = default(StoreWriteSettings), DelimitedTextWriteSettings formatSettings = default(DelimitedTextWriteSettings)) - : base(additionalProperties, writeBatchSize, writeBatchTimeout, sinkRetryCount, sinkRetryWait, maxConcurrentConnections) + public DelimitedTextSink(IDictionary additionalProperties = default(IDictionary), object writeBatchSize = default(object), object writeBatchTimeout = default(object), object sinkRetryCount = default(object), object sinkRetryWait = default(object), object maxConcurrentConnections = default(object), object tableOption = default(object), StoreWriteSettings storeSettings = default(StoreWriteSettings), DelimitedTextWriteSettings formatSettings = default(DelimitedTextWriteSettings)) + : base(additionalProperties, writeBatchSize, writeBatchTimeout, sinkRetryCount, sinkRetryWait, maxConcurrentConnections, tableOption) { StoreSettings = storeSettings; FormatSettings = formatSettings; diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DocumentDbCollectionSink.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DocumentDbCollectionSink.cs index 9ceefb6b2244..05618fdb3770 100644 --- a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DocumentDbCollectionSink.cs +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DocumentDbCollectionSink.cs @@ -46,13 +46,16 @@ public DocumentDbCollectionSink() /// The maximum concurrent /// connection count for the sink data store. Type: integer (or /// Expression with resultType integer). + /// The option to handle sink table, such as + /// autoCreate. For now only 'autoCreate' value is supported. Type: + /// string (or Expression with resultType string). /// Nested properties separator. Default /// is . (dot). Type: string (or Expression with resultType /// string). /// Describes how to write data to Azure /// Cosmos DB. Allowed values: insert and upsert. - public DocumentDbCollectionSink(IDictionary additionalProperties = default(IDictionary), object writeBatchSize = default(object), object writeBatchTimeout = default(object), object sinkRetryCount = default(object), object sinkRetryWait = default(object), object maxConcurrentConnections = default(object), object nestingSeparator = default(object), object writeBehavior = default(object)) - : base(additionalProperties, writeBatchSize, writeBatchTimeout, sinkRetryCount, sinkRetryWait, maxConcurrentConnections) + public DocumentDbCollectionSink(IDictionary additionalProperties = default(IDictionary), object writeBatchSize = default(object), object writeBatchTimeout = default(object), object sinkRetryCount = default(object), object sinkRetryWait = default(object), object maxConcurrentConnections = default(object), object tableOption = default(object), object nestingSeparator = default(object), object writeBehavior = default(object)) + : base(additionalProperties, writeBatchSize, writeBatchTimeout, sinkRetryCount, sinkRetryWait, maxConcurrentConnections, tableOption) { NestingSeparator = nestingSeparator; WriteBehavior = writeBehavior; diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DynamicsCrmSink.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DynamicsCrmSink.cs index 25a45867354d..400055fb26ef 100644 --- a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DynamicsCrmSink.cs +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DynamicsCrmSink.cs @@ -46,12 +46,15 @@ public DynamicsCrmSink() /// The maximum concurrent /// connection count for the sink data store. Type: integer (or /// Expression with resultType integer). + /// The option to handle sink table, such as + /// autoCreate. For now only 'autoCreate' value is supported. Type: + /// string (or Expression with resultType string). /// The flag indicating whether to /// ignore null values from input dataset (except key fields) during /// write operation. Default is false. Type: boolean (or Expression /// with resultType boolean). - public DynamicsCrmSink(IDictionary additionalProperties = default(IDictionary), object writeBatchSize = default(object), object writeBatchTimeout = default(object), object sinkRetryCount = default(object), object sinkRetryWait = default(object), object maxConcurrentConnections = default(object), object ignoreNullValues = default(object)) - : base(additionalProperties, writeBatchSize, writeBatchTimeout, sinkRetryCount, sinkRetryWait, maxConcurrentConnections) + public DynamicsCrmSink(IDictionary additionalProperties = default(IDictionary), object writeBatchSize = default(object), object writeBatchTimeout = default(object), object sinkRetryCount = default(object), object sinkRetryWait = default(object), object maxConcurrentConnections = default(object), object tableOption = default(object), object ignoreNullValues = default(object)) + : base(additionalProperties, writeBatchSize, writeBatchTimeout, sinkRetryCount, sinkRetryWait, maxConcurrentConnections, tableOption) { IgnoreNullValues = ignoreNullValues; CustomInit(); diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DynamicsSink.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DynamicsSink.cs index 34852c284b6a..1d15c9e2506b 100644 --- a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DynamicsSink.cs +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DynamicsSink.cs @@ -46,12 +46,15 @@ public DynamicsSink() /// The maximum concurrent /// connection count for the sink data store. Type: integer (or /// Expression with resultType integer). + /// The option to handle sink table, such as + /// autoCreate. For now only 'autoCreate' value is supported. Type: + /// string (or Expression with resultType string). /// The flag indicating whether ignore /// null values from input dataset (except key fields) during write /// operation. Default is false. Type: boolean (or Expression with /// resultType boolean). - public DynamicsSink(IDictionary additionalProperties = default(IDictionary), object writeBatchSize = default(object), object writeBatchTimeout = default(object), object sinkRetryCount = default(object), object sinkRetryWait = default(object), object maxConcurrentConnections = default(object), object ignoreNullValues = default(object)) - : base(additionalProperties, writeBatchSize, writeBatchTimeout, sinkRetryCount, sinkRetryWait, maxConcurrentConnections) + public DynamicsSink(IDictionary additionalProperties = default(IDictionary), object writeBatchSize = default(object), object writeBatchTimeout = default(object), object sinkRetryCount = default(object), object sinkRetryWait = default(object), object maxConcurrentConnections = default(object), object tableOption = default(object), object ignoreNullValues = default(object)) + : base(additionalProperties, writeBatchSize, writeBatchTimeout, sinkRetryCount, sinkRetryWait, maxConcurrentConnections, tableOption) { IgnoreNullValues = ignoreNullValues; CustomInit(); diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/EnvironmentVariableSetup.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/EnvironmentVariableSetup.cs new file mode 100644 index 000000000000..f5845ebf762b --- /dev/null +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/EnvironmentVariableSetup.cs @@ -0,0 +1,81 @@ +// +// 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.DataFactory.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// The custom setup of setting environment variable. + /// + [Rest.Serialization.JsonTransformation] + public partial class EnvironmentVariableSetup : CustomSetupBase + { + /// + /// Initializes a new instance of the EnvironmentVariableSetup class. + /// + public EnvironmentVariableSetup() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the EnvironmentVariableSetup class. + /// + /// The name of the environment + /// variable. + /// The value of the environment + /// variable. + public EnvironmentVariableSetup(string variableName, string variableValue) + { + VariableName = variableName; + VariableValue = variableValue; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the name of the environment variable. + /// + [JsonProperty(PropertyName = "typeProperties.variableName")] + public string VariableName { get; set; } + + /// + /// Gets or sets the value of the environment variable. + /// + [JsonProperty(PropertyName = "typeProperties.variableValue")] + public string VariableValue { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (VariableName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "VariableName"); + } + if (VariableValue == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "VariableValue"); + } + } + } +} diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/EventSubscriptionStatus.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/EventSubscriptionStatus.cs new file mode 100644 index 000000000000..580f566a608d --- /dev/null +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/EventSubscriptionStatus.cs @@ -0,0 +1,25 @@ +// +// 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.DataFactory.Models +{ + + /// + /// Defines values for EventSubscriptionStatus. + /// + public static class EventSubscriptionStatus + { + public const string Enabled = "Enabled"; + public const string Provisioning = "Provisioning"; + public const string Deprovisioning = "Deprovisioning"; + public const string Disabled = "Disabled"; + public const string Unknown = "Unknown"; + } +} diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/FileSystemSink.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/FileSystemSink.cs index a5020f9d87af..10e949b9a56d 100644 --- a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/FileSystemSink.cs +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/FileSystemSink.cs @@ -46,10 +46,13 @@ public FileSystemSink() /// The maximum concurrent /// connection count for the sink data store. Type: integer (or /// Expression with resultType integer). + /// The option to handle sink table, such as + /// autoCreate. For now only 'autoCreate' value is supported. Type: + /// string (or Expression with resultType string). /// The type of copy behavior for copy /// sink. - public FileSystemSink(IDictionary additionalProperties = default(IDictionary), object writeBatchSize = default(object), object writeBatchTimeout = default(object), object sinkRetryCount = default(object), object sinkRetryWait = default(object), object maxConcurrentConnections = default(object), object copyBehavior = default(object)) - : base(additionalProperties, writeBatchSize, writeBatchTimeout, sinkRetryCount, sinkRetryWait, maxConcurrentConnections) + public FileSystemSink(IDictionary additionalProperties = default(IDictionary), object writeBatchSize = default(object), object writeBatchTimeout = default(object), object sinkRetryCount = default(object), object sinkRetryWait = default(object), object maxConcurrentConnections = default(object), object tableOption = default(object), object copyBehavior = default(object)) + : base(additionalProperties, writeBatchSize, writeBatchTimeout, sinkRetryCount, sinkRetryWait, maxConcurrentConnections, tableOption) { CopyBehavior = copyBehavior; CustomInit(); diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/InformixSink.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/InformixSink.cs index 0ceb858146c6..253b5f23987e 100644 --- a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/InformixSink.cs +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/InformixSink.cs @@ -46,10 +46,13 @@ public InformixSink() /// The maximum concurrent /// connection count for the sink data store. Type: integer (or /// Expression with resultType integer). + /// The option to handle sink table, such as + /// autoCreate. For now only 'autoCreate' value is supported. Type: + /// string (or Expression with resultType string). /// A query to execute before starting the /// copy. Type: string (or Expression with resultType string). - public InformixSink(IDictionary additionalProperties = default(IDictionary), object writeBatchSize = default(object), object writeBatchTimeout = default(object), object sinkRetryCount = default(object), object sinkRetryWait = default(object), object maxConcurrentConnections = default(object), object preCopyScript = default(object)) - : base(additionalProperties, writeBatchSize, writeBatchTimeout, sinkRetryCount, sinkRetryWait, maxConcurrentConnections) + public InformixSink(IDictionary additionalProperties = default(IDictionary), object writeBatchSize = default(object), object writeBatchTimeout = default(object), object sinkRetryCount = default(object), object sinkRetryWait = default(object), object maxConcurrentConnections = default(object), object tableOption = default(object), object preCopyScript = default(object)) + : base(additionalProperties, writeBatchSize, writeBatchTimeout, sinkRetryCount, sinkRetryWait, maxConcurrentConnections, tableOption) { PreCopyScript = preCopyScript; CustomInit(); diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/IntegrationRuntimeSsisProperties.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/IntegrationRuntimeSsisProperties.cs index cd1b8b9fc3af..ce973fd96ae6 100644 --- a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/IntegrationRuntimeSsisProperties.cs +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/IntegrationRuntimeSsisProperties.cs @@ -46,7 +46,9 @@ public IntegrationRuntimeSsisProperties() /// managed dedicated integration runtime. /// The edition for the SSIS Integration Runtime. /// Possible values include: 'Standard', 'Enterprise' - public IntegrationRuntimeSsisProperties(IDictionary additionalProperties = default(IDictionary), IntegrationRuntimeSsisCatalogInfo catalogInfo = default(IntegrationRuntimeSsisCatalogInfo), string licenseType = default(string), IntegrationRuntimeCustomSetupScriptProperties customSetupScriptProperties = default(IntegrationRuntimeCustomSetupScriptProperties), IntegrationRuntimeDataProxyProperties dataProxyProperties = default(IntegrationRuntimeDataProxyProperties), string edition = default(string)) + /// Custom setup without + /// script properties for a SSIS integration runtime. + public IntegrationRuntimeSsisProperties(IDictionary additionalProperties = default(IDictionary), IntegrationRuntimeSsisCatalogInfo catalogInfo = default(IntegrationRuntimeSsisCatalogInfo), string licenseType = default(string), IntegrationRuntimeCustomSetupScriptProperties customSetupScriptProperties = default(IntegrationRuntimeCustomSetupScriptProperties), IntegrationRuntimeDataProxyProperties dataProxyProperties = default(IntegrationRuntimeDataProxyProperties), string edition = default(string), IList expressCustomSetupProperties = default(IList)) { AdditionalProperties = additionalProperties; CatalogInfo = catalogInfo; @@ -54,6 +56,7 @@ public IntegrationRuntimeSsisProperties() CustomSetupScriptProperties = customSetupScriptProperties; DataProxyProperties = dataProxyProperties; Edition = edition; + ExpressCustomSetupProperties = expressCustomSetupProperties; CustomInit(); } @@ -104,6 +107,13 @@ public IntegrationRuntimeSsisProperties() [JsonProperty(PropertyName = "edition")] public string Edition { get; set; } + /// + /// Gets or sets custom setup without script properties for a SSIS + /// integration runtime. + /// + [JsonProperty(PropertyName = "expressCustomSetupProperties")] + public IList ExpressCustomSetupProperties { get; set; } + /// /// Validate the object. /// diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/JsonDataset.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/JsonDataset.cs new file mode 100644 index 000000000000..f0a13fc24ceb --- /dev/null +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/JsonDataset.cs @@ -0,0 +1,120 @@ +// +// 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.DataFactory.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Json dataset. + /// + [Newtonsoft.Json.JsonObject("Json")] + [Rest.Serialization.JsonTransformation] + public partial class JsonDataset : Dataset + { + /// + /// Initializes a new instance of the JsonDataset class. + /// + public JsonDataset() + { + LinkedServiceName = new LinkedServiceReference(); + CustomInit(); + } + + /// + /// Initializes a new instance of the JsonDataset class. + /// + /// Linked service reference. + /// The location of the json data + /// storage. + /// Unmatched properties from the + /// message are deserialized this collection + /// Dataset description. + /// Columns that define the structure of the + /// dataset. Type: array (or Expression with resultType array), + /// itemType: DatasetDataElement. + /// Columns that define the physical type schema + /// of the dataset. Type: array (or Expression with resultType array), + /// itemType: DatasetSchemaDataElement. + /// Parameters for dataset. + /// List of tags that can be used for + /// describing the Dataset. + /// The folder that this Dataset is in. If not + /// specified, Dataset will appear at the root level. + /// The code page name of the preferred + /// encoding. If not specified, the default value is UTF-8, unless BOM + /// denotes another Unicode encoding. Refer to the name column of the + /// table in the following link to set supported values: + /// https://msdn.microsoft.com/library/system.text.encoding.aspx. Type: + /// string (or Expression with resultType string). + /// The data compression method used for the + /// json dataset. + public JsonDataset(LinkedServiceReference linkedServiceName, DatasetLocation location, IDictionary additionalProperties = default(IDictionary), string description = default(string), object structure = default(object), object schema = default(object), IDictionary parameters = default(IDictionary), IList annotations = default(IList), DatasetFolder folder = default(DatasetFolder), object encodingName = default(object), DatasetCompression compression = default(DatasetCompression)) + : base(linkedServiceName, additionalProperties, description, structure, schema, parameters, annotations, folder) + { + Location = location; + EncodingName = encodingName; + Compression = compression; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the location of the json data storage. + /// + [JsonProperty(PropertyName = "typeProperties.location")] + public DatasetLocation Location { get; set; } + + /// + /// Gets or sets the code page name of the preferred encoding. If not + /// specified, the default value is UTF-8, unless BOM denotes another + /// Unicode encoding. Refer to the name column of the table in the + /// following link to set supported values: + /// https://msdn.microsoft.com/library/system.text.encoding.aspx. Type: + /// string (or Expression with resultType string). + /// + [JsonProperty(PropertyName = "typeProperties.encodingName")] + public object EncodingName { get; set; } + + /// + /// Gets or sets the data compression method used for the json dataset. + /// + [JsonProperty(PropertyName = "typeProperties.compression")] + public DatasetCompression Compression { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + if (Location == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Location"); + } + if (Location != null) + { + Location.Validate(); + } + } + } +} diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/JsonSink.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/JsonSink.cs new file mode 100644 index 000000000000..ac94b3be6d3e --- /dev/null +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/JsonSink.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.DataFactory.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// A copy activity Json sink. + /// + public partial class JsonSink : CopySink + { + /// + /// Initializes a new instance of the JsonSink class. + /// + public JsonSink() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the JsonSink class. + /// + /// Unmatched properties from the + /// message are deserialized this collection + /// Write batch size. Type: integer (or + /// Expression with resultType integer), minimum: 0. + /// Write batch timeout. Type: string + /// (or Expression with resultType string), pattern: + /// ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + /// Sink retry count. Type: integer (or + /// Expression with resultType integer). + /// Sink retry wait. Type: string (or + /// Expression with resultType string), pattern: + /// ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + /// The maximum concurrent + /// connection count for the sink data store. Type: integer (or + /// Expression with resultType integer). + /// The option to handle sink table, such as + /// autoCreate. For now only 'autoCreate' value is supported. Type: + /// string (or Expression with resultType string). + /// Json store settings. + /// Json format settings. + public JsonSink(IDictionary additionalProperties = default(IDictionary), object writeBatchSize = default(object), object writeBatchTimeout = default(object), object sinkRetryCount = default(object), object sinkRetryWait = default(object), object maxConcurrentConnections = default(object), object tableOption = default(object), StoreWriteSettings storeSettings = default(StoreWriteSettings), JsonWriteSettings formatSettings = default(JsonWriteSettings)) + : base(additionalProperties, writeBatchSize, writeBatchTimeout, sinkRetryCount, sinkRetryWait, maxConcurrentConnections, tableOption) + { + StoreSettings = storeSettings; + FormatSettings = formatSettings; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets json store settings. + /// + [JsonProperty(PropertyName = "storeSettings")] + public StoreWriteSettings StoreSettings { get; set; } + + /// + /// Gets or sets json format settings. + /// + [JsonProperty(PropertyName = "formatSettings")] + public JsonWriteSettings FormatSettings { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (StoreSettings != null) + { + StoreSettings.Validate(); + } + if (FormatSettings != null) + { + FormatSettings.Validate(); + } + } + } +} diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/JsonSource.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/JsonSource.cs new file mode 100644 index 000000000000..2732f3e4e69d --- /dev/null +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/JsonSource.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.DataFactory.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// A copy activity Json source. + /// + public partial class JsonSource : CopySource + { + /// + /// Initializes a new instance of the JsonSource class. + /// + public JsonSource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the JsonSource class. + /// + /// Unmatched properties from the + /// message are deserialized this collection + /// Source retry count. Type: integer + /// (or Expression with resultType integer). + /// Source retry wait. Type: string (or + /// Expression with resultType string), pattern: + /// ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + /// The maximum concurrent + /// connection count for the source data store. Type: integer (or + /// Expression with resultType integer). + /// Json store settings. + public JsonSource(IDictionary additionalProperties = default(IDictionary), object sourceRetryCount = default(object), object sourceRetryWait = default(object), object maxConcurrentConnections = default(object), StoreReadSettings storeSettings = default(StoreReadSettings)) + : base(additionalProperties, sourceRetryCount, sourceRetryWait, maxConcurrentConnections) + { + StoreSettings = storeSettings; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets json store settings. + /// + [JsonProperty(PropertyName = "storeSettings")] + public StoreReadSettings StoreSettings { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (StoreSettings != null) + { + StoreSettings.Validate(); + } + } + } +} diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/JsonWriteFilePattern.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/JsonWriteFilePattern.cs new file mode 100644 index 000000000000..124f33ec1a7f --- /dev/null +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/JsonWriteFilePattern.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.DataFactory.Models +{ + + /// + /// Defines values for JsonWriteFilePattern. + /// + public static class JsonWriteFilePattern + { + public const string SetOfObjects = "setOfObjects"; + public const string ArrayOfObjects = "arrayOfObjects"; + } +} diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/JsonWriteSettings.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/JsonWriteSettings.cs new file mode 100644 index 000000000000..23b2cb664523 --- /dev/null +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/JsonWriteSettings.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.DataFactory.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Json write settings. + /// + public partial class JsonWriteSettings : FormatWriteSettings + { + /// + /// Initializes a new instance of the JsonWriteSettings class. + /// + public JsonWriteSettings() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the JsonWriteSettings class. + /// + /// The write setting type. + /// Unmatched properties from the + /// message are deserialized this collection + /// File pattern of JSON. This setting + /// controls the way a collection of JSON objects will be treated. The + /// default value is 'setOfObjects'. It is case-sensitive. Possible + /// values include: 'setOfObjects', 'arrayOfObjects' + public JsonWriteSettings(string type, IDictionary additionalProperties = default(IDictionary), string filePattern = default(string)) + : base(type, additionalProperties) + { + FilePattern = filePattern; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets file pattern of JSON. This setting controls the way a + /// collection of JSON objects will be treated. The default value is + /// 'setOfObjects'. It is case-sensitive. Possible values include: + /// 'setOfObjects', 'arrayOfObjects' + /// + [JsonProperty(PropertyName = "filePattern")] + public string FilePattern { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + } + } +} diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/MicrosoftAccessSink.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/MicrosoftAccessSink.cs index 899d6f038b43..29ecbea568fd 100644 --- a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/MicrosoftAccessSink.cs +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/MicrosoftAccessSink.cs @@ -46,10 +46,13 @@ public MicrosoftAccessSink() /// The maximum concurrent /// connection count for the sink data store. Type: integer (or /// Expression with resultType integer). + /// The option to handle sink table, such as + /// autoCreate. For now only 'autoCreate' value is supported. Type: + /// string (or Expression with resultType string). /// A query to execute before starting the /// copy. Type: string (or Expression with resultType string). - public MicrosoftAccessSink(IDictionary additionalProperties = default(IDictionary), object writeBatchSize = default(object), object writeBatchTimeout = default(object), object sinkRetryCount = default(object), object sinkRetryWait = default(object), object maxConcurrentConnections = default(object), object preCopyScript = default(object)) - : base(additionalProperties, writeBatchSize, writeBatchTimeout, sinkRetryCount, sinkRetryWait, maxConcurrentConnections) + public MicrosoftAccessSink(IDictionary additionalProperties = default(IDictionary), object writeBatchSize = default(object), object writeBatchTimeout = default(object), object sinkRetryCount = default(object), object sinkRetryWait = default(object), object maxConcurrentConnections = default(object), object tableOption = default(object), object preCopyScript = default(object)) + : base(additionalProperties, writeBatchSize, writeBatchTimeout, sinkRetryCount, sinkRetryWait, maxConcurrentConnections, tableOption) { PreCopyScript = preCopyScript; CustomInit(); diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/OdbcSink.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/OdbcSink.cs index 7151280b5eca..2d0ad3bdc807 100644 --- a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/OdbcSink.cs +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/OdbcSink.cs @@ -46,10 +46,13 @@ public OdbcSink() /// The maximum concurrent /// connection count for the sink data store. Type: integer (or /// Expression with resultType integer). + /// The option to handle sink table, such as + /// autoCreate. For now only 'autoCreate' value is supported. Type: + /// string (or Expression with resultType string). /// A query to execute before starting the /// copy. Type: string (or Expression with resultType string). - public OdbcSink(IDictionary additionalProperties = default(IDictionary), object writeBatchSize = default(object), object writeBatchTimeout = default(object), object sinkRetryCount = default(object), object sinkRetryWait = default(object), object maxConcurrentConnections = default(object), object preCopyScript = default(object)) - : base(additionalProperties, writeBatchSize, writeBatchTimeout, sinkRetryCount, sinkRetryWait, maxConcurrentConnections) + public OdbcSink(IDictionary additionalProperties = default(IDictionary), object writeBatchSize = default(object), object writeBatchTimeout = default(object), object sinkRetryCount = default(object), object sinkRetryWait = default(object), object maxConcurrentConnections = default(object), object tableOption = default(object), object preCopyScript = default(object)) + : base(additionalProperties, writeBatchSize, writeBatchTimeout, sinkRetryCount, sinkRetryWait, maxConcurrentConnections, tableOption) { PreCopyScript = preCopyScript; CustomInit(); diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/OracleSink.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/OracleSink.cs index 7859a5c6260b..3aed6e3d813d 100644 --- a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/OracleSink.cs +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/OracleSink.cs @@ -46,10 +46,13 @@ public OracleSink() /// The maximum concurrent /// connection count for the sink data store. Type: integer (or /// Expression with resultType integer). + /// The option to handle sink table, such as + /// autoCreate. For now only 'autoCreate' value is supported. Type: + /// string (or Expression with resultType string). /// SQL pre-copy script. Type: string (or /// Expression with resultType string). - public OracleSink(IDictionary additionalProperties = default(IDictionary), object writeBatchSize = default(object), object writeBatchTimeout = default(object), object sinkRetryCount = default(object), object sinkRetryWait = default(object), object maxConcurrentConnections = default(object), object preCopyScript = default(object)) - : base(additionalProperties, writeBatchSize, writeBatchTimeout, sinkRetryCount, sinkRetryWait, maxConcurrentConnections) + public OracleSink(IDictionary additionalProperties = default(IDictionary), object writeBatchSize = default(object), object writeBatchTimeout = default(object), object sinkRetryCount = default(object), object sinkRetryWait = default(object), object maxConcurrentConnections = default(object), object tableOption = default(object), object preCopyScript = default(object)) + : base(additionalProperties, writeBatchSize, writeBatchTimeout, sinkRetryCount, sinkRetryWait, maxConcurrentConnections, tableOption) { PreCopyScript = preCopyScript; CustomInit(); diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/ParquetSink.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/ParquetSink.cs index 73efe2afcdf0..6d975bbfd3f4 100644 --- a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/ParquetSink.cs +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/ParquetSink.cs @@ -46,9 +46,12 @@ public ParquetSink() /// The maximum concurrent /// connection count for the sink data store. Type: integer (or /// Expression with resultType integer). + /// The option to handle sink table, such as + /// autoCreate. For now only 'autoCreate' value is supported. Type: + /// string (or Expression with resultType string). /// Parquet store settings. - public ParquetSink(IDictionary additionalProperties = default(IDictionary), object writeBatchSize = default(object), object writeBatchTimeout = default(object), object sinkRetryCount = default(object), object sinkRetryWait = default(object), object maxConcurrentConnections = default(object), StoreWriteSettings storeSettings = default(StoreWriteSettings)) - : base(additionalProperties, writeBatchSize, writeBatchTimeout, sinkRetryCount, sinkRetryWait, maxConcurrentConnections) + public ParquetSink(IDictionary additionalProperties = default(IDictionary), object writeBatchSize = default(object), object writeBatchTimeout = default(object), object sinkRetryCount = default(object), object sinkRetryWait = default(object), object maxConcurrentConnections = default(object), object tableOption = default(object), StoreWriteSettings storeSettings = default(StoreWriteSettings)) + : base(additionalProperties, writeBatchSize, writeBatchTimeout, sinkRetryCount, sinkRetryWait, maxConcurrentConnections, tableOption) { StoreSettings = storeSettings; CustomInit(); diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/SsisPackageLocation.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/SSISPackageLocation.cs similarity index 100% rename from sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/SsisPackageLocation.cs rename to sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/SSISPackageLocation.cs diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/SalesforceServiceCloudSink.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/SalesforceServiceCloudSink.cs index a260bddc659c..bd3ff8173a12 100644 --- a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/SalesforceServiceCloudSink.cs +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/SalesforceServiceCloudSink.cs @@ -46,6 +46,9 @@ public SalesforceServiceCloudSink() /// The maximum concurrent /// connection count for the sink data store. Type: integer (or /// Expression with resultType integer). + /// The option to handle sink table, such as + /// autoCreate. For now only 'autoCreate' value is supported. Type: + /// string (or Expression with resultType string). /// The write behavior for the operation. /// Default is Insert. Possible values include: 'Insert', /// 'Upsert' @@ -61,8 +64,8 @@ public SalesforceServiceCloudSink() /// destination object to NULL when doing upsert/update operation and /// insert NULL value when doing insert operation. Type: boolean (or /// Expression with resultType boolean). - public SalesforceServiceCloudSink(IDictionary additionalProperties = default(IDictionary), object writeBatchSize = default(object), object writeBatchTimeout = default(object), object sinkRetryCount = default(object), object sinkRetryWait = default(object), object maxConcurrentConnections = default(object), string writeBehavior = default(string), object externalIdFieldName = default(object), object ignoreNullValues = default(object)) - : base(additionalProperties, writeBatchSize, writeBatchTimeout, sinkRetryCount, sinkRetryWait, maxConcurrentConnections) + public SalesforceServiceCloudSink(IDictionary additionalProperties = default(IDictionary), object writeBatchSize = default(object), object writeBatchTimeout = default(object), object sinkRetryCount = default(object), object sinkRetryWait = default(object), object maxConcurrentConnections = default(object), object tableOption = default(object), string writeBehavior = default(string), object externalIdFieldName = default(object), object ignoreNullValues = default(object)) + : base(additionalProperties, writeBatchSize, writeBatchTimeout, sinkRetryCount, sinkRetryWait, maxConcurrentConnections, tableOption) { WriteBehavior = writeBehavior; ExternalIdFieldName = externalIdFieldName; diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/SalesforceSink.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/SalesforceSink.cs index cba5c6904541..69304bd4f61d 100644 --- a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/SalesforceSink.cs +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/SalesforceSink.cs @@ -46,6 +46,9 @@ public SalesforceSink() /// The maximum concurrent /// connection count for the sink data store. Type: integer (or /// Expression with resultType integer). + /// The option to handle sink table, such as + /// autoCreate. For now only 'autoCreate' value is supported. Type: + /// string (or Expression with resultType string). /// The write behavior for the operation. /// Default is Insert. Possible values include: 'Insert', /// 'Upsert' @@ -61,8 +64,8 @@ public SalesforceSink() /// destination object to NULL when doing upsert/update operation and /// insert NULL value when doing insert operation. Type: boolean (or /// Expression with resultType boolean). - public SalesforceSink(IDictionary additionalProperties = default(IDictionary), object writeBatchSize = default(object), object writeBatchTimeout = default(object), object sinkRetryCount = default(object), object sinkRetryWait = default(object), object maxConcurrentConnections = default(object), string writeBehavior = default(string), object externalIdFieldName = default(object), object ignoreNullValues = default(object)) - : base(additionalProperties, writeBatchSize, writeBatchTimeout, sinkRetryCount, sinkRetryWait, maxConcurrentConnections) + public SalesforceSink(IDictionary additionalProperties = default(IDictionary), object writeBatchSize = default(object), object writeBatchTimeout = default(object), object sinkRetryCount = default(object), object sinkRetryWait = default(object), object maxConcurrentConnections = default(object), object tableOption = default(object), string writeBehavior = default(string), object externalIdFieldName = default(object), object ignoreNullValues = default(object)) + : base(additionalProperties, writeBatchSize, writeBatchTimeout, sinkRetryCount, sinkRetryWait, maxConcurrentConnections, tableOption) { WriteBehavior = writeBehavior; ExternalIdFieldName = externalIdFieldName; diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/SapCloudForCustomerSink.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/SapCloudForCustomerSink.cs index 9157f1e4386f..e5dc41803f2f 100644 --- a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/SapCloudForCustomerSink.cs +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/SapCloudForCustomerSink.cs @@ -46,11 +46,14 @@ public SapCloudForCustomerSink() /// The maximum concurrent /// connection count for the sink data store. Type: integer (or /// Expression with resultType integer). + /// The option to handle sink table, such as + /// autoCreate. For now only 'autoCreate' value is supported. Type: + /// string (or Expression with resultType string). /// The write behavior for the operation. /// Default is 'Insert'. Possible values include: 'Insert', /// 'Update' - public SapCloudForCustomerSink(IDictionary additionalProperties = default(IDictionary), object writeBatchSize = default(object), object writeBatchTimeout = default(object), object sinkRetryCount = default(object), object sinkRetryWait = default(object), object maxConcurrentConnections = default(object), string writeBehavior = default(string)) - : base(additionalProperties, writeBatchSize, writeBatchTimeout, sinkRetryCount, sinkRetryWait, maxConcurrentConnections) + public SapCloudForCustomerSink(IDictionary additionalProperties = default(IDictionary), object writeBatchSize = default(object), object writeBatchTimeout = default(object), object sinkRetryCount = default(object), object sinkRetryWait = default(object), object maxConcurrentConnections = default(object), object tableOption = default(object), string writeBehavior = default(string)) + : base(additionalProperties, writeBatchSize, writeBatchTimeout, sinkRetryCount, sinkRetryWait, maxConcurrentConnections, tableOption) { WriteBehavior = writeBehavior; CustomInit(); diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/SqlDWSink.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/SqlDWSink.cs index e52711727fb1..805f98203a7c 100644 --- a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/SqlDWSink.cs +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/SqlDWSink.cs @@ -46,6 +46,9 @@ public SqlDWSink() /// The maximum concurrent /// connection count for the sink data store. Type: integer (or /// Expression with resultType integer). + /// The option to handle sink table, such as + /// autoCreate. For now only 'autoCreate' value is supported. Type: + /// string (or Expression with resultType string). /// SQL pre-copy script. Type: string (or /// Expression with resultType string). /// Indicates to use PolyBase to copy data @@ -53,8 +56,8 @@ public SqlDWSink() /// Expression with resultType boolean). /// Specifies PolyBase-related settings /// when allowPolyBase is true. - public SqlDWSink(IDictionary additionalProperties = default(IDictionary), object writeBatchSize = default(object), object writeBatchTimeout = default(object), object sinkRetryCount = default(object), object sinkRetryWait = default(object), object maxConcurrentConnections = default(object), object preCopyScript = default(object), object allowPolyBase = default(object), PolybaseSettings polyBaseSettings = default(PolybaseSettings)) - : base(additionalProperties, writeBatchSize, writeBatchTimeout, sinkRetryCount, sinkRetryWait, maxConcurrentConnections) + public SqlDWSink(IDictionary additionalProperties = default(IDictionary), object writeBatchSize = default(object), object writeBatchTimeout = default(object), object sinkRetryCount = default(object), object sinkRetryWait = default(object), object maxConcurrentConnections = default(object), object tableOption = default(object), object preCopyScript = default(object), object allowPolyBase = default(object), PolybaseSettings polyBaseSettings = default(PolybaseSettings)) + : base(additionalProperties, writeBatchSize, writeBatchTimeout, sinkRetryCount, sinkRetryWait, maxConcurrentConnections, tableOption) { PreCopyScript = preCopyScript; AllowPolyBase = allowPolyBase; diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/SqlMISink.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/SqlMISink.cs index 5044366f301f..d11009fac792 100644 --- a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/SqlMISink.cs +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/SqlMISink.cs @@ -46,6 +46,9 @@ public SqlMISink() /// The maximum concurrent /// connection count for the sink data store. Type: integer (or /// Expression with resultType integer). + /// The option to handle sink table, such as + /// autoCreate. For now only 'autoCreate' value is supported. Type: + /// string (or Expression with resultType string). /// SQL writer stored /// procedure name. Type: string (or Expression with resultType /// string). @@ -58,8 +61,8 @@ public SqlMISink() /// The stored /// procedure parameter name of the table type. Type: string (or /// Expression with resultType string). - public SqlMISink(IDictionary additionalProperties = default(IDictionary), object writeBatchSize = default(object), object writeBatchTimeout = default(object), object sinkRetryCount = default(object), object sinkRetryWait = default(object), object maxConcurrentConnections = default(object), object sqlWriterStoredProcedureName = default(object), object sqlWriterTableType = default(object), object preCopyScript = default(object), IDictionary storedProcedureParameters = default(IDictionary), object storedProcedureTableTypeParameterName = default(object)) - : base(additionalProperties, writeBatchSize, writeBatchTimeout, sinkRetryCount, sinkRetryWait, maxConcurrentConnections) + public SqlMISink(IDictionary additionalProperties = default(IDictionary), object writeBatchSize = default(object), object writeBatchTimeout = default(object), object sinkRetryCount = default(object), object sinkRetryWait = default(object), object maxConcurrentConnections = default(object), object tableOption = default(object), object sqlWriterStoredProcedureName = default(object), object sqlWriterTableType = default(object), object preCopyScript = default(object), IDictionary storedProcedureParameters = default(IDictionary), object storedProcedureTableTypeParameterName = default(object)) + : base(additionalProperties, writeBatchSize, writeBatchTimeout, sinkRetryCount, sinkRetryWait, maxConcurrentConnections, tableOption) { SqlWriterStoredProcedureName = sqlWriterStoredProcedureName; SqlWriterTableType = sqlWriterTableType; diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/SqlServerSink.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/SqlServerSink.cs index 017de9d8f760..a3f859004857 100644 --- a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/SqlServerSink.cs +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/SqlServerSink.cs @@ -46,6 +46,9 @@ public SqlServerSink() /// The maximum concurrent /// connection count for the sink data store. Type: integer (or /// Expression with resultType integer). + /// The option to handle sink table, such as + /// autoCreate. For now only 'autoCreate' value is supported. Type: + /// string (or Expression with resultType string). /// SQL writer stored /// procedure name. Type: string (or Expression with resultType /// string). @@ -58,8 +61,8 @@ public SqlServerSink() /// The stored /// procedure parameter name of the table type. Type: string (or /// Expression with resultType string). - public SqlServerSink(IDictionary additionalProperties = default(IDictionary), object writeBatchSize = default(object), object writeBatchTimeout = default(object), object sinkRetryCount = default(object), object sinkRetryWait = default(object), object maxConcurrentConnections = default(object), object sqlWriterStoredProcedureName = default(object), object sqlWriterTableType = default(object), object preCopyScript = default(object), IDictionary storedProcedureParameters = default(IDictionary), object storedProcedureTableTypeParameterName = default(object)) - : base(additionalProperties, writeBatchSize, writeBatchTimeout, sinkRetryCount, sinkRetryWait, maxConcurrentConnections) + public SqlServerSink(IDictionary additionalProperties = default(IDictionary), object writeBatchSize = default(object), object writeBatchTimeout = default(object), object sinkRetryCount = default(object), object sinkRetryWait = default(object), object maxConcurrentConnections = default(object), object tableOption = default(object), object sqlWriterStoredProcedureName = default(object), object sqlWriterTableType = default(object), object preCopyScript = default(object), IDictionary storedProcedureParameters = default(IDictionary), object storedProcedureTableTypeParameterName = default(object)) + : base(additionalProperties, writeBatchSize, writeBatchTimeout, sinkRetryCount, sinkRetryWait, maxConcurrentConnections, tableOption) { SqlWriterStoredProcedureName = sqlWriterStoredProcedureName; SqlWriterTableType = sqlWriterTableType; diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/SqlSink.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/SqlSink.cs index 56c858661b2a..3d3e70cc329d 100644 --- a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/SqlSink.cs +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/SqlSink.cs @@ -46,6 +46,9 @@ public SqlSink() /// The maximum concurrent /// connection count for the sink data store. Type: integer (or /// Expression with resultType integer). + /// The option to handle sink table, such as + /// autoCreate. For now only 'autoCreate' value is supported. Type: + /// string (or Expression with resultType string). /// SQL writer stored /// procedure name. Type: string (or Expression with resultType /// string). @@ -58,8 +61,8 @@ public SqlSink() /// The stored /// procedure parameter name of the table type. Type: string (or /// Expression with resultType string). - public SqlSink(IDictionary additionalProperties = default(IDictionary), object writeBatchSize = default(object), object writeBatchTimeout = default(object), object sinkRetryCount = default(object), object sinkRetryWait = default(object), object maxConcurrentConnections = default(object), object sqlWriterStoredProcedureName = default(object), object sqlWriterTableType = default(object), object preCopyScript = default(object), IDictionary storedProcedureParameters = default(IDictionary), object storedProcedureTableTypeParameterName = default(object)) - : base(additionalProperties, writeBatchSize, writeBatchTimeout, sinkRetryCount, sinkRetryWait, maxConcurrentConnections) + public SqlSink(IDictionary additionalProperties = default(IDictionary), object writeBatchSize = default(object), object writeBatchTimeout = default(object), object sinkRetryCount = default(object), object sinkRetryWait = default(object), object maxConcurrentConnections = default(object), object tableOption = default(object), object sqlWriterStoredProcedureName = default(object), object sqlWriterTableType = default(object), object preCopyScript = default(object), IDictionary storedProcedureParameters = default(IDictionary), object storedProcedureTableTypeParameterName = default(object)) + : base(additionalProperties, writeBatchSize, writeBatchTimeout, sinkRetryCount, sinkRetryWait, maxConcurrentConnections, tableOption) { SqlWriterStoredProcedureName = sqlWriterStoredProcedureName; SqlWriterTableType = sqlWriterTableType; diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/TriggerSubscriptionOperationStatus.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/TriggerSubscriptionOperationStatus.cs new file mode 100644 index 000000000000..dc44fadce22e --- /dev/null +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/TriggerSubscriptionOperationStatus.cs @@ -0,0 +1,64 @@ +// +// 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.DataFactory.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Defines the response of a trigger subscription operation. + /// + public partial class TriggerSubscriptionOperationStatus + { + /// + /// Initializes a new instance of the + /// TriggerSubscriptionOperationStatus class. + /// + public TriggerSubscriptionOperationStatus() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// TriggerSubscriptionOperationStatus class. + /// + /// Trigger name. + /// Event Subscription Status. Possible values + /// include: 'Enabled', 'Provisioning', 'Deprovisioning', 'Disabled', + /// 'Unknown' + public TriggerSubscriptionOperationStatus(string triggerName = default(string), string status = default(string)) + { + TriggerName = triggerName; + Status = status; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets trigger name. + /// + [JsonProperty(PropertyName = "triggerName")] + public string TriggerName { get; private set; } + + /// + /// Gets event Subscription Status. Possible values include: 'Enabled', + /// 'Provisioning', 'Deprovisioning', 'Disabled', 'Unknown' + /// + [JsonProperty(PropertyName = "status")] + public string Status { get; private set; } + + } +} diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/SdkInfo_DataFactoryManagementClient.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/SdkInfo_DataFactoryManagementClient.cs index 1d5b778524b6..afb3bebe6aa9 100644 --- a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/SdkInfo_DataFactoryManagementClient.cs +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/SdkInfo_DataFactoryManagementClient.cs @@ -36,16 +36,5 @@ public static IEnumerable> ApiInfo_DataFactoryMana }.AsEnumerable(); } } - // BEGIN: Code Generation Metadata Section - public static readonly String AutoRestVersion = "latest"; - public static readonly String AutoRestBootStrapperVersion = "autorest@2.0.4283"; - public static readonly String AutoRestCmdExecuted = "cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/datafactory/resource-manager/readme.md --csharp --version=latest --reflect-api-versions --tag=package-2018-06 --csharp-sdks-folder=C:\\Users\\xiaoyz\\Source\\Repos\\azure-sdk-for-net-wenbo\\sdk"; - public static readonly String GithubForkName = "Azure"; - public static readonly String GithubBranchName = "master"; - public static readonly String GithubCommidId = "f80a6c182c85879a415d4c668473c592147416f3"; - public static readonly String CodeGenerationErrors = ""; - public static readonly String GithubRepoName = "azure-rest-api-specs"; - // END: Code Generation Metadata Section } } - diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/TriggersOperations.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/TriggersOperations.cs index 45ce129518bc..08657cb81ff2 100644 --- a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/TriggersOperations.cs +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/TriggersOperations.cs @@ -1051,7 +1051,7 @@ internal TriggersOperations(DataFactoryManagementClient client) } /// - /// Starts a trigger. + /// Subscribe event trigger to events. /// /// /// The resource group name. @@ -1068,15 +1068,265 @@ internal TriggersOperations(DataFactoryManagementClient client) /// /// The cancellation token. /// - public async Task StartWithHttpMessagesAsync(string resourceGroupName, string factoryName, string triggerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> SubscribeToEventsWithHttpMessagesAsync(string resourceGroupName, string factoryName, string triggerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { // Send request - AzureOperationResponse _response = await BeginStartWithHttpMessagesAsync(resourceGroupName, factoryName, triggerName, customHeaders, cancellationToken).ConfigureAwait(false); + AzureOperationResponse _response = await BeginSubscribeToEventsWithHttpMessagesAsync(resourceGroupName, factoryName, triggerName, customHeaders, cancellationToken).ConfigureAwait(false); return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Stops a trigger. + /// Get a trigger's event subscription status. + /// + /// + /// The resource group name. + /// + /// + /// The factory name. + /// + /// + /// The trigger name. + /// + /// + /// 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> GetEventSubscriptionStatusWithHttpMessagesAsync(string resourceGroupName, string factoryName, string triggerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (factoryName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "factoryName"); + } + if (factoryName != null) + { + if (factoryName.Length > 63) + { + throw new ValidationException(ValidationRules.MaxLength, "factoryName", 63); + } + if (factoryName.Length < 3) + { + throw new ValidationException(ValidationRules.MinLength, "factoryName", 3); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(factoryName, "^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$")) + { + throw new ValidationException(ValidationRules.Pattern, "factoryName", "^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$"); + } + } + if (triggerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "triggerName"); + } + if (triggerName != null) + { + if (triggerName.Length > 260) + { + throw new ValidationException(ValidationRules.MaxLength, "triggerName", 260); + } + if (triggerName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "triggerName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(triggerName, "^[A-Za-z0-9_][^<>*#.%&:\\\\+?/]*$")) + { + throw new ValidationException(ValidationRules.Pattern, "triggerName", "^[A-Za-z0-9_][^<>*#.%&:\\\\+?/]*$"); + } + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("factoryName", factoryName); + tracingParameters.Add("triggerName", triggerName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetEventSubscriptionStatus", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/triggers/{triggerName}/getEventSubscriptionStatus").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{factoryName}", System.Uri.EscapeDataString(factoryName)); + _url = _url.Replace("{triggerName}", System.Uri.EscapeDataString(triggerName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.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; + // 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 CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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; + } + + /// + /// Unsubscribe event trigger from events. /// /// /// The resource group name. @@ -1093,13 +1343,563 @@ internal TriggersOperations(DataFactoryManagementClient client) /// /// The cancellation token. /// - public async Task StopWithHttpMessagesAsync(string resourceGroupName, string factoryName, string triggerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UnsubscribeFromEventsWithHttpMessagesAsync(string resourceGroupName, string factoryName, string triggerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { // Send request - AzureOperationResponse _response = await BeginStopWithHttpMessagesAsync(resourceGroupName, factoryName, triggerName, customHeaders, cancellationToken).ConfigureAwait(false); + AzureOperationResponse _response = await BeginUnsubscribeFromEventsWithHttpMessagesAsync(resourceGroupName, factoryName, triggerName, customHeaders, cancellationToken).ConfigureAwait(false); return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } + /// + /// Starts a trigger. + /// + /// + /// The resource group name. + /// + /// + /// The factory name. + /// + /// + /// The trigger name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task StartWithHttpMessagesAsync(string resourceGroupName, string factoryName, string triggerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginStartWithHttpMessagesAsync(resourceGroupName, factoryName, triggerName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Stops a trigger. + /// + /// + /// The resource group name. + /// + /// + /// The factory name. + /// + /// + /// The trigger name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task StopWithHttpMessagesAsync(string resourceGroupName, string factoryName, string triggerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginStopWithHttpMessagesAsync(resourceGroupName, factoryName, triggerName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Subscribe event trigger to events. + /// + /// + /// The resource group name. + /// + /// + /// The factory name. + /// + /// + /// The trigger name. + /// + /// + /// 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> BeginSubscribeToEventsWithHttpMessagesAsync(string resourceGroupName, string factoryName, string triggerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (factoryName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "factoryName"); + } + if (factoryName != null) + { + if (factoryName.Length > 63) + { + throw new ValidationException(ValidationRules.MaxLength, "factoryName", 63); + } + if (factoryName.Length < 3) + { + throw new ValidationException(ValidationRules.MinLength, "factoryName", 3); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(factoryName, "^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$")) + { + throw new ValidationException(ValidationRules.Pattern, "factoryName", "^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$"); + } + } + if (triggerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "triggerName"); + } + if (triggerName != null) + { + if (triggerName.Length > 260) + { + throw new ValidationException(ValidationRules.MaxLength, "triggerName", 260); + } + if (triggerName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "triggerName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(triggerName, "^[A-Za-z0-9_][^<>*#.%&:\\\\+?/]*$")) + { + throw new ValidationException(ValidationRules.Pattern, "triggerName", "^[A-Za-z0-9_][^<>*#.%&:\\\\+?/]*$"); + } + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("factoryName", factoryName); + tracingParameters.Add("triggerName", triggerName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginSubscribeToEvents", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/triggers/{triggerName}/subscribeToEvents").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{factoryName}", System.Uri.EscapeDataString(factoryName)); + _url = _url.Replace("{triggerName}", System.Uri.EscapeDataString(triggerName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.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; + // 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 CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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; + } + + /// + /// Unsubscribe event trigger from events. + /// + /// + /// The resource group name. + /// + /// + /// The factory name. + /// + /// + /// The trigger name. + /// + /// + /// 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> BeginUnsubscribeFromEventsWithHttpMessagesAsync(string resourceGroupName, string factoryName, string triggerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (factoryName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "factoryName"); + } + if (factoryName != null) + { + if (factoryName.Length > 63) + { + throw new ValidationException(ValidationRules.MaxLength, "factoryName", 63); + } + if (factoryName.Length < 3) + { + throw new ValidationException(ValidationRules.MinLength, "factoryName", 3); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(factoryName, "^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$")) + { + throw new ValidationException(ValidationRules.Pattern, "factoryName", "^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$"); + } + } + if (triggerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "triggerName"); + } + if (triggerName != null) + { + if (triggerName.Length > 260) + { + throw new ValidationException(ValidationRules.MaxLength, "triggerName", 260); + } + if (triggerName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "triggerName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(triggerName, "^[A-Za-z0-9_][^<>*#.%&:\\\\+?/]*$")) + { + throw new ValidationException(ValidationRules.Pattern, "triggerName", "^[A-Za-z0-9_][^<>*#.%&:\\\\+?/]*$"); + } + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("factoryName", factoryName); + tracingParameters.Add("triggerName", triggerName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginUnsubscribeFromEvents", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/triggers/{triggerName}/unsubscribeFromEvents").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{factoryName}", System.Uri.EscapeDataString(factoryName)); + _url = _url.Replace("{triggerName}", System.Uri.EscapeDataString(triggerName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.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; + // 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 CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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; + } + /// /// Starts a trigger. /// diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/TriggersOperationsExtensions.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/TriggersOperationsExtensions.cs index b942984b5427..62ee3833a23c 100644 --- a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/TriggersOperationsExtensions.cs +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/TriggersOperationsExtensions.cs @@ -220,6 +220,144 @@ public static void Delete(this ITriggersOperations operations, string resourceGr (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, factoryName, triggerName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } + /// + /// Subscribe event trigger to events. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name. + /// + /// + /// The factory name. + /// + /// + /// The trigger name. + /// + public static TriggerSubscriptionOperationStatus SubscribeToEvents(this ITriggersOperations operations, string resourceGroupName, string factoryName, string triggerName) + { + return operations.SubscribeToEventsAsync(resourceGroupName, factoryName, triggerName).GetAwaiter().GetResult(); + } + + /// + /// Subscribe event trigger to events. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name. + /// + /// + /// The factory name. + /// + /// + /// The trigger name. + /// + /// + /// The cancellation token. + /// + public static async Task SubscribeToEventsAsync(this ITriggersOperations operations, string resourceGroupName, string factoryName, string triggerName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.SubscribeToEventsWithHttpMessagesAsync(resourceGroupName, factoryName, triggerName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Get a trigger's event subscription status. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name. + /// + /// + /// The factory name. + /// + /// + /// The trigger name. + /// + public static TriggerSubscriptionOperationStatus GetEventSubscriptionStatus(this ITriggersOperations operations, string resourceGroupName, string factoryName, string triggerName) + { + return operations.GetEventSubscriptionStatusAsync(resourceGroupName, factoryName, triggerName).GetAwaiter().GetResult(); + } + + /// + /// Get a trigger's event subscription status. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name. + /// + /// + /// The factory name. + /// + /// + /// The trigger name. + /// + /// + /// The cancellation token. + /// + public static async Task GetEventSubscriptionStatusAsync(this ITriggersOperations operations, string resourceGroupName, string factoryName, string triggerName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetEventSubscriptionStatusWithHttpMessagesAsync(resourceGroupName, factoryName, triggerName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Unsubscribe event trigger from events. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name. + /// + /// + /// The factory name. + /// + /// + /// The trigger name. + /// + public static TriggerSubscriptionOperationStatus UnsubscribeFromEvents(this ITriggersOperations operations, string resourceGroupName, string factoryName, string triggerName) + { + return operations.UnsubscribeFromEventsAsync(resourceGroupName, factoryName, triggerName).GetAwaiter().GetResult(); + } + + /// + /// Unsubscribe event trigger from events. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name. + /// + /// + /// The factory name. + /// + /// + /// The trigger name. + /// + /// + /// The cancellation token. + /// + public static async Task UnsubscribeFromEventsAsync(this ITriggersOperations operations, string resourceGroupName, string factoryName, string triggerName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.UnsubscribeFromEventsWithHttpMessagesAsync(resourceGroupName, factoryName, triggerName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Starts a trigger. /// @@ -306,6 +444,98 @@ public static void Stop(this ITriggersOperations operations, string resourceGrou (await operations.StopWithHttpMessagesAsync(resourceGroupName, factoryName, triggerName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } + /// + /// Subscribe event trigger to events. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name. + /// + /// + /// The factory name. + /// + /// + /// The trigger name. + /// + public static TriggerSubscriptionOperationStatus BeginSubscribeToEvents(this ITriggersOperations operations, string resourceGroupName, string factoryName, string triggerName) + { + return operations.BeginSubscribeToEventsAsync(resourceGroupName, factoryName, triggerName).GetAwaiter().GetResult(); + } + + /// + /// Subscribe event trigger to events. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name. + /// + /// + /// The factory name. + /// + /// + /// The trigger name. + /// + /// + /// The cancellation token. + /// + public static async Task BeginSubscribeToEventsAsync(this ITriggersOperations operations, string resourceGroupName, string factoryName, string triggerName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginSubscribeToEventsWithHttpMessagesAsync(resourceGroupName, factoryName, triggerName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Unsubscribe event trigger from events. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name. + /// + /// + /// The factory name. + /// + /// + /// The trigger name. + /// + public static TriggerSubscriptionOperationStatus BeginUnsubscribeFromEvents(this ITriggersOperations operations, string resourceGroupName, string factoryName, string triggerName) + { + return operations.BeginUnsubscribeFromEventsAsync(resourceGroupName, factoryName, triggerName).GetAwaiter().GetResult(); + } + + /// + /// Unsubscribe event trigger from events. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name. + /// + /// + /// The factory name. + /// + /// + /// The trigger name. + /// + /// + /// The cancellation token. + /// + public static async Task BeginUnsubscribeFromEventsAsync(this ITriggersOperations operations, string resourceGroupName, string factoryName, string triggerName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginUnsubscribeFromEventsWithHttpMessagesAsync(resourceGroupName, factoryName, triggerName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Starts a trigger. /// diff --git a/sdk/datamigration/Microsoft.Azure.Management.DataMigration/src/Generated/Models/CommandProperties.cs b/sdk/datamigration/Microsoft.Azure.Management.DataMigration/src/Generated/Models/CommandProperties.cs index 54ae9281bea1..90355f383357 100644 --- a/sdk/datamigration/Microsoft.Azure.Management.DataMigration/src/Generated/Models/CommandProperties.cs +++ b/sdk/datamigration/Microsoft.Azure.Management.DataMigration/src/Generated/Models/CommandProperties.cs @@ -19,7 +19,6 @@ namespace Microsoft.Azure.Management.DataMigration.Models /// Base class for all types of DMS command properties. If command is not /// supported by current client, this object is returned. /// - [Newtonsoft.Json.JsonObject("Unknown")] public partial class CommandProperties { /// diff --git a/sdk/datamigration/Microsoft.Azure.Management.DataMigration/src/Generated/Models/ConnectionInfo.cs b/sdk/datamigration/Microsoft.Azure.Management.DataMigration/src/Generated/Models/ConnectionInfo.cs index 581ac23dbf30..3bd51dd50c37 100644 --- a/sdk/datamigration/Microsoft.Azure.Management.DataMigration/src/Generated/Models/ConnectionInfo.cs +++ b/sdk/datamigration/Microsoft.Azure.Management.DataMigration/src/Generated/Models/ConnectionInfo.cs @@ -16,7 +16,6 @@ namespace Microsoft.Azure.Management.DataMigration.Models /// /// Defines the connection properties of a server /// - [Newtonsoft.Json.JsonObject("Unknown")] public partial class ConnectionInfo { /// diff --git a/sdk/datamigration/Microsoft.Azure.Management.DataMigration/src/Generated/Models/ProjectTaskProperties.cs b/sdk/datamigration/Microsoft.Azure.Management.DataMigration/src/Generated/Models/ProjectTaskProperties.cs index f8378be9a3ea..ba0a714d4aa5 100644 --- a/sdk/datamigration/Microsoft.Azure.Management.DataMigration/src/Generated/Models/ProjectTaskProperties.cs +++ b/sdk/datamigration/Microsoft.Azure.Management.DataMigration/src/Generated/Models/ProjectTaskProperties.cs @@ -19,7 +19,6 @@ namespace Microsoft.Azure.Management.DataMigration.Models /// Base class for all types of DMS task properties. If task is not /// supported by current client, this object is returned. /// - [Newtonsoft.Json.JsonObject("Unknown")] public partial class ProjectTaskProperties { /// diff --git a/sdk/datamigration/Microsoft.Azure.Management.DataMigration/src/Generated/SdkInfo_DataMigrationManagementClient.cs b/sdk/datamigration/Microsoft.Azure.Management.DataMigration/src/Generated/SdkInfo_DataMigrationManagementClient.cs index ba72d06751d1..137ba383fd2c 100644 --- a/sdk/datamigration/Microsoft.Azure.Management.DataMigration/src/Generated/SdkInfo_DataMigrationManagementClient.cs +++ b/sdk/datamigration/Microsoft.Azure.Management.DataMigration/src/Generated/SdkInfo_DataMigrationManagementClient.cs @@ -30,16 +30,5 @@ public static IEnumerable> ApiInfo_DataMigrationMa }.AsEnumerable(); } } - // BEGIN: Code Generation Metadata Section - public static readonly String AutoRestVersion = "latest"; - public static readonly String AutoRestBootStrapperVersion = "autorest@2.0.4283"; - public static readonly String AutoRestCmdExecuted = "cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/datamigration/resource-manager/readme.md --csharp --version=latest --reflect-api-versions --csharp-sdks-folder=C:\\Dev\\Git\\azure-sdk-for-net\\sdk"; - public static readonly String GithubForkName = "Azure"; - public static readonly String GithubBranchName = "master"; - public static readonly String GithubCommidId = "e9b03021559994e2988fd977d465685795c2f70d"; - public static readonly String CodeGenerationErrors = ""; - public static readonly String GithubRepoName = "azure-rest-api-specs"; - // END: Code Generation Metadata Section } } - diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/AzureMLCommitmentPlansManagementClient.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/AzureMLCommitmentPlansManagementClient.cs index 8443abc0cdc6..cc2a7be38301 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/AzureMLCommitmentPlansManagementClient.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/AzureMLCommitmentPlansManagementClient.cs @@ -1,17 +1,25 @@ +// // 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 0.17.0.0 +// +// 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.MachineLearning.CommitmentPlans { - using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; + using Microsoft.Rest.Serialization; using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; /// /// These APIs allow end users to operate on Azure Machine Learning @@ -21,7 +29,7 @@ namespace Microsoft.Azure.Management.MachineLearning.CommitmentPlans /// associations between commitment plans, and retrieving commitment plan /// usage history. /// - public partial class AzureMLCommitmentPlansManagementClient : Microsoft.Rest.ServiceClient, IAzureMLCommitmentPlansManagementClient, IAzureClient + public partial class AzureMLCommitmentPlansManagementClient : ServiceClient, IAzureMLCommitmentPlansManagementClient, IAzureClient { /// /// The base URI of the service. @@ -31,17 +39,17 @@ public partial class AzureMLCommitmentPlansManagementClient : Microsoft.Rest.Ser /// /// Gets or sets json serialization settings. /// - public Newtonsoft.Json.JsonSerializerSettings SerializationSettings { get; private set; } + public JsonSerializerSettings SerializationSettings { get; private set; } /// /// Gets or sets json deserialization settings. /// - public Newtonsoft.Json.JsonSerializerSettings DeserializationSettings { get; private set; } + public JsonSerializerSettings DeserializationSettings { get; private set; } /// /// Credentials needed for the client to connect to Azure. /// - public Microsoft.Rest.ServiceClientCredentials Credentials { get; private set; } + public ServiceClientCredentials Credentials { get; private set; } /// /// Azure Subscription ID. @@ -54,22 +62,33 @@ public partial class AzureMLCommitmentPlansManagementClient : Microsoft.Rest.Ser public string ApiVersion { get; private set; } /// - /// Gets or sets the preferred language for the response. + /// The preferred language for the response. /// public string AcceptLanguage { get; set; } /// - /// Gets or sets the retry timeout in seconds for Long Running Operations. - /// Default value is 30. + /// The retry timeout in seconds for Long Running Operations. Default value is + /// 30. /// public int? LongRunningOperationRetryTimeout { get; set; } /// - /// When set to true a unique x-ms-client-request-id value is generated and - /// included in each request. Default is true. + /// Whether a unique x-ms-client-request-id should be generated. When set to + /// true a unique x-ms-client-request-id value is generated and included in + /// each request. Default is true. /// public bool? GenerateClientRequestId { get; set; } + /// + /// Gets the IOperations. + /// + public virtual IOperations Operations { get; private set; } + + /// + /// Gets the ISkusOperations. + /// + public virtual ISkusOperations Skus { get; private set; } + /// /// Gets the ICommitmentAssociationsOperations. /// @@ -85,15 +104,28 @@ public partial class AzureMLCommitmentPlansManagementClient : Microsoft.Rest.Ser /// public virtual IUsageHistoryOperations UsageHistory { get; private set; } + /// + /// Initializes a new instance of the AzureMLCommitmentPlansManagementClient class. + /// + /// + /// HttpClient to be used + /// + /// + /// True: will dispose the provided httpClient on calling AzureMLCommitmentPlansManagementClient.Dispose(). False: will not dispose provided httpClient + protected AzureMLCommitmentPlansManagementClient(HttpClient httpClient, bool disposeHttpClient) : base(httpClient, disposeHttpClient) + { + Initialize(); + } + /// /// Initializes a new instance of the AzureMLCommitmentPlansManagementClient class. /// /// /// Optional. The delegating handlers to add to the http client pipeline. /// - protected AzureMLCommitmentPlansManagementClient(params System.Net.Http.DelegatingHandler[] handlers) : base(handlers) + protected AzureMLCommitmentPlansManagementClient(params DelegatingHandler[] handlers) : base(handlers) { - this.Initialize(); + Initialize(); } /// @@ -105,9 +137,9 @@ protected AzureMLCommitmentPlansManagementClient(params System.Net.Http.Delegati /// /// Optional. The delegating handlers to add to the http client pipeline. /// - protected AzureMLCommitmentPlansManagementClient(System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : base(rootHandler, handlers) + protected AzureMLCommitmentPlansManagementClient(HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : base(rootHandler, handlers) { - this.Initialize(); + Initialize(); } /// @@ -122,13 +154,13 @@ protected AzureMLCommitmentPlansManagementClient(System.Net.Http.HttpClientHandl /// /// Thrown when a required parameter is null /// - protected AzureMLCommitmentPlansManagementClient(System.Uri baseUri, params System.Net.Http.DelegatingHandler[] handlers) : this(handlers) + protected AzureMLCommitmentPlansManagementClient(System.Uri baseUri, params DelegatingHandler[] handlers) : this(handlers) { if (baseUri == null) { throw new System.ArgumentNullException("baseUri"); } - this.BaseUri = baseUri; + BaseUri = baseUri; } /// @@ -146,13 +178,13 @@ protected AzureMLCommitmentPlansManagementClient(System.Uri baseUri, params Syst /// /// Thrown when a required parameter is null /// - protected AzureMLCommitmentPlansManagementClient(System.Uri baseUri, System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : this(rootHandler, handlers) + protected AzureMLCommitmentPlansManagementClient(System.Uri baseUri, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) { if (baseUri == null) { throw new System.ArgumentNullException("baseUri"); } - this.BaseUri = baseUri; + BaseUri = baseUri; } /// @@ -167,16 +199,43 @@ protected AzureMLCommitmentPlansManagementClient(System.Uri baseUri, System.Net. /// /// Thrown when a required parameter is null /// - public AzureMLCommitmentPlansManagementClient(Microsoft.Rest.ServiceClientCredentials credentials, params System.Net.Http.DelegatingHandler[] handlers) : this(handlers) + public AzureMLCommitmentPlansManagementClient(ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers) { if (credentials == null) { throw new System.ArgumentNullException("credentials"); } - this.Credentials = credentials; - if (this.Credentials != null) + Credentials = credentials; + if (Credentials != null) { - this.Credentials.InitializeServiceClient(this); + Credentials.InitializeServiceClient(this); + } + } + + /// + /// Initializes a new instance of the AzureMLCommitmentPlansManagementClient class. + /// + /// + /// Required. Credentials needed for the client to connect to Azure. + /// + /// + /// HttpClient to be used + /// + /// + /// True: will dispose the provided httpClient on calling AzureMLCommitmentPlansManagementClient.Dispose(). False: will not dispose provided httpClient + /// + /// Thrown when a required parameter is null + /// + public AzureMLCommitmentPlansManagementClient(ServiceClientCredentials credentials, HttpClient httpClient, bool disposeHttpClient) : this(httpClient, disposeHttpClient) + { + if (credentials == null) + { + throw new System.ArgumentNullException("credentials"); + } + Credentials = credentials; + if (Credentials != null) + { + Credentials.InitializeServiceClient(this); } } @@ -195,16 +254,16 @@ public AzureMLCommitmentPlansManagementClient(Microsoft.Rest.ServiceClientCreden /// /// Thrown when a required parameter is null /// - public AzureMLCommitmentPlansManagementClient(Microsoft.Rest.ServiceClientCredentials credentials, System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : this(rootHandler, handlers) + public AzureMLCommitmentPlansManagementClient(ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) { if (credentials == null) { throw new System.ArgumentNullException("credentials"); } - this.Credentials = credentials; - if (this.Credentials != null) + Credentials = credentials; + if (Credentials != null) { - this.Credentials.InitializeServiceClient(this); + Credentials.InitializeServiceClient(this); } } @@ -223,7 +282,7 @@ public AzureMLCommitmentPlansManagementClient(Microsoft.Rest.ServiceClientCreden /// /// Thrown when a required parameter is null /// - public AzureMLCommitmentPlansManagementClient(System.Uri baseUri, Microsoft.Rest.ServiceClientCredentials credentials, params System.Net.Http.DelegatingHandler[] handlers) : this(handlers) + public AzureMLCommitmentPlansManagementClient(System.Uri baseUri, ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers) { if (baseUri == null) { @@ -233,11 +292,11 @@ public AzureMLCommitmentPlansManagementClient(System.Uri baseUri, Microsoft.Rest { throw new System.ArgumentNullException("credentials"); } - this.BaseUri = baseUri; - this.Credentials = credentials; - if (this.Credentials != null) + BaseUri = baseUri; + Credentials = credentials; + if (Credentials != null) { - this.Credentials.InitializeServiceClient(this); + Credentials.InitializeServiceClient(this); } } @@ -259,7 +318,7 @@ public AzureMLCommitmentPlansManagementClient(System.Uri baseUri, Microsoft.Rest /// /// Thrown when a required parameter is null /// - public AzureMLCommitmentPlansManagementClient(System.Uri baseUri, Microsoft.Rest.ServiceClientCredentials credentials, System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : this(rootHandler, handlers) + public AzureMLCommitmentPlansManagementClient(System.Uri baseUri, ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) { if (baseUri == null) { @@ -269,11 +328,11 @@ public AzureMLCommitmentPlansManagementClient(System.Uri baseUri, Microsoft.Rest { throw new System.ArgumentNullException("credentials"); } - this.BaseUri = baseUri; - this.Credentials = credentials; - if (this.Credentials != null) + BaseUri = baseUri; + Credentials = credentials; + if (Credentials != null) { - this.Credentials.InitializeServiceClient(this); + Credentials.InitializeServiceClient(this); } } @@ -286,41 +345,43 @@ public AzureMLCommitmentPlansManagementClient(System.Uri baseUri, Microsoft.Rest /// private void Initialize() { - this.CommitmentAssociations = new CommitmentAssociationsOperations(this); - this.CommitmentPlans = new CommitmentPlansOperations(this); - this.UsageHistory = new UsageHistoryOperations(this); - this.BaseUri = new System.Uri("https://management.azure.com"); - this.ApiVersion = "2016-05-01-preview"; - this.AcceptLanguage = "en-US"; - this.LongRunningOperationRetryTimeout = 30; - this.GenerateClientRequestId = true; - SerializationSettings = new Newtonsoft.Json.JsonSerializerSettings + Operations = new Operations(this); + Skus = new SkusOperations(this); + CommitmentAssociations = new CommitmentAssociationsOperations(this); + CommitmentPlans = new CommitmentPlansOperations(this); + UsageHistory = new UsageHistoryOperations(this); + BaseUri = new System.Uri("https://management.azure.com"); + ApiVersion = "2016-05-01-preview"; + AcceptLanguage = "en-US"; + LongRunningOperationRetryTimeout = 30; + GenerateClientRequestId = true; + SerializationSettings = new JsonSerializerSettings { Formatting = Newtonsoft.Json.Formatting.Indented, DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, - ContractResolver = new Microsoft.Rest.Serialization.ReadOnlyJsonContractResolver(), - Converters = new System.Collections.Generic.List + ContractResolver = new ReadOnlyJsonContractResolver(), + Converters = new List { - new Microsoft.Rest.Serialization.Iso8601TimeSpanConverter() + new Iso8601TimeSpanConverter() } }; - DeserializationSettings = new Newtonsoft.Json.JsonSerializerSettings + DeserializationSettings = new JsonSerializerSettings { DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, - ContractResolver = new Microsoft.Rest.Serialization.ReadOnlyJsonContractResolver(), - Converters = new System.Collections.Generic.List + ContractResolver = new ReadOnlyJsonContractResolver(), + Converters = new List { - new Microsoft.Rest.Serialization.Iso8601TimeSpanConverter() + new Iso8601TimeSpanConverter() } }; CustomInitialize(); - DeserializationSettings.Converters.Add(new Microsoft.Rest.Azure.CloudErrorJsonConverter()); - } + DeserializationSettings.Converters.Add(new CloudErrorJsonConverter()); + } } } diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/CommitmentAssociationsOperations.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/CommitmentAssociationsOperations.cs index d9d3b89dc083..744628259c4c 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/CommitmentAssociationsOperations.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/CommitmentAssociationsOperations.cs @@ -1,22 +1,31 @@ +// // 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 0.17.0.0 +// +// 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.MachineLearning.CommitmentPlans { - using System.Linq; 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; /// /// CommitmentAssociationsOperations operations. /// - internal partial class CommitmentAssociationsOperations : Microsoft.Rest.IServiceOperations, ICommitmentAssociationsOperations + internal partial class CommitmentAssociationsOperations : IServiceOperations, ICommitmentAssociationsOperations { /// /// Initializes a new instance of the CommitmentAssociationsOperations class. @@ -29,11 +38,11 @@ internal partial class CommitmentAssociationsOperations : Microsoft.Rest.IServic /// internal CommitmentAssociationsOperations(AzureMLCommitmentPlansManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - this.Client = client; + Client = client; } /// @@ -42,7 +51,7 @@ internal CommitmentAssociationsOperations(AzureMLCommitmentPlansManagementClient public AzureMLCommitmentPlansManagementClient Client { get; private set; } /// - /// Gets a commitment association. + /// Get a commitment association. /// /// /// The resource group name. @@ -59,87 +68,92 @@ internal CommitmentAssociationsOperations(AzureMLCommitmentPlansManagementClient /// /// 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 System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string commitmentPlanName, string commitmentAssociationName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string commitmentPlanName, string commitmentAssociationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (commitmentPlanName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "commitmentPlanName"); + throw new ValidationException(ValidationRules.CannotBeNull, "commitmentPlanName"); } if (commitmentAssociationName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "commitmentAssociationName"); + throw new ValidationException(ValidationRules.CannotBeNull, "commitmentAssociationName"); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("commitmentPlanName", commitmentPlanName); tracingParameters.Add("commitmentAssociationName", commitmentAssociationName); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearning/commitmentPlans/{commitmentPlanName}/commitmentAssociations/{commitmentAssociationName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{commitmentPlanName}", System.Uri.EscapeDataString(commitmentPlanName)); _url = _url.Replace("{commitmentAssociationName}", System.Uri.EscapeDataString(commitmentAssociationName)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } + + if (customHeaders != null) { foreach(var _header in customHeaders) @@ -155,51 +169,51 @@ internal CommitmentAssociationsOperations(AzureMLCommitmentPlansManagementClient // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (Newtonsoft.Json.JsonException) + catch (JsonException) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -209,7 +223,7 @@ internal CommitmentAssociationsOperations(AzureMLCommitmentPlansManagementClient throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -222,21 +236,21 @@ internal CommitmentAssociationsOperations(AzureMLCommitmentPlansManagementClient _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } - catch (Newtonsoft.Json.JsonException ex) + catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -259,86 +273,91 @@ internal CommitmentAssociationsOperations(AzureMLCommitmentPlansManagementClient /// /// 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 System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string commitmentPlanName, string skipToken = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string commitmentPlanName, string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (commitmentPlanName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "commitmentPlanName"); + throw new ValidationException(ValidationRules.CannotBeNull, "commitmentPlanName"); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("commitmentPlanName", commitmentPlanName); tracingParameters.Add("skipToken", skipToken); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearning/commitmentPlans/{commitmentPlanName}/commitmentAssociations").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{commitmentPlanName}", System.Uri.EscapeDataString(commitmentPlanName)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + List _queryParameters = new List(); if (skipToken != null) { _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken))); } - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } + + if (customHeaders != null) { foreach(var _header in customHeaders) @@ -354,51 +373,51 @@ internal CommitmentAssociationsOperations(AzureMLCommitmentPlansManagementClient // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (Newtonsoft.Json.JsonException) + catch (JsonException) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -408,7 +427,7 @@ internal CommitmentAssociationsOperations(AzureMLCommitmentPlansManagementClient throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -421,27 +440,27 @@ internal CommitmentAssociationsOperations(AzureMLCommitmentPlansManagementClient _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } - catch (Newtonsoft.Json.JsonException ex) + catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// Re-parents a commitment association from one commitment plan to another. + /// Re-parent a commitment association from one commitment plan to another. /// /// /// The resource group name. @@ -452,8 +471,9 @@ internal CommitmentAssociationsOperations(AzureMLCommitmentPlansManagementClient /// /// The commitment association name. /// - /// - /// The move request payload. + /// + /// The ARM ID of the commitment plan to re-parent the commitment association + /// to. /// /// /// Headers that will be added to request. @@ -461,92 +481,98 @@ internal CommitmentAssociationsOperations(AzureMLCommitmentPlansManagementClient /// /// 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 System.Threading.Tasks.Task> MoveWithHttpMessagesAsync(string resourceGroupName, string commitmentPlanName, string commitmentAssociationName, MoveCommitmentAssociationRequest movePayload, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> MoveWithHttpMessagesAsync(string resourceGroupName, string commitmentPlanName, string commitmentAssociationName, string destinationPlanId = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (commitmentPlanName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "commitmentPlanName"); + throw new ValidationException(ValidationRules.CannotBeNull, "commitmentPlanName"); } if (commitmentAssociationName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "commitmentAssociationName"); + throw new ValidationException(ValidationRules.CannotBeNull, "commitmentAssociationName"); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (movePayload == null) + MoveCommitmentAssociationRequest movePayload = new MoveCommitmentAssociationRequest(); + if (destinationPlanId != null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "movePayload"); + movePayload.DestinationPlanId = destinationPlanId; } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("commitmentPlanName", commitmentPlanName); tracingParameters.Add("commitmentAssociationName", commitmentAssociationName); tracingParameters.Add("movePayload", movePayload); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Move", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Move", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearning/commitmentPlans/{commitmentPlanName}/commitmentAssociations/{commitmentAssociationName}/move").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{commitmentPlanName}", System.Uri.EscapeDataString(commitmentPlanName)); _url = _url.Replace("{commitmentAssociationName}", System.Uri.EscapeDataString(commitmentAssociationName)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } + + if (customHeaders != null) { foreach(var _header in customHeaders) @@ -563,56 +589,56 @@ internal CommitmentAssociationsOperations(AzureMLCommitmentPlansManagementClient string _requestContent = null; if(movePayload != null) { - _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(movePayload, this.Client.SerializationSettings); - _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(movePayload, 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 (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (Newtonsoft.Json.JsonException) + catch (JsonException) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -622,7 +648,7 @@ internal CommitmentAssociationsOperations(AzureMLCommitmentPlansManagementClient throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -635,21 +661,21 @@ internal CommitmentAssociationsOperations(AzureMLCommitmentPlansManagementClient _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } - catch (Newtonsoft.Json.JsonException ex) + catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -666,61 +692,66 @@ internal CommitmentAssociationsOperations(AzureMLCommitmentPlansManagementClient /// /// 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 System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + List _queryParameters = new List(); if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } + + if (customHeaders != null) { foreach(var _header in customHeaders) @@ -736,51 +767,51 @@ internal CommitmentAssociationsOperations(AzureMLCommitmentPlansManagementClient // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (Newtonsoft.Json.JsonException) + catch (JsonException) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -790,7 +821,7 @@ internal CommitmentAssociationsOperations(AzureMLCommitmentPlansManagementClient throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -803,21 +834,21 @@ internal CommitmentAssociationsOperations(AzureMLCommitmentPlansManagementClient _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } - catch (Newtonsoft.Json.JsonException ex) + catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/CommitmentAssociationsOperationsExtensions.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/CommitmentAssociationsOperationsExtensions.cs index b179ecb7926f..4de4ae1a3247 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/CommitmentAssociationsOperationsExtensions.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/CommitmentAssociationsOperationsExtensions.cs @@ -1,16 +1,20 @@ +// // 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 0.17.0.0 +// +// 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.MachineLearning.CommitmentPlans { + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest.Azure; - using Models; /// /// Extension methods for CommitmentAssociationsOperations. @@ -18,7 +22,7 @@ namespace Microsoft.Azure.Management.MachineLearning.CommitmentPlans public static partial class CommitmentAssociationsOperationsExtensions { /// - /// Gets a commitment association. + /// Get a commitment association. /// /// /// The operations group for this extension method. @@ -34,11 +38,11 @@ public static partial class CommitmentAssociationsOperationsExtensions /// public static CommitmentAssociation Get(this ICommitmentAssociationsOperations operations, string resourceGroupName, string commitmentPlanName, string commitmentAssociationName) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((ICommitmentAssociationsOperations)s).GetAsync(resourceGroupName, commitmentPlanName, commitmentAssociationName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return operations.GetAsync(resourceGroupName, commitmentPlanName, commitmentAssociationName).GetAwaiter().GetResult(); } /// - /// Gets a commitment association. + /// Get a commitment association. /// /// /// The operations group for this extension method. @@ -55,7 +59,7 @@ public static CommitmentAssociation Get(this ICommitmentAssociationsOperations o /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task GetAsync(this ICommitmentAssociationsOperations operations, string resourceGroupName, string commitmentPlanName, string commitmentAssociationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task GetAsync(this ICommitmentAssociationsOperations operations, string resourceGroupName, string commitmentPlanName, string commitmentAssociationName, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, commitmentPlanName, commitmentAssociationName, null, cancellationToken).ConfigureAwait(false)) { @@ -78,9 +82,9 @@ public static CommitmentAssociation Get(this ICommitmentAssociationsOperations o /// /// Continuation token for pagination. /// - public static Microsoft.Rest.Azure.IPage List(this ICommitmentAssociationsOperations operations, string resourceGroupName, string commitmentPlanName, string skipToken = default(string)) + public static IPage List(this ICommitmentAssociationsOperations operations, string resourceGroupName, string commitmentPlanName, string skipToken = default(string)) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((ICommitmentAssociationsOperations)s).ListAsync(resourceGroupName, commitmentPlanName, skipToken), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return operations.ListAsync(resourceGroupName, commitmentPlanName, skipToken).GetAwaiter().GetResult(); } /// @@ -101,7 +105,7 @@ public static CommitmentAssociation Get(this ICommitmentAssociationsOperations o /// /// The cancellation token. /// - public static async Task> ListAsync(this ICommitmentAssociationsOperations operations, string resourceGroupName, string commitmentPlanName, string skipToken = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task> ListAsync(this ICommitmentAssociationsOperations operations, string resourceGroupName, string commitmentPlanName, string skipToken = default(string), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, commitmentPlanName, skipToken, null, cancellationToken).ConfigureAwait(false)) { @@ -110,7 +114,7 @@ public static CommitmentAssociation Get(this ICommitmentAssociationsOperations o } /// - /// Re-parents a commitment association from one commitment plan to another. + /// Re-parent a commitment association from one commitment plan to another. /// /// /// The operations group for this extension method. @@ -124,16 +128,17 @@ public static CommitmentAssociation Get(this ICommitmentAssociationsOperations o /// /// The commitment association name. /// - /// - /// The move request payload. + /// + /// The ARM ID of the commitment plan to re-parent the commitment association + /// to. /// - public static CommitmentAssociation Move(this ICommitmentAssociationsOperations operations, string resourceGroupName, string commitmentPlanName, string commitmentAssociationName, MoveCommitmentAssociationRequest movePayload) + public static CommitmentAssociation Move(this ICommitmentAssociationsOperations operations, string resourceGroupName, string commitmentPlanName, string commitmentAssociationName, string destinationPlanId = default(string)) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((ICommitmentAssociationsOperations)s).MoveAsync(resourceGroupName, commitmentPlanName, commitmentAssociationName, movePayload), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return operations.MoveAsync(resourceGroupName, commitmentPlanName, commitmentAssociationName, destinationPlanId).GetAwaiter().GetResult(); } /// - /// Re-parents a commitment association from one commitment plan to another. + /// Re-parent a commitment association from one commitment plan to another. /// /// /// The operations group for this extension method. @@ -147,15 +152,16 @@ public static CommitmentAssociation Move(this ICommitmentAssociationsOperations /// /// The commitment association name. /// - /// - /// The move request payload. + /// + /// The ARM ID of the commitment plan to re-parent the commitment association + /// to. /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task MoveAsync(this ICommitmentAssociationsOperations operations, string resourceGroupName, string commitmentPlanName, string commitmentAssociationName, MoveCommitmentAssociationRequest movePayload, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task MoveAsync(this ICommitmentAssociationsOperations operations, string resourceGroupName, string commitmentPlanName, string commitmentAssociationName, string destinationPlanId = default(string), CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.MoveWithHttpMessagesAsync(resourceGroupName, commitmentPlanName, commitmentAssociationName, movePayload, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.MoveWithHttpMessagesAsync(resourceGroupName, commitmentPlanName, commitmentAssociationName, destinationPlanId, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -170,9 +176,9 @@ public static CommitmentAssociation Move(this ICommitmentAssociationsOperations /// /// The NextLink from the previous successful call to List operation. /// - public static Microsoft.Rest.Azure.IPage ListNext(this ICommitmentAssociationsOperations operations, string nextPageLink) + public static IPage ListNext(this ICommitmentAssociationsOperations operations, string nextPageLink) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((ICommitmentAssociationsOperations)s).ListNextAsync(nextPageLink), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); } /// @@ -187,7 +193,7 @@ public static Microsoft.Rest.Azure.IPage ListNext(this IC /// /// The cancellation token. /// - public static async Task> ListNextAsync(this ICommitmentAssociationsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task> ListNextAsync(this ICommitmentAssociationsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/CommitmentPlansOperations.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/CommitmentPlansOperations.cs index 3a1fbcc7de82..0d72a8a4696e 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/CommitmentPlansOperations.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/CommitmentPlansOperations.cs @@ -1,22 +1,31 @@ +// // 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 0.17.0.0 +// +// 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.MachineLearning.CommitmentPlans { - using System.Linq; 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; /// /// CommitmentPlansOperations operations. /// - internal partial class CommitmentPlansOperations : Microsoft.Rest.IServiceOperations, ICommitmentPlansOperations + internal partial class CommitmentPlansOperations : IServiceOperations, ICommitmentPlansOperations { /// /// Initializes a new instance of the CommitmentPlansOperations class. @@ -29,11 +38,11 @@ internal partial class CommitmentPlansOperations : Microsoft.Rest.IServiceOperat /// internal CommitmentPlansOperations(AzureMLCommitmentPlansManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - this.Client = client; + Client = client; } /// @@ -57,81 +66,86 @@ internal CommitmentPlansOperations(AzureMLCommitmentPlansManagementClient client /// /// 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 System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string commitmentPlanName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string commitmentPlanName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (commitmentPlanName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "commitmentPlanName"); + throw new ValidationException(ValidationRules.CannotBeNull, "commitmentPlanName"); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("commitmentPlanName", commitmentPlanName); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearning/commitmentPlans/{commitmentPlanName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{commitmentPlanName}", System.Uri.EscapeDataString(commitmentPlanName)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } + + if (customHeaders != null) { foreach(var _header in customHeaders) @@ -147,51 +161,51 @@ internal CommitmentPlansOperations(AzureMLCommitmentPlansManagementClient client // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (Newtonsoft.Json.JsonException) + catch (JsonException) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -201,7 +215,7 @@ internal CommitmentPlansOperations(AzureMLCommitmentPlansManagementClient client throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -214,27 +228,27 @@ internal CommitmentPlansOperations(AzureMLCommitmentPlansManagementClient client _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } - catch (Newtonsoft.Json.JsonException ex) + catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// Creates a new Azure ML commitment plan resource or updates an existing one. + /// Create a new Azure ML commitment plan resource or updates an existing one. /// /// /// The payload to create or update the Azure ML commitment plan. @@ -251,90 +265,95 @@ internal CommitmentPlansOperations(AzureMLCommitmentPlansManagementClient client /// /// 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 System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(CommitmentPlan createOrUpdatePayload, string resourceGroupName, string commitmentPlanName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> CreateOrUpdateWithHttpMessagesAsync(CommitmentPlan createOrUpdatePayload, string resourceGroupName, string commitmentPlanName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (createOrUpdatePayload == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "createOrUpdatePayload"); + throw new ValidationException(ValidationRules.CannotBeNull, "createOrUpdatePayload"); } if (createOrUpdatePayload != null) { createOrUpdatePayload.Validate(); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (commitmentPlanName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "commitmentPlanName"); + throw new ValidationException(ValidationRules.CannotBeNull, "commitmentPlanName"); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("createOrUpdatePayload", createOrUpdatePayload); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("commitmentPlanName", commitmentPlanName); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearning/commitmentPlans/{commitmentPlanName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{commitmentPlanName}", System.Uri.EscapeDataString(commitmentPlanName)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } + + if (customHeaders != null) { foreach(var _header in customHeaders) @@ -351,56 +370,56 @@ internal CommitmentPlansOperations(AzureMLCommitmentPlansManagementClient client string _requestContent = null; if(createOrUpdatePayload != null) { - _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(createOrUpdatePayload, this.Client.SerializationSettings); - _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(createOrUpdatePayload, 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 (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (Newtonsoft.Json.JsonException) + catch (JsonException) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -410,7 +429,7 @@ internal CommitmentPlansOperations(AzureMLCommitmentPlansManagementClient client throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -423,16 +442,16 @@ internal CommitmentPlansOperations(AzureMLCommitmentPlansManagementClient client _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } - catch (Newtonsoft.Json.JsonException ex) + catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -441,21 +460,21 @@ internal CommitmentPlansOperations(AzureMLCommitmentPlansManagementClient client _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } - catch (Newtonsoft.Json.JsonException ex) + catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -475,78 +494,83 @@ internal CommitmentPlansOperations(AzureMLCommitmentPlansManagementClient client /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// + /// 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 System.Threading.Tasks.Task RemoveWithHttpMessagesAsync(string resourceGroupName, string commitmentPlanName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task RemoveWithHttpMessagesAsync(string resourceGroupName, string commitmentPlanName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (commitmentPlanName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "commitmentPlanName"); + throw new ValidationException(ValidationRules.CannotBeNull, "commitmentPlanName"); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("commitmentPlanName", commitmentPlanName); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Remove", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Remove", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearning/commitmentPlans/{commitmentPlanName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{commitmentPlanName}", System.Uri.EscapeDataString(commitmentPlanName)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } + + if (customHeaders != null) { foreach(var _header in customHeaders) @@ -562,43 +586,51 @@ internal CommitmentPlansOperations(AzureMLCommitmentPlansManagementClient client // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - if (_httpResponse.Content != null) { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } } - else { - _responseContent = string.Empty; + catch (JsonException) + { + // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -608,7 +640,7 @@ internal CommitmentPlansOperations(AzureMLCommitmentPlansManagementClient client throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -617,7 +649,7 @@ internal CommitmentPlansOperations(AzureMLCommitmentPlansManagementClient client } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -626,7 +658,7 @@ internal CommitmentPlansOperations(AzureMLCommitmentPlansManagementClient client /// Patch an existing Azure ML commitment plan resource. /// /// - /// The payload to patch the Azure ML commitment plan with. Only tags and SKU + /// The payload to use to patch the Azure ML commitment plan. Only tags and SKU /// may be modified on an existing commitment plan. /// /// @@ -641,86 +673,91 @@ internal CommitmentPlansOperations(AzureMLCommitmentPlansManagementClient client /// /// 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 System.Threading.Tasks.Task> PatchWithHttpMessagesAsync(CommitmentPlanPatchPayload patchPayload, string resourceGroupName, string commitmentPlanName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> PatchWithHttpMessagesAsync(CommitmentPlanPatchPayload patchPayload, string resourceGroupName, string commitmentPlanName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (patchPayload == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "patchPayload"); + throw new ValidationException(ValidationRules.CannotBeNull, "patchPayload"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (commitmentPlanName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "commitmentPlanName"); + throw new ValidationException(ValidationRules.CannotBeNull, "commitmentPlanName"); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("patchPayload", patchPayload); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("commitmentPlanName", commitmentPlanName); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Patch", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Patch", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearning/commitmentPlans/{commitmentPlanName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{commitmentPlanName}", System.Uri.EscapeDataString(commitmentPlanName)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } + + if (customHeaders != null) { foreach(var _header in customHeaders) @@ -737,56 +774,56 @@ internal CommitmentPlansOperations(AzureMLCommitmentPlansManagementClient client string _requestContent = null; if(patchPayload != null) { - _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(patchPayload, this.Client.SerializationSettings); - _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(patchPayload, 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 (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (Newtonsoft.Json.JsonException) + catch (JsonException) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -796,7 +833,7 @@ internal CommitmentPlansOperations(AzureMLCommitmentPlansManagementClient client throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -809,21 +846,21 @@ internal CommitmentPlansOperations(AzureMLCommitmentPlansManagementClient client _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } - catch (Newtonsoft.Json.JsonException ex) + catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -840,74 +877,79 @@ internal CommitmentPlansOperations(AzureMLCommitmentPlansManagementClient client /// /// 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 System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string skipToken = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task>> ListWithHttpMessagesAsync(string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("skipToken", skipToken); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.MachineLearning/commitmentPlans").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); if (skipToken != null) { _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken))); } - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } + + if (customHeaders != null) { foreach(var _header in customHeaders) @@ -923,51 +965,51 @@ internal CommitmentPlansOperations(AzureMLCommitmentPlansManagementClient client // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (Newtonsoft.Json.JsonException) + catch (JsonException) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -977,7 +1019,7 @@ internal CommitmentPlansOperations(AzureMLCommitmentPlansManagementClient client throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -990,21 +1032,21 @@ internal CommitmentPlansOperations(AzureMLCommitmentPlansManagementClient client _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } - catch (Newtonsoft.Json.JsonException ex) + catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -1024,80 +1066,85 @@ internal CommitmentPlansOperations(AzureMLCommitmentPlansManagementClient client /// /// 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 System.Threading.Tasks.Task>> ListInResourceGroupWithHttpMessagesAsync(string resourceGroupName, string skipToken = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task>> ListInResourceGroupWithHttpMessagesAsync(string resourceGroupName, string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("skipToken", skipToken); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListInResourceGroup", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListInResourceGroup", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearning/commitmentPlans").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + List _queryParameters = new List(); if (skipToken != null) { _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken))); } - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } + + if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1113,51 +1160,51 @@ internal CommitmentPlansOperations(AzureMLCommitmentPlansManagementClient client // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (Newtonsoft.Json.JsonException) + catch (JsonException) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1167,7 +1214,7 @@ internal CommitmentPlansOperations(AzureMLCommitmentPlansManagementClient client throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1180,21 +1227,21 @@ internal CommitmentPlansOperations(AzureMLCommitmentPlansManagementClient client _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } - catch (Newtonsoft.Json.JsonException ex) + catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -1211,61 +1258,66 @@ internal CommitmentPlansOperations(AzureMLCommitmentPlansManagementClient client /// /// 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 System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + List _queryParameters = new List(); if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } + + if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1281,51 +1333,51 @@ internal CommitmentPlansOperations(AzureMLCommitmentPlansManagementClient client // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (Newtonsoft.Json.JsonException) + catch (JsonException) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1335,7 +1387,7 @@ internal CommitmentPlansOperations(AzureMLCommitmentPlansManagementClient client throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1348,21 +1400,21 @@ internal CommitmentPlansOperations(AzureMLCommitmentPlansManagementClient client _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } - catch (Newtonsoft.Json.JsonException ex) + catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -1379,61 +1431,66 @@ internal CommitmentPlansOperations(AzureMLCommitmentPlansManagementClient client /// /// 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 System.Threading.Tasks.Task>> ListInResourceGroupNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task>> ListInResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListInResourceGroupNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListInResourceGroupNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + List _queryParameters = new List(); if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } + + if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1449,51 +1506,51 @@ internal CommitmentPlansOperations(AzureMLCommitmentPlansManagementClient client // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (Newtonsoft.Json.JsonException) + catch (JsonException) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1503,7 +1560,7 @@ internal CommitmentPlansOperations(AzureMLCommitmentPlansManagementClient client throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1516,21 +1573,21 @@ internal CommitmentPlansOperations(AzureMLCommitmentPlansManagementClient client _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } - catch (Newtonsoft.Json.JsonException ex) + catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/CommitmentPlansOperationsExtensions.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/CommitmentPlansOperationsExtensions.cs index 2b6416b5e276..efaa27437d72 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/CommitmentPlansOperationsExtensions.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/CommitmentPlansOperationsExtensions.cs @@ -1,16 +1,20 @@ +// // 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 0.17.0.0 +// +// 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.MachineLearning.CommitmentPlans { + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest.Azure; - using Models; /// /// Extension methods for CommitmentPlansOperations. @@ -32,7 +36,7 @@ public static partial class CommitmentPlansOperationsExtensions /// public static CommitmentPlan Get(this ICommitmentPlansOperations operations, string resourceGroupName, string commitmentPlanName) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((ICommitmentPlansOperations)s).GetAsync(resourceGroupName, commitmentPlanName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return operations.GetAsync(resourceGroupName, commitmentPlanName).GetAwaiter().GetResult(); } /// @@ -51,7 +55,7 @@ public static CommitmentPlan Get(this ICommitmentPlansOperations operations, str /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task GetAsync(this ICommitmentPlansOperations operations, string resourceGroupName, string commitmentPlanName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task GetAsync(this ICommitmentPlansOperations operations, string resourceGroupName, string commitmentPlanName, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, commitmentPlanName, null, cancellationToken).ConfigureAwait(false)) { @@ -60,7 +64,7 @@ public static CommitmentPlan Get(this ICommitmentPlansOperations operations, str } /// - /// Creates a new Azure ML commitment plan resource or updates an existing one. + /// Create a new Azure ML commitment plan resource or updates an existing one. /// /// /// The operations group for this extension method. @@ -76,11 +80,11 @@ public static CommitmentPlan Get(this ICommitmentPlansOperations operations, str /// public static CommitmentPlan CreateOrUpdate(this ICommitmentPlansOperations operations, CommitmentPlan createOrUpdatePayload, string resourceGroupName, string commitmentPlanName) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((ICommitmentPlansOperations)s).CreateOrUpdateAsync(createOrUpdatePayload, resourceGroupName, commitmentPlanName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return operations.CreateOrUpdateAsync(createOrUpdatePayload, resourceGroupName, commitmentPlanName).GetAwaiter().GetResult(); } /// - /// Creates a new Azure ML commitment plan resource or updates an existing one. + /// Create a new Azure ML commitment plan resource or updates an existing one. /// /// /// The operations group for this extension method. @@ -97,7 +101,7 @@ public static CommitmentPlan CreateOrUpdate(this ICommitmentPlansOperations oper /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this ICommitmentPlansOperations operations, CommitmentPlan createOrUpdatePayload, string resourceGroupName, string commitmentPlanName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task CreateOrUpdateAsync(this ICommitmentPlansOperations operations, CommitmentPlan createOrUpdatePayload, string resourceGroupName, string commitmentPlanName, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(createOrUpdatePayload, resourceGroupName, commitmentPlanName, null, cancellationToken).ConfigureAwait(false)) { @@ -119,7 +123,7 @@ public static CommitmentPlan CreateOrUpdate(this ICommitmentPlansOperations oper /// public static void Remove(this ICommitmentPlansOperations operations, string resourceGroupName, string commitmentPlanName) { - System.Threading.Tasks.Task.Factory.StartNew(s => ((ICommitmentPlansOperations)s).RemoveAsync(resourceGroupName, commitmentPlanName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + operations.RemoveAsync(resourceGroupName, commitmentPlanName).GetAwaiter().GetResult(); } /// @@ -137,9 +141,9 @@ public static void Remove(this ICommitmentPlansOperations operations, string res /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task RemoveAsync(this ICommitmentPlansOperations operations, string resourceGroupName, string commitmentPlanName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task RemoveAsync(this ICommitmentPlansOperations operations, string resourceGroupName, string commitmentPlanName, CancellationToken cancellationToken = default(CancellationToken)) { - await operations.RemoveWithHttpMessagesAsync(resourceGroupName, commitmentPlanName, null, cancellationToken).ConfigureAwait(false); + (await operations.RemoveWithHttpMessagesAsync(resourceGroupName, commitmentPlanName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// @@ -149,7 +153,7 @@ public static void Remove(this ICommitmentPlansOperations operations, string res /// The operations group for this extension method. /// /// - /// The payload to patch the Azure ML commitment plan with. Only tags and SKU + /// The payload to use to patch the Azure ML commitment plan. Only tags and SKU /// may be modified on an existing commitment plan. /// /// @@ -160,7 +164,7 @@ public static void Remove(this ICommitmentPlansOperations operations, string res /// public static CommitmentPlan Patch(this ICommitmentPlansOperations operations, CommitmentPlanPatchPayload patchPayload, string resourceGroupName, string commitmentPlanName) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((ICommitmentPlansOperations)s).PatchAsync(patchPayload, resourceGroupName, commitmentPlanName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return operations.PatchAsync(patchPayload, resourceGroupName, commitmentPlanName).GetAwaiter().GetResult(); } /// @@ -170,7 +174,7 @@ public static CommitmentPlan Patch(this ICommitmentPlansOperations operations, C /// The operations group for this extension method. /// /// - /// The payload to patch the Azure ML commitment plan with. Only tags and SKU + /// The payload to use to patch the Azure ML commitment plan. Only tags and SKU /// may be modified on an existing commitment plan. /// /// @@ -182,7 +186,7 @@ public static CommitmentPlan Patch(this ICommitmentPlansOperations operations, C /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task PatchAsync(this ICommitmentPlansOperations operations, CommitmentPlanPatchPayload patchPayload, string resourceGroupName, string commitmentPlanName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task PatchAsync(this ICommitmentPlansOperations operations, CommitmentPlanPatchPayload patchPayload, string resourceGroupName, string commitmentPlanName, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.PatchWithHttpMessagesAsync(patchPayload, resourceGroupName, commitmentPlanName, null, cancellationToken).ConfigureAwait(false)) { @@ -199,9 +203,9 @@ public static CommitmentPlan Patch(this ICommitmentPlansOperations operations, C /// /// Continuation token for pagination. /// - public static Microsoft.Rest.Azure.IPage List(this ICommitmentPlansOperations operations, string skipToken = default(string)) + public static IPage List(this ICommitmentPlansOperations operations, string skipToken = default(string)) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((ICommitmentPlansOperations)s).ListAsync(skipToken), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return operations.ListAsync(skipToken).GetAwaiter().GetResult(); } /// @@ -216,7 +220,7 @@ public static CommitmentPlan Patch(this ICommitmentPlansOperations operations, C /// /// The cancellation token. /// - public static async Task> ListAsync(this ICommitmentPlansOperations operations, string skipToken = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task> ListAsync(this ICommitmentPlansOperations operations, string skipToken = default(string), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListWithHttpMessagesAsync(skipToken, null, cancellationToken).ConfigureAwait(false)) { @@ -236,9 +240,9 @@ public static CommitmentPlan Patch(this ICommitmentPlansOperations operations, C /// /// Continuation token for pagination. /// - public static Microsoft.Rest.Azure.IPage ListInResourceGroup(this ICommitmentPlansOperations operations, string resourceGroupName, string skipToken = default(string)) + public static IPage ListInResourceGroup(this ICommitmentPlansOperations operations, string resourceGroupName, string skipToken = default(string)) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((ICommitmentPlansOperations)s).ListInResourceGroupAsync(resourceGroupName, skipToken), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return operations.ListInResourceGroupAsync(resourceGroupName, skipToken).GetAwaiter().GetResult(); } /// @@ -256,7 +260,7 @@ public static CommitmentPlan Patch(this ICommitmentPlansOperations operations, C /// /// The cancellation token. /// - public static async Task> ListInResourceGroupAsync(this ICommitmentPlansOperations operations, string resourceGroupName, string skipToken = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task> ListInResourceGroupAsync(this ICommitmentPlansOperations operations, string resourceGroupName, string skipToken = default(string), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListInResourceGroupWithHttpMessagesAsync(resourceGroupName, skipToken, null, cancellationToken).ConfigureAwait(false)) { @@ -273,9 +277,9 @@ public static CommitmentPlan Patch(this ICommitmentPlansOperations operations, C /// /// The NextLink from the previous successful call to List operation. /// - public static Microsoft.Rest.Azure.IPage ListNext(this ICommitmentPlansOperations operations, string nextPageLink) + public static IPage ListNext(this ICommitmentPlansOperations operations, string nextPageLink) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((ICommitmentPlansOperations)s).ListNextAsync(nextPageLink), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); } /// @@ -290,7 +294,7 @@ public static Microsoft.Rest.Azure.IPage ListNext(this ICommitme /// /// The cancellation token. /// - public static async Task> ListNextAsync(this ICommitmentPlansOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task> ListNextAsync(this ICommitmentPlansOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { @@ -307,9 +311,9 @@ public static Microsoft.Rest.Azure.IPage ListNext(this ICommitme /// /// The NextLink from the previous successful call to List operation. /// - public static Microsoft.Rest.Azure.IPage ListInResourceGroupNext(this ICommitmentPlansOperations operations, string nextPageLink) + public static IPage ListInResourceGroupNext(this ICommitmentPlansOperations operations, string nextPageLink) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((ICommitmentPlansOperations)s).ListInResourceGroupNextAsync(nextPageLink), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return operations.ListInResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); } /// @@ -324,7 +328,7 @@ public static Microsoft.Rest.Azure.IPage ListInResourceGroupNext /// /// The cancellation token. /// - public static async Task> ListInResourceGroupNextAsync(this ICommitmentPlansOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task> ListInResourceGroupNextAsync(this ICommitmentPlansOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListInResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/IAzureMLCommitmentPlansManagementClient.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/IAzureMLCommitmentPlansManagementClient.cs index aadd13efaa2e..72a5b494e1bd 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/IAzureMLCommitmentPlansManagementClient.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/IAzureMLCommitmentPlansManagementClient.cs @@ -1,16 +1,19 @@ +// // 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 0.17.0.0 +// +// 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.MachineLearning.CommitmentPlans { using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; + using Newtonsoft.Json; /// /// These APIs allow end users to operate on Azure Machine Learning @@ -30,17 +33,17 @@ public partial interface IAzureMLCommitmentPlansManagementClient : System.IDispo /// /// Gets or sets json serialization settings. /// - Newtonsoft.Json.JsonSerializerSettings SerializationSettings { get; } + JsonSerializerSettings SerializationSettings { get; } /// /// Gets or sets json deserialization settings. /// - Newtonsoft.Json.JsonSerializerSettings DeserializationSettings { get; } + JsonSerializerSettings DeserializationSettings { get; } /// /// Credentials needed for the client to connect to Azure. /// - Microsoft.Rest.ServiceClientCredentials Credentials { get; } + ServiceClientCredentials Credentials { get; } /// /// Azure Subscription ID. @@ -54,23 +57,34 @@ public partial interface IAzureMLCommitmentPlansManagementClient : System.IDispo string ApiVersion { get; } /// - /// Gets or sets the preferred language for the response. + /// The preferred language for the response. /// string AcceptLanguage { get; set; } /// - /// Gets or sets the retry timeout in seconds for Long Running - /// Operations. Default value is 30. + /// The retry timeout in seconds for Long Running Operations. Default + /// value is 30. /// int? LongRunningOperationRetryTimeout { get; set; } /// - /// When set to true a unique x-ms-client-request-id value is - /// generated and included in each request. Default is true. + /// Whether a unique x-ms-client-request-id should be generated. When + /// set to true a unique x-ms-client-request-id value is generated and + /// included in each request. Default is true. /// bool? GenerateClientRequestId { get; set; } + /// + /// Gets the IOperations. + /// + IOperations Operations { get; } + + /// + /// Gets the ISkusOperations. + /// + ISkusOperations Skus { get; } + /// /// Gets the ICommitmentAssociationsOperations. /// diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/ICommitmentAssociationsOperations.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/ICommitmentAssociationsOperations.cs index e0adc9674072..c63328bccda6 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/ICommitmentAssociationsOperations.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/ICommitmentAssociationsOperations.cs @@ -1,15 +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 0.17.0.0 +// +// 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.MachineLearning.CommitmentPlans { + using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; /// /// CommitmentAssociationsOperations operations. @@ -17,7 +24,7 @@ namespace Microsoft.Azure.Management.MachineLearning.CommitmentPlans public partial interface ICommitmentAssociationsOperations { /// - /// Gets a commitment association. + /// Get a commitment association. /// /// /// The resource group name. @@ -43,7 +50,7 @@ public partial interface ICommitmentAssociationsOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string commitmentPlanName, string commitmentAssociationName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> GetWithHttpMessagesAsync(string resourceGroupName, string commitmentPlanName, string commitmentAssociationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Get all commitment associations for a parent commitment plan. /// @@ -71,9 +78,9 @@ public partial interface ICommitmentAssociationsOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string commitmentPlanName, string skipToken = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task>> ListWithHttpMessagesAsync(string resourceGroupName, string commitmentPlanName, string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Re-parents a commitment association from one commitment plan to + /// Re-parent a commitment association from one commitment plan to /// another. /// /// @@ -85,8 +92,9 @@ public partial interface ICommitmentAssociationsOperations /// /// The commitment association name. /// - /// - /// The move request payload. + /// + /// The ARM ID of the commitment plan to re-parent the commitment + /// association to. /// /// /// The headers that will be added to request. @@ -103,7 +111,7 @@ public partial interface ICommitmentAssociationsOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> MoveWithHttpMessagesAsync(string resourceGroupName, string commitmentPlanName, string commitmentAssociationName, MoveCommitmentAssociationRequest movePayload, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> MoveWithHttpMessagesAsync(string resourceGroupName, string commitmentPlanName, string commitmentAssociationName, string destinationPlanId = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Get all commitment associations for a parent commitment plan. /// @@ -125,6 +133,6 @@ public partial interface ICommitmentAssociationsOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/ICommitmentPlansOperations.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/ICommitmentPlansOperations.cs index 94ec75d951cf..846202f2fd55 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/ICommitmentPlansOperations.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/ICommitmentPlansOperations.cs @@ -1,15 +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 0.17.0.0 +// +// 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.MachineLearning.CommitmentPlans { + using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; /// /// CommitmentPlansOperations operations. @@ -41,9 +48,9 @@ public partial interface ICommitmentPlansOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string commitmentPlanName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> GetWithHttpMessagesAsync(string resourceGroupName, string commitmentPlanName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Creates a new Azure ML commitment plan resource or updates an + /// Create a new Azure ML commitment plan resource or updates an /// existing one. /// /// @@ -70,7 +77,7 @@ public partial interface ICommitmentPlansOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(CommitmentPlan createOrUpdatePayload, string resourceGroupName, string commitmentPlanName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> CreateOrUpdateWithHttpMessagesAsync(CommitmentPlan createOrUpdatePayload, string resourceGroupName, string commitmentPlanName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Remove an existing Azure ML commitment plan. /// @@ -92,12 +99,12 @@ public partial interface ICommitmentPlansOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task RemoveWithHttpMessagesAsync(string resourceGroupName, string commitmentPlanName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task RemoveWithHttpMessagesAsync(string resourceGroupName, string commitmentPlanName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Patch an existing Azure ML commitment plan resource. /// /// - /// The payload to patch the Azure ML commitment plan with. Only tags + /// The payload to use to patch the Azure ML commitment plan. Only tags /// and SKU may be modified on an existing commitment plan. /// /// @@ -121,7 +128,7 @@ public partial interface ICommitmentPlansOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> PatchWithHttpMessagesAsync(CommitmentPlanPatchPayload patchPayload, string resourceGroupName, string commitmentPlanName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> PatchWithHttpMessagesAsync(CommitmentPlanPatchPayload patchPayload, string resourceGroupName, string commitmentPlanName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Retrieve all Azure ML commitment plans in a subscription. /// @@ -143,7 +150,7 @@ public partial interface ICommitmentPlansOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string skipToken = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task>> ListWithHttpMessagesAsync(string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Retrieve all Azure ML commitment plans in a resource group. /// @@ -168,7 +175,7 @@ public partial interface ICommitmentPlansOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task>> ListInResourceGroupWithHttpMessagesAsync(string resourceGroupName, string skipToken = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task>> ListInResourceGroupWithHttpMessagesAsync(string resourceGroupName, string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Retrieve all Azure ML commitment plans in a subscription. /// @@ -190,7 +197,7 @@ public partial interface ICommitmentPlansOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Retrieve all Azure ML commitment plans in a resource group. /// @@ -212,6 +219,6 @@ public partial interface ICommitmentPlansOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task>> ListInResourceGroupNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task>> ListInResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/IOperations.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/IOperations.cs new file mode 100644 index 000000000000..9f0a68a88fca --- /dev/null +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/IOperations.cs @@ -0,0 +1,47 @@ +// +// 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.MachineLearning.CommitmentPlans +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Operations operations. + /// + public partial interface IOperations + { + /// + /// Lists all of the available Azure Machine Learning Studio Commitment + /// Plan RP REST API operations. + /// + /// + /// 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>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/ISkusOperations.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/ISkusOperations.cs new file mode 100644 index 000000000000..9028d6af4a85 --- /dev/null +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/ISkusOperations.cs @@ -0,0 +1,46 @@ +// +// 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.MachineLearning.CommitmentPlans +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// SkusOperations operations. + /// + public partial interface ISkusOperations + { + /// + /// Lists the available commitment plan SKUs. + /// + /// + /// 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>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/IUsageHistoryOperations.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/IUsageHistoryOperations.cs index 4a82b5add85e..3ffd0ccec626 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/IUsageHistoryOperations.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/IUsageHistoryOperations.cs @@ -1,15 +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 0.17.0.0 +// +// 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.MachineLearning.CommitmentPlans { + using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; /// /// UsageHistoryOperations operations. @@ -17,7 +24,7 @@ namespace Microsoft.Azure.Management.MachineLearning.CommitmentPlans public partial interface IUsageHistoryOperations { /// - /// Retrieves the usage history for an Azure ML commitment plan. + /// Retrieve the usage history for an Azure ML commitment plan. /// /// /// The resource group name. @@ -43,9 +50,9 @@ public partial interface IUsageHistoryOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string commitmentPlanName, string skipToken = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task>> ListWithHttpMessagesAsync(string resourceGroupName, string commitmentPlanName, string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Retrieves the usage history for an Azure ML commitment plan. + /// Retrieve the usage history for an Azure ML commitment plan. /// /// /// The NextLink from the previous successful call to List operation. @@ -65,6 +72,6 @@ public partial interface IUsageHistoryOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/CatalogSku.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/CatalogSku.cs new file mode 100644 index 000000000000..e9a850bc9259 --- /dev/null +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/CatalogSku.cs @@ -0,0 +1,114 @@ +// +// 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.MachineLearning.CommitmentPlans.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Details of a commitment plan SKU. + /// + public partial class CatalogSku + { + /// + /// Initializes a new instance of the CatalogSku class. + /// + public CatalogSku() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the CatalogSku class. + /// + /// Resource type name + /// SKU name + /// SKU tier + /// Regions where the SKU is available. + /// SKU scaling information + /// The capability information for the + /// specified SKU. + /// The cost information for the specified + /// SKU. + /// Restrictions which would prevent a SKU + /// from being used. This is empty if there are no + /// restrictions. + public CatalogSku(string resourceType = default(string), string name = default(string), string tier = default(string), IList locations = default(IList), SkuCapacity capacity = default(SkuCapacity), IList capabilities = default(IList), IList costs = default(IList), IList restrictions = default(IList)) + { + ResourceType = resourceType; + Name = name; + Tier = tier; + Locations = locations; + Capacity = capacity; + Capabilities = capabilities; + Costs = costs; + Restrictions = restrictions; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets resource type name + /// + [JsonProperty(PropertyName = "resourceType")] + public string ResourceType { get; private set; } + + /// + /// Gets SKU name + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets SKU tier + /// + [JsonProperty(PropertyName = "tier")] + public string Tier { get; private set; } + + /// + /// Gets regions where the SKU is available. + /// + [JsonProperty(PropertyName = "locations")] + public IList Locations { get; private set; } + + /// + /// Gets SKU scaling information + /// + [JsonProperty(PropertyName = "capacity")] + public SkuCapacity Capacity { get; private set; } + + /// + /// Gets the capability information for the specified SKU. + /// + [JsonProperty(PropertyName = "capabilities")] + public IList Capabilities { get; private set; } + + /// + /// Gets the cost information for the specified SKU. + /// + [JsonProperty(PropertyName = "costs")] + public IList Costs { get; private set; } + + /// + /// Gets restrictions which would prevent a SKU from being used. This + /// is empty if there are no restrictions. + /// + [JsonProperty(PropertyName = "restrictions")] + public IList Restrictions { get; private set; } + + } +} diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/CommitmentAssociation.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/CommitmentAssociation.cs index 2a3c767d54bc..a792c135e404 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/CommitmentAssociation.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/CommitmentAssociation.cs @@ -1,13 +1,18 @@ +// // 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 0.17.0.0 +// +// 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.MachineLearning.CommitmentPlans.Models { + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// @@ -19,7 +24,10 @@ public partial class CommitmentAssociation : Resource /// /// Initializes a new instance of the CommitmentAssociation class. /// - public CommitmentAssociation() { } + public CommitmentAssociation() + { + CustomInit(); + } /// /// Initializes a new instance of the CommitmentAssociation class. @@ -33,29 +41,35 @@ public CommitmentAssociation() { } /// concurrency. /// The properties of the commitment /// association resource. - public CommitmentAssociation(string location, string id = default(string), string name = default(string), string type = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string etag = default(string), CommitmentAssociationProperties properties = default(CommitmentAssociationProperties)) + public CommitmentAssociation(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string etag = default(string), CommitmentAssociationProperties properties = default(CommitmentAssociationProperties)) : base(location, id, name, type, tags) { Etag = etag; Properties = properties; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets an entity tag used to enforce optimistic concurrency. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + [JsonProperty(PropertyName = "etag")] public string Etag { get; set; } /// /// Gets or sets the properties of the commitment association resource. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties")] + [JsonProperty(PropertyName = "properties")] public CommitmentAssociationProperties Properties { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public override void Validate() diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/CommitmentAssociationProperties.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/CommitmentAssociationProperties.cs index 4dbf6adf5501..8bb23bcc5ebe 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/CommitmentAssociationProperties.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/CommitmentAssociationProperties.cs @@ -1,13 +1,16 @@ +// // 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 0.17.0.0 +// +// 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.MachineLearning.CommitmentPlans.Models { + using Newtonsoft.Json; using System.Linq; /// @@ -19,7 +22,10 @@ public partial class CommitmentAssociationProperties /// Initializes a new instance of the CommitmentAssociationProperties /// class. /// - public CommitmentAssociationProperties() { } + public CommitmentAssociationProperties() + { + CustomInit(); + } /// /// Initializes a new instance of the CommitmentAssociationProperties @@ -37,26 +43,32 @@ public CommitmentAssociationProperties() { } AssociatedResourceId = associatedResourceId; CommitmentPlanId = commitmentPlanId; CreationDate = creationDate; + CustomInit(); } /// - /// Gets the ID of the resource this association points to, such as - /// the ARM ID of an Azure ML web service. + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the ID of the resource this association points to, such as the + /// ARM ID of an Azure ML web service. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "associatedResourceId")] + [JsonProperty(PropertyName = "associatedResourceId")] public string AssociatedResourceId { get; private set; } /// /// Gets the ARM ID of the parent Azure ML commitment plan. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "commitmentPlanId")] + [JsonProperty(PropertyName = "commitmentPlanId")] public string CommitmentPlanId { get; private set; } /// /// Gets the date at which this commitment association was created, in /// ISO 8601 format. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "creationDate")] + [JsonProperty(PropertyName = "creationDate")] public System.DateTime? CreationDate { get; private set; } } diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/CommitmentPlan.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/CommitmentPlan.cs index fd4f4c618ae4..83b3bb34c5a1 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/CommitmentPlan.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/CommitmentPlan.cs @@ -1,13 +1,18 @@ +// // 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 0.17.0.0 +// +// 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.MachineLearning.CommitmentPlans.Models { + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// @@ -18,7 +23,10 @@ public partial class CommitmentPlan : Resource /// /// Initializes a new instance of the CommitmentPlan class. /// - public CommitmentPlan() { } + public CommitmentPlan() + { + CustomInit(); + } /// /// Initializes a new instance of the CommitmentPlan class. @@ -32,36 +40,42 @@ public CommitmentPlan() { } /// concurrency. /// The commitment plan properties. /// The commitment plan SKU. - public CommitmentPlan(string location, string id = default(string), string name = default(string), string type = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string etag = default(string), CommitmentPlanProperties properties = default(CommitmentPlanProperties), ResourceSku sku = default(ResourceSku)) + public CommitmentPlan(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string etag = default(string), CommitmentPlanProperties properties = default(CommitmentPlanProperties), ResourceSku sku = default(ResourceSku)) : base(location, id, name, type, tags) { Etag = etag; Properties = properties; Sku = sku; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets an entity tag used to enforce optimistic concurrency. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + [JsonProperty(PropertyName = "etag")] public string Etag { get; set; } /// /// Gets the commitment plan properties. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties")] + [JsonProperty(PropertyName = "properties")] public CommitmentPlanProperties Properties { get; private set; } /// /// Gets or sets the commitment plan SKU. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "sku")] + [JsonProperty(PropertyName = "sku")] public ResourceSku Sku { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public override void Validate() diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/CommitmentPlanPatchPayload.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/CommitmentPlanPatchPayload.cs index aa229333b127..6f28a8357c84 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/CommitmentPlanPatchPayload.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/CommitmentPlanPatchPayload.cs @@ -1,13 +1,18 @@ +// // 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 0.17.0.0 +// +// 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.MachineLearning.CommitmentPlans.Models { + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// @@ -18,7 +23,10 @@ public partial class CommitmentPlanPatchPayload /// /// Initializes a new instance of the CommitmentPlanPatchPayload class. /// - public CommitmentPlanPatchPayload() { } + public CommitmentPlanPatchPayload() + { + CustomInit(); + } /// /// Initializes a new instance of the CommitmentPlanPatchPayload class. @@ -26,22 +34,28 @@ public CommitmentPlanPatchPayload() { } /// User-defined tags for the commitment /// plan. /// The commitment plan SKU. - public CommitmentPlanPatchPayload(System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), ResourceSku sku = default(ResourceSku)) + public CommitmentPlanPatchPayload(IDictionary tags = default(IDictionary), ResourceSku sku = default(ResourceSku)) { Tags = tags; Sku = sku; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets user-defined tags for the commitment plan. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] - public System.Collections.Generic.IDictionary Tags { get; set; } + [JsonProperty(PropertyName = "tags")] + public IDictionary Tags { get; set; } /// /// Gets or sets the commitment plan SKU. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "sku")] + [JsonProperty(PropertyName = "sku")] public ResourceSku Sku { get; set; } } diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/CommitmentPlanProperties.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/CommitmentPlanProperties.cs index d4c173ec1a39..ae9ce844ab4e 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/CommitmentPlanProperties.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/CommitmentPlanProperties.cs @@ -1,13 +1,18 @@ +// // 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 0.17.0.0 +// +// 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.MachineLearning.CommitmentPlans.Models { + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// @@ -18,7 +23,10 @@ public partial class CommitmentPlanProperties /// /// Initializes a new instance of the CommitmentPlanProperties class. /// - public CommitmentPlanProperties() { } + public CommitmentPlanProperties() + { + CustomInit(); + } /// /// Initializes a new instance of the CommitmentPlanProperties class. @@ -42,10 +50,9 @@ public CommitmentPlanProperties() { } /// The frequency at which this /// commitment plan's included quantities are refilled. /// Indicates whether this - /// commitment plan will be moved into a suspended state if usage - /// beyond the commitment plan's included quantities is - /// incurred. - public CommitmentPlanProperties(bool? chargeForOverage = default(bool?), bool? chargeForPlan = default(bool?), System.DateTime? creationDate = default(System.DateTime?), System.Collections.Generic.IDictionary includedQuantities = default(System.Collections.Generic.IDictionary), int? maxAssociationLimit = default(int?), int? maxCapacityLimit = default(int?), int? minCapacityLimit = default(int?), string planMeter = default(string), int? refillFrequencyInDays = default(int?), bool? suspendPlanOnOverage = default(bool?)) + /// commitment plan will be moved into a suspended state if usage goes + /// beyond the commitment plan's included quantities. + public CommitmentPlanProperties(bool? chargeForOverage = default(bool?), bool? chargeForPlan = default(bool?), System.DateTime? creationDate = default(System.DateTime?), IDictionary includedQuantities = default(IDictionary), int? maxAssociationLimit = default(int?), int? maxCapacityLimit = default(int?), int? minCapacityLimit = default(int?), string planMeter = default(string), int? refillFrequencyInDays = default(int?), bool? suspendPlanOnOverage = default(bool?)) { ChargeForOverage = chargeForOverage; ChargeForPlan = chargeForPlan; @@ -57,73 +64,79 @@ public CommitmentPlanProperties() { } PlanMeter = planMeter; RefillFrequencyInDays = refillFrequencyInDays; SuspendPlanOnOverage = suspendPlanOnOverage; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets indicates whether usage beyond the commitment plan's included /// quantities will be charged. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "chargeForOverage")] + [JsonProperty(PropertyName = "chargeForOverage")] public bool? ChargeForOverage { get; private set; } /// /// Gets indicates whether the commitment plan will incur a charge. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "chargeForPlan")] + [JsonProperty(PropertyName = "chargeForPlan")] public bool? ChargeForPlan { get; private set; } /// /// Gets the date at which this commitment plan was created, in ISO /// 8601 format. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "creationDate")] + [JsonProperty(PropertyName = "creationDate")] public System.DateTime? CreationDate { get; private set; } /// /// Gets the included resource quantities this plan gives you. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "includedQuantities")] - public System.Collections.Generic.IDictionary IncludedQuantities { get; private set; } + [JsonProperty(PropertyName = "includedQuantities")] + public IDictionary IncludedQuantities { get; private set; } /// /// Gets the maximum number of commitment associations that can be /// children of this commitment plan. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "maxAssociationLimit")] + [JsonProperty(PropertyName = "maxAssociationLimit")] public int? MaxAssociationLimit { get; private set; } /// /// Gets the maximum scale-out capacity for this commitment plan. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "maxCapacityLimit")] + [JsonProperty(PropertyName = "maxCapacityLimit")] public int? MaxCapacityLimit { get; private set; } /// /// Gets the minimum scale-out capacity for this commitment plan. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "minCapacityLimit")] + [JsonProperty(PropertyName = "minCapacityLimit")] public int? MinCapacityLimit { get; private set; } /// /// Gets the Azure meter which will be used to charge for this /// commitment plan. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "planMeter")] + [JsonProperty(PropertyName = "planMeter")] public string PlanMeter { get; private set; } /// /// Gets the frequency at which this commitment plan's included /// quantities are refilled. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "refillFrequencyInDays")] + [JsonProperty(PropertyName = "refillFrequencyInDays")] public int? RefillFrequencyInDays { get; private set; } /// /// Gets indicates whether this commitment plan will be moved into a - /// suspended state if usage beyond the commitment plan's included - /// quantities is incurred. + /// suspended state if usage goes beyond the commitment plan's included + /// quantities. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "suspendPlanOnOverage")] + [JsonProperty(PropertyName = "suspendPlanOnOverage")] public bool? SuspendPlanOnOverage { get; private set; } } diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/MoveCommitmentAssociationRequest.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/MoveCommitmentAssociationRequest.cs index dacdbb3b3931..5579e6c7c0ce 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/MoveCommitmentAssociationRequest.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/MoveCommitmentAssociationRequest.cs @@ -1,13 +1,16 @@ +// // 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 0.17.0.0 +// +// 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.MachineLearning.CommitmentPlans.Models { + using Newtonsoft.Json; using System.Linq; /// @@ -20,7 +23,10 @@ public partial class MoveCommitmentAssociationRequest /// Initializes a new instance of the MoveCommitmentAssociationRequest /// class. /// - public MoveCommitmentAssociationRequest() { } + public MoveCommitmentAssociationRequest() + { + CustomInit(); + } /// /// Initializes a new instance of the MoveCommitmentAssociationRequest @@ -31,13 +37,19 @@ public MoveCommitmentAssociationRequest() { } public MoveCommitmentAssociationRequest(string destinationPlanId = default(string)) { DestinationPlanId = destinationPlanId; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the ARM ID of the commitment plan to re-parent the /// commitment association to. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "destinationPlanId")] + [JsonProperty(PropertyName = "destinationPlanId")] public string DestinationPlanId { get; set; } } diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/OperationDisplayInfo.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/OperationDisplayInfo.cs new file mode 100644 index 000000000000..f5b7791b0df6 --- /dev/null +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/OperationDisplayInfo.cs @@ -0,0 +1,78 @@ +// +// 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.MachineLearning.CommitmentPlans.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The API operation info. + /// + public partial class OperationDisplayInfo + { + /// + /// Initializes a new instance of the OperationDisplayInfo class. + /// + public OperationDisplayInfo() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the OperationDisplayInfo class. + /// + /// The description of the operation. + /// The action that users can perform, based on + /// their permission level. + /// The service provider. + /// The resource on which the operation is + /// performed. + public OperationDisplayInfo(string description = default(string), string operation = default(string), string provider = default(string), string resource = default(string)) + { + Description = description; + Operation = operation; + Provider = provider; + Resource = resource; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the description of the operation. + /// + [JsonProperty(PropertyName = "description")] + public string Description { get; private set; } + + /// + /// Gets the action that users can perform, based on their permission + /// level. + /// + [JsonProperty(PropertyName = "operation")] + public string Operation { get; private set; } + + /// + /// Gets the service provider. + /// + [JsonProperty(PropertyName = "provider")] + public string Provider { get; private set; } + + /// + /// Gets the resource on which the operation is performed. + /// + [JsonProperty(PropertyName = "resource")] + public string Resource { get; private set; } + + } +} diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/OperationEntity.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/OperationEntity.cs new file mode 100644 index 000000000000..4431ebd97b82 --- /dev/null +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/OperationEntity.cs @@ -0,0 +1,60 @@ +// +// 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.MachineLearning.CommitmentPlans.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// An API operation. + /// + public partial class OperationEntity + { + /// + /// Initializes a new instance of the OperationEntity class. + /// + public OperationEntity() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the OperationEntity class. + /// + /// Operation name: + /// {provider}/{resource}/{operation}. + /// The API operation info. + public OperationEntity(string name = default(string), OperationDisplayInfo display = default(OperationDisplayInfo)) + { + Name = name; + Display = display; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets operation name: {provider}/{resource}/{operation}. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets or sets the API operation info. + /// + [JsonProperty(PropertyName = "display")] + public OperationDisplayInfo Display { get; set; } + + } +} diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/Page.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/Page.cs index b0c92b5772ea..d8191257580d 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/Page.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/Page.cs @@ -1,44 +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 0.17.0.0 +// +// 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.MachineLearning.CommitmentPlans.Models { + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; /// /// Defines a page in Azure responses. /// /// Type of the page content items - [Newtonsoft.Json.JsonObject] - public class Page : Microsoft.Rest.Azure.IPage + [JsonObject] + public class Page : IPage { /// /// Gets the link to the next page. /// - [Newtonsoft.Json.JsonProperty("nextLink")] - public System.String NextPageLink { get; private set; } + [JsonProperty("")] + public string NextPageLink { get; private set; } - [Newtonsoft.Json.JsonProperty("value")] - private System.Collections.Generic.IList Items{ get; set; } + [JsonProperty("value")] + private IList Items{ get; set; } /// /// Returns an enumerator that iterates through the collection. /// /// A an enumerator that can be used to iterate through the collection. - public System.Collections.Generic.IEnumerator GetEnumerator() + public IEnumerator GetEnumerator() { - return (Items == null) ? System.Linq.Enumerable.Empty().GetEnumerator() : Items.GetEnumerator(); + return Items == null ? System.Linq.Enumerable.Empty().GetEnumerator() : Items.GetEnumerator(); } /// /// Returns an enumerator that iterates through the collection. /// /// A an enumerator that can be used to iterate through the collection. - System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + IEnumerator IEnumerable.GetEnumerator() { return GetEnumerator(); } diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/Page1.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/Page1.cs new file mode 100644 index 000000000000..bfe6b9c800a2 --- /dev/null +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/Page1.cs @@ -0,0 +1,53 @@ +// +// 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.MachineLearning.CommitmentPlans.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + + /// + /// Defines a page in Azure responses. + /// + /// Type of the page content items + [JsonObject] + public class Page1 : IPage + { + /// + /// Gets the link to the next page. + /// + [JsonProperty("nextLink")] + public string NextPageLink { get; private set; } + + [JsonProperty("value")] + private IList Items{ get; set; } + + /// + /// Returns an enumerator that iterates through the collection. + /// + /// A an enumerator that can be used to iterate through the collection. + public IEnumerator GetEnumerator() + { + return Items == null ? System.Linq.Enumerable.Empty().GetEnumerator() : Items.GetEnumerator(); + } + + /// + /// Returns an enumerator that iterates through the collection. + /// + /// A an enumerator that can be used to iterate through the collection. + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + } +} diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/PlanQuantity.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/PlanQuantity.cs index c838a4c9dc80..698f61193f3e 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/PlanQuantity.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/PlanQuantity.cs @@ -1,13 +1,16 @@ +// // 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 0.17.0.0 +// +// 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.MachineLearning.CommitmentPlans.Models { + using Newtonsoft.Json; using System.Linq; /// @@ -19,7 +22,10 @@ public partial class PlanQuantity /// /// Initializes a new instance of the PlanQuantity class. /// - public PlanQuantity() { } + public PlanQuantity() + { + CustomInit(); + } /// /// Initializes a new instance of the PlanQuantity class. @@ -38,32 +44,38 @@ public PlanQuantity() { } Amount = amount; IncludedQuantityMeter = includedQuantityMeter; OverageMeter = overageMeter; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets the quantity added to the commitment plan at an interval /// specified by its allowance frequency. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "allowance")] + [JsonProperty(PropertyName = "allowance")] public double? Allowance { get; private set; } /// /// Gets the quantity available to the plan the last time usage was /// calculated. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "amount")] + [JsonProperty(PropertyName = "amount")] public double? Amount { get; private set; } /// /// Gets the Azure meter for usage against included quantities. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "includedQuantityMeter")] + [JsonProperty(PropertyName = "includedQuantityMeter")] public string IncludedQuantityMeter { get; private set; } /// /// Gets the Azure meter for usage which exceeds included quantities. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "overageMeter")] + [JsonProperty(PropertyName = "overageMeter")] public string OverageMeter { get; private set; } } diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/PlanUsageHistory.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/PlanUsageHistory.cs index deaeab8f757f..a6ed7a67e562 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/PlanUsageHistory.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/PlanUsageHistory.cs @@ -1,13 +1,18 @@ +// // 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 0.17.0.0 +// +// 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.MachineLearning.CommitmentPlans.Models { + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// @@ -19,7 +24,10 @@ public partial class PlanUsageHistory /// /// Initializes a new instance of the PlanUsageHistory class. /// - public PlanUsageHistory() { } + public PlanUsageHistory() + { + CustomInit(); + } /// /// Initializes a new instance of the PlanUsageHistory class. @@ -41,7 +49,7 @@ public PlanUsageHistory() { } /// resources. /// The date of usage, in ISO 8601 /// format. - public PlanUsageHistory(System.Collections.Generic.IDictionary planDeletionOverage = default(System.Collections.Generic.IDictionary), System.Collections.Generic.IDictionary planMigrationOverage = default(System.Collections.Generic.IDictionary), System.Collections.Generic.IDictionary planQuantitiesAfterUsage = default(System.Collections.Generic.IDictionary), System.Collections.Generic.IDictionary planQuantitiesBeforeUsage = default(System.Collections.Generic.IDictionary), System.Collections.Generic.IDictionary planUsageOverage = default(System.Collections.Generic.IDictionary), System.Collections.Generic.IDictionary usage = default(System.Collections.Generic.IDictionary), System.DateTime? usageDate = default(System.DateTime?)) + public PlanUsageHistory(IDictionary planDeletionOverage = default(IDictionary), IDictionary planMigrationOverage = default(IDictionary), IDictionary planQuantitiesAfterUsage = default(IDictionary), IDictionary planQuantitiesBeforeUsage = default(IDictionary), IDictionary planUsageOverage = default(IDictionary), IDictionary usage = default(IDictionary), System.DateTime? usageDate = default(System.DateTime?)) { PlanDeletionOverage = planDeletionOverage; PlanMigrationOverage = planMigrationOverage; @@ -50,55 +58,61 @@ public PlanUsageHistory() { } PlanUsageOverage = planUsageOverage; Usage = usage; UsageDate = usageDate; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets overage incurred as a result of deleting a commitment /// plan. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "planDeletionOverage")] - public System.Collections.Generic.IDictionary PlanDeletionOverage { get; set; } + [JsonProperty(PropertyName = "planDeletionOverage")] + public IDictionary PlanDeletionOverage { get; set; } /// - /// Gets or sets overage incurred as a result of migrating a - /// commitment plan from one SKU to another. + /// Gets or sets overage incurred as a result of migrating a commitment + /// plan from one SKU to another. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "planMigrationOverage")] - public System.Collections.Generic.IDictionary PlanMigrationOverage { get; set; } + [JsonProperty(PropertyName = "planMigrationOverage")] + public IDictionary PlanMigrationOverage { get; set; } /// /// Gets or sets included quantities remaining after usage against the /// commitment plan's associated resources was calculated. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "planQuantitiesAfterUsage")] - public System.Collections.Generic.IDictionary PlanQuantitiesAfterUsage { get; set; } + [JsonProperty(PropertyName = "planQuantitiesAfterUsage")] + public IDictionary PlanQuantitiesAfterUsage { get; set; } /// - /// Gets or sets included quantities remaining before usage against - /// the commitment plan's associated resources was calculated. + /// Gets or sets included quantities remaining before usage against the + /// commitment plan's associated resources was calculated. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "planQuantitiesBeforeUsage")] - public System.Collections.Generic.IDictionary PlanQuantitiesBeforeUsage { get; set; } + [JsonProperty(PropertyName = "planQuantitiesBeforeUsage")] + public IDictionary PlanQuantitiesBeforeUsage { get; set; } /// /// Gets or sets usage against the commitment plan's associated /// resources which was not covered by included quantities and is /// therefore overage. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "planUsageOverage")] - public System.Collections.Generic.IDictionary PlanUsageOverage { get; set; } + [JsonProperty(PropertyName = "planUsageOverage")] + public IDictionary PlanUsageOverage { get; set; } /// /// Gets or sets usage against the commitment plan's associated /// resources. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "usage")] - public System.Collections.Generic.IDictionary Usage { get; set; } + [JsonProperty(PropertyName = "usage")] + public IDictionary Usage { get; set; } /// /// Gets or sets the date of usage, in ISO 8601 format. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "usageDate")] + [JsonProperty(PropertyName = "usageDate")] public System.DateTime? UsageDate { get; set; } } diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/Resource.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/Resource.cs index 67c1add69648..2b6e5d479126 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/Resource.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/Resource.cs @@ -1,24 +1,34 @@ +// // 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 0.17.0.0 +// +// 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.MachineLearning.CommitmentPlans.Models { + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// /// Common properties of an ARM resource. /// - public partial class Resource : Microsoft.Rest.Azure.IResource + public partial class Resource : IResource { /// /// Initializes a new instance of the Resource class. /// - public Resource() { } + public Resource() + { + CustomInit(); + } /// /// Initializes a new instance of the Resource class. @@ -28,56 +38,62 @@ public Resource() { } /// Resource name. /// Resource type. /// User-defined tags for the resource. - public Resource(string location, string id = default(string), string name = default(string), string type = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary)) + public Resource(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary)) { Id = id; Name = name; Location = location; Type = type; Tags = tags; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets resource Id. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + [JsonProperty(PropertyName = "id")] public string Id { get; private set; } /// /// Gets resource name. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + [JsonProperty(PropertyName = "name")] public string Name { get; private set; } /// /// Gets or sets resource location. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + [JsonProperty(PropertyName = "location")] public string Location { get; set; } /// /// Gets resource type. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + [JsonProperty(PropertyName = "type")] public string Type { get; private set; } /// /// Gets or sets user-defined tags for the resource. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] - public System.Collections.Generic.IDictionary Tags { get; set; } + [JsonProperty(PropertyName = "tags")] + public IDictionary Tags { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { if (Location == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Location"); + throw new ValidationException(ValidationRules.CannotBeNull, "Location"); } } } diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/ResourceSku.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/ResourceSku.cs index 8db25c7df3ae..584b04ada117 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/ResourceSku.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/ResourceSku.cs @@ -1,13 +1,16 @@ +// // 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 0.17.0.0 +// +// 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.MachineLearning.CommitmentPlans.Models { + using Newtonsoft.Json; using System.Linq; /// @@ -18,13 +21,16 @@ public partial class ResourceSku /// /// Initializes a new instance of the ResourceSku class. /// - public ResourceSku() { } + public ResourceSku() + { + CustomInit(); + } /// /// Initializes a new instance of the ResourceSku class. /// - /// The scale-out capacity of the resource. 1 - /// is 1x, 2 is 2x, etc. This impacts the quantities and cost of any + /// The scale-out capacity of the resource. 1 is + /// 1x, 2 is 2x, etc. This impacts the quantities and cost of any /// commitment plan resource. /// The SKU name. Along with tier, uniquely /// identifies the SKU. @@ -35,28 +41,34 @@ public ResourceSku() { } Capacity = capacity; Name = name; Tier = tier; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the scale-out capacity of the resource. 1 is 1x, 2 is /// 2x, etc. This impacts the quantities and cost of any commitment /// plan resource. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "capacity")] + [JsonProperty(PropertyName = "capacity")] public int? Capacity { get; set; } /// - /// Gets or sets the SKU name. Along with tier, uniquely identifies - /// the SKU. + /// Gets or sets the SKU name. Along with tier, uniquely identifies the + /// SKU. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// - /// Gets or sets the SKU tier. Along with name, uniquely identifies - /// the SKU. + /// Gets or sets the SKU tier. Along with name, uniquely identifies the + /// SKU. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "tier")] + [JsonProperty(PropertyName = "tier")] public string Tier { get; set; } } diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/ResourceSkuRestrictionsReasonCode.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/ResourceSkuRestrictionsReasonCode.cs new file mode 100644 index 000000000000..7c1ab21b400f --- /dev/null +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/ResourceSkuRestrictionsReasonCode.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.MachineLearning.CommitmentPlans.Models +{ + + /// + /// Defines values for ResourceSkuRestrictionsReasonCode. + /// + public static class ResourceSkuRestrictionsReasonCode + { + public const string QuotaId = "QuotaId"; + public const string NotAvailableForSubscription = "NotAvailableForSubscription"; + } +} diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/ResourceSkuRestrictionsType.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/ResourceSkuRestrictionsType.cs new file mode 100644 index 000000000000..ac37b1127674 --- /dev/null +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/ResourceSkuRestrictionsType.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.MachineLearning.CommitmentPlans.Models +{ + + /// + /// Defines values for ResourceSkuRestrictionsType. + /// + public static class ResourceSkuRestrictionsType + { + public const string Location = "location"; + public const string Zone = "zone"; + } +} diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/SkuCapability.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/SkuCapability.cs new file mode 100644 index 000000000000..4948e52b192e --- /dev/null +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/SkuCapability.cs @@ -0,0 +1,59 @@ +// +// 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.MachineLearning.CommitmentPlans.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Describes The SKU capabilities object. + /// + public partial class SkuCapability + { + /// + /// Initializes a new instance of the SkuCapability class. + /// + public SkuCapability() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SkuCapability class. + /// + /// The capability name. + /// The capability value. + public SkuCapability(string name = default(string), string value = default(string)) + { + Name = name; + Value = value; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the capability name. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets the capability value. + /// + [JsonProperty(PropertyName = "value")] + public string Value { get; private set; } + + } +} diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/SkuCapacity.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/SkuCapacity.cs new file mode 100644 index 000000000000..26450a837d03 --- /dev/null +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/SkuCapacity.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.MachineLearning.CommitmentPlans.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Describes scaling information of a SKU. + /// + public partial class SkuCapacity + { + /// + /// Initializes a new instance of the SkuCapacity class. + /// + public SkuCapacity() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SkuCapacity class. + /// + /// The minimum capacity. + /// The maximum capacity that can be set. + /// The default capacity. + /// The scale type applicable to the sku. + /// Possible values include: 'Automatic', 'Manual', 'None' + public SkuCapacity(long? minimum = default(long?), long? maximum = default(long?), long? defaultProperty = default(long?), string scaleType = default(string)) + { + Minimum = minimum; + Maximum = maximum; + DefaultProperty = defaultProperty; + ScaleType = scaleType; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the minimum capacity. + /// + [JsonProperty(PropertyName = "minimum")] + public long? Minimum { get; private set; } + + /// + /// Gets the maximum capacity that can be set. + /// + [JsonProperty(PropertyName = "maximum")] + public long? Maximum { get; private set; } + + /// + /// Gets the default capacity. + /// + [JsonProperty(PropertyName = "default")] + public long? DefaultProperty { get; private set; } + + /// + /// Gets the scale type applicable to the sku. Possible values include: + /// 'Automatic', 'Manual', 'None' + /// + [JsonProperty(PropertyName = "scaleType")] + public string ScaleType { get; private set; } + + } +} diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/SkuCapacityScaleType.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/SkuCapacityScaleType.cs new file mode 100644 index 000000000000..d668e06eb08b --- /dev/null +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/SkuCapacityScaleType.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.MachineLearning.CommitmentPlans.Models +{ + + /// + /// Defines values for SkuCapacityScaleType. + /// + public static class SkuCapacityScaleType + { + public const string Automatic = "Automatic"; + public const string Manual = "Manual"; + public const string None = "None"; + } +} diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/SkuCost.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/SkuCost.cs new file mode 100644 index 000000000000..7b28e0b052ce --- /dev/null +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/SkuCost.cs @@ -0,0 +1,69 @@ +// +// 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.MachineLearning.CommitmentPlans.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Describes metadata for SKU cost info. + /// + public partial class SkuCost + { + /// + /// Initializes a new instance of the SkuCost class. + /// + public SkuCost() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SkuCost class. + /// + /// The meter used for this part of a SKU's + /// cost. + /// The multiplier for the meter ID. + /// The overall duration represented by the + /// quantity. + public SkuCost(string meterID = default(string), long? quantity = default(long?), string extendedUnit = default(string)) + { + MeterID = meterID; + Quantity = quantity; + ExtendedUnit = extendedUnit; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the meter used for this part of a SKU's cost. + /// + [JsonProperty(PropertyName = "meterID")] + public string MeterID { get; private set; } + + /// + /// Gets the multiplier for the meter ID. + /// + [JsonProperty(PropertyName = "quantity")] + public long? Quantity { get; private set; } + + /// + /// Gets the overall duration represented by the quantity. + /// + [JsonProperty(PropertyName = "extendedUnit")] + public string ExtendedUnit { get; private set; } + + } +} diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/SkuRestrictions.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/SkuRestrictions.cs new file mode 100644 index 000000000000..0f040d4a5d0f --- /dev/null +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/SkuRestrictions.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.MachineLearning.CommitmentPlans.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Describes restrictions which would prevent a SKU from being used. + /// + public partial class SkuRestrictions + { + /// + /// Initializes a new instance of the SkuRestrictions class. + /// + public SkuRestrictions() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SkuRestrictions class. + /// + /// The type of restrictions. Possible values + /// include: 'location', 'zone' + /// The value of restrictions. If the restriction + /// type is set to location. This would be different locations where + /// the SKU is restricted. + /// The reason for restriction. Possible + /// values include: 'QuotaId', 'NotAvailableForSubscription' + public SkuRestrictions(string type = default(string), IList values = default(IList), string reasonCode = default(string)) + { + Type = type; + Values = values; + ReasonCode = reasonCode; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the type of restrictions. Possible values include: 'location', + /// 'zone' + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } + + /// + /// Gets the value of restrictions. If the restriction type is set to + /// location. This would be different locations where the SKU is + /// restricted. + /// + [JsonProperty(PropertyName = "values")] + public IList Values { get; private set; } + + /// + /// Gets the reason for restriction. Possible values include: + /// 'QuotaId', 'NotAvailableForSubscription' + /// + [JsonProperty(PropertyName = "reasonCode")] + public string ReasonCode { get; private set; } + + } +} diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Operations.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Operations.cs new file mode 100644 index 000000000000..82f2821876ab --- /dev/null +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Operations.cs @@ -0,0 +1,228 @@ +// +// 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.MachineLearning.CommitmentPlans +{ + 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; + + /// + /// Operations operations. + /// + internal partial class Operations : IServiceOperations, IOperations + { + /// + /// Initializes a new instance of the Operations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal Operations(AzureMLCommitmentPlansManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the AzureMLCommitmentPlansManagementClient + /// + public AzureMLCommitmentPlansManagementClient Client { get; private set; } + + /// + /// Lists all of the available Azure Machine Learning Studio Commitment Plan RP + /// REST API operations. + /// + /// + /// 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>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.MachineLearning/operations").ToString(); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.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("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 CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/OperationsExtensions.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/OperationsExtensions.cs new file mode 100644 index 000000000000..fcbce82c783f --- /dev/null +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/OperationsExtensions.cs @@ -0,0 +1,57 @@ +// +// 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.MachineLearning.CommitmentPlans +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for Operations. + /// + public static partial class OperationsExtensions + { + /// + /// Lists all of the available Azure Machine Learning Studio Commitment Plan RP + /// REST API operations. + /// + /// + /// The operations group for this extension method. + /// + public static IEnumerable List(this IOperations operations) + { + return operations.ListAsync().GetAwaiter().GetResult(); + } + + /// + /// Lists all of the available Azure Machine Learning Studio Commitment Plan RP + /// REST API operations. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/SdkInfo_AzureMLCommitmentPlansManagementClient.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/SdkInfo_AzureMLCommitmentPlansManagementClient.cs new file mode 100644 index 000000000000..a62dd37437eb --- /dev/null +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/SdkInfo_AzureMLCommitmentPlansManagementClient.cs @@ -0,0 +1,31 @@ + +// +// 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.MachineLearning.CommitmentPlans +{ + using System; + using System.Collections.Generic; + using System.Linq; + + internal static partial class SdkInfo + { + public static IEnumerable> ApiInfo_AzureMLCommitmentPlansManagementClient + { + get + { + return new Tuple[] + { + new Tuple("MachineLearning", "CommitmentAssociations", "2016-05-01-preview"), + new Tuple("MachineLearning", "CommitmentPlans", "2016-05-01-preview"), + new Tuple("MachineLearning", "Operations", "2016-05-01-preview"), + new Tuple("MachineLearning", "Skus", "2016-05-01-preview"), + new Tuple("MachineLearning", "UsageHistory", "2016-05-01-preview"), + }.AsEnumerable(); + } + } + } +} diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/SkusOperations.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/SkusOperations.cs new file mode 100644 index 000000000000..998f6fa13842 --- /dev/null +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/SkusOperations.cs @@ -0,0 +1,232 @@ +// +// 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.MachineLearning.CommitmentPlans +{ + 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; + + /// + /// SkusOperations operations. + /// + internal partial class SkusOperations : IServiceOperations, ISkusOperations + { + /// + /// Initializes a new instance of the SkusOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal SkusOperations(AzureMLCommitmentPlansManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the AzureMLCommitmentPlansManagementClient + /// + public AzureMLCommitmentPlansManagementClient Client { get; private set; } + + /// + /// Lists the available commitment plan SKUs. + /// + /// + /// 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>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.MachineLearning/skus").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.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("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 CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/SkusOperationsExtensions.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/SkusOperationsExtensions.cs new file mode 100644 index 000000000000..496c081e8d1e --- /dev/null +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/SkusOperationsExtensions.cs @@ -0,0 +1,55 @@ +// +// 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.MachineLearning.CommitmentPlans +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for SkusOperations. + /// + public static partial class SkusOperationsExtensions + { + /// + /// Lists the available commitment plan SKUs. + /// + /// + /// The operations group for this extension method. + /// + public static IEnumerable List(this ISkusOperations operations) + { + return operations.ListAsync().GetAwaiter().GetResult(); + } + + /// + /// Lists the available commitment plan SKUs. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this ISkusOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/UsageHistoryOperations.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/UsageHistoryOperations.cs index 968a7145dad8..b9e85c531685 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/UsageHistoryOperations.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/UsageHistoryOperations.cs @@ -1,22 +1,31 @@ +// // 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 0.17.0.0 +// +// 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.MachineLearning.CommitmentPlans { - using System.Linq; 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; /// /// UsageHistoryOperations operations. /// - internal partial class UsageHistoryOperations : Microsoft.Rest.IServiceOperations, IUsageHistoryOperations + internal partial class UsageHistoryOperations : IServiceOperations, IUsageHistoryOperations { /// /// Initializes a new instance of the UsageHistoryOperations class. @@ -29,11 +38,11 @@ internal partial class UsageHistoryOperations : Microsoft.Rest.IServiceOperation /// internal UsageHistoryOperations(AzureMLCommitmentPlansManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - this.Client = client; + Client = client; } /// @@ -42,7 +51,7 @@ internal UsageHistoryOperations(AzureMLCommitmentPlansManagementClient client) public AzureMLCommitmentPlansManagementClient Client { get; private set; } /// - /// Retrieves the usage history for an Azure ML commitment plan. + /// Retrieve the usage history for an Azure ML commitment plan. /// /// /// The resource group name. @@ -59,86 +68,91 @@ internal UsageHistoryOperations(AzureMLCommitmentPlansManagementClient client) /// /// 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 System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string commitmentPlanName, string skipToken = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string commitmentPlanName, string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (commitmentPlanName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "commitmentPlanName"); + throw new ValidationException(ValidationRules.CannotBeNull, "commitmentPlanName"); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("commitmentPlanName", commitmentPlanName); tracingParameters.Add("skipToken", skipToken); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearning/commitmentPlans/{commitmentPlanName}/usageHistory").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{commitmentPlanName}", System.Uri.EscapeDataString(commitmentPlanName)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + List _queryParameters = new List(); if (skipToken != null) { _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken))); } - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } + + if (customHeaders != null) { foreach(var _header in customHeaders) @@ -154,51 +168,51 @@ internal UsageHistoryOperations(AzureMLCommitmentPlansManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (Newtonsoft.Json.JsonException) + catch (JsonException) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -208,7 +222,7 @@ internal UsageHistoryOperations(AzureMLCommitmentPlansManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -221,27 +235,27 @@ internal UsageHistoryOperations(AzureMLCommitmentPlansManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } - catch (Newtonsoft.Json.JsonException ex) + catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// Retrieves the usage history for an Azure ML commitment plan. + /// Retrieve the usage history for an Azure ML commitment plan. /// /// /// The NextLink from the previous successful call to List operation. @@ -252,61 +266,66 @@ internal UsageHistoryOperations(AzureMLCommitmentPlansManagementClient client) /// /// 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 System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + List _queryParameters = new List(); if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } + + if (customHeaders != null) { foreach(var _header in customHeaders) @@ -322,51 +341,51 @@ internal UsageHistoryOperations(AzureMLCommitmentPlansManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (Newtonsoft.Json.JsonException) + catch (JsonException) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -376,7 +395,7 @@ internal UsageHistoryOperations(AzureMLCommitmentPlansManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -389,21 +408,21 @@ internal UsageHistoryOperations(AzureMLCommitmentPlansManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } - catch (Newtonsoft.Json.JsonException ex) + catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/UsageHistoryOperationsExtensions.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/UsageHistoryOperationsExtensions.cs index fd6654385ed7..d4cc21bace18 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/UsageHistoryOperationsExtensions.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/UsageHistoryOperationsExtensions.cs @@ -1,16 +1,20 @@ +// // 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 0.17.0.0 +// +// 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.MachineLearning.CommitmentPlans { + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest.Azure; - using Models; /// /// Extension methods for UsageHistoryOperations. @@ -18,7 +22,7 @@ namespace Microsoft.Azure.Management.MachineLearning.CommitmentPlans public static partial class UsageHistoryOperationsExtensions { /// - /// Retrieves the usage history for an Azure ML commitment plan. + /// Retrieve the usage history for an Azure ML commitment plan. /// /// /// The operations group for this extension method. @@ -32,13 +36,13 @@ public static partial class UsageHistoryOperationsExtensions /// /// Continuation token for pagination. /// - public static Microsoft.Rest.Azure.IPage List(this IUsageHistoryOperations operations, string resourceGroupName, string commitmentPlanName, string skipToken = default(string)) + public static IPage List(this IUsageHistoryOperations operations, string resourceGroupName, string commitmentPlanName, string skipToken = default(string)) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IUsageHistoryOperations)s).ListAsync(resourceGroupName, commitmentPlanName, skipToken), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return operations.ListAsync(resourceGroupName, commitmentPlanName, skipToken).GetAwaiter().GetResult(); } /// - /// Retrieves the usage history for an Azure ML commitment plan. + /// Retrieve the usage history for an Azure ML commitment plan. /// /// /// The operations group for this extension method. @@ -55,7 +59,7 @@ public static partial class UsageHistoryOperationsExtensions /// /// The cancellation token. /// - public static async Task> ListAsync(this IUsageHistoryOperations operations, string resourceGroupName, string commitmentPlanName, string skipToken = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task> ListAsync(this IUsageHistoryOperations operations, string resourceGroupName, string commitmentPlanName, string skipToken = default(string), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, commitmentPlanName, skipToken, null, cancellationToken).ConfigureAwait(false)) { @@ -64,7 +68,7 @@ public static partial class UsageHistoryOperationsExtensions } /// - /// Retrieves the usage history for an Azure ML commitment plan. + /// Retrieve the usage history for an Azure ML commitment plan. /// /// /// The operations group for this extension method. @@ -72,13 +76,13 @@ public static partial class UsageHistoryOperationsExtensions /// /// The NextLink from the previous successful call to List operation. /// - public static Microsoft.Rest.Azure.IPage ListNext(this IUsageHistoryOperations operations, string nextPageLink) + public static IPage ListNext(this IUsageHistoryOperations operations, string nextPageLink) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IUsageHistoryOperations)s).ListNextAsync(nextPageLink), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); } /// - /// Retrieves the usage history for an Azure ML commitment plan. + /// Retrieve the usage history for an Azure ML commitment plan. /// /// /// The operations group for this extension method. @@ -89,7 +93,7 @@ public static Microsoft.Rest.Azure.IPage ListNext(this IUsageH /// /// The cancellation token. /// - public static async Task> ListNextAsync(this IUsageHistoryOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task> ListNextAsync(this IUsageHistoryOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/AzureMLWebServicesManagementClient.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/AzureMLWebServicesManagementClient.cs index 97f5b86e4e18..8a04aa606cb9 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/AzureMLWebServicesManagementClient.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/AzureMLWebServicesManagementClient.cs @@ -1,12 +1,15 @@ -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// +// 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.MachineLearning.WebServices { - using Microsoft.Azure; - using Microsoft.Azure.Management; - using Microsoft.Azure.Management.MachineLearning; using Microsoft.Rest; using Microsoft.Rest.Azure; using Microsoft.Rest.Serialization; @@ -62,27 +65,46 @@ public partial class AzureMLWebServicesManagementClient : ServiceClient - /// Gets or sets the preferred language for the response. + /// The preferred language for the response. /// public string AcceptLanguage { get; set; } /// - /// Gets or sets the retry timeout in seconds for Long Running Operations. - /// Default value is 30. + /// The retry timeout in seconds for Long Running Operations. Default value is + /// 30. /// public int? LongRunningOperationRetryTimeout { get; set; } /// - /// When set to true a unique x-ms-client-request-id value is generated and - /// included in each request. Default is true. + /// Whether a unique x-ms-client-request-id should be generated. When set to + /// true a unique x-ms-client-request-id value is generated and included in + /// each request. Default is true. /// public bool? GenerateClientRequestId { get; set; } + /// + /// Gets the IOperations. + /// + public virtual IOperations Operations { get; private set; } + /// /// Gets the IWebServicesOperations. /// public virtual IWebServicesOperations WebServices { get; private set; } + /// + /// Initializes a new instance of the AzureMLWebServicesManagementClient class. + /// + /// + /// HttpClient to be used + /// + /// + /// True: will dispose the provided httpClient on calling AzureMLWebServicesManagementClient.Dispose(). False: will not dispose provided httpClient + protected AzureMLWebServicesManagementClient(HttpClient httpClient, bool disposeHttpClient) : base(httpClient, disposeHttpClient) + { + Initialize(); + } + /// /// Initializes a new instance of the AzureMLWebServicesManagementClient class. /// @@ -178,6 +200,33 @@ public AzureMLWebServicesManagementClient(ServiceClientCredentials credentials, } } + /// + /// Initializes a new instance of the AzureMLWebServicesManagementClient class. + /// + /// + /// Required. Credentials needed for the client to connect to Azure. + /// + /// + /// HttpClient to be used + /// + /// + /// True: will dispose the provided httpClient on calling AzureMLWebServicesManagementClient.Dispose(). False: will not dispose provided httpClient + /// + /// Thrown when a required parameter is null + /// + public AzureMLWebServicesManagementClient(ServiceClientCredentials credentials, HttpClient httpClient, bool disposeHttpClient) : this(httpClient, disposeHttpClient) + { + if (credentials == null) + { + throw new System.ArgumentNullException("credentials"); + } + Credentials = credentials; + if (Credentials != null) + { + Credentials.InitializeServiceClient(this); + } + } + /// /// Initializes a new instance of the AzureMLWebServicesManagementClient class. /// @@ -284,6 +333,7 @@ public AzureMLWebServicesManagementClient(System.Uri baseUri, ServiceClientCrede /// private void Initialize() { + Operations = new Operations(this); WebServices = new WebServicesOperations(this); BaseUri = new System.Uri("https://management.azure.com"); ApiVersion = "2017-01-01"; diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/IAzureMLWebServicesManagementClient.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/IAzureMLWebServicesManagementClient.cs index 86bed6fbb621..f5e1e2214463 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/IAzureMLWebServicesManagementClient.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/IAzureMLWebServicesManagementClient.cs @@ -1,12 +1,15 @@ -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// +// 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.MachineLearning.WebServices { - using Microsoft.Azure; - using Microsoft.Azure.Management; - using Microsoft.Azure.Management.MachineLearning; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; @@ -57,23 +60,29 @@ public partial interface IAzureMLWebServicesManagementClient : System.IDisposabl string ApiVersion { get; } /// - /// Gets or sets the preferred language for the response. + /// The preferred language for the response. /// string AcceptLanguage { get; set; } /// - /// Gets or sets the retry timeout in seconds for Long Running - /// Operations. Default value is 30. + /// The retry timeout in seconds for Long Running Operations. Default + /// value is 30. /// int? LongRunningOperationRetryTimeout { get; set; } /// - /// When set to true a unique x-ms-client-request-id value is generated - /// and included in each request. Default is true. + /// Whether a unique x-ms-client-request-id should be generated. When + /// set to true a unique x-ms-client-request-id value is generated and + /// included in each request. Default is true. /// bool? GenerateClientRequestId { get; set; } + /// + /// Gets the IOperations. + /// + IOperations Operations { get; } + /// /// Gets the IWebServicesOperations. /// diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/IOperations.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/IOperations.cs new file mode 100644 index 000000000000..fd9f36c77a8b --- /dev/null +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/IOperations.cs @@ -0,0 +1,46 @@ +// +// 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.MachineLearning.WebServices +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Operations operations. + /// + public partial interface IOperations + { + /// + /// Lists all the available REST API operations. + /// + /// + /// 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>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/IWebServicesOperations.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/IWebServicesOperations.cs index f7c80dd83010..9d056b8fe3c6 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/IWebServicesOperations.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/IWebServicesOperations.cs @@ -1,12 +1,15 @@ -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// +// 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.MachineLearning.WebServices { - using Microsoft.Azure; - using Microsoft.Azure.Management; - using Microsoft.Azure.Management.MachineLearning; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; @@ -112,7 +115,7 @@ public partial interface IWebServicesOperations /// /// Thrown when a required parameter is null /// - Task> PatchWithHttpMessagesAsync(string resourceGroupName, string webServiceName, WebService patchPayload, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> PatchWithHttpMessagesAsync(string resourceGroupName, string webServiceName, PatchedWebService patchPayload, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Deletes the specified web service. /// @@ -302,7 +305,7 @@ public partial interface IWebServicesOperations /// /// Thrown when a required parameter is null /// - Task> BeginPatchWithHttpMessagesAsync(string resourceGroupName, string webServiceName, WebService patchPayload, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> BeginPatchWithHttpMessagesAsync(string resourceGroupName, string webServiceName, PatchedWebService patchPayload, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Deletes the specified web service. /// diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/AssetItem.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/AssetItem.cs index 57150943b626..690dc8e00b4c 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/AssetItem.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/AssetItem.cs @@ -1,13 +1,15 @@ -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// +// 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.MachineLearning.WebServices.Models { - using Microsoft.Azure; - using Microsoft.Azure.Management; - using Microsoft.Azure.Management.MachineLearning; - using Microsoft.Azure.Management.MachineLearning.WebServices; using Microsoft.Rest; using Newtonsoft.Json; using System.Collections; @@ -24,7 +26,7 @@ public partial class AssetItem /// public AssetItem() { - CustomInit(); + CustomInit(); } /// diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/AssetType.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/AssetType.cs index 22b3736a9325..a134414a7895 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/AssetType.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/AssetType.cs @@ -1,13 +1,15 @@ -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// +// 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.MachineLearning.WebServices.Models { - using Microsoft.Azure; - using Microsoft.Azure.Management; - using Microsoft.Azure.Management.MachineLearning; - using Microsoft.Azure.Management.MachineLearning.WebServices; /// /// Defines values for AssetType. diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/AsyncOperationErrorInfo.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/AsyncOperationErrorInfo.cs index af099828f123..d3ac17b54151 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/AsyncOperationErrorInfo.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/AsyncOperationErrorInfo.cs @@ -1,13 +1,15 @@ -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// +// 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.MachineLearning.WebServices.Models { - using Microsoft.Azure; - using Microsoft.Azure.Management; - using Microsoft.Azure.Management.MachineLearning; - using Microsoft.Azure.Management.MachineLearning.WebServices; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; @@ -23,7 +25,7 @@ public partial class AsyncOperationErrorInfo /// public AsyncOperationErrorInfo() { - CustomInit(); + CustomInit(); } /// @@ -49,28 +51,28 @@ public AsyncOperationErrorInfo() partial void CustomInit(); /// - /// Gets or sets the error code. + /// Gets the error code. /// [JsonProperty(PropertyName = "code")] - public string Code { get; set; } + public string Code { get; private set; } /// - /// Gets or sets the error target. + /// Gets the error target. /// [JsonProperty(PropertyName = "target")] - public string Target { get; set; } + public string Target { get; private set; } /// - /// Gets or sets the error message. + /// Gets the error message. /// [JsonProperty(PropertyName = "message")] - public string Message { get; set; } + public string Message { get; private set; } /// - /// Gets or sets an array containing error information. + /// Gets an array containing error information. /// [JsonProperty(PropertyName = "details")] - public IList Details { get; set; } + public IList Details { get; private set; } } } diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/AsyncOperationStatus.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/AsyncOperationStatus.cs index 4a268f847399..2c940e32cd83 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/AsyncOperationStatus.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/AsyncOperationStatus.cs @@ -1,13 +1,15 @@ -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// +// 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.MachineLearning.WebServices.Models { - using Microsoft.Azure; - using Microsoft.Azure.Management; - using Microsoft.Azure.Management.MachineLearning; - using Microsoft.Azure.Management.MachineLearning.WebServices; using Newtonsoft.Json; using System.Linq; @@ -21,7 +23,7 @@ public partial class AsyncOperationStatus /// public AsyncOperationStatus() { - CustomInit(); + CustomInit(); } /// @@ -58,16 +60,16 @@ public AsyncOperationStatus() partial void CustomInit(); /// - /// Gets or sets async operation id. + /// Gets async operation id. /// [JsonProperty(PropertyName = "id")] - public string Id { get; set; } + public string Id { get; private set; } /// - /// Gets or sets async operation name. + /// Gets async operation name. /// [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + public string Name { get; private set; } /// /// Gets read Only: The provisioning state of the web service. Valid @@ -90,17 +92,17 @@ public AsyncOperationStatus() public System.DateTime? EndTime { get; private set; } /// - /// Gets or sets async operation progress. + /// Gets async operation progress. /// [JsonProperty(PropertyName = "percentComplete")] - public double? PercentComplete { get; set; } + public double? PercentComplete { get; private set; } /// - /// Gets or sets if the async operation fails, this structure contains - /// the error details. + /// Gets if the async operation fails, this structure contains the + /// error details. /// [JsonProperty(PropertyName = "errorInfo")] - public AsyncOperationErrorInfo ErrorInfo { get; set; } + public AsyncOperationErrorInfo ErrorInfo { get; private set; } } } diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/BlobLocation.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/BlobLocation.cs index 0db14597bb0c..627b2b55fecf 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/BlobLocation.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/BlobLocation.cs @@ -1,13 +1,15 @@ -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// +// 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.MachineLearning.WebServices.Models { - using Microsoft.Azure; - using Microsoft.Azure.Management; - using Microsoft.Azure.Management.MachineLearning; - using Microsoft.Azure.Management.MachineLearning.WebServices; using Microsoft.Rest; using Newtonsoft.Json; using System.Linq; @@ -22,7 +24,7 @@ public partial class BlobLocation /// public BlobLocation() { - CustomInit(); + CustomInit(); } /// diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/ColumnFormat.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/ColumnFormat.cs index 1b0375302ad5..a8057c21d771 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/ColumnFormat.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/ColumnFormat.cs @@ -1,13 +1,15 @@ -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// +// 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.MachineLearning.WebServices.Models { - using Microsoft.Azure; - using Microsoft.Azure.Management; - using Microsoft.Azure.Management.MachineLearning; - using Microsoft.Azure.Management.MachineLearning.WebServices; /// /// Defines values for ColumnFormat. diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/ColumnSpecification.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/ColumnSpecification.cs index ce020e2c147e..2e0dcd19f09d 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/ColumnSpecification.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/ColumnSpecification.cs @@ -1,13 +1,15 @@ -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// +// 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.MachineLearning.WebServices.Models { - using Microsoft.Azure; - using Microsoft.Azure.Management; - using Microsoft.Azure.Management.MachineLearning; - using Microsoft.Azure.Management.MachineLearning.WebServices; using Microsoft.Rest; using Newtonsoft.Json; using System.Collections; @@ -26,7 +28,7 @@ public partial class ColumnSpecification /// public ColumnSpecification() { - CustomInit(); + CustomInit(); } /// diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/ColumnType.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/ColumnType.cs index f8d47e9e0a5d..dbe2f90335c9 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/ColumnType.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/ColumnType.cs @@ -1,13 +1,15 @@ -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// +// 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.MachineLearning.WebServices.Models { - using Microsoft.Azure; - using Microsoft.Azure.Management; - using Microsoft.Azure.Management.MachineLearning; - using Microsoft.Azure.Management.MachineLearning.WebServices; /// /// Defines values for ColumnType. diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/CommitmentPlan.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/CommitmentPlan.cs index ce496069f342..94b87a45226f 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/CommitmentPlan.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/CommitmentPlan.cs @@ -1,13 +1,15 @@ -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// +// 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.MachineLearning.WebServices.Models { - using Microsoft.Azure; - using Microsoft.Azure.Management; - using Microsoft.Azure.Management.MachineLearning; - using Microsoft.Azure.Management.MachineLearning.WebServices; using Microsoft.Rest; using Newtonsoft.Json; using System.Linq; @@ -23,7 +25,7 @@ public partial class CommitmentPlan /// public CommitmentPlan() { - CustomInit(); + CustomInit(); } /// diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/DiagnosticsConfiguration.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/DiagnosticsConfiguration.cs index 1da135a7b2cf..9a300e5aee71 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/DiagnosticsConfiguration.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/DiagnosticsConfiguration.cs @@ -1,13 +1,15 @@ -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// +// 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.MachineLearning.WebServices.Models { - using Microsoft.Azure; - using Microsoft.Azure.Management; - using Microsoft.Azure.Management.MachineLearning; - using Microsoft.Azure.Management.MachineLearning.WebServices; using Microsoft.Rest; using Newtonsoft.Json; using System.Linq; @@ -22,7 +24,7 @@ public partial class DiagnosticsConfiguration /// public DiagnosticsConfiguration() { - CustomInit(); + CustomInit(); } /// diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/DiagnosticsLevel.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/DiagnosticsLevel.cs index f22377f4647d..4bf6bd229014 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/DiagnosticsLevel.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/DiagnosticsLevel.cs @@ -1,13 +1,15 @@ -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// +// 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.MachineLearning.WebServices.Models { - using Microsoft.Azure; - using Microsoft.Azure.Management; - using Microsoft.Azure.Management.MachineLearning; - using Microsoft.Azure.Management.MachineLearning.WebServices; /// /// Defines values for DiagnosticsLevel. diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/ExampleRequest.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/ExampleRequest.cs index 908cd5b3bb0c..493a651a8a9c 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/ExampleRequest.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/ExampleRequest.cs @@ -1,13 +1,15 @@ -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// +// 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.MachineLearning.WebServices.Models { - using Microsoft.Azure; - using Microsoft.Azure.Management; - using Microsoft.Azure.Management.MachineLearning; - using Microsoft.Azure.Management.MachineLearning.WebServices; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; @@ -23,7 +25,7 @@ public partial class ExampleRequest /// public ExampleRequest() { - CustomInit(); + CustomInit(); } /// diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/GraphEdge.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/GraphEdge.cs index f040a7d8d11d..5ef2ba6ff68f 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/GraphEdge.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/GraphEdge.cs @@ -1,13 +1,15 @@ -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// +// 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.MachineLearning.WebServices.Models { - using Microsoft.Azure; - using Microsoft.Azure.Management; - using Microsoft.Azure.Management.MachineLearning; - using Microsoft.Azure.Management.MachineLearning.WebServices; using Newtonsoft.Json; using System.Linq; @@ -21,7 +23,7 @@ public partial class GraphEdge /// public GraphEdge() { - CustomInit(); + CustomInit(); } /// diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/GraphNode.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/GraphNode.cs index d4ed58fb9152..4cf4f90a3e7a 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/GraphNode.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/GraphNode.cs @@ -1,13 +1,15 @@ -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// +// 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.MachineLearning.WebServices.Models { - using Microsoft.Azure; - using Microsoft.Azure.Management; - using Microsoft.Azure.Management.MachineLearning; - using Microsoft.Azure.Management.MachineLearning.WebServices; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; @@ -25,7 +27,7 @@ public partial class GraphNode /// public GraphNode() { - CustomInit(); + CustomInit(); } /// diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/GraphPackage.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/GraphPackage.cs index 71722811f013..379940c51807 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/GraphPackage.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/GraphPackage.cs @@ -1,13 +1,15 @@ -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// +// 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.MachineLearning.WebServices.Models { - using Microsoft.Azure; - using Microsoft.Azure.Management; - using Microsoft.Azure.Management.MachineLearning; - using Microsoft.Azure.Management.MachineLearning.WebServices; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; @@ -23,7 +25,7 @@ public partial class GraphPackage /// public GraphPackage() { - CustomInit(); + CustomInit(); } /// diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/GraphParameter.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/GraphParameter.cs index d6c098841611..43fe68f0a609 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/GraphParameter.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/GraphParameter.cs @@ -1,13 +1,15 @@ -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// +// 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.MachineLearning.WebServices.Models { - using Microsoft.Azure; - using Microsoft.Azure.Management; - using Microsoft.Azure.Management.MachineLearning; - using Microsoft.Azure.Management.MachineLearning.WebServices; using Microsoft.Rest; using Newtonsoft.Json; using System.Collections; @@ -24,7 +26,7 @@ public partial class GraphParameter /// public GraphParameter() { - CustomInit(); + CustomInit(); } /// diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/GraphParameterLink.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/GraphParameterLink.cs index 3827df6fc49d..250c0f05930c 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/GraphParameterLink.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/GraphParameterLink.cs @@ -1,13 +1,15 @@ -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// +// 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.MachineLearning.WebServices.Models { - using Microsoft.Azure; - using Microsoft.Azure.Management; - using Microsoft.Azure.Management.MachineLearning; - using Microsoft.Azure.Management.MachineLearning.WebServices; using Microsoft.Rest; using Newtonsoft.Json; using System.Linq; @@ -22,7 +24,7 @@ public partial class GraphParameterLink /// public GraphParameterLink() { - CustomInit(); + CustomInit(); } /// diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/InputPort.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/InputPort.cs index d5c42f5dea37..e3e4721e7f77 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/InputPort.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/InputPort.cs @@ -1,13 +1,15 @@ -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// +// 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.MachineLearning.WebServices.Models { - using Microsoft.Azure; - using Microsoft.Azure.Management; - using Microsoft.Azure.Management.MachineLearning; - using Microsoft.Azure.Management.MachineLearning.WebServices; using Newtonsoft.Json; using System.Linq; @@ -21,7 +23,7 @@ public partial class InputPort /// public InputPort() { - CustomInit(); + CustomInit(); } /// diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/InputPortType.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/InputPortType.cs index cbdbff530fd4..5335a80af7cd 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/InputPortType.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/InputPortType.cs @@ -1,13 +1,15 @@ -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// +// 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.MachineLearning.WebServices.Models { - using Microsoft.Azure; - using Microsoft.Azure.Management; - using Microsoft.Azure.Management.MachineLearning; - using Microsoft.Azure.Management.MachineLearning.WebServices; /// /// Defines values for InputPortType. diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/MachineLearningWorkspace.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/MachineLearningWorkspace.cs index 303e70af525f..aa5c19c1ba9d 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/MachineLearningWorkspace.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/MachineLearningWorkspace.cs @@ -1,13 +1,15 @@ -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// +// 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.MachineLearning.WebServices.Models { - using Microsoft.Azure; - using Microsoft.Azure.Management; - using Microsoft.Azure.Management.MachineLearning; - using Microsoft.Azure.Management.MachineLearning.WebServices; using Microsoft.Rest; using Newtonsoft.Json; using System.Linq; @@ -23,7 +25,7 @@ public partial class MachineLearningWorkspace /// public MachineLearningWorkspace() { - CustomInit(); + CustomInit(); } /// diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/ModeValueInfo.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/ModeValueInfo.cs index 081d3d19de62..b262c205db3a 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/ModeValueInfo.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/ModeValueInfo.cs @@ -1,13 +1,15 @@ -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// +// 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.MachineLearning.WebServices.Models { - using Microsoft.Azure; - using Microsoft.Azure.Management; - using Microsoft.Azure.Management.MachineLearning; - using Microsoft.Azure.Management.MachineLearning.WebServices; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; @@ -23,7 +25,7 @@ public partial class ModeValueInfo /// public ModeValueInfo() { - CustomInit(); + CustomInit(); } /// diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/ModuleAssetParameter.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/ModuleAssetParameter.cs index f9a4a3875e63..6a8e80b53b49 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/ModuleAssetParameter.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/ModuleAssetParameter.cs @@ -1,13 +1,15 @@ -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// +// 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.MachineLearning.WebServices.Models { - using Microsoft.Azure; - using Microsoft.Azure.Management; - using Microsoft.Azure.Management.MachineLearning; - using Microsoft.Azure.Management.MachineLearning.WebServices; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; @@ -23,7 +25,7 @@ public partial class ModuleAssetParameter /// public ModuleAssetParameter() { - CustomInit(); + CustomInit(); } /// diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/OperationDisplayInfo.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/OperationDisplayInfo.cs new file mode 100644 index 000000000000..bd06c0199bd8 --- /dev/null +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/OperationDisplayInfo.cs @@ -0,0 +1,78 @@ +// +// 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.MachineLearning.WebServices.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The API operation info. + /// + public partial class OperationDisplayInfo + { + /// + /// Initializes a new instance of the OperationDisplayInfo class. + /// + public OperationDisplayInfo() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the OperationDisplayInfo class. + /// + /// The description of the operation. + /// The action that users can perform, based on + /// their permission level. + /// The service provider. + /// The resource on which the operation is + /// performed. + public OperationDisplayInfo(string description = default(string), string operation = default(string), string provider = default(string), string resource = default(string)) + { + Description = description; + Operation = operation; + Provider = provider; + Resource = resource; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the description of the operation. + /// + [JsonProperty(PropertyName = "description")] + public string Description { get; private set; } + + /// + /// Gets the action that users can perform, based on their permission + /// level. + /// + [JsonProperty(PropertyName = "operation")] + public string Operation { get; private set; } + + /// + /// Gets the service provider. + /// + [JsonProperty(PropertyName = "provider")] + public string Provider { get; private set; } + + /// + /// Gets the resource on which the operation is performed. + /// + [JsonProperty(PropertyName = "resource")] + public string Resource { get; private set; } + + } +} diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/OperationEntity.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/OperationEntity.cs new file mode 100644 index 000000000000..badc8d3c0576 --- /dev/null +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/OperationEntity.cs @@ -0,0 +1,60 @@ +// +// 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.MachineLearning.WebServices.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// An API operation. + /// + public partial class OperationEntity + { + /// + /// Initializes a new instance of the OperationEntity class. + /// + public OperationEntity() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the OperationEntity class. + /// + /// Operation name: + /// {provider}/{resource}/{operation}. + /// The API operation info. + public OperationEntity(string name = default(string), OperationDisplayInfo display = default(OperationDisplayInfo)) + { + Name = name; + Display = display; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets operation name: {provider}/{resource}/{operation}. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets or sets the API operation info. + /// + [JsonProperty(PropertyName = "display")] + public OperationDisplayInfo Display { get; set; } + + } +} diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/OutputPort.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/OutputPort.cs index 35beacb2053a..d8f281b57510 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/OutputPort.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/OutputPort.cs @@ -1,13 +1,15 @@ -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// +// 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.MachineLearning.WebServices.Models { - using Microsoft.Azure; - using Microsoft.Azure.Management; - using Microsoft.Azure.Management.MachineLearning; - using Microsoft.Azure.Management.MachineLearning.WebServices; using Newtonsoft.Json; using System.Linq; @@ -21,7 +23,7 @@ public partial class OutputPort /// public OutputPort() { - CustomInit(); + CustomInit(); } /// diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/OutputPortType.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/OutputPortType.cs index aa06b4c27444..7af9ede58d5d 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/OutputPortType.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/OutputPortType.cs @@ -1,13 +1,15 @@ -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// +// 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.MachineLearning.WebServices.Models { - using Microsoft.Azure; - using Microsoft.Azure.Management; - using Microsoft.Azure.Management.MachineLearning; - using Microsoft.Azure.Management.MachineLearning.WebServices; /// /// Defines values for OutputPortType. diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/Page.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/Page.cs index 59eadd37557f..41dcf8e69bc0 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/Page.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/Page.cs @@ -1,13 +1,15 @@ -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// +// 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.MachineLearning.WebServices.Models { - using Microsoft.Azure; - using Microsoft.Azure.Management; - using Microsoft.Azure.Management.MachineLearning; - using Microsoft.Azure.Management.MachineLearning.WebServices; using Microsoft.Rest; using Microsoft.Rest.Azure; using Newtonsoft.Json; @@ -24,7 +26,7 @@ public class Page : IPage /// /// Gets the link to the next page. /// - [JsonProperty("nextLink")] + [JsonProperty("")] public string NextPageLink { get; private set; } [JsonProperty("value")] diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/Page1.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/Page1.cs new file mode 100644 index 000000000000..e0a99dda6b2a --- /dev/null +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/Page1.cs @@ -0,0 +1,53 @@ +// +// 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.MachineLearning.WebServices.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + + /// + /// Defines a page in Azure responses. + /// + /// Type of the page content items + [JsonObject] + public class Page1 : IPage + { + /// + /// Gets the link to the next page. + /// + [JsonProperty("nextLink")] + public string NextPageLink { get; private set; } + + [JsonProperty("value")] + private IList Items{ get; set; } + + /// + /// Returns an enumerator that iterates through the collection. + /// + /// A an enumerator that can be used to iterate through the collection. + public IEnumerator GetEnumerator() + { + return Items == null ? System.Linq.Enumerable.Empty().GetEnumerator() : Items.GetEnumerator(); + } + + /// + /// Returns an enumerator that iterates through the collection. + /// + /// A an enumerator that can be used to iterate through the collection. + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + } +} diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/ParameterType.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/ParameterType.cs index 004c0cdb1e58..763898404ad2 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/ParameterType.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/ParameterType.cs @@ -1,13 +1,15 @@ -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// +// 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.MachineLearning.WebServices.Models { - using Microsoft.Azure; - using Microsoft.Azure.Management; - using Microsoft.Azure.Management.MachineLearning; - using Microsoft.Azure.Management.MachineLearning.WebServices; /// /// Defines values for ParameterType. diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/PatchedResource.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/PatchedResource.cs new file mode 100644 index 000000000000..00567dcd4f13 --- /dev/null +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/PatchedResource.cs @@ -0,0 +1,89 @@ +// +// 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.MachineLearning.WebServices.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Azure resource. + /// + public partial class PatchedResource : IResource + { + /// + /// Initializes a new instance of the PatchedResource class. + /// + public PatchedResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PatchedResource class. + /// + /// Specifies the resource ID. + /// Specifies the name of the resource. + /// Specifies the location of the + /// resource. + /// Specifies the type of the resource. + /// Contains resource tags defined as key/value + /// pairs. + public PatchedResource(string id = default(string), string name = default(string), string location = default(string), string type = default(string), IDictionary tags = default(IDictionary)) + { + Id = id; + Name = name; + Location = location; + Type = type; + Tags = tags; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets specifies the resource ID. + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; private set; } + + /// + /// Gets specifies the name of the resource. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets specifies the location of the resource. + /// + [JsonProperty(PropertyName = "location")] + public string Location { get; private set; } + + /// + /// Gets specifies the type of the resource. + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } + + /// + /// Gets or sets contains resource tags defined as key/value pairs. + /// + [JsonProperty(PropertyName = "tags")] + public IDictionary Tags { get; set; } + + } +} diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/PatchedWebService.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/PatchedWebService.cs new file mode 100644 index 000000000000..68ea35f99189 --- /dev/null +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/PatchedWebService.cs @@ -0,0 +1,76 @@ +// +// 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.MachineLearning.WebServices.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Instance of an Patched Azure ML web service resource. + /// + public partial class PatchedWebService : PatchedResource + { + /// + /// Initializes a new instance of the PatchedWebService class. + /// + public PatchedWebService() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PatchedWebService class. + /// + /// Specifies the resource ID. + /// Specifies the name of the resource. + /// Specifies the location of the + /// resource. + /// Specifies the type of the resource. + /// Contains resource tags defined as key/value + /// pairs. + /// Contains the property payload that + /// describes the web service. + public PatchedWebService(string id = default(string), string name = default(string), string location = default(string), string type = default(string), IDictionary tags = default(IDictionary), WebServiceProperties properties = default(WebServiceProperties)) + : base(id, name, location, type, tags) + { + Properties = properties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets contains the property payload that describes the web + /// service. + /// + [JsonProperty(PropertyName = "properties")] + public WebServiceProperties Properties { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Properties != null) + { + Properties.Validate(); + } + } + } +} diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/ProvisioningState.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/ProvisioningState.cs index 144a6fe04df4..fea33276d254 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/ProvisioningState.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/ProvisioningState.cs @@ -1,13 +1,15 @@ -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// +// 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.MachineLearning.WebServices.Models { - using Microsoft.Azure; - using Microsoft.Azure.Management; - using Microsoft.Azure.Management.MachineLearning; - using Microsoft.Azure.Management.MachineLearning.WebServices; /// /// Defines values for ProvisioningState. diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/RealtimeConfiguration.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/RealtimeConfiguration.cs index 7b095d537b75..488a790fad18 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/RealtimeConfiguration.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/RealtimeConfiguration.cs @@ -1,13 +1,15 @@ -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// +// 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.MachineLearning.WebServices.Models { - using Microsoft.Azure; - using Microsoft.Azure.Management; - using Microsoft.Azure.Management.MachineLearning; - using Microsoft.Azure.Management.MachineLearning.WebServices; using Microsoft.Rest; using Newtonsoft.Json; using System.Linq; @@ -23,7 +25,7 @@ public partial class RealtimeConfiguration /// public RealtimeConfiguration() { - CustomInit(); + CustomInit(); } /// diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/Resource.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/Resource.cs index 892032cfa24d..d54ffba79ab6 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/Resource.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/Resource.cs @@ -1,13 +1,15 @@ -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// +// 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.MachineLearning.WebServices.Models { - using Microsoft.Azure; - using Microsoft.Azure.Management; - using Microsoft.Azure.Management.MachineLearning; - using Microsoft.Azure.Management.MachineLearning.WebServices; using Microsoft.Rest; using Microsoft.Rest.Azure; using Newtonsoft.Json; @@ -25,7 +27,7 @@ public partial class Resource : IResource /// public Resource() { - CustomInit(); + CustomInit(); } /// diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/ServiceInputOutputSpecification.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/ServiceInputOutputSpecification.cs index 96a77fdaf876..476dfc87979d 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/ServiceInputOutputSpecification.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/ServiceInputOutputSpecification.cs @@ -1,13 +1,15 @@ -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// +// 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.MachineLearning.WebServices.Models { - using Microsoft.Azure; - using Microsoft.Azure.Management; - using Microsoft.Azure.Management.MachineLearning; - using Microsoft.Azure.Management.MachineLearning.WebServices; using Microsoft.Rest; using Newtonsoft.Json; using System.Collections; @@ -26,7 +28,7 @@ public partial class ServiceInputOutputSpecification /// public ServiceInputOutputSpecification() { - CustomInit(); + CustomInit(); } /// diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/StorageAccount.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/StorageAccount.cs index 6bbe4e0e7ee9..1a264bd9e2a8 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/StorageAccount.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/StorageAccount.cs @@ -1,13 +1,15 @@ -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// +// 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.MachineLearning.WebServices.Models { - using Microsoft.Azure; - using Microsoft.Azure.Management; - using Microsoft.Azure.Management.MachineLearning; - using Microsoft.Azure.Management.MachineLearning.WebServices; using Newtonsoft.Json; using System.Linq; @@ -21,7 +23,7 @@ public partial class StorageAccount /// public StorageAccount() { - CustomInit(); + CustomInit(); } /// diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/TableSpecification.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/TableSpecification.cs index 5916d2486c4b..dbe126bc7348 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/TableSpecification.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/TableSpecification.cs @@ -1,13 +1,15 @@ -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// +// 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.MachineLearning.WebServices.Models { - using Microsoft.Azure; - using Microsoft.Azure.Management; - using Microsoft.Azure.Management.MachineLearning; - using Microsoft.Azure.Management.MachineLearning.WebServices; using Microsoft.Rest; using Newtonsoft.Json; using System.Collections; @@ -25,7 +27,7 @@ public partial class TableSpecification /// public TableSpecification() { - CustomInit(); + CustomInit(); } /// diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/WebService.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/WebService.cs index 3b6fc2453dca..0b56f3061965 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/WebService.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/WebService.cs @@ -1,13 +1,15 @@ -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// +// 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.MachineLearning.WebServices.Models { - using Microsoft.Azure; - using Microsoft.Azure.Management; - using Microsoft.Azure.Management.MachineLearning; - using Microsoft.Azure.Management.MachineLearning.WebServices; using Microsoft.Rest; using Newtonsoft.Json; using System.Collections; @@ -24,7 +26,7 @@ public partial class WebService : Resource /// public WebService() { - CustomInit(); + CustomInit(); } /// diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/WebServiceKeys.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/WebServiceKeys.cs index 3a1f7e8a1edc..4b3a8a9f4718 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/WebServiceKeys.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/WebServiceKeys.cs @@ -1,13 +1,15 @@ -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// +// 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.MachineLearning.WebServices.Models { - using Microsoft.Azure; - using Microsoft.Azure.Management; - using Microsoft.Azure.Management.MachineLearning; - using Microsoft.Azure.Management.MachineLearning.WebServices; using Newtonsoft.Json; using System.Linq; @@ -21,7 +23,7 @@ public partial class WebServiceKeys /// public WebServiceKeys() { - CustomInit(); + CustomInit(); } /// diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/WebServiceParameter.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/WebServiceParameter.cs index 545c49f699da..e2042c2bef3b 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/WebServiceParameter.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/WebServiceParameter.cs @@ -1,13 +1,15 @@ -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// +// 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.MachineLearning.WebServices.Models { - using Microsoft.Azure; - using Microsoft.Azure.Management; - using Microsoft.Azure.Management.MachineLearning; - using Microsoft.Azure.Management.MachineLearning.WebServices; using Newtonsoft.Json; using System.Linq; @@ -21,7 +23,7 @@ public partial class WebServiceParameter /// public WebServiceParameter() { - CustomInit(); + CustomInit(); } /// diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/WebServiceProperties.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/WebServiceProperties.cs index 197cee34c8d2..759a91f89e12 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/WebServiceProperties.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/WebServiceProperties.cs @@ -1,13 +1,15 @@ -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// +// 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.MachineLearning.WebServices.Models { - using Microsoft.Azure; - using Microsoft.Azure.Management; - using Microsoft.Azure.Management.MachineLearning; - using Microsoft.Azure.Management.MachineLearning.WebServices; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; @@ -23,7 +25,7 @@ public partial class WebServiceProperties /// public WebServiceProperties() { - CustomInit(); + CustomInit(); } /// @@ -95,7 +97,7 @@ public WebServiceProperties() /// determined by adding the size of the Assets, Input, Output, /// Package, Parameters, and the ExampleRequest. /// The URI of the payload blob. This - /// paramater contains a value only if the payloadsInBlobStorage + /// parameter contains a value only if the payloadsInBlobStorage /// parameter is set to true. Otherwise is set to null. public WebServiceProperties(string title = default(string), string description = default(string), System.DateTime? createdOn = default(System.DateTime?), System.DateTime? modifiedOn = default(System.DateTime?), string provisioningState = default(string), WebServiceKeys keys = default(WebServiceKeys), bool? readOnlyProperty = default(bool?), string swaggerLocation = default(string), bool? exposeSampleData = default(bool?), RealtimeConfiguration realtimeConfiguration = default(RealtimeConfiguration), DiagnosticsConfiguration diagnostics = default(DiagnosticsConfiguration), StorageAccount storageAccount = default(StorageAccount), MachineLearningWorkspace machineLearningWorkspace = default(MachineLearningWorkspace), CommitmentPlan commitmentPlan = default(CommitmentPlan), ServiceInputOutputSpecification input = default(ServiceInputOutputSpecification), ServiceInputOutputSpecification output = default(ServiceInputOutputSpecification), ExampleRequest exampleRequest = default(ExampleRequest), IDictionary assets = default(IDictionary), IDictionary parameters = default(IDictionary), bool? payloadsInBlobStorage = default(bool?), BlobLocation payloadsLocation = default(BlobLocation)) { @@ -286,7 +288,7 @@ public WebServiceProperties() public bool? PayloadsInBlobStorage { get; set; } /// - /// Gets or sets the URI of the payload blob. This paramater contains a + /// Gets or sets the URI of the payload blob. This parameter contains a /// value only if the payloadsInBlobStorage parameter is set to true. /// Otherwise is set to null. /// diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/WebServicePropertiesForGraph.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/WebServicePropertiesForGraph.cs index c261e5337216..44c6f8ff079e 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/WebServicePropertiesForGraph.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/WebServicePropertiesForGraph.cs @@ -1,13 +1,15 @@ -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// +// 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.MachineLearning.WebServices.Models { - using Microsoft.Azure; - using Microsoft.Azure.Management; - using Microsoft.Azure.Management.MachineLearning; - using Microsoft.Azure.Management.MachineLearning.WebServices; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; @@ -25,7 +27,7 @@ public partial class WebServicePropertiesForGraph : WebServiceProperties /// public WebServicePropertiesForGraph() { - CustomInit(); + CustomInit(); } /// @@ -98,7 +100,7 @@ public WebServicePropertiesForGraph() /// determined by adding the size of the Assets, Input, Output, /// Package, Parameters, and the ExampleRequest. /// The URI of the payload blob. This - /// paramater contains a value only if the payloadsInBlobStorage + /// parameter contains a value only if the payloadsInBlobStorage /// parameter is set to true. Otherwise is set to null. /// The definition of the graph package making up /// this web service. diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Operations.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Operations.cs new file mode 100644 index 000000000000..2a37dc75aa29 --- /dev/null +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Operations.cs @@ -0,0 +1,227 @@ +// +// 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.MachineLearning.WebServices +{ + 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; + + /// + /// Operations operations. + /// + internal partial class Operations : IServiceOperations, IOperations + { + /// + /// Initializes a new instance of the Operations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal Operations(AzureMLWebServicesManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the AzureMLWebServicesManagementClient + /// + public AzureMLWebServicesManagementClient Client { get; private set; } + + /// + /// Lists all the available REST API operations. + /// + /// + /// 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>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.MachineLearning/operations").ToString(); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.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("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 CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/OperationsExtensions.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/OperationsExtensions.cs new file mode 100644 index 000000000000..3a7a8ec9b98c --- /dev/null +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/OperationsExtensions.cs @@ -0,0 +1,55 @@ +// +// 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.MachineLearning.WebServices +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for Operations. + /// + public static partial class OperationsExtensions + { + /// + /// Lists all the available REST API operations. + /// + /// + /// The operations group for this extension method. + /// + public static IEnumerable List(this IOperations operations) + { + return operations.ListAsync().GetAwaiter().GetResult(); + } + + /// + /// Lists all the available REST API operations. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/SdkInfo_AzureMLWebServicesManagementClient.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/SdkInfo_AzureMLWebServicesManagementClient.cs new file mode 100644 index 000000000000..462ef8a83d1f --- /dev/null +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/SdkInfo_AzureMLWebServicesManagementClient.cs @@ -0,0 +1,28 @@ + +// +// 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.MachineLearning.WebServices +{ + using System; + using System.Collections.Generic; + using System.Linq; + + internal static partial class SdkInfo + { + public static IEnumerable> ApiInfo_AzureMLWebServicesManagementClient + { + get + { + return new Tuple[] + { + new Tuple("MachineLearning", "Operations", "2017-01-01"), + new Tuple("MachineLearning", "WebServices", "2017-01-01"), + }.AsEnumerable(); + } + } + } +} diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/WebServicesOperations.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/WebServicesOperations.cs index 830384b1d781..715676d82175 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/WebServicesOperations.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/WebServicesOperations.cs @@ -1,12 +1,15 @@ -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// +// 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.MachineLearning.WebServices { - using Microsoft.Azure; - using Microsoft.Azure.Management; - using Microsoft.Azure.Management.MachineLearning; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; @@ -302,7 +305,7 @@ internal WebServicesOperations(AzureMLWebServicesManagementClient client) /// /// The cancellation token. /// - public async Task> PatchWithHttpMessagesAsync(string resourceGroupName, string webServiceName, WebService patchPayload, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> PatchWithHttpMessagesAsync(string resourceGroupName, string webServiceName, PatchedWebService patchPayload, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { // Send Request AzureOperationResponse _response = await BeginPatchWithHttpMessagesAsync(resourceGroupName, webServiceName, patchPayload, customHeaders, cancellationToken).ConfigureAwait(false); @@ -733,7 +736,7 @@ internal WebServicesOperations(AzureMLWebServicesManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -919,7 +922,7 @@ internal WebServicesOperations(AzureMLWebServicesManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -1208,7 +1211,7 @@ internal WebServicesOperations(AzureMLWebServicesManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginPatchWithHttpMessagesAsync(string resourceGroupName, string webServiceName, WebService patchPayload, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginPatchWithHttpMessagesAsync(string resourceGroupName, string webServiceName, PatchedWebService patchPayload, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -1706,7 +1709,7 @@ internal WebServicesOperations(AzureMLWebServicesManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 202 && (int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -1927,7 +1930,7 @@ internal WebServicesOperations(AzureMLWebServicesManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -2100,7 +2103,7 @@ internal WebServicesOperations(AzureMLWebServicesManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/WebServicesOperationsExtensions.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/WebServicesOperationsExtensions.cs index 9d1dd4ff5507..4c8a0cc80d3e 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/WebServicesOperationsExtensions.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/WebServicesOperationsExtensions.cs @@ -1,12 +1,15 @@ -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// +// 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.MachineLearning.WebServices { - using Microsoft.Azure; - using Microsoft.Azure.Management; - using Microsoft.Azure.Management.MachineLearning; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; @@ -139,7 +142,7 @@ public static WebService CreateOrUpdate(this IWebServicesOperations operations, /// /// The payload to use to patch the web service. /// - public static WebService Patch(this IWebServicesOperations operations, string resourceGroupName, string webServiceName, WebService patchPayload) + public static WebService Patch(this IWebServicesOperations operations, string resourceGroupName, string webServiceName, PatchedWebService patchPayload) { return operations.PatchAsync(resourceGroupName, webServiceName, patchPayload).GetAwaiter().GetResult(); } @@ -164,7 +167,7 @@ public static WebService Patch(this IWebServicesOperations operations, string re /// /// The cancellation token. /// - public static async Task PatchAsync(this IWebServicesOperations operations, string resourceGroupName, string webServiceName, WebService patchPayload, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task PatchAsync(this IWebServicesOperations operations, string resourceGroupName, string webServiceName, PatchedWebService patchPayload, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.PatchWithHttpMessagesAsync(resourceGroupName, webServiceName, patchPayload, null, cancellationToken).ConfigureAwait(false)) { @@ -448,7 +451,7 @@ public static WebService BeginCreateOrUpdate(this IWebServicesOperations operati /// /// The payload to use to patch the web service. /// - public static WebService BeginPatch(this IWebServicesOperations operations, string resourceGroupName, string webServiceName, WebService patchPayload) + public static WebService BeginPatch(this IWebServicesOperations operations, string resourceGroupName, string webServiceName, PatchedWebService patchPayload) { return operations.BeginPatchAsync(resourceGroupName, webServiceName, patchPayload).GetAwaiter().GetResult(); } @@ -473,7 +476,7 @@ public static WebService BeginPatch(this IWebServicesOperations operations, stri /// /// The cancellation token. /// - public static async Task BeginPatchAsync(this IWebServicesOperations operations, string resourceGroupName, string webServiceName, WebService patchPayload, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginPatchAsync(this IWebServicesOperations operations, string resourceGroupName, string webServiceName, PatchedWebService patchPayload, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.BeginPatchWithHttpMessagesAsync(resourceGroupName, webServiceName, patchPayload, null, cancellationToken).ConfigureAwait(false)) { diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/IMachineLearningWorkspacesManagementClient.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/IMachineLearningWorkspacesManagementClient.cs new file mode 100644 index 000000000000..20956cd5db00 --- /dev/null +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/IMachineLearningWorkspacesManagementClient.cs @@ -0,0 +1,85 @@ +// +// 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.MachineLearning.Workspaces +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + + /// + /// These APIs allow end users to operate on Azure Machine Learning + /// Workspace resources. They support CRUD operations for Azure Machine + /// Learning Workspaces. + /// + public partial interface IMachineLearningWorkspacesManagementClient : System.IDisposable + { + /// + /// The base URI of the service. + /// + System.Uri BaseUri { get; set; } + + /// + /// Gets or sets json serialization settings. + /// + JsonSerializerSettings SerializationSettings { get; } + + /// + /// Gets or sets json deserialization settings. + /// + JsonSerializerSettings DeserializationSettings { get; } + + /// + /// Credentials needed for the client to connect to Azure. + /// + ServiceClientCredentials Credentials { get; } + + /// + /// The Microsoft Azure subscription ID. + /// + string SubscriptionId { get; set; } + + /// + /// The client API version. + /// + string ApiVersion { get; } + + /// + /// The preferred language for the response. + /// + string AcceptLanguage { get; set; } + + /// + /// The retry timeout in seconds for Long Running Operations. Default + /// value is 30. + /// + int? LongRunningOperationRetryTimeout { get; set; } + + /// + /// Whether a unique x-ms-client-request-id should be generated. When + /// set to true a unique x-ms-client-request-id value is generated and + /// included in each request. Default is true. + /// + bool? GenerateClientRequestId { get; set; } + + + /// + /// Gets the IOperations. + /// + IOperations Operations { get; } + + /// + /// Gets the IWorkspacesOperations. + /// + IWorkspacesOperations Workspaces { get; } + + } +} diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/IOperations.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/IOperations.cs new file mode 100644 index 000000000000..e7133f305dcc --- /dev/null +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/IOperations.cs @@ -0,0 +1,47 @@ +// +// 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.MachineLearning.Workspaces +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Operations operations. + /// + public partial interface IOperations + { + /// + /// Lists all of the available Azure Machine Learning Studio REST API + /// operations. + /// + /// + /// 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>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/IWorkspacesOperations.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/IWorkspacesOperations.cs new file mode 100644 index 000000000000..d952edf1dd7b --- /dev/null +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/IWorkspacesOperations.cs @@ -0,0 +1,274 @@ +// +// 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.MachineLearning.Workspaces +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// WorkspacesOperations operations. + /// + public partial interface IWorkspacesOperations + { + /// + /// Gets the properties of the specified machine learning workspace. + /// + /// + /// The name of the resource group to which the machine learning + /// workspace belongs. + /// + /// + /// The name of the machine learning workspace. + /// + /// + /// 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> GetWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates or updates a workspace with the specified parameters. + /// + /// + /// The name of the resource group to which the machine learning + /// workspace belongs. + /// + /// + /// The name of the machine learning workspace. + /// + /// + /// The parameters for creating or updating a machine learning + /// workspace. + /// + /// + /// 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> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Workspace parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes a machine learning workspace. + /// + /// + /// The name of the resource group to which the machine learning + /// workspace belongs. + /// + /// + /// The name of the machine learning workspace. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Updates a machine learning workspace with the specified parameters. + /// + /// + /// The name of the resource group to which the machine learning + /// workspace belongs. + /// + /// + /// The name of the machine learning workspace. + /// + /// + /// The parameters for updating a machine learning workspace. + /// + /// + /// 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> UpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, WorkspaceUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Resync storage keys associated with this workspace. + /// + /// + /// The name of the machine learning workspace. + /// + /// + /// The name of the resource group to which the machine learning + /// workspace belongs. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task ResyncStorageKeysWithHttpMessagesAsync(string workspaceName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// List the authorization keys associated with this workspace. + /// + /// + /// The name of the machine learning workspace. + /// + /// + /// The name of the resource group to which the machine learning + /// workspace belongs. + /// + /// + /// 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> ListWorkspaceKeysWithHttpMessagesAsync(string workspaceName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists all the available machine learning workspaces under the + /// specified resource group. + /// + /// + /// The name of the resource group to which the machine learning + /// workspace belongs. + /// + /// + /// 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>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists all the available machine learning workspaces under the + /// specified subscription. + /// + /// + /// 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>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists all the available machine learning workspaces under the + /// specified resource group. + /// + /// + /// 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>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists all the available machine learning workspaces under the + /// specified subscription. + /// + /// + /// 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>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/MachineLearningWorkspacesManagementClient.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/MachineLearningWorkspacesManagementClient.cs new file mode 100644 index 000000000000..c161ba5d6f51 --- /dev/null +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/MachineLearningWorkspacesManagementClient.cs @@ -0,0 +1,368 @@ +// +// 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.MachineLearning.Workspaces +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Microsoft.Rest.Serialization; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + + /// + /// These APIs allow end users to operate on Azure Machine Learning + /// Workspace resources. They support CRUD operations for Azure Machine + /// Learning Workspaces. + /// + public partial class MachineLearningWorkspacesManagementClient : ServiceClient, IMachineLearningWorkspacesManagementClient, IAzureClient + { + /// + /// The base URI of the service. + /// + public System.Uri BaseUri { get; set; } + + /// + /// Gets or sets json serialization settings. + /// + public JsonSerializerSettings SerializationSettings { get; private set; } + + /// + /// Gets or sets json deserialization settings. + /// + public JsonSerializerSettings DeserializationSettings { get; private set; } + + /// + /// Credentials needed for the client to connect to Azure. + /// + public ServiceClientCredentials Credentials { get; private set; } + + /// + /// The Microsoft Azure subscription ID. + /// + public string SubscriptionId { get; set; } + + /// + /// The client API version. + /// + public string ApiVersion { get; private set; } + + /// + /// The preferred language for the response. + /// + public string AcceptLanguage { get; set; } + + /// + /// The retry timeout in seconds for Long Running Operations. Default value is + /// 30. + /// + public int? LongRunningOperationRetryTimeout { get; set; } + + /// + /// Whether a unique x-ms-client-request-id should be generated. When set to + /// true a unique x-ms-client-request-id value is generated and included in + /// each request. Default is true. + /// + public bool? GenerateClientRequestId { get; set; } + + /// + /// Gets the IOperations. + /// + public virtual IOperations Operations { get; private set; } + + /// + /// Gets the IWorkspacesOperations. + /// + public virtual IWorkspacesOperations Workspaces { get; private set; } + + /// + /// Initializes a new instance of the MachineLearningWorkspacesManagementClient class. + /// + /// + /// HttpClient to be used + /// + /// + /// True: will dispose the provided httpClient on calling MachineLearningWorkspacesManagementClient.Dispose(). False: will not dispose provided httpClient + protected MachineLearningWorkspacesManagementClient(HttpClient httpClient, bool disposeHttpClient) : base(httpClient, disposeHttpClient) + { + Initialize(); + } + + /// + /// Initializes a new instance of the MachineLearningWorkspacesManagementClient class. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + protected MachineLearningWorkspacesManagementClient(params DelegatingHandler[] handlers) : base(handlers) + { + Initialize(); + } + + /// + /// Initializes a new instance of the MachineLearningWorkspacesManagementClient class. + /// + /// + /// Optional. The http client handler used to handle http transport. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + protected MachineLearningWorkspacesManagementClient(HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : base(rootHandler, handlers) + { + Initialize(); + } + + /// + /// Initializes a new instance of the MachineLearningWorkspacesManagementClient class. + /// + /// + /// Optional. The base URI of the service. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + protected MachineLearningWorkspacesManagementClient(System.Uri baseUri, params DelegatingHandler[] handlers) : this(handlers) + { + if (baseUri == null) + { + throw new System.ArgumentNullException("baseUri"); + } + BaseUri = baseUri; + } + + /// + /// Initializes a new instance of the MachineLearningWorkspacesManagementClient class. + /// + /// + /// Optional. The base URI of the service. + /// + /// + /// Optional. The http client handler used to handle http transport. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + protected MachineLearningWorkspacesManagementClient(System.Uri baseUri, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + { + if (baseUri == null) + { + throw new System.ArgumentNullException("baseUri"); + } + BaseUri = baseUri; + } + + /// + /// Initializes a new instance of the MachineLearningWorkspacesManagementClient class. + /// + /// + /// Required. Credentials needed for the client to connect to Azure. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + public MachineLearningWorkspacesManagementClient(ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers) + { + if (credentials == null) + { + throw new System.ArgumentNullException("credentials"); + } + Credentials = credentials; + if (Credentials != null) + { + Credentials.InitializeServiceClient(this); + } + } + + /// + /// Initializes a new instance of the MachineLearningWorkspacesManagementClient class. + /// + /// + /// Required. Credentials needed for the client to connect to Azure. + /// + /// + /// HttpClient to be used + /// + /// + /// True: will dispose the provided httpClient on calling MachineLearningWorkspacesManagementClient.Dispose(). False: will not dispose provided httpClient + /// + /// Thrown when a required parameter is null + /// + public MachineLearningWorkspacesManagementClient(ServiceClientCredentials credentials, HttpClient httpClient, bool disposeHttpClient) : this(httpClient, disposeHttpClient) + { + if (credentials == null) + { + throw new System.ArgumentNullException("credentials"); + } + Credentials = credentials; + if (Credentials != null) + { + Credentials.InitializeServiceClient(this); + } + } + + /// + /// Initializes a new instance of the MachineLearningWorkspacesManagementClient class. + /// + /// + /// Required. Credentials needed for the client to connect to Azure. + /// + /// + /// Optional. The http client handler used to handle http transport. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + public MachineLearningWorkspacesManagementClient(ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + { + if (credentials == null) + { + throw new System.ArgumentNullException("credentials"); + } + Credentials = credentials; + if (Credentials != null) + { + Credentials.InitializeServiceClient(this); + } + } + + /// + /// Initializes a new instance of the MachineLearningWorkspacesManagementClient class. + /// + /// + /// Optional. The base URI of the service. + /// + /// + /// Required. Credentials needed for the client to connect to Azure. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + public MachineLearningWorkspacesManagementClient(System.Uri baseUri, ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers) + { + if (baseUri == null) + { + throw new System.ArgumentNullException("baseUri"); + } + if (credentials == null) + { + throw new System.ArgumentNullException("credentials"); + } + BaseUri = baseUri; + Credentials = credentials; + if (Credentials != null) + { + Credentials.InitializeServiceClient(this); + } + } + + /// + /// Initializes a new instance of the MachineLearningWorkspacesManagementClient class. + /// + /// + /// Optional. The base URI of the service. + /// + /// + /// Required. Credentials needed for the client to connect to Azure. + /// + /// + /// Optional. The http client handler used to handle http transport. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + public MachineLearningWorkspacesManagementClient(System.Uri baseUri, ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + { + if (baseUri == null) + { + throw new System.ArgumentNullException("baseUri"); + } + if (credentials == null) + { + throw new System.ArgumentNullException("credentials"); + } + BaseUri = baseUri; + Credentials = credentials; + if (Credentials != null) + { + Credentials.InitializeServiceClient(this); + } + } + + /// + /// An optional partial-method to perform custom initialization. + /// + partial void CustomInitialize(); + /// + /// Initializes client properties. + /// + private void Initialize() + { + Operations = new Operations(this); + Workspaces = new WorkspacesOperations(this); + BaseUri = new System.Uri("https://management.azure.com"); + ApiVersion = "2016-04-01"; + AcceptLanguage = "en-US"; + LongRunningOperationRetryTimeout = 30; + GenerateClientRequestId = true; + SerializationSettings = new JsonSerializerSettings + { + Formatting = Newtonsoft.Json.Formatting.Indented, + DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, + DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, + NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, + ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, + ContractResolver = new ReadOnlyJsonContractResolver(), + Converters = new List + { + new Iso8601TimeSpanConverter() + } + }; + SerializationSettings.Converters.Add(new TransformationJsonConverter()); + DeserializationSettings = new JsonSerializerSettings + { + DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, + DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, + NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, + ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, + ContractResolver = new ReadOnlyJsonContractResolver(), + Converters = new List + { + new Iso8601TimeSpanConverter() + } + }; + CustomInitialize(); + DeserializationSettings.Converters.Add(new TransformationJsonConverter()); + DeserializationSettings.Converters.Add(new CloudErrorJsonConverter()); + } + } +} diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/Models/ErrorResponse.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/Models/ErrorResponse.cs new file mode 100644 index 000000000000..726875b65fd7 --- /dev/null +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/Models/ErrorResponse.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.MachineLearning.Workspaces.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// The error response send when an operation fails. + /// + public partial class ErrorResponse + { + /// + /// Initializes a new instance of the ErrorResponse class. + /// + public ErrorResponse() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ErrorResponse class. + /// + /// error code + /// error message + public ErrorResponse(string code, string message) + { + Code = code; + Message = message; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets error code + /// + [JsonProperty(PropertyName = "code")] + public string Code { get; set; } + + /// + /// Gets or sets error message + /// + [JsonProperty(PropertyName = "message")] + public string Message { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Code == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Code"); + } + if (Message == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Message"); + } + } + } +} diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/Models/ErrorResponseException.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/Models/ErrorResponseException.cs new file mode 100644 index 000000000000..b8cb0fb9cef2 --- /dev/null +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/Models/ErrorResponseException.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.MachineLearning.Workspaces.Models +{ + using Microsoft.Rest; + + /// + /// Exception thrown for an invalid response with ErrorResponse + /// information. + /// + public partial class ErrorResponseException : 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 ErrorResponse Body { get; set; } + + /// + /// Initializes a new instance of the ErrorResponseException class. + /// + public ErrorResponseException() + { + } + + /// + /// Initializes a new instance of the ErrorResponseException class. + /// + /// The exception message. + public ErrorResponseException(string message) + : this(message, null) + { + } + + /// + /// Initializes a new instance of the ErrorResponseException class. + /// + /// The exception message. + /// Inner exception. + public ErrorResponseException(string message, System.Exception innerException) + : base(message, innerException) + { + } + } +} diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/Models/Operation.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/Models/Operation.cs new file mode 100644 index 000000000000..56b1142d5e51 --- /dev/null +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/Models/Operation.cs @@ -0,0 +1,60 @@ +// +// 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.MachineLearning.Workspaces.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Azure Machine Learning Studio REST API operation + /// + public partial class Operation + { + /// + /// Initializes a new instance of the Operation class. + /// + public Operation() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Operation class. + /// + /// Operation name: + /// {provider}/{resource}/{operation} + /// Display name of operation + public Operation(string name = default(string), OperationDisplay display = default(OperationDisplay)) + { + Name = name; + Display = display; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets operation name: {provider}/{resource}/{operation} + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets display name of operation + /// + [JsonProperty(PropertyName = "display")] + public OperationDisplay Display { get; set; } + + } +} diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/Models/OperationDisplay.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/Models/OperationDisplay.cs new file mode 100644 index 000000000000..4d7ff6ec3ac7 --- /dev/null +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/Models/OperationDisplay.cs @@ -0,0 +1,79 @@ +// +// 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.MachineLearning.Workspaces.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Display name of operation + /// + public partial class OperationDisplay + { + /// + /// Initializes a new instance of the OperationDisplay class. + /// + public OperationDisplay() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the OperationDisplay class. + /// + /// The resource provider name: + /// Microsoft.MachineLearning + /// The resource on which the operation is + /// performed. + /// The operation that users can + /// perform. + /// The description for the + /// 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(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the resource provider name: Microsoft.MachineLearning + /// + [JsonProperty(PropertyName = "provider")] + public string Provider { get; set; } + + /// + /// Gets or sets the resource on which the operation is performed. + /// + [JsonProperty(PropertyName = "resource")] + public string Resource { get; set; } + + /// + /// Gets or sets the operation that users can perform. + /// + [JsonProperty(PropertyName = "operation")] + public string Operation { get; set; } + + /// + /// Gets or sets the description for the operation. + /// + [JsonProperty(PropertyName = "description")] + public string Description { get; set; } + + } +} diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/Models/Page.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/Models/Page.cs new file mode 100644 index 000000000000..4831c9246fe7 --- /dev/null +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/Models/Page.cs @@ -0,0 +1,53 @@ +// +// 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.MachineLearning.Workspaces.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + + /// + /// Defines a page in Azure responses. + /// + /// Type of the page content items + [JsonObject] + public class Page : IPage + { + /// + /// Gets the link to the next page. + /// + [JsonProperty("")] + public string NextPageLink { get; private set; } + + [JsonProperty("value")] + private IList Items{ get; set; } + + /// + /// Returns an enumerator that iterates through the collection. + /// + /// A an enumerator that can be used to iterate through the collection. + public IEnumerator GetEnumerator() + { + return Items == null ? System.Linq.Enumerable.Empty().GetEnumerator() : Items.GetEnumerator(); + } + + /// + /// Returns an enumerator that iterates through the collection. + /// + /// A an enumerator that can be used to iterate through the collection. + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + } +} diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/Models/Page1.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/Models/Page1.cs new file mode 100644 index 000000000000..ef01aaba6929 --- /dev/null +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/Models/Page1.cs @@ -0,0 +1,53 @@ +// +// 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.MachineLearning.Workspaces.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + + /// + /// Defines a page in Azure responses. + /// + /// Type of the page content items + [JsonObject] + public class Page1 : IPage + { + /// + /// Gets the link to the next page. + /// + [JsonProperty("nextLink")] + public string NextPageLink { get; private set; } + + [JsonProperty("value")] + private IList Items{ get; set; } + + /// + /// Returns an enumerator that iterates through the collection. + /// + /// A an enumerator that can be used to iterate through the collection. + public IEnumerator GetEnumerator() + { + return Items == null ? System.Linq.Enumerable.Empty().GetEnumerator() : Items.GetEnumerator(); + } + + /// + /// Returns an enumerator that iterates through the collection. + /// + /// A an enumerator that can be used to iterate through the collection. + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + } +} diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/Models/Resource.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/Models/Resource.cs new file mode 100644 index 000000000000..fb19a06a6bd0 --- /dev/null +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/Models/Resource.cs @@ -0,0 +1,102 @@ +// +// 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.MachineLearning.Workspaces.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// An Azure resource. + /// + public partial class Resource : IResource + { + /// + /// Initializes a new instance of the Resource class. + /// + public Resource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Resource class. + /// + /// The location of the resource. This cannot be + /// changed after the resource is created. + /// The resource ID. + /// The name of the resource. + /// The type of the resource. + /// The tags of the resource. + public Resource(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary)) + { + Id = id; + Name = name; + Type = type; + Location = location; + Tags = tags; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the resource ID. + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; private set; } + + /// + /// Gets the name of the resource. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets the type of the resource. + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } + + /// + /// Gets or sets the location of the resource. This cannot be changed + /// after the resource is created. + /// + [JsonProperty(PropertyName = "location")] + public string Location { get; set; } + + /// + /// Gets or sets the tags of the resource. + /// + [JsonProperty(PropertyName = "tags")] + public IDictionary Tags { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Location == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Location"); + } + } + } +} diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/Models/Workspace.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/Models/Workspace.cs new file mode 100644 index 000000000000..f2acda53a03b --- /dev/null +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/Models/Workspace.cs @@ -0,0 +1,154 @@ +// +// 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.MachineLearning.Workspaces.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// An object that represents a machine learning workspace. + /// + [Rest.Serialization.JsonTransformation] + public partial class Workspace : Resource + { + /// + /// Initializes a new instance of the Workspace class. + /// + public Workspace() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Workspace class. + /// + /// The location of the resource. This cannot be + /// changed after the resource is created. + /// The fully qualified arm id of + /// the storage account associated with this workspace. + /// The email id of the owner for this + /// workspace. + /// The resource ID. + /// The name of the resource. + /// The type of the resource. + /// The tags of the resource. + /// The type of this workspace. Possible + /// values include: 'Production', 'Free', 'Anonymous', 'PaidStandard', + /// 'PaidPremium' + /// The current state of workspace + /// resource. Possible values include: 'Deleted', 'Enabled', + /// 'Disabled', 'Migrated', 'Updated', 'Registered', + /// 'Unregistered' + /// The immutable id associated with this + /// workspace. + /// The creation time for this workspace + /// resource. + /// The regional endpoint for the machine + /// learning studio service which hosts this workspace. + /// The key vault identifier used + /// for encrypted workspaces. + public Workspace(string location, string userStorageAccountId, string ownerEmail, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), WorkspaceType? workspaceType = default(WorkspaceType?), WorkspaceState? workspaceState = default(WorkspaceState?), string workspaceId = default(string), string creationTime = default(string), string studioEndpoint = default(string), string keyVaultIdentifierId = default(string)) + : base(location, id, name, type, tags) + { + UserStorageAccountId = userStorageAccountId; + OwnerEmail = ownerEmail; + WorkspaceType = workspaceType; + WorkspaceState = workspaceState; + WorkspaceId = workspaceId; + CreationTime = creationTime; + StudioEndpoint = studioEndpoint; + KeyVaultIdentifierId = keyVaultIdentifierId; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the fully qualified arm id of the storage account + /// associated with this workspace. + /// + [JsonProperty(PropertyName = "properties.userStorageAccountId")] + public string UserStorageAccountId { get; set; } + + /// + /// Gets or sets the email id of the owner for this workspace. + /// + [JsonProperty(PropertyName = "properties.ownerEmail")] + public string OwnerEmail { get; set; } + + /// + /// Gets the type of this workspace. Possible values include: + /// 'Production', 'Free', 'Anonymous', 'PaidStandard', 'PaidPremium' + /// + [JsonProperty(PropertyName = "properties.workspaceType")] + public WorkspaceType? WorkspaceType { get; private set; } + + /// + /// Gets the current state of workspace resource. Possible values + /// include: 'Deleted', 'Enabled', 'Disabled', 'Migrated', 'Updated', + /// 'Registered', 'Unregistered' + /// + [JsonProperty(PropertyName = "properties.workspaceState")] + public WorkspaceState? WorkspaceState { get; private set; } + + /// + /// Gets the immutable id associated with this workspace. + /// + [JsonProperty(PropertyName = "properties.workspaceId")] + public string WorkspaceId { get; private set; } + + /// + /// Gets the creation time for this workspace resource. + /// + [JsonProperty(PropertyName = "properties.creationTime")] + public string CreationTime { get; private set; } + + /// + /// Gets the regional endpoint for the machine learning studio service + /// which hosts this workspace. + /// + [JsonProperty(PropertyName = "properties.studioEndpoint")] + public string StudioEndpoint { get; private set; } + + /// + /// Gets or sets the key vault identifier used for encrypted + /// workspaces. + /// + [JsonProperty(PropertyName = "properties.keyVaultIdentifierId")] + public string KeyVaultIdentifierId { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + if (UserStorageAccountId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "UserStorageAccountId"); + } + if (OwnerEmail == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "OwnerEmail"); + } + } + } +} diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/Models/WorkspaceKeysResponse.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/Models/WorkspaceKeysResponse.cs new file mode 100644 index 000000000000..f7d53d57cd6d --- /dev/null +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/Models/WorkspaceKeysResponse.cs @@ -0,0 +1,61 @@ +// +// 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.MachineLearning.Workspaces.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Workspace authorization keys for a workspace. + /// + public partial class WorkspaceKeysResponse + { + /// + /// Initializes a new instance of the WorkspaceKeysResponse class. + /// + public WorkspaceKeysResponse() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the WorkspaceKeysResponse class. + /// + /// Primary authorization key for this + /// workspace. + /// Secondary authorization key for this + /// workspace. + public WorkspaceKeysResponse(string primaryToken = default(string), string secondaryToken = default(string)) + { + PrimaryToken = primaryToken; + SecondaryToken = secondaryToken; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets primary authorization key for this workspace. + /// + [JsonProperty(PropertyName = "primaryToken")] + public string PrimaryToken { get; set; } + + /// + /// Gets or sets secondary authorization key for this workspace. + /// + [JsonProperty(PropertyName = "secondaryToken")] + public string SecondaryToken { get; set; } + + } +} diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/Models/WorkspaceState.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/Models/WorkspaceState.cs new file mode 100644 index 000000000000..7397c093770a --- /dev/null +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/Models/WorkspaceState.cs @@ -0,0 +1,90 @@ +// +// 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.MachineLearning.Workspaces.Models +{ + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for WorkspaceState. + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum WorkspaceState + { + [EnumMember(Value = "Deleted")] + Deleted, + [EnumMember(Value = "Enabled")] + Enabled, + [EnumMember(Value = "Disabled")] + Disabled, + [EnumMember(Value = "Migrated")] + Migrated, + [EnumMember(Value = "Updated")] + Updated, + [EnumMember(Value = "Registered")] + Registered, + [EnumMember(Value = "Unregistered")] + Unregistered + } + internal static class WorkspaceStateEnumExtension + { + internal static string ToSerializedValue(this WorkspaceState? value) + { + return value == null ? null : ((WorkspaceState)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this WorkspaceState value) + { + switch( value ) + { + case WorkspaceState.Deleted: + return "Deleted"; + case WorkspaceState.Enabled: + return "Enabled"; + case WorkspaceState.Disabled: + return "Disabled"; + case WorkspaceState.Migrated: + return "Migrated"; + case WorkspaceState.Updated: + return "Updated"; + case WorkspaceState.Registered: + return "Registered"; + case WorkspaceState.Unregistered: + return "Unregistered"; + } + return null; + } + + internal static WorkspaceState? ParseWorkspaceState(this string value) + { + switch( value ) + { + case "Deleted": + return WorkspaceState.Deleted; + case "Enabled": + return WorkspaceState.Enabled; + case "Disabled": + return WorkspaceState.Disabled; + case "Migrated": + return WorkspaceState.Migrated; + case "Updated": + return WorkspaceState.Updated; + case "Registered": + return WorkspaceState.Registered; + case "Unregistered": + return WorkspaceState.Unregistered; + } + return null; + } + } +} diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/Models/WorkspaceType.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/Models/WorkspaceType.cs new file mode 100644 index 000000000000..697dc69f9439 --- /dev/null +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/Models/WorkspaceType.cs @@ -0,0 +1,78 @@ +// +// 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.MachineLearning.Workspaces.Models +{ + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for WorkspaceType. + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum WorkspaceType + { + [EnumMember(Value = "Production")] + Production, + [EnumMember(Value = "Free")] + Free, + [EnumMember(Value = "Anonymous")] + Anonymous, + [EnumMember(Value = "PaidStandard")] + PaidStandard, + [EnumMember(Value = "PaidPremium")] + PaidPremium + } + internal static class WorkspaceTypeEnumExtension + { + internal static string ToSerializedValue(this WorkspaceType? value) + { + return value == null ? null : ((WorkspaceType)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this WorkspaceType value) + { + switch( value ) + { + case WorkspaceType.Production: + return "Production"; + case WorkspaceType.Free: + return "Free"; + case WorkspaceType.Anonymous: + return "Anonymous"; + case WorkspaceType.PaidStandard: + return "PaidStandard"; + case WorkspaceType.PaidPremium: + return "PaidPremium"; + } + return null; + } + + internal static WorkspaceType? ParseWorkspaceType(this string value) + { + switch( value ) + { + case "Production": + return WorkspaceType.Production; + case "Free": + return WorkspaceType.Free; + case "Anonymous": + return WorkspaceType.Anonymous; + case "PaidStandard": + return WorkspaceType.PaidStandard; + case "PaidPremium": + return WorkspaceType.PaidPremium; + } + return null; + } + } +} diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/Models/WorkspaceUpdateParameters.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/Models/WorkspaceUpdateParameters.cs new file mode 100644 index 000000000000..490d970fdb71 --- /dev/null +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/Models/WorkspaceUpdateParameters.cs @@ -0,0 +1,80 @@ +// +// 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.MachineLearning.Workspaces.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The parameters for updating a machine learning workspace. + /// + [Rest.Serialization.JsonTransformation] + public partial class WorkspaceUpdateParameters + { + /// + /// Initializes a new instance of the WorkspaceUpdateParameters class. + /// + public WorkspaceUpdateParameters() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the WorkspaceUpdateParameters class. + /// + /// The resource tags for the machine learning + /// workspace. + /// The current state of workspace + /// resource. Possible values include: 'Deleted', 'Enabled', + /// 'Disabled', 'Migrated', 'Updated', 'Registered', + /// 'Unregistered' + /// The key vault identifier used + /// for encrypted workspaces. + public WorkspaceUpdateParameters(IDictionary tags = default(IDictionary), WorkspaceState? workspaceState = default(WorkspaceState?), string keyVaultIdentifierId = default(string)) + { + Tags = tags; + WorkspaceState = workspaceState; + KeyVaultIdentifierId = keyVaultIdentifierId; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the resource tags for the machine learning workspace. + /// + [JsonProperty(PropertyName = "tags")] + public IDictionary Tags { get; set; } + + /// + /// Gets or sets the current state of workspace resource. Possible + /// values include: 'Deleted', 'Enabled', 'Disabled', 'Migrated', + /// 'Updated', 'Registered', 'Unregistered' + /// + [JsonProperty(PropertyName = "properties.workspaceState")] + public WorkspaceState? WorkspaceState { get; set; } + + /// + /// Gets or sets the key vault identifier used for encrypted + /// workspaces. + /// + [JsonProperty(PropertyName = "properties.keyVaultIdentifierId")] + public string KeyVaultIdentifierId { get; set; } + + } +} diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/Operations.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/Operations.cs new file mode 100644 index 000000000000..06893bf1b75c --- /dev/null +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/Operations.cs @@ -0,0 +1,223 @@ +// +// 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.MachineLearning.Workspaces +{ + 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; + + /// + /// Operations operations. + /// + internal partial class Operations : IServiceOperations, IOperations + { + /// + /// Initializes a new instance of the Operations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal Operations(MachineLearningWorkspacesManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the MachineLearningWorkspacesManagementClient + /// + public MachineLearningWorkspacesManagementClient Client { get; private set; } + + /// + /// Lists all of the available Azure Machine Learning Studio REST API + /// operations. + /// + /// + /// 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>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.MachineLearning/operations").ToString(); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.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("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/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/OperationsExtensions.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/OperationsExtensions.cs new file mode 100644 index 000000000000..319c893bb01a --- /dev/null +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/OperationsExtensions.cs @@ -0,0 +1,57 @@ +// +// 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.MachineLearning.Workspaces +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for Operations. + /// + public static partial class OperationsExtensions + { + /// + /// Lists all of the available Azure Machine Learning Studio REST API + /// operations. + /// + /// + /// The operations group for this extension method. + /// + public static IEnumerable List(this IOperations operations) + { + return operations.ListAsync().GetAwaiter().GetResult(); + } + + /// + /// Lists all of the available Azure Machine Learning Studio REST API + /// operations. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/SdkInfo_MachineLearningWorkspacesManagementClient.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/SdkInfo_MachineLearningWorkspacesManagementClient.cs new file mode 100644 index 000000000000..9d1d92314e01 --- /dev/null +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/SdkInfo_MachineLearningWorkspacesManagementClient.cs @@ -0,0 +1,28 @@ + +// +// 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.MachineLearning.Workspaces +{ + using System; + using System.Collections.Generic; + using System.Linq; + + internal static partial class SdkInfo + { + public static IEnumerable> ApiInfo_MachineLearningWorkspacesManagementClient + { + get + { + return new Tuple[] + { + new Tuple("MachineLearning", "Operations", "2016-04-01"), + new Tuple("MachineLearning", "Workspaces", "2016-04-01"), + }.AsEnumerable(); + } + } + } +} diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/WorkspacesOperations.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/WorkspacesOperations.cs new file mode 100644 index 000000000000..6d5a6e5971c9 --- /dev/null +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/WorkspacesOperations.cs @@ -0,0 +1,1892 @@ +// +// 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.MachineLearning.Workspaces +{ + 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; + + /// + /// WorkspacesOperations operations. + /// + internal partial class WorkspacesOperations : IServiceOperations, IWorkspacesOperations + { + /// + /// Initializes a new instance of the WorkspacesOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal WorkspacesOperations(MachineLearningWorkspacesManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the MachineLearningWorkspacesManagementClient + /// + public MachineLearningWorkspacesManagementClient Client { get; private set; } + + /// + /// Gets the properties of the specified machine learning workspace. + /// + /// + /// The name of the resource group to which the machine learning workspace + /// belongs. + /// + /// + /// The name of the machine learning workspace. + /// + /// + /// 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> GetWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearning/workspaces/{workspaceName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.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("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; + } + + /// + /// Creates or updates a workspace with the specified parameters. + /// + /// + /// The name of the resource group to which the machine learning workspace + /// belongs. + /// + /// + /// The name of the machine learning workspace. + /// + /// + /// The parameters for creating or updating a machine learning workspace. + /// + /// + /// 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> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Workspace parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (parameters != null) + { + parameters.Validate(); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearning/workspaces/{workspaceName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.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("PUT"); + _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(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, 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) + { + 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; + } + + /// + /// Deletes a machine learning workspace. + /// + /// + /// The name of the resource group to which the machine learning workspace + /// belongs. + /// + /// + /// The name of the machine learning workspace. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// 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 DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearning/workspaces/{workspaceName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.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("DELETE"); + _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 && (int)_statusCode != 204) + { + 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(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Updates a machine learning workspace with the specified parameters. + /// + /// + /// The name of the resource group to which the machine learning workspace + /// belongs. + /// + /// + /// The name of the machine learning workspace. + /// + /// + /// The parameters for updating a machine learning workspace. + /// + /// + /// 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> UpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, WorkspaceUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Update", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearning/workspaces/{workspaceName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.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("PATCH"); + _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(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, 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) + { + 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; + } + + /// + /// Resync storage keys associated with this workspace. + /// + /// + /// The name of the machine learning workspace. + /// + /// + /// The name of the resource group to which the machine learning workspace + /// belongs. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// 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 ResyncStorageKeysWithHttpMessagesAsync(string workspaceName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ResyncStorageKeys", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearning/workspaces/{workspaceName}/resyncStorageKeys").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.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; + // 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(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// List the authorization keys associated with this workspace. + /// + /// + /// The name of the machine learning workspace. + /// + /// + /// The name of the resource group to which the machine learning workspace + /// belongs. + /// + /// + /// 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> ListWorkspaceKeysWithHttpMessagesAsync(string workspaceName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListWorkspaceKeys", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearning/workspaces/{workspaceName}/listWorkspaceKeys").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.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; + // 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 all the available machine learning workspaces under the specified + /// resource group. + /// + /// + /// The name of the resource group to which the machine learning workspace + /// belongs. + /// + /// + /// 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>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearning/workspaces").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.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("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 all the available machine learning workspaces under the specified + /// subscription. + /// + /// + /// 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>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.MachineLearning/workspaces").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.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("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 all the available machine learning workspaces under the specified + /// resource group. + /// + /// + /// 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>> ListByResourceGroupNextWithHttpMessagesAsync(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, "ListByResourceGroupNext", 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 all the available machine learning workspaces under the specified + /// subscription. + /// + /// + /// 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>> ListNextWithHttpMessagesAsync(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, "ListNext", 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/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/WorkspacesOperationsExtensions.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/WorkspacesOperationsExtensions.cs new file mode 100644 index 000000000000..bbf1605cc9d0 --- /dev/null +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/WorkspacesOperationsExtensions.cs @@ -0,0 +1,423 @@ +// +// 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.MachineLearning.Workspaces +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for WorkspacesOperations. + /// + public static partial class WorkspacesOperationsExtensions + { + /// + /// Gets the properties of the specified machine learning workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group to which the machine learning workspace + /// belongs. + /// + /// + /// The name of the machine learning workspace. + /// + public static Workspace Get(this IWorkspacesOperations operations, string resourceGroupName, string workspaceName) + { + return operations.GetAsync(resourceGroupName, workspaceName).GetAwaiter().GetResult(); + } + + /// + /// Gets the properties of the specified machine learning workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group to which the machine learning workspace + /// belongs. + /// + /// + /// The name of the machine learning workspace. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IWorkspacesOperations operations, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, workspaceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Creates or updates a workspace with the specified parameters. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group to which the machine learning workspace + /// belongs. + /// + /// + /// The name of the machine learning workspace. + /// + /// + /// The parameters for creating or updating a machine learning workspace. + /// + public static Workspace CreateOrUpdate(this IWorkspacesOperations operations, string resourceGroupName, string workspaceName, Workspace parameters) + { + return operations.CreateOrUpdateAsync(resourceGroupName, workspaceName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates a workspace with the specified parameters. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group to which the machine learning workspace + /// belongs. + /// + /// + /// The name of the machine learning workspace. + /// + /// + /// The parameters for creating or updating a machine learning workspace. + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this IWorkspacesOperations operations, string resourceGroupName, string workspaceName, Workspace parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes a machine learning workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group to which the machine learning workspace + /// belongs. + /// + /// + /// The name of the machine learning workspace. + /// + public static void Delete(this IWorkspacesOperations operations, string resourceGroupName, string workspaceName) + { + operations.DeleteAsync(resourceGroupName, workspaceName).GetAwaiter().GetResult(); + } + + /// + /// Deletes a machine learning workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group to which the machine learning workspace + /// belongs. + /// + /// + /// The name of the machine learning workspace. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this IWorkspacesOperations operations, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Updates a machine learning workspace with the specified parameters. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group to which the machine learning workspace + /// belongs. + /// + /// + /// The name of the machine learning workspace. + /// + /// + /// The parameters for updating a machine learning workspace. + /// + public static Workspace Update(this IWorkspacesOperations operations, string resourceGroupName, string workspaceName, WorkspaceUpdateParameters parameters) + { + return operations.UpdateAsync(resourceGroupName, workspaceName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Updates a machine learning workspace with the specified parameters. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group to which the machine learning workspace + /// belongs. + /// + /// + /// The name of the machine learning workspace. + /// + /// + /// The parameters for updating a machine learning workspace. + /// + /// + /// The cancellation token. + /// + public static async Task UpdateAsync(this IWorkspacesOperations operations, string resourceGroupName, string workspaceName, WorkspaceUpdateParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Resync storage keys associated with this workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the machine learning workspace. + /// + /// + /// The name of the resource group to which the machine learning workspace + /// belongs. + /// + public static void ResyncStorageKeys(this IWorkspacesOperations operations, string workspaceName, string resourceGroupName) + { + operations.ResyncStorageKeysAsync(workspaceName, resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Resync storage keys associated with this workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the machine learning workspace. + /// + /// + /// The name of the resource group to which the machine learning workspace + /// belongs. + /// + /// + /// The cancellation token. + /// + public static async Task ResyncStorageKeysAsync(this IWorkspacesOperations operations, string workspaceName, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.ResyncStorageKeysWithHttpMessagesAsync(workspaceName, resourceGroupName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// List the authorization keys associated with this workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the machine learning workspace. + /// + /// + /// The name of the resource group to which the machine learning workspace + /// belongs. + /// + public static WorkspaceKeysResponse ListWorkspaceKeys(this IWorkspacesOperations operations, string workspaceName, string resourceGroupName) + { + return operations.ListWorkspaceKeysAsync(workspaceName, resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// List the authorization keys associated with this workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the machine learning workspace. + /// + /// + /// The name of the resource group to which the machine learning workspace + /// belongs. + /// + /// + /// The cancellation token. + /// + public static async Task ListWorkspaceKeysAsync(this IWorkspacesOperations operations, string workspaceName, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWorkspaceKeysWithHttpMessagesAsync(workspaceName, resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Lists all the available machine learning workspaces under the specified + /// resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group to which the machine learning workspace + /// belongs. + /// + public static IPage ListByResourceGroup(this IWorkspacesOperations operations, string resourceGroupName) + { + return operations.ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Lists all the available machine learning workspaces under the specified + /// resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group to which the machine learning workspace + /// belongs. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByResourceGroupAsync(this IWorkspacesOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Lists all the available machine learning workspaces under the specified + /// subscription. + /// + /// + /// The operations group for this extension method. + /// + public static IPage List(this IWorkspacesOperations operations) + { + return operations.ListAsync().GetAwaiter().GetResult(); + } + + /// + /// Lists all the available machine learning workspaces under the specified + /// subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IWorkspacesOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Lists all the available machine learning workspaces under the specified + /// resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListByResourceGroupNext(this IWorkspacesOperations operations, string nextPageLink) + { + return operations.ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists all the available machine learning workspaces under the specified + /// resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByResourceGroupNextAsync(this IWorkspacesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Lists all the available machine learning workspaces under the specified + /// subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListNext(this IWorkspacesOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists all the available machine learning workspaces under the specified + /// subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListNextAsync(this IWorkspacesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IPublicIpAddressesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IPublicIPAddressesOperations.cs similarity index 100% rename from sdk/network/Microsoft.Azure.Management.Network/src/Generated/IPublicIpAddressesOperations.cs rename to sdk/network/Microsoft.Azure.Management.Network/src/Generated/IPublicIPAddressesOperations.cs diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IServiceTagsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IServiceTagsOperations.cs index 7aa52a33381d..d6e0a0b50a27 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IServiceTagsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IServiceTagsOperations.cs @@ -27,7 +27,10 @@ public partial interface IServiceTagsOperations /// Gets a list of service tag information resources. /// /// - /// The location. + /// The location that will be used as a reference for version (not as a + /// filter based on location, you will get the list of service tags + /// with prefix details across all regions but limited to the cloud + /// that your subscription belongs to). /// /// /// The headers that will be added to request. diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IVirtualWANsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IVirtualWansOperations.cs similarity index 100% rename from sdk/network/Microsoft.Azure.Management.Network/src/Generated/IVirtualWANsOperations.cs rename to sdk/network/Microsoft.Azure.Management.Network/src/Generated/IVirtualWansOperations.cs diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayFrontendIpConfiguration.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayFrontendIPConfiguration.cs similarity index 100% rename from sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayFrontendIpConfiguration.cs rename to sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayFrontendIPConfiguration.cs diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayIpConfiguration.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayIPConfiguration.cs similarity index 100% rename from sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayIpConfiguration.cs rename to sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayIPConfiguration.cs diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/FrontendIpConfiguration.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/FrontendIPConfiguration.cs similarity index 100% rename from sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/FrontendIpConfiguration.cs rename to sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/FrontendIPConfiguration.cs diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/IpAllocationMethod.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/IPAllocationMethod.cs similarity index 100% rename from sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/IpAllocationMethod.cs rename to sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/IPAllocationMethod.cs diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkInterfaceIpConfiguration.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkInterfaceIPConfiguration.cs similarity index 100% rename from sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkInterfaceIpConfiguration.cs rename to sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkInterfaceIPConfiguration.cs diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PublicIpAddress.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PublicIPAddress.cs similarity index 100% rename from sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PublicIpAddress.cs rename to sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PublicIPAddress.cs diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PublicIpAddressDnsSettings.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PublicIPAddressDnsSettings.cs similarity index 100% rename from sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PublicIpAddressDnsSettings.cs rename to sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PublicIPAddressDnsSettings.cs diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualNetworkGatewayIpConfiguration.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualNetworkGatewayIPConfiguration.cs similarity index 100% rename from sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualNetworkGatewayIpConfiguration.cs rename to sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualNetworkGatewayIPConfiguration.cs diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PublicIpAddressesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PublicIPAddressesOperations.cs similarity index 100% rename from sdk/network/Microsoft.Azure.Management.Network/src/Generated/PublicIpAddressesOperations.cs rename to sdk/network/Microsoft.Azure.Management.Network/src/Generated/PublicIPAddressesOperations.cs diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PublicIpAddressesOperationsExtensions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PublicIPAddressesOperationsExtensions.cs similarity index 100% rename from sdk/network/Microsoft.Azure.Management.Network/src/Generated/PublicIpAddressesOperationsExtensions.cs rename to sdk/network/Microsoft.Azure.Management.Network/src/Generated/PublicIPAddressesOperationsExtensions.cs diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ServiceTagsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ServiceTagsOperations.cs index 6addc5e6580d..cb28c68ff4b4 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ServiceTagsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ServiceTagsOperations.cs @@ -54,7 +54,10 @@ internal ServiceTagsOperations(NetworkManagementClient client) /// Gets a list of service tag information resources. /// /// - /// The location. + /// The location that will be used as a reference for version (not as a filter + /// based on location, you will get the list of service tags with prefix + /// details across all regions but limited to the cloud that your subscription + /// belongs to). /// /// /// Headers that will be added to request. diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ServiceTagsOperationsExtensions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ServiceTagsOperationsExtensions.cs index d575231bde96..be01db34c7b1 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ServiceTagsOperationsExtensions.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ServiceTagsOperationsExtensions.cs @@ -28,7 +28,10 @@ public static partial class ServiceTagsOperationsExtensions /// The operations group for this extension method. /// /// - /// The location. + /// The location that will be used as a reference for version (not as a filter + /// based on location, you will get the list of service tags with prefix + /// details across all regions but limited to the cloud that your subscription + /// belongs to). /// public static ServiceTagsListResult List(this IServiceTagsOperations operations, string location) { @@ -42,7 +45,10 @@ public static ServiceTagsListResult List(this IServiceTagsOperations operations, /// The operations group for this extension method. /// /// - /// The location. + /// The location that will be used as a reference for version (not as a filter + /// based on location, you will get the list of service tags with prefix + /// details across all regions but limited to the cloud that your subscription + /// belongs to). /// /// /// The cancellation token. diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualWANsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualWansOperations.cs similarity index 100% rename from sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualWANsOperations.cs rename to sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualWansOperations.cs diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualWANsOperationsExtensions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualWansOperationsExtensions.cs similarity index 100% rename from sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualWANsOperationsExtensions.cs rename to sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualWansOperationsExtensions.cs diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureFileshareProtectedItem.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureFileshareProtectedItem.cs index 94519b0eb2d3..c2c8d85c7c26 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureFileshareProtectedItem.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureFileshareProtectedItem.cs @@ -53,6 +53,16 @@ public AzureFileshareProtectedItem() /// Create mode to indicate recovery of /// existing soft deleted data source or creation of new data source. /// Possible values include: 'Invalid', 'Default', 'Recover' + /// Time for deferred deletion in + /// UTC + /// Flag to identify whether + /// the DS is scheduled for deferred delete + /// Time remaining before the + /// DS marked for deferred delete is permanently deleted + /// Flag to identify + /// whether the deferred deleted DS is to be purged soon + /// Flag to identify that deferred deleted DS + /// is to be moved into Pause state /// Friendly name of the fileshare /// represented by this backup item. /// Backup status of this backup @@ -69,8 +79,8 @@ public AzureFileshareProtectedItem() /// on this backup item. /// Additional information with this backup /// item. - public AzureFileshareProtectedItem(string backupManagementType = default(string), string workloadType = default(string), string containerName = default(string), string sourceResourceId = default(string), string policyId = default(string), System.DateTime? lastRecoveryPoint = default(System.DateTime?), string backupSetName = default(string), string createMode = default(string), string friendlyName = default(string), string protectionStatus = default(string), string protectionState = default(string), string healthStatus = default(string), string lastBackupStatus = default(string), System.DateTime? lastBackupTime = default(System.DateTime?), AzureFileshareProtectedItemExtendedInfo extendedInfo = default(AzureFileshareProtectedItemExtendedInfo)) - : base(backupManagementType, workloadType, containerName, sourceResourceId, policyId, lastRecoveryPoint, backupSetName, createMode) + public AzureFileshareProtectedItem(string backupManagementType = default(string), string workloadType = default(string), string containerName = default(string), string sourceResourceId = default(string), string policyId = default(string), System.DateTime? lastRecoveryPoint = default(System.DateTime?), string backupSetName = default(string), string createMode = default(string), System.DateTime? deferredDeleteTimeInUTC = default(System.DateTime?), bool? isScheduledForDeferredDelete = default(bool?), string deferredDeleteTimeRemaining = default(string), bool? isDeferredDeleteScheduleUpcoming = default(bool?), bool? isRehydrate = default(bool?), string friendlyName = default(string), string protectionStatus = default(string), string protectionState = default(string), string healthStatus = default(string), string lastBackupStatus = default(string), System.DateTime? lastBackupTime = default(System.DateTime?), AzureFileshareProtectedItemExtendedInfo extendedInfo = default(AzureFileshareProtectedItemExtendedInfo)) + : base(backupManagementType, workloadType, containerName, sourceResourceId, policyId, lastRecoveryPoint, backupSetName, createMode, deferredDeleteTimeInUTC, isScheduledForDeferredDelete, deferredDeleteTimeRemaining, isDeferredDeleteScheduleUpcoming, isRehydrate) { FriendlyName = friendlyName; ProtectionStatus = protectionStatus; diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureIaaSClassicComputeVMProtectedItem.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureIaaSClassicComputeVMProtectedItem.cs index 1ea077f3a29a..bf2f99a60239 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureIaaSClassicComputeVMProtectedItem.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureIaaSClassicComputeVMProtectedItem.cs @@ -56,6 +56,16 @@ public AzureIaaSClassicComputeVMProtectedItem() /// Create mode to indicate recovery of /// existing soft deleted data source or creation of new data source. /// Possible values include: 'Invalid', 'Default', 'Recover' + /// Time for deferred deletion in + /// UTC + /// Flag to identify whether + /// the DS is scheduled for deferred delete + /// Time remaining before the + /// DS marked for deferred delete is permanently deleted + /// Flag to identify + /// whether the deferred deleted DS is to be purged soon + /// Flag to identify that deferred deleted DS + /// is to be moved into Pause state /// Friendly name of the VM represented by /// this backup item. /// Fully qualified ARM ID of the @@ -78,8 +88,8 @@ public AzureIaaSClassicComputeVMProtectedItem() /// item. /// Additional information for this backup /// item. - public AzureIaaSClassicComputeVMProtectedItem(string backupManagementType = default(string), string workloadType = default(string), string containerName = default(string), string sourceResourceId = default(string), string policyId = default(string), System.DateTime? lastRecoveryPoint = default(System.DateTime?), string backupSetName = default(string), string createMode = default(string), string friendlyName = default(string), string virtualMachineId = default(string), string protectionStatus = default(string), string protectionState = default(string), string healthStatus = default(string), IList healthDetails = default(IList), string lastBackupStatus = default(string), System.DateTime? lastBackupTime = default(System.DateTime?), string protectedItemDataId = default(string), AzureIaaSVMProtectedItemExtendedInfo extendedInfo = default(AzureIaaSVMProtectedItemExtendedInfo)) - : base(backupManagementType, workloadType, containerName, sourceResourceId, policyId, lastRecoveryPoint, backupSetName, createMode, friendlyName, virtualMachineId, protectionStatus, protectionState, healthStatus, healthDetails, lastBackupStatus, lastBackupTime, protectedItemDataId, extendedInfo) + public AzureIaaSClassicComputeVMProtectedItem(string backupManagementType = default(string), string workloadType = default(string), string containerName = default(string), string sourceResourceId = default(string), string policyId = default(string), System.DateTime? lastRecoveryPoint = default(System.DateTime?), string backupSetName = default(string), string createMode = default(string), System.DateTime? deferredDeleteTimeInUTC = default(System.DateTime?), bool? isScheduledForDeferredDelete = default(bool?), string deferredDeleteTimeRemaining = default(string), bool? isDeferredDeleteScheduleUpcoming = default(bool?), bool? isRehydrate = default(bool?), string friendlyName = default(string), string virtualMachineId = default(string), string protectionStatus = default(string), string protectionState = default(string), string healthStatus = default(string), IList healthDetails = default(IList), string lastBackupStatus = default(string), System.DateTime? lastBackupTime = default(System.DateTime?), string protectedItemDataId = default(string), AzureIaaSVMProtectedItemExtendedInfo extendedInfo = default(AzureIaaSVMProtectedItemExtendedInfo)) + : base(backupManagementType, workloadType, containerName, sourceResourceId, policyId, lastRecoveryPoint, backupSetName, createMode, deferredDeleteTimeInUTC, isScheduledForDeferredDelete, deferredDeleteTimeRemaining, isDeferredDeleteScheduleUpcoming, isRehydrate, friendlyName, virtualMachineId, protectionStatus, protectionState, healthStatus, healthDetails, lastBackupStatus, lastBackupTime, protectedItemDataId, extendedInfo) { CustomInit(); } diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureIaaSComputeVMProtectedItem.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureIaaSComputeVMProtectedItem.cs index c4480f4bcfb8..d80bdc2370cc 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureIaaSComputeVMProtectedItem.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureIaaSComputeVMProtectedItem.cs @@ -56,6 +56,16 @@ public AzureIaaSComputeVMProtectedItem() /// Create mode to indicate recovery of /// existing soft deleted data source or creation of new data source. /// Possible values include: 'Invalid', 'Default', 'Recover' + /// Time for deferred deletion in + /// UTC + /// Flag to identify whether + /// the DS is scheduled for deferred delete + /// Time remaining before the + /// DS marked for deferred delete is permanently deleted + /// Flag to identify + /// whether the deferred deleted DS is to be purged soon + /// Flag to identify that deferred deleted DS + /// is to be moved into Pause state /// Friendly name of the VM represented by /// this backup item. /// Fully qualified ARM ID of the @@ -78,8 +88,8 @@ public AzureIaaSComputeVMProtectedItem() /// item. /// Additional information for this backup /// item. - public AzureIaaSComputeVMProtectedItem(string backupManagementType = default(string), string workloadType = default(string), string containerName = default(string), string sourceResourceId = default(string), string policyId = default(string), System.DateTime? lastRecoveryPoint = default(System.DateTime?), string backupSetName = default(string), string createMode = default(string), string friendlyName = default(string), string virtualMachineId = default(string), string protectionStatus = default(string), string protectionState = default(string), string healthStatus = default(string), IList healthDetails = default(IList), string lastBackupStatus = default(string), System.DateTime? lastBackupTime = default(System.DateTime?), string protectedItemDataId = default(string), AzureIaaSVMProtectedItemExtendedInfo extendedInfo = default(AzureIaaSVMProtectedItemExtendedInfo)) - : base(backupManagementType, workloadType, containerName, sourceResourceId, policyId, lastRecoveryPoint, backupSetName, createMode, friendlyName, virtualMachineId, protectionStatus, protectionState, healthStatus, healthDetails, lastBackupStatus, lastBackupTime, protectedItemDataId, extendedInfo) + public AzureIaaSComputeVMProtectedItem(string backupManagementType = default(string), string workloadType = default(string), string containerName = default(string), string sourceResourceId = default(string), string policyId = default(string), System.DateTime? lastRecoveryPoint = default(System.DateTime?), string backupSetName = default(string), string createMode = default(string), System.DateTime? deferredDeleteTimeInUTC = default(System.DateTime?), bool? isScheduledForDeferredDelete = default(bool?), string deferredDeleteTimeRemaining = default(string), bool? isDeferredDeleteScheduleUpcoming = default(bool?), bool? isRehydrate = default(bool?), string friendlyName = default(string), string virtualMachineId = default(string), string protectionStatus = default(string), string protectionState = default(string), string healthStatus = default(string), IList healthDetails = default(IList), string lastBackupStatus = default(string), System.DateTime? lastBackupTime = default(System.DateTime?), string protectedItemDataId = default(string), AzureIaaSVMProtectedItemExtendedInfo extendedInfo = default(AzureIaaSVMProtectedItemExtendedInfo)) + : base(backupManagementType, workloadType, containerName, sourceResourceId, policyId, lastRecoveryPoint, backupSetName, createMode, deferredDeleteTimeInUTC, isScheduledForDeferredDelete, deferredDeleteTimeRemaining, isDeferredDeleteScheduleUpcoming, isRehydrate, friendlyName, virtualMachineId, protectionStatus, protectionState, healthStatus, healthDetails, lastBackupStatus, lastBackupTime, protectedItemDataId, extendedInfo) { CustomInit(); } diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureIaaSVMProtectedItem.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureIaaSVMProtectedItem.cs index 95879a770199..3337a47f2e91 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureIaaSVMProtectedItem.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureIaaSVMProtectedItem.cs @@ -52,6 +52,16 @@ public AzureIaaSVMProtectedItem() /// Create mode to indicate recovery of /// existing soft deleted data source or creation of new data source. /// Possible values include: 'Invalid', 'Default', 'Recover' + /// Time for deferred deletion in + /// UTC + /// Flag to identify whether + /// the DS is scheduled for deferred delete + /// Time remaining before the + /// DS marked for deferred delete is permanently deleted + /// Flag to identify + /// whether the deferred deleted DS is to be purged soon + /// Flag to identify that deferred deleted DS + /// is to be moved into Pause state /// Friendly name of the VM represented by /// this backup item. /// Fully qualified ARM ID of the @@ -74,8 +84,8 @@ public AzureIaaSVMProtectedItem() /// item. /// Additional information for this backup /// item. - public AzureIaaSVMProtectedItem(string backupManagementType = default(string), string workloadType = default(string), string containerName = default(string), string sourceResourceId = default(string), string policyId = default(string), System.DateTime? lastRecoveryPoint = default(System.DateTime?), string backupSetName = default(string), string createMode = default(string), string friendlyName = default(string), string virtualMachineId = default(string), string protectionStatus = default(string), string protectionState = default(string), string healthStatus = default(string), IList healthDetails = default(IList), string lastBackupStatus = default(string), System.DateTime? lastBackupTime = default(System.DateTime?), string protectedItemDataId = default(string), AzureIaaSVMProtectedItemExtendedInfo extendedInfo = default(AzureIaaSVMProtectedItemExtendedInfo)) - : base(backupManagementType, workloadType, containerName, sourceResourceId, policyId, lastRecoveryPoint, backupSetName, createMode) + public AzureIaaSVMProtectedItem(string backupManagementType = default(string), string workloadType = default(string), string containerName = default(string), string sourceResourceId = default(string), string policyId = default(string), System.DateTime? lastRecoveryPoint = default(System.DateTime?), string backupSetName = default(string), string createMode = default(string), System.DateTime? deferredDeleteTimeInUTC = default(System.DateTime?), bool? isScheduledForDeferredDelete = default(bool?), string deferredDeleteTimeRemaining = default(string), bool? isDeferredDeleteScheduleUpcoming = default(bool?), bool? isRehydrate = default(bool?), string friendlyName = default(string), string virtualMachineId = default(string), string protectionStatus = default(string), string protectionState = default(string), string healthStatus = default(string), IList healthDetails = default(IList), string lastBackupStatus = default(string), System.DateTime? lastBackupTime = default(System.DateTime?), string protectedItemDataId = default(string), AzureIaaSVMProtectedItemExtendedInfo extendedInfo = default(AzureIaaSVMProtectedItemExtendedInfo)) + : base(backupManagementType, workloadType, containerName, sourceResourceId, policyId, lastRecoveryPoint, backupSetName, createMode, deferredDeleteTimeInUTC, isScheduledForDeferredDelete, deferredDeleteTimeRemaining, isDeferredDeleteScheduleUpcoming, isRehydrate) { FriendlyName = friendlyName; VirtualMachineId = virtualMachineId; diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureSqlProtectedItem.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureSqlProtectedItem.cs index 669052315ed7..85ec7328e3bd 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureSqlProtectedItem.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureSqlProtectedItem.cs @@ -51,6 +51,16 @@ public AzureSqlProtectedItem() /// Create mode to indicate recovery of /// existing soft deleted data source or creation of new data source. /// Possible values include: 'Invalid', 'Default', 'Recover' + /// Time for deferred deletion in + /// UTC + /// Flag to identify whether + /// the DS is scheduled for deferred delete + /// Time remaining before the + /// DS marked for deferred delete is permanently deleted + /// Flag to identify + /// whether the deferred deleted DS is to be purged soon + /// Flag to identify that deferred deleted DS + /// is to be moved into Pause state /// Internal ID of a backup item. /// Used by Azure SQL Backup engine to contact Recovery /// Services. @@ -59,8 +69,8 @@ public AzureSqlProtectedItem() /// 'ProtectionError', 'ProtectionStopped', 'ProtectionPaused' /// Additional information for this backup /// item. - public AzureSqlProtectedItem(string backupManagementType = default(string), string workloadType = default(string), string containerName = default(string), string sourceResourceId = default(string), string policyId = default(string), System.DateTime? lastRecoveryPoint = default(System.DateTime?), string backupSetName = default(string), string createMode = default(string), string protectedItemDataId = default(string), string protectionState = default(string), AzureSqlProtectedItemExtendedInfo extendedInfo = default(AzureSqlProtectedItemExtendedInfo)) - : base(backupManagementType, workloadType, containerName, sourceResourceId, policyId, lastRecoveryPoint, backupSetName, createMode) + public AzureSqlProtectedItem(string backupManagementType = default(string), string workloadType = default(string), string containerName = default(string), string sourceResourceId = default(string), string policyId = default(string), System.DateTime? lastRecoveryPoint = default(System.DateTime?), string backupSetName = default(string), string createMode = default(string), System.DateTime? deferredDeleteTimeInUTC = default(System.DateTime?), bool? isScheduledForDeferredDelete = default(bool?), string deferredDeleteTimeRemaining = default(string), bool? isDeferredDeleteScheduleUpcoming = default(bool?), bool? isRehydrate = default(bool?), string protectedItemDataId = default(string), string protectionState = default(string), AzureSqlProtectedItemExtendedInfo extendedInfo = default(AzureSqlProtectedItemExtendedInfo)) + : base(backupManagementType, workloadType, containerName, sourceResourceId, policyId, lastRecoveryPoint, backupSetName, createMode, deferredDeleteTimeInUTC, isScheduledForDeferredDelete, deferredDeleteTimeRemaining, isDeferredDeleteScheduleUpcoming, isRehydrate) { ProtectedItemDataId = protectedItemDataId; ProtectionState = protectionState; diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadProtectedItem.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadProtectedItem.cs index 478c65683d25..e8052c6c4d48 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadProtectedItem.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadProtectedItem.cs @@ -52,6 +52,16 @@ public AzureVmWorkloadProtectedItem() /// Create mode to indicate recovery of /// existing soft deleted data source or creation of new data source. /// Possible values include: 'Invalid', 'Default', 'Recover' + /// Time for deferred deletion in + /// UTC + /// Flag to identify whether + /// the DS is scheduled for deferred delete + /// Time remaining before the + /// DS marked for deferred delete is permanently deleted + /// Flag to identify + /// whether the deferred deleted DS is to be purged soon + /// Flag to identify that deferred deleted DS + /// is to be moved into Pause state /// Friendly name of the DB represented by /// this backup item. /// Host/Cluster Name for instance or @@ -80,8 +90,8 @@ public AzureVmWorkloadProtectedItem() /// 'IRPending' /// Additional information for this backup /// item. - public AzureVmWorkloadProtectedItem(string backupManagementType = default(string), string workloadType = default(string), string containerName = default(string), string sourceResourceId = default(string), string policyId = default(string), System.DateTime? lastRecoveryPoint = default(System.DateTime?), string backupSetName = default(string), string createMode = default(string), string friendlyName = default(string), string serverName = default(string), string parentName = default(string), string parentType = default(string), string protectionStatus = default(string), string protectionState = default(string), string lastBackupStatus = default(string), System.DateTime? lastBackupTime = default(System.DateTime?), ErrorDetail lastBackupErrorDetail = default(ErrorDetail), string protectedItemDataSourceId = default(string), string protectedItemHealthStatus = default(string), AzureVmWorkloadProtectedItemExtendedInfo extendedInfo = default(AzureVmWorkloadProtectedItemExtendedInfo)) - : base(backupManagementType, workloadType, containerName, sourceResourceId, policyId, lastRecoveryPoint, backupSetName, createMode) + public AzureVmWorkloadProtectedItem(string backupManagementType = default(string), string workloadType = default(string), string containerName = default(string), string sourceResourceId = default(string), string policyId = default(string), System.DateTime? lastRecoveryPoint = default(System.DateTime?), string backupSetName = default(string), string createMode = default(string), System.DateTime? deferredDeleteTimeInUTC = default(System.DateTime?), bool? isScheduledForDeferredDelete = default(bool?), string deferredDeleteTimeRemaining = default(string), bool? isDeferredDeleteScheduleUpcoming = default(bool?), bool? isRehydrate = default(bool?), string friendlyName = default(string), string serverName = default(string), string parentName = default(string), string parentType = default(string), string protectionStatus = default(string), string protectionState = default(string), string lastBackupStatus = default(string), System.DateTime? lastBackupTime = default(System.DateTime?), ErrorDetail lastBackupErrorDetail = default(ErrorDetail), string protectedItemDataSourceId = default(string), string protectedItemHealthStatus = default(string), AzureVmWorkloadProtectedItemExtendedInfo extendedInfo = default(AzureVmWorkloadProtectedItemExtendedInfo)) + : base(backupManagementType, workloadType, containerName, sourceResourceId, policyId, lastRecoveryPoint, backupSetName, createMode, deferredDeleteTimeInUTC, isScheduledForDeferredDelete, deferredDeleteTimeRemaining, isDeferredDeleteScheduleUpcoming, isRehydrate) { FriendlyName = friendlyName; ServerName = serverName; diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadSAPAseDatabaseProtectedItem.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadSAPAseDatabaseProtectedItem.cs index 576c85be0e43..9b9daea48047 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadSAPAseDatabaseProtectedItem.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadSAPAseDatabaseProtectedItem.cs @@ -54,6 +54,16 @@ public AzureVmWorkloadSAPAseDatabaseProtectedItem() /// Create mode to indicate recovery of /// existing soft deleted data source or creation of new data source. /// Possible values include: 'Invalid', 'Default', 'Recover' + /// Time for deferred deletion in + /// UTC + /// Flag to identify whether + /// the DS is scheduled for deferred delete + /// Time remaining before the + /// DS marked for deferred delete is permanently deleted + /// Flag to identify + /// whether the deferred deleted DS is to be purged soon + /// Flag to identify that deferred deleted DS + /// is to be moved into Pause state /// Friendly name of the DB represented by /// this backup item. /// Host/Cluster Name for instance or @@ -82,8 +92,8 @@ public AzureVmWorkloadSAPAseDatabaseProtectedItem() /// 'IRPending' /// Additional information for this backup /// item. - public AzureVmWorkloadSAPAseDatabaseProtectedItem(string backupManagementType = default(string), string workloadType = default(string), string containerName = default(string), string sourceResourceId = default(string), string policyId = default(string), System.DateTime? lastRecoveryPoint = default(System.DateTime?), string backupSetName = default(string), string createMode = default(string), string friendlyName = default(string), string serverName = default(string), string parentName = default(string), string parentType = default(string), string protectionStatus = default(string), string protectionState = default(string), string lastBackupStatus = default(string), System.DateTime? lastBackupTime = default(System.DateTime?), ErrorDetail lastBackupErrorDetail = default(ErrorDetail), string protectedItemDataSourceId = default(string), string protectedItemHealthStatus = default(string), AzureVmWorkloadProtectedItemExtendedInfo extendedInfo = default(AzureVmWorkloadProtectedItemExtendedInfo)) - : base(backupManagementType, workloadType, containerName, sourceResourceId, policyId, lastRecoveryPoint, backupSetName, createMode, friendlyName, serverName, parentName, parentType, protectionStatus, protectionState, lastBackupStatus, lastBackupTime, lastBackupErrorDetail, protectedItemDataSourceId, protectedItemHealthStatus, extendedInfo) + public AzureVmWorkloadSAPAseDatabaseProtectedItem(string backupManagementType = default(string), string workloadType = default(string), string containerName = default(string), string sourceResourceId = default(string), string policyId = default(string), System.DateTime? lastRecoveryPoint = default(System.DateTime?), string backupSetName = default(string), string createMode = default(string), System.DateTime? deferredDeleteTimeInUTC = default(System.DateTime?), bool? isScheduledForDeferredDelete = default(bool?), string deferredDeleteTimeRemaining = default(string), bool? isDeferredDeleteScheduleUpcoming = default(bool?), bool? isRehydrate = default(bool?), string friendlyName = default(string), string serverName = default(string), string parentName = default(string), string parentType = default(string), string protectionStatus = default(string), string protectionState = default(string), string lastBackupStatus = default(string), System.DateTime? lastBackupTime = default(System.DateTime?), ErrorDetail lastBackupErrorDetail = default(ErrorDetail), string protectedItemDataSourceId = default(string), string protectedItemHealthStatus = default(string), AzureVmWorkloadProtectedItemExtendedInfo extendedInfo = default(AzureVmWorkloadProtectedItemExtendedInfo)) + : base(backupManagementType, workloadType, containerName, sourceResourceId, policyId, lastRecoveryPoint, backupSetName, createMode, deferredDeleteTimeInUTC, isScheduledForDeferredDelete, deferredDeleteTimeRemaining, isDeferredDeleteScheduleUpcoming, isRehydrate, friendlyName, serverName, parentName, parentType, protectionStatus, protectionState, lastBackupStatus, lastBackupTime, lastBackupErrorDetail, protectedItemDataSourceId, protectedItemHealthStatus, extendedInfo) { CustomInit(); } diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadSAPHanaDatabaseProtectedItem.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadSAPHanaDatabaseProtectedItem.cs index bb0f054516c5..2a0487a257ab 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadSAPHanaDatabaseProtectedItem.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadSAPHanaDatabaseProtectedItem.cs @@ -54,6 +54,16 @@ public AzureVmWorkloadSAPHanaDatabaseProtectedItem() /// Create mode to indicate recovery of /// existing soft deleted data source or creation of new data source. /// Possible values include: 'Invalid', 'Default', 'Recover' + /// Time for deferred deletion in + /// UTC + /// Flag to identify whether + /// the DS is scheduled for deferred delete + /// Time remaining before the + /// DS marked for deferred delete is permanently deleted + /// Flag to identify + /// whether the deferred deleted DS is to be purged soon + /// Flag to identify that deferred deleted DS + /// is to be moved into Pause state /// Friendly name of the DB represented by /// this backup item. /// Host/Cluster Name for instance or @@ -82,8 +92,8 @@ public AzureVmWorkloadSAPHanaDatabaseProtectedItem() /// 'IRPending' /// Additional information for this backup /// item. - public AzureVmWorkloadSAPHanaDatabaseProtectedItem(string backupManagementType = default(string), string workloadType = default(string), string containerName = default(string), string sourceResourceId = default(string), string policyId = default(string), System.DateTime? lastRecoveryPoint = default(System.DateTime?), string backupSetName = default(string), string createMode = default(string), string friendlyName = default(string), string serverName = default(string), string parentName = default(string), string parentType = default(string), string protectionStatus = default(string), string protectionState = default(string), string lastBackupStatus = default(string), System.DateTime? lastBackupTime = default(System.DateTime?), ErrorDetail lastBackupErrorDetail = default(ErrorDetail), string protectedItemDataSourceId = default(string), string protectedItemHealthStatus = default(string), AzureVmWorkloadProtectedItemExtendedInfo extendedInfo = default(AzureVmWorkloadProtectedItemExtendedInfo)) - : base(backupManagementType, workloadType, containerName, sourceResourceId, policyId, lastRecoveryPoint, backupSetName, createMode, friendlyName, serverName, parentName, parentType, protectionStatus, protectionState, lastBackupStatus, lastBackupTime, lastBackupErrorDetail, protectedItemDataSourceId, protectedItemHealthStatus, extendedInfo) + public AzureVmWorkloadSAPHanaDatabaseProtectedItem(string backupManagementType = default(string), string workloadType = default(string), string containerName = default(string), string sourceResourceId = default(string), string policyId = default(string), System.DateTime? lastRecoveryPoint = default(System.DateTime?), string backupSetName = default(string), string createMode = default(string), System.DateTime? deferredDeleteTimeInUTC = default(System.DateTime?), bool? isScheduledForDeferredDelete = default(bool?), string deferredDeleteTimeRemaining = default(string), bool? isDeferredDeleteScheduleUpcoming = default(bool?), bool? isRehydrate = default(bool?), string friendlyName = default(string), string serverName = default(string), string parentName = default(string), string parentType = default(string), string protectionStatus = default(string), string protectionState = default(string), string lastBackupStatus = default(string), System.DateTime? lastBackupTime = default(System.DateTime?), ErrorDetail lastBackupErrorDetail = default(ErrorDetail), string protectedItemDataSourceId = default(string), string protectedItemHealthStatus = default(string), AzureVmWorkloadProtectedItemExtendedInfo extendedInfo = default(AzureVmWorkloadProtectedItemExtendedInfo)) + : base(backupManagementType, workloadType, containerName, sourceResourceId, policyId, lastRecoveryPoint, backupSetName, createMode, deferredDeleteTimeInUTC, isScheduledForDeferredDelete, deferredDeleteTimeRemaining, isDeferredDeleteScheduleUpcoming, isRehydrate, friendlyName, serverName, parentName, parentType, protectionStatus, protectionState, lastBackupStatus, lastBackupTime, lastBackupErrorDetail, protectedItemDataSourceId, protectedItemHealthStatus, extendedInfo) { CustomInit(); } diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadSQLDatabaseProtectedItem.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadSQLDatabaseProtectedItem.cs index 4ceed98a1b6a..bae47ebdf55c 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadSQLDatabaseProtectedItem.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadSQLDatabaseProtectedItem.cs @@ -53,6 +53,16 @@ public AzureVmWorkloadSQLDatabaseProtectedItem() /// Create mode to indicate recovery of /// existing soft deleted data source or creation of new data source. /// Possible values include: 'Invalid', 'Default', 'Recover' + /// Time for deferred deletion in + /// UTC + /// Flag to identify whether + /// the DS is scheduled for deferred delete + /// Time remaining before the + /// DS marked for deferred delete is permanently deleted + /// Flag to identify + /// whether the deferred deleted DS is to be purged soon + /// Flag to identify that deferred deleted DS + /// is to be moved into Pause state /// Friendly name of the DB represented by /// this backup item. /// Host/Cluster Name for instance or @@ -81,8 +91,8 @@ public AzureVmWorkloadSQLDatabaseProtectedItem() /// 'IRPending' /// Additional information for this backup /// item. - public AzureVmWorkloadSQLDatabaseProtectedItem(string backupManagementType = default(string), string workloadType = default(string), string containerName = default(string), string sourceResourceId = default(string), string policyId = default(string), System.DateTime? lastRecoveryPoint = default(System.DateTime?), string backupSetName = default(string), string createMode = default(string), string friendlyName = default(string), string serverName = default(string), string parentName = default(string), string parentType = default(string), string protectionStatus = default(string), string protectionState = default(string), string lastBackupStatus = default(string), System.DateTime? lastBackupTime = default(System.DateTime?), ErrorDetail lastBackupErrorDetail = default(ErrorDetail), string protectedItemDataSourceId = default(string), string protectedItemHealthStatus = default(string), AzureVmWorkloadProtectedItemExtendedInfo extendedInfo = default(AzureVmWorkloadProtectedItemExtendedInfo)) - : base(backupManagementType, workloadType, containerName, sourceResourceId, policyId, lastRecoveryPoint, backupSetName, createMode, friendlyName, serverName, parentName, parentType, protectionStatus, protectionState, lastBackupStatus, lastBackupTime, lastBackupErrorDetail, protectedItemDataSourceId, protectedItemHealthStatus, extendedInfo) + public AzureVmWorkloadSQLDatabaseProtectedItem(string backupManagementType = default(string), string workloadType = default(string), string containerName = default(string), string sourceResourceId = default(string), string policyId = default(string), System.DateTime? lastRecoveryPoint = default(System.DateTime?), string backupSetName = default(string), string createMode = default(string), System.DateTime? deferredDeleteTimeInUTC = default(System.DateTime?), bool? isScheduledForDeferredDelete = default(bool?), string deferredDeleteTimeRemaining = default(string), bool? isDeferredDeleteScheduleUpcoming = default(bool?), bool? isRehydrate = default(bool?), string friendlyName = default(string), string serverName = default(string), string parentName = default(string), string parentType = default(string), string protectionStatus = default(string), string protectionState = default(string), string lastBackupStatus = default(string), System.DateTime? lastBackupTime = default(System.DateTime?), ErrorDetail lastBackupErrorDetail = default(ErrorDetail), string protectedItemDataSourceId = default(string), string protectedItemHealthStatus = default(string), AzureVmWorkloadProtectedItemExtendedInfo extendedInfo = default(AzureVmWorkloadProtectedItemExtendedInfo)) + : base(backupManagementType, workloadType, containerName, sourceResourceId, policyId, lastRecoveryPoint, backupSetName, createMode, deferredDeleteTimeInUTC, isScheduledForDeferredDelete, deferredDeleteTimeRemaining, isDeferredDeleteScheduleUpcoming, isRehydrate, friendlyName, serverName, parentName, parentType, protectionStatus, protectionState, lastBackupStatus, lastBackupTime, lastBackupErrorDetail, protectedItemDataSourceId, protectedItemHealthStatus, extendedInfo) { CustomInit(); } diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/DPMProtectedItem.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/DPMProtectedItem.cs index a69008e1668c..f518bb5c876f 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/DPMProtectedItem.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/DPMProtectedItem.cs @@ -50,6 +50,16 @@ public DPMProtectedItem() /// Create mode to indicate recovery of /// existing soft deleted data source or creation of new data source. /// Possible values include: 'Invalid', 'Default', 'Recover' + /// Time for deferred deletion in + /// UTC + /// Flag to identify whether + /// the DS is scheduled for deferred delete + /// Time remaining before the + /// DS marked for deferred delete is permanently deleted + /// Flag to identify + /// whether the deferred deleted DS is to be purged soon + /// Flag to identify that deferred deleted DS + /// is to be moved into Pause state /// Friendly name of the managed /// item /// Backup Management server protecting @@ -58,17 +68,14 @@ public DPMProtectedItem() /// engine. Possible values include: 'Invalid', 'IRPending', /// 'Protected', 'ProtectionError', 'ProtectionStopped', /// 'ProtectionPaused' - /// To check if backup item - /// is scheduled for deferred delete /// Extended info of the backup /// item. - public DPMProtectedItem(string backupManagementType = default(string), string workloadType = default(string), string containerName = default(string), string sourceResourceId = default(string), string policyId = default(string), System.DateTime? lastRecoveryPoint = default(System.DateTime?), string backupSetName = default(string), string createMode = default(string), string friendlyName = default(string), string backupEngineName = default(string), string protectionState = default(string), bool? isScheduledForDeferredDelete = default(bool?), DPMProtectedItemExtendedInfo extendedInfo = default(DPMProtectedItemExtendedInfo)) - : base(backupManagementType, workloadType, containerName, sourceResourceId, policyId, lastRecoveryPoint, backupSetName, createMode) + public DPMProtectedItem(string backupManagementType = default(string), string workloadType = default(string), string containerName = default(string), string sourceResourceId = default(string), string policyId = default(string), System.DateTime? lastRecoveryPoint = default(System.DateTime?), string backupSetName = default(string), string createMode = default(string), System.DateTime? deferredDeleteTimeInUTC = default(System.DateTime?), bool? isScheduledForDeferredDelete = default(bool?), string deferredDeleteTimeRemaining = default(string), bool? isDeferredDeleteScheduleUpcoming = default(bool?), bool? isRehydrate = default(bool?), string friendlyName = default(string), string backupEngineName = default(string), string protectionState = default(string), DPMProtectedItemExtendedInfo extendedInfo = default(DPMProtectedItemExtendedInfo)) + : base(backupManagementType, workloadType, containerName, sourceResourceId, policyId, lastRecoveryPoint, backupSetName, createMode, deferredDeleteTimeInUTC, isScheduledForDeferredDelete, deferredDeleteTimeRemaining, isDeferredDeleteScheduleUpcoming, isRehydrate) { FriendlyName = friendlyName; BackupEngineName = backupEngineName; ProtectionState = protectionState; - IsScheduledForDeferredDelete = isScheduledForDeferredDelete; ExtendedInfo = extendedInfo; CustomInit(); } @@ -98,13 +105,6 @@ public DPMProtectedItem() [JsonProperty(PropertyName = "protectionState")] public string ProtectionState { get; set; } - /// - /// Gets or sets to check if backup item is scheduled for deferred - /// delete - /// - [JsonProperty(PropertyName = "isScheduledForDeferredDelete")] - public bool? IsScheduledForDeferredDelete { get; set; } - /// /// Gets or sets extended info of the backup item. /// diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/GenericProtectedItem.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/GenericProtectedItem.cs index 78fa257eac23..9cdb3cd0e8ac 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/GenericProtectedItem.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/GenericProtectedItem.cs @@ -52,6 +52,16 @@ public GenericProtectedItem() /// Create mode to indicate recovery of /// existing soft deleted data source or creation of new data source. /// Possible values include: 'Invalid', 'Default', 'Recover' + /// Time for deferred deletion in + /// UTC + /// Flag to identify whether + /// the DS is scheduled for deferred delete + /// Time remaining before the + /// DS marked for deferred delete is permanently deleted + /// Flag to identify + /// whether the deferred deleted DS is to be purged soon + /// Flag to identify that deferred deleted DS + /// is to be moved into Pause state /// Friendly name of the container. /// Indicates consistency of policy object /// and policy applied to this backup item. @@ -63,8 +73,8 @@ public GenericProtectedItem() /// Loosely coupled (type, value) /// associations (example - parent of a protected item) /// Name of this backup item's fabric. - public GenericProtectedItem(string backupManagementType = default(string), string workloadType = default(string), string containerName = default(string), string sourceResourceId = default(string), string policyId = default(string), System.DateTime? lastRecoveryPoint = default(System.DateTime?), string backupSetName = default(string), string createMode = default(string), string friendlyName = default(string), string policyState = default(string), string protectionState = default(string), long? protectedItemId = default(long?), IDictionary sourceAssociations = default(IDictionary), string fabricName = default(string)) - : base(backupManagementType, workloadType, containerName, sourceResourceId, policyId, lastRecoveryPoint, backupSetName, createMode) + public GenericProtectedItem(string backupManagementType = default(string), string workloadType = default(string), string containerName = default(string), string sourceResourceId = default(string), string policyId = default(string), System.DateTime? lastRecoveryPoint = default(System.DateTime?), string backupSetName = default(string), string createMode = default(string), System.DateTime? deferredDeleteTimeInUTC = default(System.DateTime?), bool? isScheduledForDeferredDelete = default(bool?), string deferredDeleteTimeRemaining = default(string), bool? isDeferredDeleteScheduleUpcoming = default(bool?), bool? isRehydrate = default(bool?), string friendlyName = default(string), string policyState = default(string), string protectionState = default(string), long? protectedItemId = default(long?), IDictionary sourceAssociations = default(IDictionary), string fabricName = default(string)) + : base(backupManagementType, workloadType, containerName, sourceResourceId, policyId, lastRecoveryPoint, backupSetName, createMode, deferredDeleteTimeInUTC, isScheduledForDeferredDelete, deferredDeleteTimeRemaining, isDeferredDeleteScheduleUpcoming, isRehydrate) { FriendlyName = friendlyName; PolicyState = policyState; diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/MabFileFolderProtectedItem.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/MabFileFolderProtectedItem.cs index 4a4474a85585..967c1d31130e 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/MabFileFolderProtectedItem.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/MabFileFolderProtectedItem.cs @@ -50,6 +50,16 @@ public MabFileFolderProtectedItem() /// Create mode to indicate recovery of /// existing soft deleted data source or creation of new data source. /// Possible values include: 'Invalid', 'Default', 'Recover' + /// Time for deferred deletion in + /// UTC + /// Flag to identify whether + /// the DS is scheduled for deferred delete + /// Time remaining before the + /// DS marked for deferred delete is permanently deleted + /// Flag to identify + /// whether the deferred deleted DS is to be purged soon + /// Flag to identify that deferred deleted DS + /// is to be moved into Pause state /// Friendly name of this backup /// item. /// Name of the computer associated with @@ -58,20 +68,17 @@ public MabFileFolderProtectedItem() /// operation. /// Protected, ProtectionStopped, /// IRPending or ProtectionError - /// Specifies if the item is - /// scheduled for deferred deletion. /// Sync time for deferred /// deletion. /// Additional information with this backup /// item. - public MabFileFolderProtectedItem(string backupManagementType = default(string), string workloadType = default(string), string containerName = default(string), string sourceResourceId = default(string), string policyId = default(string), System.DateTime? lastRecoveryPoint = default(System.DateTime?), string backupSetName = default(string), string createMode = default(string), string friendlyName = default(string), string computerName = default(string), string lastBackupStatus = default(string), string protectionState = default(string), bool? isScheduledForDeferredDelete = default(bool?), long? deferredDeleteSyncTimeInUTC = default(long?), MabFileFolderProtectedItemExtendedInfo extendedInfo = default(MabFileFolderProtectedItemExtendedInfo)) - : base(backupManagementType, workloadType, containerName, sourceResourceId, policyId, lastRecoveryPoint, backupSetName, createMode) + public MabFileFolderProtectedItem(string backupManagementType = default(string), string workloadType = default(string), string containerName = default(string), string sourceResourceId = default(string), string policyId = default(string), System.DateTime? lastRecoveryPoint = default(System.DateTime?), string backupSetName = default(string), string createMode = default(string), System.DateTime? deferredDeleteTimeInUTC = default(System.DateTime?), bool? isScheduledForDeferredDelete = default(bool?), string deferredDeleteTimeRemaining = default(string), bool? isDeferredDeleteScheduleUpcoming = default(bool?), bool? isRehydrate = default(bool?), string friendlyName = default(string), string computerName = default(string), string lastBackupStatus = default(string), string protectionState = default(string), long? deferredDeleteSyncTimeInUTC = default(long?), MabFileFolderProtectedItemExtendedInfo extendedInfo = default(MabFileFolderProtectedItemExtendedInfo)) + : base(backupManagementType, workloadType, containerName, sourceResourceId, policyId, lastRecoveryPoint, backupSetName, createMode, deferredDeleteTimeInUTC, isScheduledForDeferredDelete, deferredDeleteTimeRemaining, isDeferredDeleteScheduleUpcoming, isRehydrate) { FriendlyName = friendlyName; ComputerName = computerName; LastBackupStatus = lastBackupStatus; ProtectionState = protectionState; - IsScheduledForDeferredDelete = isScheduledForDeferredDelete; DeferredDeleteSyncTimeInUTC = deferredDeleteSyncTimeInUTC; ExtendedInfo = extendedInfo; CustomInit(); @@ -107,13 +114,6 @@ public MabFileFolderProtectedItem() [JsonProperty(PropertyName = "protectionState")] public string ProtectionState { get; set; } - /// - /// Gets or sets specifies if the item is scheduled for deferred - /// deletion. - /// - [JsonProperty(PropertyName = "isScheduledForDeferredDelete")] - public bool? IsScheduledForDeferredDelete { get; set; } - /// /// Gets or sets sync time for deferred deletion. /// diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ProtectedItem.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ProtectedItem.cs index f469e6301a66..6a6a16901e72 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ProtectedItem.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ProtectedItem.cs @@ -50,7 +50,17 @@ public ProtectedItem() /// Create mode to indicate recovery of /// existing soft deleted data source or creation of new data source. /// Possible values include: 'Invalid', 'Default', 'Recover' - public ProtectedItem(string backupManagementType = default(string), string workloadType = default(string), string containerName = default(string), string sourceResourceId = default(string), string policyId = default(string), System.DateTime? lastRecoveryPoint = default(System.DateTime?), string backupSetName = default(string), string createMode = default(string)) + /// Time for deferred deletion in + /// UTC + /// Flag to identify whether + /// the DS is scheduled for deferred delete + /// Time remaining before the + /// DS marked for deferred delete is permanently deleted + /// Flag to identify + /// whether the deferred deleted DS is to be purged soon + /// Flag to identify that deferred deleted DS + /// is to be moved into Pause state + public ProtectedItem(string backupManagementType = default(string), string workloadType = default(string), string containerName = default(string), string sourceResourceId = default(string), string policyId = default(string), System.DateTime? lastRecoveryPoint = default(System.DateTime?), string backupSetName = default(string), string createMode = default(string), System.DateTime? deferredDeleteTimeInUTC = default(System.DateTime?), bool? isScheduledForDeferredDelete = default(bool?), string deferredDeleteTimeRemaining = default(string), bool? isDeferredDeleteScheduleUpcoming = default(bool?), bool? isRehydrate = default(bool?)) { BackupManagementType = backupManagementType; WorkloadType = workloadType; @@ -60,6 +70,11 @@ public ProtectedItem() LastRecoveryPoint = lastRecoveryPoint; BackupSetName = backupSetName; CreateMode = createMode; + DeferredDeleteTimeInUTC = deferredDeleteTimeInUTC; + IsScheduledForDeferredDelete = isScheduledForDeferredDelete; + DeferredDeleteTimeRemaining = deferredDeleteTimeRemaining; + IsDeferredDeleteScheduleUpcoming = isDeferredDeleteScheduleUpcoming; + IsRehydrate = isRehydrate; CustomInit(); } @@ -127,5 +142,39 @@ public ProtectedItem() [JsonProperty(PropertyName = "createMode")] public string CreateMode { get; set; } + /// + /// Gets or sets time for deferred deletion in UTC + /// + [JsonProperty(PropertyName = "deferredDeleteTimeInUTC")] + public System.DateTime? DeferredDeleteTimeInUTC { get; set; } + + /// + /// Gets or sets flag to identify whether the DS is scheduled for + /// deferred delete + /// + [JsonProperty(PropertyName = "isScheduledForDeferredDelete")] + public bool? IsScheduledForDeferredDelete { get; set; } + + /// + /// Gets or sets time remaining before the DS marked for deferred + /// delete is permanently deleted + /// + [JsonProperty(PropertyName = "deferredDeleteTimeRemaining")] + public string DeferredDeleteTimeRemaining { get; set; } + + /// + /// Gets or sets flag to identify whether the deferred deleted DS is to + /// be purged soon + /// + [JsonProperty(PropertyName = "isDeferredDeleteScheduleUpcoming")] + public bool? IsDeferredDeleteScheduleUpcoming { get; set; } + + /// + /// Gets or sets flag to identify that deferred deleted DS is to be + /// moved into Pause state + /// + [JsonProperty(PropertyName = "isRehydrate")] + public bool? IsRehydrate { get; set; } + } } diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/SdkInfo_RecoveryServicesBackupClient.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/SdkInfo_RecoveryServicesBackupClient.cs index 78e58c8b24c9..f2773abea140 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/SdkInfo_RecoveryServicesBackupClient.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/SdkInfo_RecoveryServicesBackupClient.cs @@ -60,16 +60,5 @@ public static IEnumerable> ApiInfo_RecoveryService }.AsEnumerable(); } } - // BEGIN: Code Generation Metadata Section - public static readonly String AutoRestVersion = "latest"; - public static readonly String AutoRestBootStrapperVersion = "autorest@2.0.4283"; - public static readonly String AutoRestCmdExecuted = "cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/recoveryservicesbackup/resource-manager/readme.md --csharp --version=latest --reflect-api-versions --csharp-sdks-folder=C:\\myclones\\azure-sdk-for-net\\src\\SDKs"; - public static readonly String GithubForkName = "Azure"; - public static readonly String GithubBranchName = "master"; - public static readonly String GithubCommidId = "279463bd1349946a31719cbe799fc394e6003531"; - public static readonly String CodeGenerationErrors = ""; - public static readonly String GithubRepoName = "azure-rest-api-specs"; - // END: Code Generation Metadata Section } } -