diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/Azure.Batch.csproj b/src/SDKs/Batch/DataPlane/Azure.Batch/Azure.Batch.csproj index b56b581b4348..2106365b3ec1 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/Azure.Batch.csproj +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/Azure.Batch.csproj @@ -22,8 +22,7 @@ - - $(DefineConstants);netstandard14;PORTABLE + $(DefineConstants);netstandard14 diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/AccountOperations.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/AccountOperations.cs index b61df9eb177d..ce15c9629457 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/AccountOperations.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/AccountOperations.cs @@ -8,15 +8,23 @@ namespace Microsoft.Azure.Batch.Protocol { - 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; + using System.Threading; + using System.Threading.Tasks; /// /// AccountOperations operations. /// - internal partial class AccountOperations : Microsoft.Rest.IServiceOperations, IAccountOperations + internal partial class AccountOperations : IServiceOperations, IAccountOperations { /// /// Initializes a new instance of the AccountOperations class. @@ -33,7 +41,7 @@ internal AccountOperations(BatchServiceClient client) { throw new System.ArgumentNullException("client"); } - this.Client = client; + Client = client; } /// @@ -56,10 +64,10 @@ internal AccountOperations(BatchServiceClient client) /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -68,11 +76,11 @@ internal AccountOperations(BatchServiceClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task,AccountListNodeAgentSkusHeaders>> ListNodeAgentSkusWithHttpMessagesAsync(AccountListNodeAgentSkusOptions accountListNodeAgentSkusOptions = default(AccountListNodeAgentSkusOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task,AccountListNodeAgentSkusHeaders>> ListNodeAgentSkusWithHttpMessagesAsync(AccountListNodeAgentSkusOptions accountListNodeAgentSkusOptions = default(AccountListNodeAgentSkusOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - 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"); } string filter = default(string); if (accountListNodeAgentSkusOptions != null) @@ -105,12 +113,12 @@ internal AccountOperations(BatchServiceClient client) ocpDate = accountListNodeAgentSkusOptions.OcpDate; } // 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("filter", filter); tracingParameters.Add("maxResults", maxResults); tracingParameters.Add("timeout", timeout); @@ -118,15 +126,15 @@ internal AccountOperations(BatchServiceClient client) tracingParameters.Add("returnClientRequestId", returnClientRequestId); tracingParameters.Add("ocpDate", ocpDate); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNodeAgentSkus", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListNodeAgentSkus", 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("/") ? "" : "/")), "nodeagentskus").ToString(); - 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 (filter != null) { @@ -134,33 +142,33 @@ internal AccountOperations(BatchServiceClient client) } if (maxResults != null) { - _queryParameters.Add(string.Format("maxresults={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(maxResults, this.Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("maxresults={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(maxResults, Client.SerializationSettings).Trim('"')))); } if (timeout != null) { - _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(timeout, this.Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(timeout, Client.SerializationSettings).Trim('"')))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _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("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 (clientRequestId != null) { @@ -168,7 +176,7 @@ internal AccountOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(clientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("client-request-id", SafeJsonConvert.SerializeObject(clientRequestId, Client.SerializationSettings).Trim('"')); } if (returnClientRequestId != null) { @@ -176,7 +184,7 @@ internal AccountOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("return-client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(returnClientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", SafeJsonConvert.SerializeObject(returnClientRequestId, Client.SerializationSettings).Trim('"')); } if (ocpDate != null) { @@ -184,7 +192,7 @@ internal AccountOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("ocp-date"); } - _httpRequest.Headers.TryAddWithoutValidation("ocp-date", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ocpDate, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("ocp-date", SafeJsonConvert.SerializeObject(ocpDate, new DateTimeRfc1123JsonConverter()).Trim('"')); } @@ -203,23 +211,23 @@ internal AccountOperations(BatchServiceClient 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) @@ -228,21 +236,21 @@ internal AccountOperations(BatchServiceClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - BatchError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + BatchError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -252,7 +260,7 @@ internal AccountOperations(BatchServiceClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse,AccountListNodeAgentSkusHeaders>(); + var _result = new AzureOperationResponse,AccountListNodeAgentSkusHeaders>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("request-id")) @@ -265,34 +273,34 @@ internal AccountOperations(BatchServiceClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = 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); } } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(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 headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -315,10 +323,10 @@ internal AccountOperations(BatchServiceClient client) /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -327,11 +335,11 @@ internal AccountOperations(BatchServiceClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task,AccountListNodeAgentSkusHeaders>> ListNodeAgentSkusNextWithHttpMessagesAsync(string nextPageLink, AccountListNodeAgentSkusNextOptions accountListNodeAgentSkusNextOptions = default(AccountListNodeAgentSkusNextOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task,AccountListNodeAgentSkusHeaders>> ListNodeAgentSkusNextWithHttpMessagesAsync(string nextPageLink, AccountListNodeAgentSkusNextOptions accountListNodeAgentSkusNextOptions = default(AccountListNodeAgentSkusNextOptions), 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"); } System.Guid? clientRequestId = default(System.Guid?); if (accountListNodeAgentSkusNextOptions != null) @@ -349,44 +357,44 @@ internal AccountOperations(BatchServiceClient client) ocpDate = accountListNodeAgentSkusNextOptions.OcpDate; } // 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("clientRequestId", clientRequestId); tracingParameters.Add("returnClientRequestId", returnClientRequestId); tracingParameters.Add("ocpDate", ocpDate); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNodeAgentSkusNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListNodeAgentSkusNext", 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 += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _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("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 (clientRequestId != null) { @@ -394,7 +402,7 @@ internal AccountOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(clientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("client-request-id", SafeJsonConvert.SerializeObject(clientRequestId, Client.SerializationSettings).Trim('"')); } if (returnClientRequestId != null) { @@ -402,7 +410,7 @@ internal AccountOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("return-client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(returnClientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", SafeJsonConvert.SerializeObject(returnClientRequestId, Client.SerializationSettings).Trim('"')); } if (ocpDate != null) { @@ -410,7 +418,7 @@ internal AccountOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("ocp-date"); } - _httpRequest.Headers.TryAddWithoutValidation("ocp-date", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ocpDate, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("ocp-date", SafeJsonConvert.SerializeObject(ocpDate, new DateTimeRfc1123JsonConverter()).Trim('"')); } @@ -429,23 +437,23 @@ internal AccountOperations(BatchServiceClient 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) @@ -454,21 +462,21 @@ internal AccountOperations(BatchServiceClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - BatchError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + BatchError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -478,7 +486,7 @@ internal AccountOperations(BatchServiceClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse,AccountListNodeAgentSkusHeaders>(); + var _result = new AzureOperationResponse,AccountListNodeAgentSkusHeaders>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("request-id")) @@ -491,37 +499,37 @@ internal AccountOperations(BatchServiceClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = 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); } } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(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 headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } } -} +} \ No newline at end of file diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/AccountOperationsExtensions.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/AccountOperationsExtensions.cs index 852c994ca611..c077d712c133 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/AccountOperationsExtensions.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/AccountOperationsExtensions.cs @@ -8,8 +8,11 @@ namespace Microsoft.Azure.Batch.Protocol { + using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; + using System.Threading; + using System.Threading.Tasks; /// /// Extension methods for AccountOperations. @@ -25,9 +28,9 @@ public static partial class AccountOperationsExtensions /// /// Additional parameters for the operation /// - public static Microsoft.Rest.Azure.IPage ListNodeAgentSkus(this IAccountOperations operations, AccountListNodeAgentSkusOptions accountListNodeAgentSkusOptions = default(AccountListNodeAgentSkusOptions)) + public static IPage ListNodeAgentSkus(this IAccountOperations operations, AccountListNodeAgentSkusOptions accountListNodeAgentSkusOptions = default(AccountListNodeAgentSkusOptions)) { - return ((IAccountOperations)operations).ListNodeAgentSkusAsync(accountListNodeAgentSkusOptions).GetAwaiter().GetResult(); + return operations.ListNodeAgentSkusAsync(accountListNodeAgentSkusOptions).GetAwaiter().GetResult(); } /// @@ -42,7 +45,7 @@ public static partial class AccountOperationsExtensions /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListNodeAgentSkusAsync(this IAccountOperations operations, AccountListNodeAgentSkusOptions accountListNodeAgentSkusOptions = default(AccountListNodeAgentSkusOptions), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task> ListNodeAgentSkusAsync(this IAccountOperations operations, AccountListNodeAgentSkusOptions accountListNodeAgentSkusOptions = default(AccountListNodeAgentSkusOptions), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListNodeAgentSkusWithHttpMessagesAsync(accountListNodeAgentSkusOptions, null, cancellationToken).ConfigureAwait(false)) { @@ -62,9 +65,9 @@ public static partial class AccountOperationsExtensions /// /// Additional parameters for the operation /// - public static Microsoft.Rest.Azure.IPage ListNodeAgentSkusNext(this IAccountOperations operations, string nextPageLink, AccountListNodeAgentSkusNextOptions accountListNodeAgentSkusNextOptions = default(AccountListNodeAgentSkusNextOptions)) + public static IPage ListNodeAgentSkusNext(this IAccountOperations operations, string nextPageLink, AccountListNodeAgentSkusNextOptions accountListNodeAgentSkusNextOptions = default(AccountListNodeAgentSkusNextOptions)) { - return ((IAccountOperations)operations).ListNodeAgentSkusNextAsync(nextPageLink, accountListNodeAgentSkusNextOptions).GetAwaiter().GetResult(); + return operations.ListNodeAgentSkusNextAsync(nextPageLink, accountListNodeAgentSkusNextOptions).GetAwaiter().GetResult(); } /// @@ -82,7 +85,7 @@ public static partial class AccountOperationsExtensions /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListNodeAgentSkusNextAsync(this IAccountOperations operations, string nextPageLink, AccountListNodeAgentSkusNextOptions accountListNodeAgentSkusNextOptions = default(AccountListNodeAgentSkusNextOptions), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task> ListNodeAgentSkusNextAsync(this IAccountOperations operations, string nextPageLink, AccountListNodeAgentSkusNextOptions accountListNodeAgentSkusNextOptions = default(AccountListNodeAgentSkusNextOptions), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListNodeAgentSkusNextWithHttpMessagesAsync(nextPageLink, accountListNodeAgentSkusNextOptions, null, cancellationToken).ConfigureAwait(false)) { @@ -91,4 +94,4 @@ public static partial class AccountOperationsExtensions } } -} +} \ No newline at end of file diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/ApplicationOperations.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/ApplicationOperations.cs index 925da95c2a4b..a4d450c38752 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/ApplicationOperations.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/ApplicationOperations.cs @@ -8,15 +8,23 @@ namespace Microsoft.Azure.Batch.Protocol { - 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; + using System.Threading; + using System.Threading.Tasks; /// /// ApplicationOperations operations. /// - internal partial class ApplicationOperations : Microsoft.Rest.IServiceOperations, IApplicationOperations + internal partial class ApplicationOperations : IServiceOperations, IApplicationOperations { /// /// Initializes a new instance of the ApplicationOperations class. @@ -33,7 +41,7 @@ internal ApplicationOperations(BatchServiceClient client) { throw new System.ArgumentNullException("client"); } - this.Client = client; + Client = client; } /// @@ -63,10 +71,10 @@ internal ApplicationOperations(BatchServiceClient client) /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -75,11 +83,11 @@ internal ApplicationOperations(BatchServiceClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task,ApplicationListHeaders>> ListWithHttpMessagesAsync(ApplicationListOptions applicationListOptions = default(ApplicationListOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task,ApplicationListHeaders>> ListWithHttpMessagesAsync(ApplicationListOptions applicationListOptions = default(ApplicationListOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - 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"); } int? maxResults = default(int?); if (applicationListOptions != null) @@ -107,57 +115,57 @@ internal ApplicationOperations(BatchServiceClient client) ocpDate = applicationListOptions.OcpDate; } // 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("maxResults", maxResults); tracingParameters.Add("timeout", timeout); tracingParameters.Add("clientRequestId", clientRequestId); tracingParameters.Add("returnClientRequestId", returnClientRequestId); tracingParameters.Add("ocpDate", ocpDate); 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("/") ? "" : "/")), "applications").ToString(); - 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 (maxResults != null) { - _queryParameters.Add(string.Format("maxresults={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(maxResults, this.Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("maxresults={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(maxResults, Client.SerializationSettings).Trim('"')))); } if (timeout != null) { - _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(timeout, this.Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(timeout, Client.SerializationSettings).Trim('"')))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _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("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 (clientRequestId != null) { @@ -165,7 +173,7 @@ internal ApplicationOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(clientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("client-request-id", SafeJsonConvert.SerializeObject(clientRequestId, Client.SerializationSettings).Trim('"')); } if (returnClientRequestId != null) { @@ -173,7 +181,7 @@ internal ApplicationOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("return-client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(returnClientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", SafeJsonConvert.SerializeObject(returnClientRequestId, Client.SerializationSettings).Trim('"')); } if (ocpDate != null) { @@ -181,7 +189,7 @@ internal ApplicationOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("ocp-date"); } - _httpRequest.Headers.TryAddWithoutValidation("ocp-date", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ocpDate, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("ocp-date", SafeJsonConvert.SerializeObject(ocpDate, new DateTimeRfc1123JsonConverter()).Trim('"')); } @@ -200,23 +208,23 @@ internal ApplicationOperations(BatchServiceClient 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) @@ -225,21 +233,21 @@ internal ApplicationOperations(BatchServiceClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - BatchError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + BatchError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -249,7 +257,7 @@ internal ApplicationOperations(BatchServiceClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse,ApplicationListHeaders>(); + var _result = new AzureOperationResponse,ApplicationListHeaders>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("request-id")) @@ -262,34 +270,34 @@ internal ApplicationOperations(BatchServiceClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = 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); } } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(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 headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -297,6 +305,13 @@ internal ApplicationOperations(BatchServiceClient client) /// /// Gets information about the specified application. /// + /// + /// This operation returns only applications and versions that are available + /// for use on compute nodes; that is, that can be used in an application + /// package reference. For administrator information about applications and + /// versions that are not yet available to compute nodes, use the Azure portal + /// or the Azure Resource Manager API. + /// /// /// The ID of the application. /// @@ -312,10 +327,10 @@ internal ApplicationOperations(BatchServiceClient client) /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -324,15 +339,15 @@ internal ApplicationOperations(BatchServiceClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string applicationId, ApplicationGetOptions applicationGetOptions = default(ApplicationGetOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string applicationId, ApplicationGetOptions applicationGetOptions = default(ApplicationGetOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (applicationId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "applicationId"); + throw new ValidationException(ValidationRules.CannotBeNull, "applicationId"); } - 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"); } int? timeout = default(int?); if (applicationGetOptions != null) @@ -355,54 +370,54 @@ internal ApplicationOperations(BatchServiceClient client) ocpDate = applicationGetOptions.OcpDate; } // 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("applicationId", applicationId); tracingParameters.Add("timeout", timeout); tracingParameters.Add("clientRequestId", clientRequestId); tracingParameters.Add("returnClientRequestId", returnClientRequestId); tracingParameters.Add("ocpDate", ocpDate); 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("/") ? "" : "/")), "applications/{applicationId}").ToString(); _url = _url.Replace("{applicationId}", System.Uri.EscapeDataString(applicationId)); - 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 (timeout != null) { - _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(timeout, this.Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(timeout, Client.SerializationSettings).Trim('"')))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _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("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 (clientRequestId != null) { @@ -410,7 +425,7 @@ internal ApplicationOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(clientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("client-request-id", SafeJsonConvert.SerializeObject(clientRequestId, Client.SerializationSettings).Trim('"')); } if (returnClientRequestId != null) { @@ -418,7 +433,7 @@ internal ApplicationOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("return-client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(returnClientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", SafeJsonConvert.SerializeObject(returnClientRequestId, Client.SerializationSettings).Trim('"')); } if (ocpDate != null) { @@ -426,7 +441,7 @@ internal ApplicationOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("ocp-date"); } - _httpRequest.Headers.TryAddWithoutValidation("ocp-date", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ocpDate, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("ocp-date", SafeJsonConvert.SerializeObject(ocpDate, new DateTimeRfc1123JsonConverter()).Trim('"')); } @@ -445,23 +460,23 @@ internal ApplicationOperations(BatchServiceClient 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) @@ -470,21 +485,21 @@ internal ApplicationOperations(BatchServiceClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - BatchError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + BatchError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -494,7 +509,7 @@ internal ApplicationOperations(BatchServiceClient 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("request-id")) @@ -507,34 +522,34 @@ internal ApplicationOperations(BatchServiceClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = 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); } } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(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 headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -564,10 +579,10 @@ internal ApplicationOperations(BatchServiceClient client) /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -576,11 +591,11 @@ internal ApplicationOperations(BatchServiceClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task,ApplicationListHeaders>> ListNextWithHttpMessagesAsync(string nextPageLink, ApplicationListNextOptions applicationListNextOptions = default(ApplicationListNextOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task,ApplicationListHeaders>> ListNextWithHttpMessagesAsync(string nextPageLink, ApplicationListNextOptions applicationListNextOptions = default(ApplicationListNextOptions), 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"); } System.Guid? clientRequestId = default(System.Guid?); if (applicationListNextOptions != null) @@ -598,44 +613,44 @@ internal ApplicationOperations(BatchServiceClient client) ocpDate = applicationListNextOptions.OcpDate; } // 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("clientRequestId", clientRequestId); tracingParameters.Add("returnClientRequestId", returnClientRequestId); tracingParameters.Add("ocpDate", ocpDate); 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 += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _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("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 (clientRequestId != null) { @@ -643,7 +658,7 @@ internal ApplicationOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(clientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("client-request-id", SafeJsonConvert.SerializeObject(clientRequestId, Client.SerializationSettings).Trim('"')); } if (returnClientRequestId != null) { @@ -651,7 +666,7 @@ internal ApplicationOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("return-client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(returnClientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", SafeJsonConvert.SerializeObject(returnClientRequestId, Client.SerializationSettings).Trim('"')); } if (ocpDate != null) { @@ -659,7 +674,7 @@ internal ApplicationOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("ocp-date"); } - _httpRequest.Headers.TryAddWithoutValidation("ocp-date", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ocpDate, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("ocp-date", SafeJsonConvert.SerializeObject(ocpDate, new DateTimeRfc1123JsonConverter()).Trim('"')); } @@ -678,23 +693,23 @@ internal ApplicationOperations(BatchServiceClient 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) @@ -703,21 +718,21 @@ internal ApplicationOperations(BatchServiceClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - BatchError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + BatchError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -727,7 +742,7 @@ internal ApplicationOperations(BatchServiceClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse,ApplicationListHeaders>(); + var _result = new AzureOperationResponse,ApplicationListHeaders>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("request-id")) @@ -740,37 +755,37 @@ internal ApplicationOperations(BatchServiceClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = 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); } } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(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 headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } } -} +} \ No newline at end of file diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/ApplicationOperationsExtensions.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/ApplicationOperationsExtensions.cs index 10205aa84116..671d162b878a 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/ApplicationOperationsExtensions.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/ApplicationOperationsExtensions.cs @@ -8,8 +8,11 @@ namespace Microsoft.Azure.Batch.Protocol { + using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; + using System.Threading; + using System.Threading.Tasks; /// /// Extension methods for ApplicationOperations. @@ -32,9 +35,9 @@ public static partial class ApplicationOperationsExtensions /// /// Additional parameters for the operation /// - public static Microsoft.Rest.Azure.IPage List(this IApplicationOperations operations, ApplicationListOptions applicationListOptions = default(ApplicationListOptions)) + public static IPage List(this IApplicationOperations operations, ApplicationListOptions applicationListOptions = default(ApplicationListOptions)) { - return ((IApplicationOperations)operations).ListAsync(applicationListOptions).GetAwaiter().GetResult(); + return operations.ListAsync(applicationListOptions).GetAwaiter().GetResult(); } /// @@ -56,7 +59,7 @@ public static partial class ApplicationOperationsExtensions /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListAsync(this IApplicationOperations operations, ApplicationListOptions applicationListOptions = default(ApplicationListOptions), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task> ListAsync(this IApplicationOperations operations, ApplicationListOptions applicationListOptions = default(ApplicationListOptions), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListWithHttpMessagesAsync(applicationListOptions, null, cancellationToken).ConfigureAwait(false)) { @@ -67,6 +70,13 @@ public static partial class ApplicationOperationsExtensions /// /// Gets information about the specified application. /// + /// + /// This operation returns only applications and versions that are available + /// for use on compute nodes; that is, that can be used in an application + /// package reference. For administrator information about applications and + /// versions that are not yet available to compute nodes, use the Azure portal + /// or the Azure Resource Manager API. + /// /// /// The operations group for this extension method. /// @@ -78,12 +88,19 @@ public static partial class ApplicationOperationsExtensions /// public static ApplicationSummary Get(this IApplicationOperations operations, string applicationId, ApplicationGetOptions applicationGetOptions = default(ApplicationGetOptions)) { - return ((IApplicationOperations)operations).GetAsync(applicationId, applicationGetOptions).GetAwaiter().GetResult(); + return operations.GetAsync(applicationId, applicationGetOptions).GetAwaiter().GetResult(); } /// /// Gets information about the specified application. /// + /// + /// This operation returns only applications and versions that are available + /// for use on compute nodes; that is, that can be used in an application + /// package reference. For administrator information about applications and + /// versions that are not yet available to compute nodes, use the Azure portal + /// or the Azure Resource Manager API. + /// /// /// The operations group for this extension method. /// @@ -96,7 +113,7 @@ public static partial class ApplicationOperationsExtensions /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task GetAsync(this IApplicationOperations operations, string applicationId, ApplicationGetOptions applicationGetOptions = default(ApplicationGetOptions), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task GetAsync(this IApplicationOperations operations, string applicationId, ApplicationGetOptions applicationGetOptions = default(ApplicationGetOptions), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.GetWithHttpMessagesAsync(applicationId, applicationGetOptions, null, cancellationToken).ConfigureAwait(false)) { @@ -123,9 +140,9 @@ public static partial class ApplicationOperationsExtensions /// /// Additional parameters for the operation /// - public static Microsoft.Rest.Azure.IPage ListNext(this IApplicationOperations operations, string nextPageLink, ApplicationListNextOptions applicationListNextOptions = default(ApplicationListNextOptions)) + public static IPage ListNext(this IApplicationOperations operations, string nextPageLink, ApplicationListNextOptions applicationListNextOptions = default(ApplicationListNextOptions)) { - return ((IApplicationOperations)operations).ListNextAsync(nextPageLink, applicationListNextOptions).GetAwaiter().GetResult(); + return operations.ListNextAsync(nextPageLink, applicationListNextOptions).GetAwaiter().GetResult(); } /// @@ -150,7 +167,7 @@ public static partial class ApplicationOperationsExtensions /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListNextAsync(this IApplicationOperations operations, string nextPageLink, ApplicationListNextOptions applicationListNextOptions = default(ApplicationListNextOptions), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task> ListNextAsync(this IApplicationOperations operations, string nextPageLink, ApplicationListNextOptions applicationListNextOptions = default(ApplicationListNextOptions), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, applicationListNextOptions, null, cancellationToken).ConfigureAwait(false)) { @@ -159,4 +176,4 @@ public static partial class ApplicationOperationsExtensions } } -} +} \ No newline at end of file diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/BatchServiceClient.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/BatchServiceClient.cs index 06d036edb45a..a88add623195 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/BatchServiceClient.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/BatchServiceClient.cs @@ -8,15 +8,23 @@ namespace Microsoft.Azure.Batch.Protocol { - using System.Linq; + using Microsoft.Azure; + using Microsoft.Azure.Batch; 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; /// /// A client for issuing REST requests to the Azure Batch service. /// - public partial class BatchServiceClient : Microsoft.Rest.ServiceClient, IBatchServiceClient, IAzureClient + public partial class BatchServiceClient : ServiceClient, IBatchServiceClient, IAzureClient { /// /// The base URI of the service. @@ -26,17 +34,17 @@ public partial class BatchServiceClient : Microsoft.Rest.ServiceClient /// 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; } /// /// Client API Version. @@ -111,9 +119,9 @@ public partial class BatchServiceClient : Microsoft.Rest.ServiceClient /// Optional. The delegating handlers to add to the http client pipeline. /// - protected BatchServiceClient(params System.Net.Http.DelegatingHandler[] handlers) : base(handlers) + protected BatchServiceClient(params DelegatingHandler[] handlers) : base(handlers) { - this.Initialize(); + Initialize(); } /// @@ -125,9 +133,9 @@ protected BatchServiceClient(params System.Net.Http.DelegatingHandler[] handlers /// /// Optional. The delegating handlers to add to the http client pipeline. /// - protected BatchServiceClient(System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : base(rootHandler, handlers) + protected BatchServiceClient(HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : base(rootHandler, handlers) { - this.Initialize(); + Initialize(); } /// @@ -142,13 +150,13 @@ protected BatchServiceClient(System.Net.Http.HttpClientHandler rootHandler, para /// /// Thrown when a required parameter is null /// - protected BatchServiceClient(System.Uri baseUri, params System.Net.Http.DelegatingHandler[] handlers) : this(handlers) + protected BatchServiceClient(System.Uri baseUri, params DelegatingHandler[] handlers) : this(handlers) { if (baseUri == null) { throw new System.ArgumentNullException("baseUri"); } - this.BaseUri = baseUri; + BaseUri = baseUri; } /// @@ -166,13 +174,13 @@ protected BatchServiceClient(System.Uri baseUri, params System.Net.Http.Delegati /// /// Thrown when a required parameter is null /// - protected BatchServiceClient(System.Uri baseUri, System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : this(rootHandler, handlers) + protected BatchServiceClient(System.Uri baseUri, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) { if (baseUri == null) { throw new System.ArgumentNullException("baseUri"); } - this.BaseUri = baseUri; + BaseUri = baseUri; } /// @@ -187,16 +195,16 @@ protected BatchServiceClient(System.Uri baseUri, System.Net.Http.HttpClientHandl /// /// Thrown when a required parameter is null /// - public BatchServiceClient(Microsoft.Rest.ServiceClientCredentials credentials, params System.Net.Http.DelegatingHandler[] handlers) : this(handlers) + public BatchServiceClient(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); } } @@ -215,16 +223,16 @@ public BatchServiceClient(Microsoft.Rest.ServiceClientCredentials credentials, p /// /// Thrown when a required parameter is null /// - public BatchServiceClient(Microsoft.Rest.ServiceClientCredentials credentials, System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : this(rootHandler, handlers) + public BatchServiceClient(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); } } @@ -243,7 +251,7 @@ public BatchServiceClient(Microsoft.Rest.ServiceClientCredentials credentials, S /// /// Thrown when a required parameter is null /// - public BatchServiceClient(System.Uri baseUri, Microsoft.Rest.ServiceClientCredentials credentials, params System.Net.Http.DelegatingHandler[] handlers) : this(handlers) + public BatchServiceClient(System.Uri baseUri, ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers) { if (baseUri == null) { @@ -253,11 +261,11 @@ public BatchServiceClient(System.Uri baseUri, Microsoft.Rest.ServiceClientCreden { 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); } } @@ -279,7 +287,7 @@ public BatchServiceClient(System.Uri baseUri, Microsoft.Rest.ServiceClientCreden /// /// Thrown when a required parameter is null /// - public BatchServiceClient(System.Uri baseUri, Microsoft.Rest.ServiceClientCredentials credentials, System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : this(rootHandler, handlers) + public BatchServiceClient(System.Uri baseUri, ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) { if (baseUri == null) { @@ -289,11 +297,11 @@ public BatchServiceClient(System.Uri baseUri, Microsoft.Rest.ServiceClientCreden { 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); } } @@ -306,47 +314,47 @@ public BatchServiceClient(System.Uri baseUri, Microsoft.Rest.ServiceClientCreden /// private void Initialize() { - this.Application = new ApplicationOperations(this); - this.Pool = new PoolOperations(this); - this.Account = new AccountOperations(this); - this.Job = new JobOperations(this); - this.Certificate = new CertificateOperations(this); - this.File = new FileOperations(this); - this.JobSchedule = new JobScheduleOperations(this); - this.Task = new TaskOperations(this); - this.ComputeNode = new ComputeNodeOperations(this); - this.BaseUri = new System.Uri("https://batch.core.windows.net"); - this.ApiVersion = "2017-06-01.5.1"; - this.AcceptLanguage = "en-US"; - this.LongRunningOperationRetryTimeout = 30; - this.GenerateClientRequestId = true; - SerializationSettings = new Newtonsoft.Json.JsonSerializerSettings + Application = new ApplicationOperations(this); + Pool = new PoolOperations(this); + Account = new AccountOperations(this); + Job = new JobOperations(this); + Certificate = new CertificateOperations(this); + File = new FileOperations(this); + JobSchedule = new JobScheduleOperations(this); + Task = new TaskOperations(this); + ComputeNode = new ComputeNodeOperations(this); + BaseUri = new System.Uri("https://batch.core.windows.net"); + ApiVersion = "2017-06-01.5.1"; + 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/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/CertificateOperations.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/CertificateOperations.cs index 9b5d3d216941..85b175cf22cb 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/CertificateOperations.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/CertificateOperations.cs @@ -8,15 +8,23 @@ namespace Microsoft.Azure.Batch.Protocol { - 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; + using System.Threading; + using System.Threading.Tasks; /// /// CertificateOperations operations. /// - internal partial class CertificateOperations : Microsoft.Rest.IServiceOperations, ICertificateOperations + internal partial class CertificateOperations : IServiceOperations, ICertificateOperations { /// /// Initializes a new instance of the CertificateOperations class. @@ -33,7 +41,7 @@ internal CertificateOperations(BatchServiceClient client) { throw new System.ArgumentNullException("client"); } - this.Client = client; + Client = client; } /// @@ -59,7 +67,7 @@ internal CertificateOperations(BatchServiceClient client) /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -68,19 +76,19 @@ internal CertificateOperations(BatchServiceClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> AddWithHttpMessagesAsync(CertificateAddParameter certificate, CertificateAddOptions certificateAddOptions = default(CertificateAddOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> AddWithHttpMessagesAsync(CertificateAddParameter certificate, CertificateAddOptions certificateAddOptions = default(CertificateAddOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (certificate == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "certificate"); + throw new ValidationException(ValidationRules.CannotBeNull, "certificate"); } if (certificate != null) { certificate.Validate(); } - 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"); } int? timeout = default(int?); if (certificateAddOptions != null) @@ -103,53 +111,53 @@ internal CertificateOperations(BatchServiceClient client) ocpDate = certificateAddOptions.OcpDate; } // 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("certificate", certificate); tracingParameters.Add("timeout", timeout); tracingParameters.Add("clientRequestId", clientRequestId); tracingParameters.Add("returnClientRequestId", returnClientRequestId); tracingParameters.Add("ocpDate", ocpDate); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Add", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Add", 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("/") ? "" : "/")), "certificates").ToString(); - 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 (timeout != null) { - _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(timeout, this.Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(timeout, Client.SerializationSettings).Trim('"')))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _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("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 (clientRequestId != null) { @@ -157,7 +165,7 @@ internal CertificateOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(clientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("client-request-id", SafeJsonConvert.SerializeObject(clientRequestId, Client.SerializationSettings).Trim('"')); } if (returnClientRequestId != null) { @@ -165,7 +173,7 @@ internal CertificateOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("return-client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(returnClientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", SafeJsonConvert.SerializeObject(returnClientRequestId, Client.SerializationSettings).Trim('"')); } if (ocpDate != null) { @@ -173,7 +181,7 @@ internal CertificateOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("ocp-date"); } - _httpRequest.Headers.TryAddWithoutValidation("ocp-date", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ocpDate, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("ocp-date", SafeJsonConvert.SerializeObject(ocpDate, new DateTimeRfc1123JsonConverter()).Trim('"')); } @@ -193,28 +201,28 @@ internal CertificateOperations(BatchServiceClient client) string _requestContent = null; if(certificate != null) { - _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(certificate, this.Client.SerializationSettings); - _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = SafeJsonConvert.SerializeObject(certificate, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; odata=minimalmetadata; 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 != 201) @@ -223,21 +231,21 @@ internal CertificateOperations(BatchServiceClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - BatchError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + BatchError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -247,7 +255,7 @@ internal CertificateOperations(BatchServiceClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); + var _result = new AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("request-id")) @@ -256,20 +264,20 @@ internal CertificateOperations(BatchServiceClient client) } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(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 headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -290,10 +298,10 @@ internal CertificateOperations(BatchServiceClient client) /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -302,11 +310,11 @@ internal CertificateOperations(BatchServiceClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task,CertificateListHeaders>> ListWithHttpMessagesAsync(CertificateListOptions certificateListOptions = default(CertificateListOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task,CertificateListHeaders>> ListWithHttpMessagesAsync(CertificateListOptions certificateListOptions = default(CertificateListOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - 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"); } string filter = default(string); if (certificateListOptions != null) @@ -344,12 +352,12 @@ internal CertificateOperations(BatchServiceClient client) ocpDate = certificateListOptions.OcpDate; } // 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("filter", filter); tracingParameters.Add("select", select); tracingParameters.Add("maxResults", maxResults); @@ -358,15 +366,15 @@ internal CertificateOperations(BatchServiceClient client) tracingParameters.Add("returnClientRequestId", returnClientRequestId); tracingParameters.Add("ocpDate", ocpDate); 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("/") ? "" : "/")), "certificates").ToString(); - 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 (filter != null) { @@ -378,33 +386,33 @@ internal CertificateOperations(BatchServiceClient client) } if (maxResults != null) { - _queryParameters.Add(string.Format("maxresults={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(maxResults, this.Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("maxresults={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(maxResults, Client.SerializationSettings).Trim('"')))); } if (timeout != null) { - _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(timeout, this.Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(timeout, Client.SerializationSettings).Trim('"')))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _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("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 (clientRequestId != null) { @@ -412,7 +420,7 @@ internal CertificateOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(clientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("client-request-id", SafeJsonConvert.SerializeObject(clientRequestId, Client.SerializationSettings).Trim('"')); } if (returnClientRequestId != null) { @@ -420,7 +428,7 @@ internal CertificateOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("return-client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(returnClientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", SafeJsonConvert.SerializeObject(returnClientRequestId, Client.SerializationSettings).Trim('"')); } if (ocpDate != null) { @@ -428,7 +436,7 @@ internal CertificateOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("ocp-date"); } - _httpRequest.Headers.TryAddWithoutValidation("ocp-date", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ocpDate, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("ocp-date", SafeJsonConvert.SerializeObject(ocpDate, new DateTimeRfc1123JsonConverter()).Trim('"')); } @@ -447,23 +455,23 @@ internal CertificateOperations(BatchServiceClient 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) @@ -472,21 +480,21 @@ internal CertificateOperations(BatchServiceClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - BatchError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + BatchError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -496,7 +504,7 @@ internal CertificateOperations(BatchServiceClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse,CertificateListHeaders>(); + var _result = new AzureOperationResponse,CertificateListHeaders>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("request-id")) @@ -509,34 +517,34 @@ internal CertificateOperations(BatchServiceClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = 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); } } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(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 headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -571,7 +579,7 @@ internal CertificateOperations(BatchServiceClient client) /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -580,19 +588,19 @@ internal CertificateOperations(BatchServiceClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> CancelDeletionWithHttpMessagesAsync(string thumbprintAlgorithm, string thumbprint, CertificateCancelDeletionOptions certificateCancelDeletionOptions = default(CertificateCancelDeletionOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> CancelDeletionWithHttpMessagesAsync(string thumbprintAlgorithm, string thumbprint, CertificateCancelDeletionOptions certificateCancelDeletionOptions = default(CertificateCancelDeletionOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (thumbprintAlgorithm == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "thumbprintAlgorithm"); + throw new ValidationException(ValidationRules.CannotBeNull, "thumbprintAlgorithm"); } if (thumbprint == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "thumbprint"); + throw new ValidationException(ValidationRules.CannotBeNull, "thumbprint"); } - 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"); } int? timeout = default(int?); if (certificateCancelDeletionOptions != null) @@ -615,12 +623,12 @@ internal CertificateOperations(BatchServiceClient client) ocpDate = certificateCancelDeletionOptions.OcpDate; } // 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("thumbprintAlgorithm", thumbprintAlgorithm); tracingParameters.Add("thumbprint", thumbprint); tracingParameters.Add("timeout", timeout); @@ -628,43 +636,43 @@ internal CertificateOperations(BatchServiceClient client) tracingParameters.Add("returnClientRequestId", returnClientRequestId); tracingParameters.Add("ocpDate", ocpDate); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "CancelDeletion", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CancelDeletion", 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("/") ? "" : "/")), "certificates(thumbprintAlgorithm={thumbprintAlgorithm},thumbprint={thumbprint})/canceldelete").ToString(); _url = _url.Replace("{thumbprintAlgorithm}", System.Uri.EscapeDataString(thumbprintAlgorithm)); _url = _url.Replace("{thumbprint}", System.Uri.EscapeDataString(thumbprint)); - 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 (timeout != null) { - _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(timeout, this.Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(timeout, Client.SerializationSettings).Trim('"')))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _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("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 (clientRequestId != null) { @@ -672,7 +680,7 @@ internal CertificateOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(clientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("client-request-id", SafeJsonConvert.SerializeObject(clientRequestId, Client.SerializationSettings).Trim('"')); } if (returnClientRequestId != null) { @@ -680,7 +688,7 @@ internal CertificateOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("return-client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(returnClientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", SafeJsonConvert.SerializeObject(returnClientRequestId, Client.SerializationSettings).Trim('"')); } if (ocpDate != null) { @@ -688,7 +696,7 @@ internal CertificateOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("ocp-date"); } - _httpRequest.Headers.TryAddWithoutValidation("ocp-date", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ocpDate, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("ocp-date", SafeJsonConvert.SerializeObject(ocpDate, new DateTimeRfc1123JsonConverter()).Trim('"')); } @@ -707,23 +715,23 @@ internal CertificateOperations(BatchServiceClient 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 != 204) @@ -732,21 +740,21 @@ internal CertificateOperations(BatchServiceClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - BatchError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + BatchError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -756,7 +764,7 @@ internal CertificateOperations(BatchServiceClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); + var _result = new AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("request-id")) @@ -765,20 +773,20 @@ internal CertificateOperations(BatchServiceClient client) } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(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 headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -816,7 +824,7 @@ internal CertificateOperations(BatchServiceClient client) /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -825,19 +833,19 @@ internal CertificateOperations(BatchServiceClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> DeleteWithHttpMessagesAsync(string thumbprintAlgorithm, string thumbprint, CertificateDeleteOptions certificateDeleteOptions = default(CertificateDeleteOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> DeleteWithHttpMessagesAsync(string thumbprintAlgorithm, string thumbprint, CertificateDeleteOptions certificateDeleteOptions = default(CertificateDeleteOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (thumbprintAlgorithm == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "thumbprintAlgorithm"); + throw new ValidationException(ValidationRules.CannotBeNull, "thumbprintAlgorithm"); } if (thumbprint == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "thumbprint"); + throw new ValidationException(ValidationRules.CannotBeNull, "thumbprint"); } - 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"); } int? timeout = default(int?); if (certificateDeleteOptions != null) @@ -860,12 +868,12 @@ internal CertificateOperations(BatchServiceClient client) ocpDate = certificateDeleteOptions.OcpDate; } // 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("thumbprintAlgorithm", thumbprintAlgorithm); tracingParameters.Add("thumbprint", thumbprint); tracingParameters.Add("timeout", timeout); @@ -873,43 +881,43 @@ internal CertificateOperations(BatchServiceClient client) tracingParameters.Add("returnClientRequestId", returnClientRequestId); tracingParameters.Add("ocpDate", ocpDate); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Delete", 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("/") ? "" : "/")), "certificates(thumbprintAlgorithm={thumbprintAlgorithm},thumbprint={thumbprint})").ToString(); _url = _url.Replace("{thumbprintAlgorithm}", System.Uri.EscapeDataString(thumbprintAlgorithm)); _url = _url.Replace("{thumbprint}", System.Uri.EscapeDataString(thumbprint)); - 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 (timeout != null) { - _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(timeout, this.Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(timeout, Client.SerializationSettings).Trim('"')))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _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("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 (clientRequestId != null) { @@ -917,7 +925,7 @@ internal CertificateOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(clientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("client-request-id", SafeJsonConvert.SerializeObject(clientRequestId, Client.SerializationSettings).Trim('"')); } if (returnClientRequestId != null) { @@ -925,7 +933,7 @@ internal CertificateOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("return-client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(returnClientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", SafeJsonConvert.SerializeObject(returnClientRequestId, Client.SerializationSettings).Trim('"')); } if (ocpDate != null) { @@ -933,7 +941,7 @@ internal CertificateOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("ocp-date"); } - _httpRequest.Headers.TryAddWithoutValidation("ocp-date", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ocpDate, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("ocp-date", SafeJsonConvert.SerializeObject(ocpDate, new DateTimeRfc1123JsonConverter()).Trim('"')); } @@ -952,23 +960,23 @@ internal CertificateOperations(BatchServiceClient 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 != 202) @@ -977,21 +985,21 @@ internal CertificateOperations(BatchServiceClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - BatchError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + BatchError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1001,7 +1009,7 @@ internal CertificateOperations(BatchServiceClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); + var _result = new AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("request-id")) @@ -1010,20 +1018,20 @@ internal CertificateOperations(BatchServiceClient client) } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(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 headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -1049,10 +1057,10 @@ internal CertificateOperations(BatchServiceClient client) /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1061,19 +1069,19 @@ internal CertificateOperations(BatchServiceClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string thumbprintAlgorithm, string thumbprint, CertificateGetOptions certificateGetOptions = default(CertificateGetOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string thumbprintAlgorithm, string thumbprint, CertificateGetOptions certificateGetOptions = default(CertificateGetOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (thumbprintAlgorithm == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "thumbprintAlgorithm"); + throw new ValidationException(ValidationRules.CannotBeNull, "thumbprintAlgorithm"); } if (thumbprint == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "thumbprint"); + throw new ValidationException(ValidationRules.CannotBeNull, "thumbprint"); } - 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"); } string select = default(string); if (certificateGetOptions != null) @@ -1101,12 +1109,12 @@ internal CertificateOperations(BatchServiceClient client) ocpDate = certificateGetOptions.OcpDate; } // 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("thumbprintAlgorithm", thumbprintAlgorithm); tracingParameters.Add("thumbprint", thumbprint); tracingParameters.Add("select", select); @@ -1115,17 +1123,17 @@ internal CertificateOperations(BatchServiceClient client) tracingParameters.Add("returnClientRequestId", returnClientRequestId); tracingParameters.Add("ocpDate", ocpDate); 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("/") ? "" : "/")), "certificates(thumbprintAlgorithm={thumbprintAlgorithm},thumbprint={thumbprint})").ToString(); _url = _url.Replace("{thumbprintAlgorithm}", System.Uri.EscapeDataString(thumbprintAlgorithm)); _url = _url.Replace("{thumbprint}", System.Uri.EscapeDataString(thumbprint)); - 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 (select != null) { @@ -1133,29 +1141,29 @@ internal CertificateOperations(BatchServiceClient client) } if (timeout != null) { - _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(timeout, this.Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(timeout, Client.SerializationSettings).Trim('"')))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _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("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 (clientRequestId != null) { @@ -1163,7 +1171,7 @@ internal CertificateOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(clientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("client-request-id", SafeJsonConvert.SerializeObject(clientRequestId, Client.SerializationSettings).Trim('"')); } if (returnClientRequestId != null) { @@ -1171,7 +1179,7 @@ internal CertificateOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("return-client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(returnClientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", SafeJsonConvert.SerializeObject(returnClientRequestId, Client.SerializationSettings).Trim('"')); } if (ocpDate != null) { @@ -1179,7 +1187,7 @@ internal CertificateOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("ocp-date"); } - _httpRequest.Headers.TryAddWithoutValidation("ocp-date", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ocpDate, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("ocp-date", SafeJsonConvert.SerializeObject(ocpDate, new DateTimeRfc1123JsonConverter()).Trim('"')); } @@ -1198,23 +1206,23 @@ internal CertificateOperations(BatchServiceClient 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) @@ -1223,21 +1231,21 @@ internal CertificateOperations(BatchServiceClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - BatchError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + BatchError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1247,7 +1255,7 @@ internal CertificateOperations(BatchServiceClient 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("request-id")) @@ -1260,34 +1268,34 @@ internal CertificateOperations(BatchServiceClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = 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); } } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(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 headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -1311,10 +1319,10 @@ internal CertificateOperations(BatchServiceClient client) /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1323,11 +1331,11 @@ internal CertificateOperations(BatchServiceClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task,CertificateListHeaders>> ListNextWithHttpMessagesAsync(string nextPageLink, CertificateListNextOptions certificateListNextOptions = default(CertificateListNextOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task,CertificateListHeaders>> ListNextWithHttpMessagesAsync(string nextPageLink, CertificateListNextOptions certificateListNextOptions = default(CertificateListNextOptions), 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"); } System.Guid? clientRequestId = default(System.Guid?); if (certificateListNextOptions != null) @@ -1345,44 +1353,44 @@ internal CertificateOperations(BatchServiceClient client) ocpDate = certificateListNextOptions.OcpDate; } // 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("clientRequestId", clientRequestId); tracingParameters.Add("returnClientRequestId", returnClientRequestId); tracingParameters.Add("ocpDate", ocpDate); 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 += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _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("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 (clientRequestId != null) { @@ -1390,7 +1398,7 @@ internal CertificateOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(clientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("client-request-id", SafeJsonConvert.SerializeObject(clientRequestId, Client.SerializationSettings).Trim('"')); } if (returnClientRequestId != null) { @@ -1398,7 +1406,7 @@ internal CertificateOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("return-client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(returnClientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", SafeJsonConvert.SerializeObject(returnClientRequestId, Client.SerializationSettings).Trim('"')); } if (ocpDate != null) { @@ -1406,7 +1414,7 @@ internal CertificateOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("ocp-date"); } - _httpRequest.Headers.TryAddWithoutValidation("ocp-date", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ocpDate, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("ocp-date", SafeJsonConvert.SerializeObject(ocpDate, new DateTimeRfc1123JsonConverter()).Trim('"')); } @@ -1425,23 +1433,23 @@ internal CertificateOperations(BatchServiceClient 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) @@ -1450,21 +1458,21 @@ internal CertificateOperations(BatchServiceClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - BatchError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + BatchError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1474,7 +1482,7 @@ internal CertificateOperations(BatchServiceClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse,CertificateListHeaders>(); + var _result = new AzureOperationResponse,CertificateListHeaders>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("request-id")) @@ -1487,37 +1495,37 @@ internal CertificateOperations(BatchServiceClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = 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); } } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(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 headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } } -} +} \ No newline at end of file diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/CertificateOperationsExtensions.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/CertificateOperationsExtensions.cs index 6d2405e7d07a..177d54be21cb 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/CertificateOperationsExtensions.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/CertificateOperationsExtensions.cs @@ -8,8 +8,11 @@ namespace Microsoft.Azure.Batch.Protocol { + using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; + using System.Threading; + using System.Threading.Tasks; /// /// Extension methods for CertificateOperations. @@ -30,7 +33,7 @@ public static partial class CertificateOperationsExtensions /// public static CertificateAddHeaders Add(this ICertificateOperations operations, CertificateAddParameter certificate, CertificateAddOptions certificateAddOptions = default(CertificateAddOptions)) { - return ((ICertificateOperations)operations).AddAsync(certificate, certificateAddOptions).GetAwaiter().GetResult(); + return operations.AddAsync(certificate, certificateAddOptions).GetAwaiter().GetResult(); } /// @@ -48,7 +51,7 @@ public static partial class CertificateOperationsExtensions /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task AddAsync(this ICertificateOperations operations, CertificateAddParameter certificate, CertificateAddOptions certificateAddOptions = default(CertificateAddOptions), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task AddAsync(this ICertificateOperations operations, CertificateAddParameter certificate, CertificateAddOptions certificateAddOptions = default(CertificateAddOptions), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.AddWithHttpMessagesAsync(certificate, certificateAddOptions, null, cancellationToken).ConfigureAwait(false)) { @@ -66,9 +69,9 @@ public static partial class CertificateOperationsExtensions /// /// Additional parameters for the operation /// - public static Microsoft.Rest.Azure.IPage List(this ICertificateOperations operations, CertificateListOptions certificateListOptions = default(CertificateListOptions)) + public static IPage List(this ICertificateOperations operations, CertificateListOptions certificateListOptions = default(CertificateListOptions)) { - return ((ICertificateOperations)operations).ListAsync(certificateListOptions).GetAwaiter().GetResult(); + return operations.ListAsync(certificateListOptions).GetAwaiter().GetResult(); } /// @@ -84,7 +87,7 @@ public static partial class CertificateOperationsExtensions /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListAsync(this ICertificateOperations operations, CertificateListOptions certificateListOptions = default(CertificateListOptions), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task> ListAsync(this ICertificateOperations operations, CertificateListOptions certificateListOptions = default(CertificateListOptions), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListWithHttpMessagesAsync(certificateListOptions, null, cancellationToken).ConfigureAwait(false)) { @@ -118,7 +121,7 @@ public static partial class CertificateOperationsExtensions /// public static CertificateCancelDeletionHeaders CancelDeletion(this ICertificateOperations operations, string thumbprintAlgorithm, string thumbprint, CertificateCancelDeletionOptions certificateCancelDeletionOptions = default(CertificateCancelDeletionOptions)) { - return ((ICertificateOperations)operations).CancelDeletionAsync(thumbprintAlgorithm, thumbprint, certificateCancelDeletionOptions).GetAwaiter().GetResult(); + return operations.CancelDeletionAsync(thumbprintAlgorithm, thumbprint, certificateCancelDeletionOptions).GetAwaiter().GetResult(); } /// @@ -148,7 +151,7 @@ public static partial class CertificateOperationsExtensions /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task CancelDeletionAsync(this ICertificateOperations operations, string thumbprintAlgorithm, string thumbprint, CertificateCancelDeletionOptions certificateCancelDeletionOptions = default(CertificateCancelDeletionOptions), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task CancelDeletionAsync(this ICertificateOperations operations, string thumbprintAlgorithm, string thumbprint, CertificateCancelDeletionOptions certificateCancelDeletionOptions = default(CertificateCancelDeletionOptions), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.CancelDeletionWithHttpMessagesAsync(thumbprintAlgorithm, thumbprint, certificateCancelDeletionOptions, null, cancellationToken).ConfigureAwait(false)) { @@ -185,7 +188,7 @@ public static partial class CertificateOperationsExtensions /// public static CertificateDeleteHeaders Delete(this ICertificateOperations operations, string thumbprintAlgorithm, string thumbprint, CertificateDeleteOptions certificateDeleteOptions = default(CertificateDeleteOptions)) { - return ((ICertificateOperations)operations).DeleteAsync(thumbprintAlgorithm, thumbprint, certificateDeleteOptions).GetAwaiter().GetResult(); + return operations.DeleteAsync(thumbprintAlgorithm, thumbprint, certificateDeleteOptions).GetAwaiter().GetResult(); } /// @@ -218,7 +221,7 @@ public static partial class CertificateOperationsExtensions /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task DeleteAsync(this ICertificateOperations operations, string thumbprintAlgorithm, string thumbprint, CertificateDeleteOptions certificateDeleteOptions = default(CertificateDeleteOptions), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task DeleteAsync(this ICertificateOperations operations, string thumbprintAlgorithm, string thumbprint, CertificateDeleteOptions certificateDeleteOptions = default(CertificateDeleteOptions), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.DeleteWithHttpMessagesAsync(thumbprintAlgorithm, thumbprint, certificateDeleteOptions, null, cancellationToken).ConfigureAwait(false)) { @@ -243,7 +246,7 @@ public static partial class CertificateOperationsExtensions /// public static Certificate Get(this ICertificateOperations operations, string thumbprintAlgorithm, string thumbprint, CertificateGetOptions certificateGetOptions = default(CertificateGetOptions)) { - return ((ICertificateOperations)operations).GetAsync(thumbprintAlgorithm, thumbprint, certificateGetOptions).GetAwaiter().GetResult(); + return operations.GetAsync(thumbprintAlgorithm, thumbprint, certificateGetOptions).GetAwaiter().GetResult(); } /// @@ -264,7 +267,7 @@ public static partial class CertificateOperationsExtensions /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task GetAsync(this ICertificateOperations operations, string thumbprintAlgorithm, string thumbprint, CertificateGetOptions certificateGetOptions = default(CertificateGetOptions), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task GetAsync(this ICertificateOperations operations, string thumbprintAlgorithm, string thumbprint, CertificateGetOptions certificateGetOptions = default(CertificateGetOptions), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.GetWithHttpMessagesAsync(thumbprintAlgorithm, thumbprint, certificateGetOptions, null, cancellationToken).ConfigureAwait(false)) { @@ -285,9 +288,9 @@ public static partial class CertificateOperationsExtensions /// /// Additional parameters for the operation /// - public static Microsoft.Rest.Azure.IPage ListNext(this ICertificateOperations operations, string nextPageLink, CertificateListNextOptions certificateListNextOptions = default(CertificateListNextOptions)) + public static IPage ListNext(this ICertificateOperations operations, string nextPageLink, CertificateListNextOptions certificateListNextOptions = default(CertificateListNextOptions)) { - return ((ICertificateOperations)operations).ListNextAsync(nextPageLink, certificateListNextOptions).GetAwaiter().GetResult(); + return operations.ListNextAsync(nextPageLink, certificateListNextOptions).GetAwaiter().GetResult(); } /// @@ -306,7 +309,7 @@ public static partial class CertificateOperationsExtensions /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListNextAsync(this ICertificateOperations operations, string nextPageLink, CertificateListNextOptions certificateListNextOptions = default(CertificateListNextOptions), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task> ListNextAsync(this ICertificateOperations operations, string nextPageLink, CertificateListNextOptions certificateListNextOptions = default(CertificateListNextOptions), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, certificateListNextOptions, null, cancellationToken).ConfigureAwait(false)) { @@ -315,4 +318,4 @@ public static partial class CertificateOperationsExtensions } } -} +} \ No newline at end of file diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/ComputeNodeOperations.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/ComputeNodeOperations.cs index 138c691ca069..4d1e56d86895 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/ComputeNodeOperations.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/ComputeNodeOperations.cs @@ -8,15 +8,24 @@ namespace Microsoft.Azure.Batch.Protocol { - 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.IO; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; /// /// ComputeNodeOperations operations. /// - internal partial class ComputeNodeOperations : Microsoft.Rest.IServiceOperations, IComputeNodeOperations + internal partial class ComputeNodeOperations : IServiceOperations, IComputeNodeOperations { /// /// Initializes a new instance of the ComputeNodeOperations class. @@ -33,7 +42,7 @@ internal ComputeNodeOperations(BatchServiceClient client) { throw new System.ArgumentNullException("client"); } - this.Client = client; + Client = client; } /// @@ -69,7 +78,7 @@ internal ComputeNodeOperations(BatchServiceClient client) /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -78,27 +87,27 @@ internal ComputeNodeOperations(BatchServiceClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> AddUserWithHttpMessagesAsync(string poolId, string nodeId, ComputeNodeUser user, ComputeNodeAddUserOptions computeNodeAddUserOptions = default(ComputeNodeAddUserOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> AddUserWithHttpMessagesAsync(string poolId, string nodeId, ComputeNodeUser user, ComputeNodeAddUserOptions computeNodeAddUserOptions = default(ComputeNodeAddUserOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (poolId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "poolId"); + throw new ValidationException(ValidationRules.CannotBeNull, "poolId"); } if (nodeId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nodeId"); + throw new ValidationException(ValidationRules.CannotBeNull, "nodeId"); } if (user == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "user"); + throw new ValidationException(ValidationRules.CannotBeNull, "user"); } if (user != null) { user.Validate(); } - 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"); } int? timeout = default(int?); if (computeNodeAddUserOptions != null) @@ -121,12 +130,12 @@ internal ComputeNodeOperations(BatchServiceClient client) ocpDate = computeNodeAddUserOptions.OcpDate; } // 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("poolId", poolId); tracingParameters.Add("nodeId", nodeId); tracingParameters.Add("user", user); @@ -135,43 +144,43 @@ internal ComputeNodeOperations(BatchServiceClient client) tracingParameters.Add("returnClientRequestId", returnClientRequestId); tracingParameters.Add("ocpDate", ocpDate); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "AddUser", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "AddUser", 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("/") ? "" : "/")), "pools/{poolId}/nodes/{nodeId}/users").ToString(); _url = _url.Replace("{poolId}", System.Uri.EscapeDataString(poolId)); _url = _url.Replace("{nodeId}", System.Uri.EscapeDataString(nodeId)); - 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 (timeout != null) { - _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(timeout, this.Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(timeout, Client.SerializationSettings).Trim('"')))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _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("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 (clientRequestId != null) { @@ -179,7 +188,7 @@ internal ComputeNodeOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(clientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("client-request-id", SafeJsonConvert.SerializeObject(clientRequestId, Client.SerializationSettings).Trim('"')); } if (returnClientRequestId != null) { @@ -187,7 +196,7 @@ internal ComputeNodeOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("return-client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(returnClientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", SafeJsonConvert.SerializeObject(returnClientRequestId, Client.SerializationSettings).Trim('"')); } if (ocpDate != null) { @@ -195,7 +204,7 @@ internal ComputeNodeOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("ocp-date"); } - _httpRequest.Headers.TryAddWithoutValidation("ocp-date", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ocpDate, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("ocp-date", SafeJsonConvert.SerializeObject(ocpDate, new DateTimeRfc1123JsonConverter()).Trim('"')); } @@ -215,28 +224,28 @@ internal ComputeNodeOperations(BatchServiceClient client) string _requestContent = null; if(user != null) { - _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(user, this.Client.SerializationSettings); - _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = SafeJsonConvert.SerializeObject(user, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; odata=minimalmetadata; 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 != 201) @@ -245,21 +254,21 @@ internal ComputeNodeOperations(BatchServiceClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - BatchError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + BatchError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -269,7 +278,7 @@ internal ComputeNodeOperations(BatchServiceClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); + var _result = new AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("request-id")) @@ -278,20 +287,20 @@ internal ComputeNodeOperations(BatchServiceClient client) } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(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 headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -324,7 +333,7 @@ internal ComputeNodeOperations(BatchServiceClient client) /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -333,23 +342,23 @@ internal ComputeNodeOperations(BatchServiceClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> DeleteUserWithHttpMessagesAsync(string poolId, string nodeId, string userName, ComputeNodeDeleteUserOptions computeNodeDeleteUserOptions = default(ComputeNodeDeleteUserOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> DeleteUserWithHttpMessagesAsync(string poolId, string nodeId, string userName, ComputeNodeDeleteUserOptions computeNodeDeleteUserOptions = default(ComputeNodeDeleteUserOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (poolId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "poolId"); + throw new ValidationException(ValidationRules.CannotBeNull, "poolId"); } if (nodeId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nodeId"); + throw new ValidationException(ValidationRules.CannotBeNull, "nodeId"); } if (userName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "userName"); + throw new ValidationException(ValidationRules.CannotBeNull, "userName"); } - 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"); } int? timeout = default(int?); if (computeNodeDeleteUserOptions != null) @@ -372,12 +381,12 @@ internal ComputeNodeOperations(BatchServiceClient client) ocpDate = computeNodeDeleteUserOptions.OcpDate; } // 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("poolId", poolId); tracingParameters.Add("nodeId", nodeId); tracingParameters.Add("userName", userName); @@ -386,44 +395,44 @@ internal ComputeNodeOperations(BatchServiceClient client) tracingParameters.Add("returnClientRequestId", returnClientRequestId); tracingParameters.Add("ocpDate", ocpDate); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "DeleteUser", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteUser", 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("/") ? "" : "/")), "pools/{poolId}/nodes/{nodeId}/users/{userName}").ToString(); _url = _url.Replace("{poolId}", System.Uri.EscapeDataString(poolId)); _url = _url.Replace("{nodeId}", System.Uri.EscapeDataString(nodeId)); _url = _url.Replace("{userName}", System.Uri.EscapeDataString(userName)); - 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 (timeout != null) { - _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(timeout, this.Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(timeout, Client.SerializationSettings).Trim('"')))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _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("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 (clientRequestId != null) { @@ -431,7 +440,7 @@ internal ComputeNodeOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(clientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("client-request-id", SafeJsonConvert.SerializeObject(clientRequestId, Client.SerializationSettings).Trim('"')); } if (returnClientRequestId != null) { @@ -439,7 +448,7 @@ internal ComputeNodeOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("return-client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(returnClientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", SafeJsonConvert.SerializeObject(returnClientRequestId, Client.SerializationSettings).Trim('"')); } if (ocpDate != null) { @@ -447,7 +456,7 @@ internal ComputeNodeOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("ocp-date"); } - _httpRequest.Headers.TryAddWithoutValidation("ocp-date", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ocpDate, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("ocp-date", SafeJsonConvert.SerializeObject(ocpDate, new DateTimeRfc1123JsonConverter()).Trim('"')); } @@ -466,23 +475,23 @@ internal ComputeNodeOperations(BatchServiceClient 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) @@ -491,21 +500,21 @@ internal ComputeNodeOperations(BatchServiceClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - BatchError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + BatchError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -515,7 +524,7 @@ internal ComputeNodeOperations(BatchServiceClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); + var _result = new AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("request-id")) @@ -524,26 +533,26 @@ internal ComputeNodeOperations(BatchServiceClient client) } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(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 headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// Updates the password or expiration time of a user account on the specified + /// Updates the password and expiration time of a user account on the specified /// compute node. /// /// @@ -576,7 +585,7 @@ internal ComputeNodeOperations(BatchServiceClient client) /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -585,27 +594,27 @@ internal ComputeNodeOperations(BatchServiceClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> UpdateUserWithHttpMessagesAsync(string poolId, string nodeId, string userName, NodeUpdateUserParameter nodeUpdateUserParameter, ComputeNodeUpdateUserOptions computeNodeUpdateUserOptions = default(ComputeNodeUpdateUserOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> UpdateUserWithHttpMessagesAsync(string poolId, string nodeId, string userName, NodeUpdateUserParameter nodeUpdateUserParameter, ComputeNodeUpdateUserOptions computeNodeUpdateUserOptions = default(ComputeNodeUpdateUserOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (poolId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "poolId"); + throw new ValidationException(ValidationRules.CannotBeNull, "poolId"); } if (nodeId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nodeId"); + throw new ValidationException(ValidationRules.CannotBeNull, "nodeId"); } if (userName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "userName"); + throw new ValidationException(ValidationRules.CannotBeNull, "userName"); } if (nodeUpdateUserParameter == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nodeUpdateUserParameter"); + throw new ValidationException(ValidationRules.CannotBeNull, "nodeUpdateUserParameter"); } - 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"); } int? timeout = default(int?); if (computeNodeUpdateUserOptions != null) @@ -628,12 +637,12 @@ internal ComputeNodeOperations(BatchServiceClient client) ocpDate = computeNodeUpdateUserOptions.OcpDate; } // 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("poolId", poolId); tracingParameters.Add("nodeId", nodeId); tracingParameters.Add("userName", userName); @@ -643,44 +652,44 @@ internal ComputeNodeOperations(BatchServiceClient client) tracingParameters.Add("returnClientRequestId", returnClientRequestId); tracingParameters.Add("ocpDate", ocpDate); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "UpdateUser", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateUser", 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("/") ? "" : "/")), "pools/{poolId}/nodes/{nodeId}/users/{userName}").ToString(); _url = _url.Replace("{poolId}", System.Uri.EscapeDataString(poolId)); _url = _url.Replace("{nodeId}", System.Uri.EscapeDataString(nodeId)); _url = _url.Replace("{userName}", System.Uri.EscapeDataString(userName)); - 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 (timeout != null) { - _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(timeout, this.Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(timeout, Client.SerializationSettings).Trim('"')))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _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("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 (clientRequestId != null) { @@ -688,7 +697,7 @@ internal ComputeNodeOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(clientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("client-request-id", SafeJsonConvert.SerializeObject(clientRequestId, Client.SerializationSettings).Trim('"')); } if (returnClientRequestId != null) { @@ -696,7 +705,7 @@ internal ComputeNodeOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("return-client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(returnClientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", SafeJsonConvert.SerializeObject(returnClientRequestId, Client.SerializationSettings).Trim('"')); } if (ocpDate != null) { @@ -704,7 +713,7 @@ internal ComputeNodeOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("ocp-date"); } - _httpRequest.Headers.TryAddWithoutValidation("ocp-date", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ocpDate, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("ocp-date", SafeJsonConvert.SerializeObject(ocpDate, new DateTimeRfc1123JsonConverter()).Trim('"')); } @@ -724,28 +733,28 @@ internal ComputeNodeOperations(BatchServiceClient client) string _requestContent = null; if(nodeUpdateUserParameter != null) { - _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(nodeUpdateUserParameter, this.Client.SerializationSettings); - _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = SafeJsonConvert.SerializeObject(nodeUpdateUserParameter, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; odata=minimalmetadata; 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) @@ -754,21 +763,21 @@ internal ComputeNodeOperations(BatchServiceClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - BatchError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + BatchError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -778,7 +787,7 @@ internal ComputeNodeOperations(BatchServiceClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); + var _result = new AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("request-id")) @@ -787,20 +796,20 @@ internal ComputeNodeOperations(BatchServiceClient client) } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(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 headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -826,10 +835,10 @@ internal ComputeNodeOperations(BatchServiceClient client) /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -838,19 +847,19 @@ internal ComputeNodeOperations(BatchServiceClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string poolId, string nodeId, ComputeNodeGetOptions computeNodeGetOptions = default(ComputeNodeGetOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string poolId, string nodeId, ComputeNodeGetOptions computeNodeGetOptions = default(ComputeNodeGetOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (poolId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "poolId"); + throw new ValidationException(ValidationRules.CannotBeNull, "poolId"); } if (nodeId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nodeId"); + throw new ValidationException(ValidationRules.CannotBeNull, "nodeId"); } - 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"); } string select = default(string); if (computeNodeGetOptions != null) @@ -878,12 +887,12 @@ internal ComputeNodeOperations(BatchServiceClient client) ocpDate = computeNodeGetOptions.OcpDate; } // 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("poolId", poolId); tracingParameters.Add("nodeId", nodeId); tracingParameters.Add("select", select); @@ -892,17 +901,17 @@ internal ComputeNodeOperations(BatchServiceClient client) tracingParameters.Add("returnClientRequestId", returnClientRequestId); tracingParameters.Add("ocpDate", ocpDate); 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("/") ? "" : "/")), "pools/{poolId}/nodes/{nodeId}").ToString(); _url = _url.Replace("{poolId}", System.Uri.EscapeDataString(poolId)); _url = _url.Replace("{nodeId}", System.Uri.EscapeDataString(nodeId)); - 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 (select != null) { @@ -910,29 +919,29 @@ internal ComputeNodeOperations(BatchServiceClient client) } if (timeout != null) { - _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(timeout, this.Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(timeout, Client.SerializationSettings).Trim('"')))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _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("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 (clientRequestId != null) { @@ -940,7 +949,7 @@ internal ComputeNodeOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(clientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("client-request-id", SafeJsonConvert.SerializeObject(clientRequestId, Client.SerializationSettings).Trim('"')); } if (returnClientRequestId != null) { @@ -948,7 +957,7 @@ internal ComputeNodeOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("return-client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(returnClientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", SafeJsonConvert.SerializeObject(returnClientRequestId, Client.SerializationSettings).Trim('"')); } if (ocpDate != null) { @@ -956,7 +965,7 @@ internal ComputeNodeOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("ocp-date"); } - _httpRequest.Headers.TryAddWithoutValidation("ocp-date", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ocpDate, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("ocp-date", SafeJsonConvert.SerializeObject(ocpDate, new DateTimeRfc1123JsonConverter()).Trim('"')); } @@ -975,23 +984,23 @@ internal ComputeNodeOperations(BatchServiceClient 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) @@ -1000,21 +1009,21 @@ internal ComputeNodeOperations(BatchServiceClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - BatchError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + BatchError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1024,7 +1033,7 @@ internal ComputeNodeOperations(BatchServiceClient 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("request-id")) @@ -1037,34 +1046,34 @@ internal ComputeNodeOperations(BatchServiceClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = 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); } } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(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 headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -1083,7 +1092,20 @@ internal ComputeNodeOperations(BatchServiceClient client) /// /// /// When to reboot the compute node and what to do with currently running - /// tasks. The default value is requeue. Possible values include: 'requeue', + /// tasks. Values are: + /// + /// requeue - Terminate running task processes and requeue the tasks. The tasks + /// will run again when a node is available. Restart the node as soon as tasks + /// have been terminated. + /// terminate - Terminate running tasks. The tasks will not run again. Restart + /// the node as soon as tasks have been terminated. + /// taskcompletion - Allow currently running tasks to complete. Schedule no new + /// tasks while waiting. Restart the node when all tasks have completed. + /// retaineddata - Allow currently running tasks to complete, then wait for all + /// task data retention periods to expire. Schedule no new tasks while waiting. + /// Restart the node when all task retention periods have expired. + /// + /// The default value is requeue. Possible values include: 'requeue', /// 'terminate', 'taskCompletion', 'retainedData' /// /// @@ -1098,7 +1120,7 @@ internal ComputeNodeOperations(BatchServiceClient client) /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1107,19 +1129,19 @@ internal ComputeNodeOperations(BatchServiceClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> RebootWithHttpMessagesAsync(string poolId, string nodeId, ComputeNodeRebootOption? nodeRebootOption = default(ComputeNodeRebootOption?), ComputeNodeRebootOptions computeNodeRebootOptions = default(ComputeNodeRebootOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> RebootWithHttpMessagesAsync(string poolId, string nodeId, ComputeNodeRebootOption? nodeRebootOption = default(ComputeNodeRebootOption?), ComputeNodeRebootOptions computeNodeRebootOptions = default(ComputeNodeRebootOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (poolId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "poolId"); + throw new ValidationException(ValidationRules.CannotBeNull, "poolId"); } if (nodeId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nodeId"); + throw new ValidationException(ValidationRules.CannotBeNull, "nodeId"); } - 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"); } int? timeout = default(int?); if (computeNodeRebootOptions != null) @@ -1148,12 +1170,12 @@ internal ComputeNodeOperations(BatchServiceClient client) nodeRebootParameter.NodeRebootOption = nodeRebootOption; } // 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("poolId", poolId); tracingParameters.Add("nodeId", nodeId); tracingParameters.Add("timeout", timeout); @@ -1162,43 +1184,43 @@ internal ComputeNodeOperations(BatchServiceClient client) tracingParameters.Add("ocpDate", ocpDate); tracingParameters.Add("nodeRebootParameter", nodeRebootParameter); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Reboot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Reboot", 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("/") ? "" : "/")), "pools/{poolId}/nodes/{nodeId}/reboot").ToString(); _url = _url.Replace("{poolId}", System.Uri.EscapeDataString(poolId)); _url = _url.Replace("{nodeId}", System.Uri.EscapeDataString(nodeId)); - 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 (timeout != null) { - _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(timeout, this.Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(timeout, Client.SerializationSettings).Trim('"')))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _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("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 (clientRequestId != null) { @@ -1206,7 +1228,7 @@ internal ComputeNodeOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(clientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("client-request-id", SafeJsonConvert.SerializeObject(clientRequestId, Client.SerializationSettings).Trim('"')); } if (returnClientRequestId != null) { @@ -1214,7 +1236,7 @@ internal ComputeNodeOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("return-client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(returnClientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", SafeJsonConvert.SerializeObject(returnClientRequestId, Client.SerializationSettings).Trim('"')); } if (ocpDate != null) { @@ -1222,7 +1244,7 @@ internal ComputeNodeOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("ocp-date"); } - _httpRequest.Headers.TryAddWithoutValidation("ocp-date", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ocpDate, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("ocp-date", SafeJsonConvert.SerializeObject(ocpDate, new DateTimeRfc1123JsonConverter()).Trim('"')); } @@ -1242,28 +1264,28 @@ internal ComputeNodeOperations(BatchServiceClient client) string _requestContent = null; if(nodeRebootParameter != null) { - _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(nodeRebootParameter, this.Client.SerializationSettings); - _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = SafeJsonConvert.SerializeObject(nodeRebootParameter, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; odata=minimalmetadata; 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 != 202) @@ -1272,21 +1294,21 @@ internal ComputeNodeOperations(BatchServiceClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - BatchError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + BatchError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1296,7 +1318,7 @@ internal ComputeNodeOperations(BatchServiceClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); + var _result = new AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("request-id")) @@ -1305,20 +1327,20 @@ internal ComputeNodeOperations(BatchServiceClient client) } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(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 headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -1339,7 +1361,20 @@ internal ComputeNodeOperations(BatchServiceClient client) /// /// /// When to reimage the compute node and what to do with currently running - /// tasks. The default value is requeue. Possible values include: 'requeue', + /// tasks. Values are: + /// + /// requeue - Terminate running task processes and requeue the tasks. The tasks + /// will run again when a node is available. Reimage the node as soon as tasks + /// have been terminated. + /// terminate - Terminate running tasks. The tasks will not run again. Reimage + /// the node as soon as tasks have been terminated. + /// taskcompletion - Allow currently running tasks to complete. Schedule no new + /// tasks while waiting. Reimage the node when all tasks have completed. + /// retaineddata - Allow currently running tasks to complete, then wait for all + /// task data retention periods to expire. Schedule no new tasks while waiting. + /// Reimage the node when all task retention periods have expired. + /// + /// The default value is requeue. Possible values include: 'requeue', /// 'terminate', 'taskCompletion', 'retainedData' /// /// @@ -1354,7 +1389,7 @@ internal ComputeNodeOperations(BatchServiceClient client) /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1363,19 +1398,19 @@ internal ComputeNodeOperations(BatchServiceClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> ReimageWithHttpMessagesAsync(string poolId, string nodeId, ComputeNodeReimageOption? nodeReimageOption = default(ComputeNodeReimageOption?), ComputeNodeReimageOptions computeNodeReimageOptions = default(ComputeNodeReimageOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> ReimageWithHttpMessagesAsync(string poolId, string nodeId, ComputeNodeReimageOption? nodeReimageOption = default(ComputeNodeReimageOption?), ComputeNodeReimageOptions computeNodeReimageOptions = default(ComputeNodeReimageOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (poolId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "poolId"); + throw new ValidationException(ValidationRules.CannotBeNull, "poolId"); } if (nodeId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nodeId"); + throw new ValidationException(ValidationRules.CannotBeNull, "nodeId"); } - 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"); } int? timeout = default(int?); if (computeNodeReimageOptions != null) @@ -1404,12 +1439,12 @@ internal ComputeNodeOperations(BatchServiceClient client) nodeReimageParameter.NodeReimageOption = nodeReimageOption; } // 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("poolId", poolId); tracingParameters.Add("nodeId", nodeId); tracingParameters.Add("timeout", timeout); @@ -1418,43 +1453,43 @@ internal ComputeNodeOperations(BatchServiceClient client) tracingParameters.Add("ocpDate", ocpDate); tracingParameters.Add("nodeReimageParameter", nodeReimageParameter); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Reimage", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Reimage", 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("/") ? "" : "/")), "pools/{poolId}/nodes/{nodeId}/reimage").ToString(); _url = _url.Replace("{poolId}", System.Uri.EscapeDataString(poolId)); _url = _url.Replace("{nodeId}", System.Uri.EscapeDataString(nodeId)); - 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 (timeout != null) { - _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(timeout, this.Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(timeout, Client.SerializationSettings).Trim('"')))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _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("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 (clientRequestId != null) { @@ -1462,7 +1497,7 @@ internal ComputeNodeOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(clientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("client-request-id", SafeJsonConvert.SerializeObject(clientRequestId, Client.SerializationSettings).Trim('"')); } if (returnClientRequestId != null) { @@ -1470,7 +1505,7 @@ internal ComputeNodeOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("return-client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(returnClientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", SafeJsonConvert.SerializeObject(returnClientRequestId, Client.SerializationSettings).Trim('"')); } if (ocpDate != null) { @@ -1478,7 +1513,7 @@ internal ComputeNodeOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("ocp-date"); } - _httpRequest.Headers.TryAddWithoutValidation("ocp-date", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ocpDate, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("ocp-date", SafeJsonConvert.SerializeObject(ocpDate, new DateTimeRfc1123JsonConverter()).Trim('"')); } @@ -1498,28 +1533,28 @@ internal ComputeNodeOperations(BatchServiceClient client) string _requestContent = null; if(nodeReimageParameter != null) { - _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(nodeReimageParameter, this.Client.SerializationSettings); - _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = SafeJsonConvert.SerializeObject(nodeReimageParameter, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; odata=minimalmetadata; 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 != 202) @@ -1528,21 +1563,21 @@ internal ComputeNodeOperations(BatchServiceClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - BatchError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + BatchError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1552,7 +1587,7 @@ internal ComputeNodeOperations(BatchServiceClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); + var _result = new AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("request-id")) @@ -1561,20 +1596,20 @@ internal ComputeNodeOperations(BatchServiceClient client) } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(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 headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -1582,6 +1617,10 @@ internal ComputeNodeOperations(BatchServiceClient client) /// /// Disables task scheduling on the specified compute node. /// + /// + /// You can disable task scheduling on a node only if its current scheduling + /// state is enabled. + /// /// /// The ID of the pool that contains the compute node. /// @@ -1590,8 +1629,18 @@ internal ComputeNodeOperations(BatchServiceClient client) /// /// /// What to do with currently running tasks when disabling task scheduling on - /// the compute node. The default value is requeue. Possible values include: - /// 'requeue', 'terminate', 'taskCompletion' + /// the compute node. Values are: + /// + /// requeue - Terminate running task processes and requeue the tasks. The tasks + /// may run again on other compute nodes, or when task scheduling is re-enabled + /// on this node. Enter offline state as soon as tasks have been terminated. + /// terminate - Terminate running tasks. The tasks will not run again. Enter + /// offline state as soon as tasks have been terminated. + /// taskcompletion - Allow currently running tasks to complete. Schedule no new + /// tasks while waiting. Enter offline state when all tasks have completed. + /// + /// The default value is requeue. Possible values include: 'requeue', + /// 'terminate', 'taskCompletion' /// /// /// Additional parameters for the operation @@ -1605,7 +1654,7 @@ internal ComputeNodeOperations(BatchServiceClient client) /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1614,19 +1663,19 @@ internal ComputeNodeOperations(BatchServiceClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> DisableSchedulingWithHttpMessagesAsync(string poolId, string nodeId, DisableComputeNodeSchedulingOption? nodeDisableSchedulingOption = default(DisableComputeNodeSchedulingOption?), ComputeNodeDisableSchedulingOptions computeNodeDisableSchedulingOptions = default(ComputeNodeDisableSchedulingOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> DisableSchedulingWithHttpMessagesAsync(string poolId, string nodeId, DisableComputeNodeSchedulingOption? nodeDisableSchedulingOption = default(DisableComputeNodeSchedulingOption?), ComputeNodeDisableSchedulingOptions computeNodeDisableSchedulingOptions = default(ComputeNodeDisableSchedulingOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (poolId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "poolId"); + throw new ValidationException(ValidationRules.CannotBeNull, "poolId"); } if (nodeId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nodeId"); + throw new ValidationException(ValidationRules.CannotBeNull, "nodeId"); } - 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"); } int? timeout = default(int?); if (computeNodeDisableSchedulingOptions != null) @@ -1655,12 +1704,12 @@ internal ComputeNodeOperations(BatchServiceClient client) nodeDisableSchedulingParameter.NodeDisableSchedulingOption = nodeDisableSchedulingOption; } // 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("poolId", poolId); tracingParameters.Add("nodeId", nodeId); tracingParameters.Add("timeout", timeout); @@ -1669,43 +1718,43 @@ internal ComputeNodeOperations(BatchServiceClient client) tracingParameters.Add("ocpDate", ocpDate); tracingParameters.Add("nodeDisableSchedulingParameter", nodeDisableSchedulingParameter); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "DisableScheduling", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DisableScheduling", 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("/") ? "" : "/")), "pools/{poolId}/nodes/{nodeId}/disablescheduling").ToString(); _url = _url.Replace("{poolId}", System.Uri.EscapeDataString(poolId)); _url = _url.Replace("{nodeId}", System.Uri.EscapeDataString(nodeId)); - 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 (timeout != null) { - _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(timeout, this.Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(timeout, Client.SerializationSettings).Trim('"')))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _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("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 (clientRequestId != null) { @@ -1713,7 +1762,7 @@ internal ComputeNodeOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(clientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("client-request-id", SafeJsonConvert.SerializeObject(clientRequestId, Client.SerializationSettings).Trim('"')); } if (returnClientRequestId != null) { @@ -1721,7 +1770,7 @@ internal ComputeNodeOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("return-client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(returnClientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", SafeJsonConvert.SerializeObject(returnClientRequestId, Client.SerializationSettings).Trim('"')); } if (ocpDate != null) { @@ -1729,7 +1778,7 @@ internal ComputeNodeOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("ocp-date"); } - _httpRequest.Headers.TryAddWithoutValidation("ocp-date", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ocpDate, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("ocp-date", SafeJsonConvert.SerializeObject(ocpDate, new DateTimeRfc1123JsonConverter()).Trim('"')); } @@ -1749,28 +1798,28 @@ internal ComputeNodeOperations(BatchServiceClient client) string _requestContent = null; if(nodeDisableSchedulingParameter != null) { - _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(nodeDisableSchedulingParameter, this.Client.SerializationSettings); - _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = SafeJsonConvert.SerializeObject(nodeDisableSchedulingParameter, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; odata=minimalmetadata; 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) @@ -1779,21 +1828,21 @@ internal ComputeNodeOperations(BatchServiceClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - BatchError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + BatchError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1803,7 +1852,7 @@ internal ComputeNodeOperations(BatchServiceClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); + var _result = new AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("request-id")) @@ -1812,20 +1861,20 @@ internal ComputeNodeOperations(BatchServiceClient client) } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(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 headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -1833,6 +1882,10 @@ internal ComputeNodeOperations(BatchServiceClient client) /// /// Enables task scheduling on the specified compute node. /// + /// + /// You can enable task scheduling on a node only if its current scheduling + /// state is disabled + /// /// /// The ID of the pool that contains the compute node. /// @@ -1851,7 +1904,7 @@ internal ComputeNodeOperations(BatchServiceClient client) /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1860,19 +1913,19 @@ internal ComputeNodeOperations(BatchServiceClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> EnableSchedulingWithHttpMessagesAsync(string poolId, string nodeId, ComputeNodeEnableSchedulingOptions computeNodeEnableSchedulingOptions = default(ComputeNodeEnableSchedulingOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> EnableSchedulingWithHttpMessagesAsync(string poolId, string nodeId, ComputeNodeEnableSchedulingOptions computeNodeEnableSchedulingOptions = default(ComputeNodeEnableSchedulingOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (poolId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "poolId"); + throw new ValidationException(ValidationRules.CannotBeNull, "poolId"); } if (nodeId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nodeId"); + throw new ValidationException(ValidationRules.CannotBeNull, "nodeId"); } - 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"); } int? timeout = default(int?); if (computeNodeEnableSchedulingOptions != null) @@ -1895,12 +1948,12 @@ internal ComputeNodeOperations(BatchServiceClient client) ocpDate = computeNodeEnableSchedulingOptions.OcpDate; } // 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("poolId", poolId); tracingParameters.Add("nodeId", nodeId); tracingParameters.Add("timeout", timeout); @@ -1908,43 +1961,43 @@ internal ComputeNodeOperations(BatchServiceClient client) tracingParameters.Add("returnClientRequestId", returnClientRequestId); tracingParameters.Add("ocpDate", ocpDate); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "EnableScheduling", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "EnableScheduling", 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("/") ? "" : "/")), "pools/{poolId}/nodes/{nodeId}/enablescheduling").ToString(); _url = _url.Replace("{poolId}", System.Uri.EscapeDataString(poolId)); _url = _url.Replace("{nodeId}", System.Uri.EscapeDataString(nodeId)); - 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 (timeout != null) { - _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(timeout, this.Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(timeout, Client.SerializationSettings).Trim('"')))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _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("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 (clientRequestId != null) { @@ -1952,7 +2005,7 @@ internal ComputeNodeOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(clientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("client-request-id", SafeJsonConvert.SerializeObject(clientRequestId, Client.SerializationSettings).Trim('"')); } if (returnClientRequestId != null) { @@ -1960,7 +2013,7 @@ internal ComputeNodeOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("return-client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(returnClientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", SafeJsonConvert.SerializeObject(returnClientRequestId, Client.SerializationSettings).Trim('"')); } if (ocpDate != null) { @@ -1968,7 +2021,7 @@ internal ComputeNodeOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("ocp-date"); } - _httpRequest.Headers.TryAddWithoutValidation("ocp-date", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ocpDate, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("ocp-date", SafeJsonConvert.SerializeObject(ocpDate, new DateTimeRfc1123JsonConverter()).Trim('"')); } @@ -1987,23 +2040,23 @@ internal ComputeNodeOperations(BatchServiceClient 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) @@ -2012,21 +2065,21 @@ internal ComputeNodeOperations(BatchServiceClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - BatchError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + BatchError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2036,7 +2089,7 @@ internal ComputeNodeOperations(BatchServiceClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); + var _result = new AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("request-id")) @@ -2045,20 +2098,20 @@ internal ComputeNodeOperations(BatchServiceClient client) } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(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 headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -2069,7 +2122,8 @@ internal ComputeNodeOperations(BatchServiceClient client) /// /// Before you can remotely login to a node using the remote login settings, /// you must create a user account on the node. This API can be invoked only on - /// pools created with the virtual machine configuration property. + /// pools created with the virtual machine configuration property. For pools + /// created with a cloud service configuration, see the GetRemoteDesktop API. /// /// /// The ID of the pool that contains the compute node. @@ -2089,10 +2143,10 @@ internal ComputeNodeOperations(BatchServiceClient client) /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -2101,19 +2155,19 @@ internal ComputeNodeOperations(BatchServiceClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> GetRemoteLoginSettingsWithHttpMessagesAsync(string poolId, string nodeId, ComputeNodeGetRemoteLoginSettingsOptions computeNodeGetRemoteLoginSettingsOptions = default(ComputeNodeGetRemoteLoginSettingsOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> GetRemoteLoginSettingsWithHttpMessagesAsync(string poolId, string nodeId, ComputeNodeGetRemoteLoginSettingsOptions computeNodeGetRemoteLoginSettingsOptions = default(ComputeNodeGetRemoteLoginSettingsOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (poolId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "poolId"); + throw new ValidationException(ValidationRules.CannotBeNull, "poolId"); } if (nodeId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nodeId"); + throw new ValidationException(ValidationRules.CannotBeNull, "nodeId"); } - 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"); } int? timeout = default(int?); if (computeNodeGetRemoteLoginSettingsOptions != null) @@ -2136,12 +2190,12 @@ internal ComputeNodeOperations(BatchServiceClient client) ocpDate = computeNodeGetRemoteLoginSettingsOptions.OcpDate; } // 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("poolId", poolId); tracingParameters.Add("nodeId", nodeId); tracingParameters.Add("timeout", timeout); @@ -2149,43 +2203,43 @@ internal ComputeNodeOperations(BatchServiceClient client) tracingParameters.Add("returnClientRequestId", returnClientRequestId); tracingParameters.Add("ocpDate", ocpDate); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetRemoteLoginSettings", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetRemoteLoginSettings", 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("/") ? "" : "/")), "pools/{poolId}/nodes/{nodeId}/remoteloginsettings").ToString(); _url = _url.Replace("{poolId}", System.Uri.EscapeDataString(poolId)); _url = _url.Replace("{nodeId}", System.Uri.EscapeDataString(nodeId)); - 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 (timeout != null) { - _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(timeout, this.Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(timeout, Client.SerializationSettings).Trim('"')))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _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("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 (clientRequestId != null) { @@ -2193,7 +2247,7 @@ internal ComputeNodeOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(clientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("client-request-id", SafeJsonConvert.SerializeObject(clientRequestId, Client.SerializationSettings).Trim('"')); } if (returnClientRequestId != null) { @@ -2201,7 +2255,7 @@ internal ComputeNodeOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("return-client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(returnClientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", SafeJsonConvert.SerializeObject(returnClientRequestId, Client.SerializationSettings).Trim('"')); } if (ocpDate != null) { @@ -2209,7 +2263,7 @@ internal ComputeNodeOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("ocp-date"); } - _httpRequest.Headers.TryAddWithoutValidation("ocp-date", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ocpDate, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("ocp-date", SafeJsonConvert.SerializeObject(ocpDate, new DateTimeRfc1123JsonConverter()).Trim('"')); } @@ -2228,23 +2282,23 @@ internal ComputeNodeOperations(BatchServiceClient 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) @@ -2253,21 +2307,21 @@ internal ComputeNodeOperations(BatchServiceClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - BatchError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + BatchError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2277,7 +2331,7 @@ internal ComputeNodeOperations(BatchServiceClient 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("request-id")) @@ -2290,34 +2344,34 @@ internal ComputeNodeOperations(BatchServiceClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = 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); } } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(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 headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -2327,8 +2381,9 @@ internal ComputeNodeOperations(BatchServiceClient client) /// /// /// Before you can access a node by using the RDP file, you must create a user - /// account on the node. This API can only be invoked on pools created with the - /// cloud service configuration property. + /// account on the node. This API can only be invoked on pools created with a + /// cloud service configuration. For pools created with a virtual machine + /// configuration, see the GetRemoteLoginSettings API. /// /// /// The ID of the pool that contains the compute node. @@ -2349,10 +2404,10 @@ internal ComputeNodeOperations(BatchServiceClient client) /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -2361,19 +2416,19 @@ internal ComputeNodeOperations(BatchServiceClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> GetRemoteDesktopWithHttpMessagesAsync(string poolId, string nodeId, ComputeNodeGetRemoteDesktopOptions computeNodeGetRemoteDesktopOptions = default(ComputeNodeGetRemoteDesktopOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> GetRemoteDesktopWithHttpMessagesAsync(string poolId, string nodeId, ComputeNodeGetRemoteDesktopOptions computeNodeGetRemoteDesktopOptions = default(ComputeNodeGetRemoteDesktopOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (poolId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "poolId"); + throw new ValidationException(ValidationRules.CannotBeNull, "poolId"); } if (nodeId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nodeId"); + throw new ValidationException(ValidationRules.CannotBeNull, "nodeId"); } - 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"); } int? timeout = default(int?); if (computeNodeGetRemoteDesktopOptions != null) @@ -2396,12 +2451,12 @@ internal ComputeNodeOperations(BatchServiceClient client) ocpDate = computeNodeGetRemoteDesktopOptions.OcpDate; } // 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("poolId", poolId); tracingParameters.Add("nodeId", nodeId); tracingParameters.Add("timeout", timeout); @@ -2409,43 +2464,43 @@ internal ComputeNodeOperations(BatchServiceClient client) tracingParameters.Add("returnClientRequestId", returnClientRequestId); tracingParameters.Add("ocpDate", ocpDate); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetRemoteDesktop", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetRemoteDesktop", 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("/") ? "" : "/")), "pools/{poolId}/nodes/{nodeId}/rdp").ToString(); _url = _url.Replace("{poolId}", System.Uri.EscapeDataString(poolId)); _url = _url.Replace("{nodeId}", System.Uri.EscapeDataString(nodeId)); - 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 (timeout != null) { - _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(timeout, this.Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(timeout, Client.SerializationSettings).Trim('"')))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _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("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 (clientRequestId != null) { @@ -2453,7 +2508,7 @@ internal ComputeNodeOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(clientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("client-request-id", SafeJsonConvert.SerializeObject(clientRequestId, Client.SerializationSettings).Trim('"')); } if (returnClientRequestId != null) { @@ -2461,7 +2516,7 @@ internal ComputeNodeOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("return-client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(returnClientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", SafeJsonConvert.SerializeObject(returnClientRequestId, Client.SerializationSettings).Trim('"')); } if (ocpDate != null) { @@ -2469,7 +2524,7 @@ internal ComputeNodeOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("ocp-date"); } - _httpRequest.Headers.TryAddWithoutValidation("ocp-date", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ocpDate, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("ocp-date", SafeJsonConvert.SerializeObject(ocpDate, new DateTimeRfc1123JsonConverter()).Trim('"')); } @@ -2488,23 +2543,23 @@ internal ComputeNodeOperations(BatchServiceClient 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, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, 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) @@ -2513,21 +2568,21 @@ internal ComputeNodeOperations(BatchServiceClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - BatchError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + BatchError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2537,7 +2592,7 @@ internal ComputeNodeOperations(BatchServiceClient 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("request-id")) @@ -2551,20 +2606,20 @@ internal ComputeNodeOperations(BatchServiceClient client) } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(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 headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -2587,10 +2642,10 @@ internal ComputeNodeOperations(BatchServiceClient client) /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -2599,15 +2654,15 @@ internal ComputeNodeOperations(BatchServiceClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task,ComputeNodeListHeaders>> ListWithHttpMessagesAsync(string poolId, ComputeNodeListOptions computeNodeListOptions = default(ComputeNodeListOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task,ComputeNodeListHeaders>> ListWithHttpMessagesAsync(string poolId, ComputeNodeListOptions computeNodeListOptions = default(ComputeNodeListOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (poolId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "poolId"); + throw new ValidationException(ValidationRules.CannotBeNull, "poolId"); } - 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"); } string filter = default(string); if (computeNodeListOptions != null) @@ -2645,12 +2700,12 @@ internal ComputeNodeOperations(BatchServiceClient client) ocpDate = computeNodeListOptions.OcpDate; } // 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("poolId", poolId); tracingParameters.Add("filter", filter); tracingParameters.Add("select", select); @@ -2660,16 +2715,16 @@ internal ComputeNodeOperations(BatchServiceClient client) tracingParameters.Add("returnClientRequestId", returnClientRequestId); tracingParameters.Add("ocpDate", ocpDate); 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("/") ? "" : "/")), "pools/{poolId}/nodes").ToString(); _url = _url.Replace("{poolId}", System.Uri.EscapeDataString(poolId)); - 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 (filter != null) { @@ -2681,33 +2736,33 @@ internal ComputeNodeOperations(BatchServiceClient client) } if (maxResults != null) { - _queryParameters.Add(string.Format("maxresults={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(maxResults, this.Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("maxresults={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(maxResults, Client.SerializationSettings).Trim('"')))); } if (timeout != null) { - _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(timeout, this.Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(timeout, Client.SerializationSettings).Trim('"')))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _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("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 (clientRequestId != null) { @@ -2715,7 +2770,7 @@ internal ComputeNodeOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(clientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("client-request-id", SafeJsonConvert.SerializeObject(clientRequestId, Client.SerializationSettings).Trim('"')); } if (returnClientRequestId != null) { @@ -2723,7 +2778,7 @@ internal ComputeNodeOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("return-client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(returnClientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", SafeJsonConvert.SerializeObject(returnClientRequestId, Client.SerializationSettings).Trim('"')); } if (ocpDate != null) { @@ -2731,7 +2786,7 @@ internal ComputeNodeOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("ocp-date"); } - _httpRequest.Headers.TryAddWithoutValidation("ocp-date", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ocpDate, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("ocp-date", SafeJsonConvert.SerializeObject(ocpDate, new DateTimeRfc1123JsonConverter()).Trim('"')); } @@ -2750,23 +2805,23 @@ internal ComputeNodeOperations(BatchServiceClient 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) @@ -2775,21 +2830,21 @@ internal ComputeNodeOperations(BatchServiceClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - BatchError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + BatchError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2799,7 +2854,7 @@ internal ComputeNodeOperations(BatchServiceClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse,ComputeNodeListHeaders>(); + var _result = new AzureOperationResponse,ComputeNodeListHeaders>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("request-id")) @@ -2812,34 +2867,34 @@ internal ComputeNodeOperations(BatchServiceClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = 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); } } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(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 headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -2862,10 +2917,10 @@ internal ComputeNodeOperations(BatchServiceClient client) /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -2874,11 +2929,11 @@ internal ComputeNodeOperations(BatchServiceClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task,ComputeNodeListHeaders>> ListNextWithHttpMessagesAsync(string nextPageLink, ComputeNodeListNextOptions computeNodeListNextOptions = default(ComputeNodeListNextOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task,ComputeNodeListHeaders>> ListNextWithHttpMessagesAsync(string nextPageLink, ComputeNodeListNextOptions computeNodeListNextOptions = default(ComputeNodeListNextOptions), 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"); } System.Guid? clientRequestId = default(System.Guid?); if (computeNodeListNextOptions != null) @@ -2896,44 +2951,44 @@ internal ComputeNodeOperations(BatchServiceClient client) ocpDate = computeNodeListNextOptions.OcpDate; } // 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("clientRequestId", clientRequestId); tracingParameters.Add("returnClientRequestId", returnClientRequestId); tracingParameters.Add("ocpDate", ocpDate); 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 += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _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("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 (clientRequestId != null) { @@ -2941,7 +2996,7 @@ internal ComputeNodeOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(clientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("client-request-id", SafeJsonConvert.SerializeObject(clientRequestId, Client.SerializationSettings).Trim('"')); } if (returnClientRequestId != null) { @@ -2949,7 +3004,7 @@ internal ComputeNodeOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("return-client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(returnClientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", SafeJsonConvert.SerializeObject(returnClientRequestId, Client.SerializationSettings).Trim('"')); } if (ocpDate != null) { @@ -2957,7 +3012,7 @@ internal ComputeNodeOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("ocp-date"); } - _httpRequest.Headers.TryAddWithoutValidation("ocp-date", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ocpDate, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("ocp-date", SafeJsonConvert.SerializeObject(ocpDate, new DateTimeRfc1123JsonConverter()).Trim('"')); } @@ -2976,23 +3031,23 @@ internal ComputeNodeOperations(BatchServiceClient 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) @@ -3001,21 +3056,21 @@ internal ComputeNodeOperations(BatchServiceClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - BatchError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + BatchError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -3025,7 +3080,7 @@ internal ComputeNodeOperations(BatchServiceClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse,ComputeNodeListHeaders>(); + var _result = new AzureOperationResponse,ComputeNodeListHeaders>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("request-id")) @@ -3038,37 +3093,37 @@ internal ComputeNodeOperations(BatchServiceClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = 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); } } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(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 headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } } -} +} \ No newline at end of file diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/ComputeNodeOperationsExtensions.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/ComputeNodeOperationsExtensions.cs index bffca4d3eebe..84d239b6e2e6 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/ComputeNodeOperationsExtensions.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/ComputeNodeOperationsExtensions.cs @@ -8,8 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol { + using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; + using System.IO; + using System.Threading; + using System.Threading.Tasks; /// /// Extension methods for ComputeNodeOperations. @@ -40,7 +44,7 @@ public static partial class ComputeNodeOperationsExtensions /// public static ComputeNodeAddUserHeaders AddUser(this IComputeNodeOperations operations, string poolId, string nodeId, ComputeNodeUser user, ComputeNodeAddUserOptions computeNodeAddUserOptions = default(ComputeNodeAddUserOptions)) { - return ((IComputeNodeOperations)operations).AddUserAsync(poolId, nodeId, user, computeNodeAddUserOptions).GetAwaiter().GetResult(); + return operations.AddUserAsync(poolId, nodeId, user, computeNodeAddUserOptions).GetAwaiter().GetResult(); } /// @@ -68,7 +72,7 @@ public static partial class ComputeNodeOperationsExtensions /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task AddUserAsync(this IComputeNodeOperations operations, string poolId, string nodeId, ComputeNodeUser user, ComputeNodeAddUserOptions computeNodeAddUserOptions = default(ComputeNodeAddUserOptions), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task AddUserAsync(this IComputeNodeOperations operations, string poolId, string nodeId, ComputeNodeUser user, ComputeNodeAddUserOptions computeNodeAddUserOptions = default(ComputeNodeAddUserOptions), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.AddUserWithHttpMessagesAsync(poolId, nodeId, user, computeNodeAddUserOptions, null, cancellationToken).ConfigureAwait(false)) { @@ -100,7 +104,7 @@ public static partial class ComputeNodeOperationsExtensions /// public static ComputeNodeDeleteUserHeaders DeleteUser(this IComputeNodeOperations operations, string poolId, string nodeId, string userName, ComputeNodeDeleteUserOptions computeNodeDeleteUserOptions = default(ComputeNodeDeleteUserOptions)) { - return ((IComputeNodeOperations)operations).DeleteUserAsync(poolId, nodeId, userName, computeNodeDeleteUserOptions).GetAwaiter().GetResult(); + return operations.DeleteUserAsync(poolId, nodeId, userName, computeNodeDeleteUserOptions).GetAwaiter().GetResult(); } /// @@ -128,7 +132,7 @@ public static partial class ComputeNodeOperationsExtensions /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task DeleteUserAsync(this IComputeNodeOperations operations, string poolId, string nodeId, string userName, ComputeNodeDeleteUserOptions computeNodeDeleteUserOptions = default(ComputeNodeDeleteUserOptions), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task DeleteUserAsync(this IComputeNodeOperations operations, string poolId, string nodeId, string userName, ComputeNodeDeleteUserOptions computeNodeDeleteUserOptions = default(ComputeNodeDeleteUserOptions), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.DeleteUserWithHttpMessagesAsync(poolId, nodeId, userName, computeNodeDeleteUserOptions, null, cancellationToken).ConfigureAwait(false)) { @@ -137,7 +141,7 @@ public static partial class ComputeNodeOperationsExtensions } /// - /// Updates the password or expiration time of a user account on the specified + /// Updates the password and expiration time of a user account on the specified /// compute node. /// /// @@ -166,11 +170,11 @@ public static partial class ComputeNodeOperationsExtensions /// public static ComputeNodeUpdateUserHeaders UpdateUser(this IComputeNodeOperations operations, string poolId, string nodeId, string userName, NodeUpdateUserParameter nodeUpdateUserParameter, ComputeNodeUpdateUserOptions computeNodeUpdateUserOptions = default(ComputeNodeUpdateUserOptions)) { - return ((IComputeNodeOperations)operations).UpdateUserAsync(poolId, nodeId, userName, nodeUpdateUserParameter, computeNodeUpdateUserOptions).GetAwaiter().GetResult(); + return operations.UpdateUserAsync(poolId, nodeId, userName, nodeUpdateUserParameter, computeNodeUpdateUserOptions).GetAwaiter().GetResult(); } /// - /// Updates the password or expiration time of a user account on the specified + /// Updates the password and expiration time of a user account on the specified /// compute node. /// /// @@ -200,7 +204,7 @@ public static partial class ComputeNodeOperationsExtensions /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task UpdateUserAsync(this IComputeNodeOperations operations, string poolId, string nodeId, string userName, NodeUpdateUserParameter nodeUpdateUserParameter, ComputeNodeUpdateUserOptions computeNodeUpdateUserOptions = default(ComputeNodeUpdateUserOptions), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task UpdateUserAsync(this IComputeNodeOperations operations, string poolId, string nodeId, string userName, NodeUpdateUserParameter nodeUpdateUserParameter, ComputeNodeUpdateUserOptions computeNodeUpdateUserOptions = default(ComputeNodeUpdateUserOptions), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.UpdateUserWithHttpMessagesAsync(poolId, nodeId, userName, nodeUpdateUserParameter, computeNodeUpdateUserOptions, null, cancellationToken).ConfigureAwait(false)) { @@ -225,7 +229,7 @@ public static partial class ComputeNodeOperationsExtensions /// public static ComputeNode Get(this IComputeNodeOperations operations, string poolId, string nodeId, ComputeNodeGetOptions computeNodeGetOptions = default(ComputeNodeGetOptions)) { - return ((IComputeNodeOperations)operations).GetAsync(poolId, nodeId, computeNodeGetOptions).GetAwaiter().GetResult(); + return operations.GetAsync(poolId, nodeId, computeNodeGetOptions).GetAwaiter().GetResult(); } /// @@ -246,7 +250,7 @@ public static partial class ComputeNodeOperationsExtensions /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task GetAsync(this IComputeNodeOperations operations, string poolId, string nodeId, ComputeNodeGetOptions computeNodeGetOptions = default(ComputeNodeGetOptions), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task GetAsync(this IComputeNodeOperations operations, string poolId, string nodeId, ComputeNodeGetOptions computeNodeGetOptions = default(ComputeNodeGetOptions), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.GetWithHttpMessagesAsync(poolId, nodeId, computeNodeGetOptions, null, cancellationToken).ConfigureAwait(false)) { @@ -271,7 +275,20 @@ public static partial class ComputeNodeOperationsExtensions /// /// /// When to reboot the compute node and what to do with currently running - /// tasks. The default value is requeue. Possible values include: 'requeue', + /// tasks. Values are: + /// + /// requeue - Terminate running task processes and requeue the tasks. The tasks + /// will run again when a node is available. Restart the node as soon as tasks + /// have been terminated. + /// terminate - Terminate running tasks. The tasks will not run again. Restart + /// the node as soon as tasks have been terminated. + /// taskcompletion - Allow currently running tasks to complete. Schedule no new + /// tasks while waiting. Restart the node when all tasks have completed. + /// retaineddata - Allow currently running tasks to complete, then wait for all + /// task data retention periods to expire. Schedule no new tasks while waiting. + /// Restart the node when all task retention periods have expired. + /// + /// The default value is requeue. Possible values include: 'requeue', /// 'terminate', 'taskCompletion', 'retainedData' /// /// @@ -279,7 +296,7 @@ public static partial class ComputeNodeOperationsExtensions /// public static ComputeNodeRebootHeaders Reboot(this IComputeNodeOperations operations, string poolId, string nodeId, ComputeNodeRebootOption? nodeRebootOption = default(ComputeNodeRebootOption?), ComputeNodeRebootOptions computeNodeRebootOptions = default(ComputeNodeRebootOptions)) { - return ((IComputeNodeOperations)operations).RebootAsync(poolId, nodeId, nodeRebootOption, computeNodeRebootOptions).GetAwaiter().GetResult(); + return operations.RebootAsync(poolId, nodeId, nodeRebootOption, computeNodeRebootOptions).GetAwaiter().GetResult(); } /// @@ -299,7 +316,20 @@ public static partial class ComputeNodeOperationsExtensions /// /// /// When to reboot the compute node and what to do with currently running - /// tasks. The default value is requeue. Possible values include: 'requeue', + /// tasks. Values are: + /// + /// requeue - Terminate running task processes and requeue the tasks. The tasks + /// will run again when a node is available. Restart the node as soon as tasks + /// have been terminated. + /// terminate - Terminate running tasks. The tasks will not run again. Restart + /// the node as soon as tasks have been terminated. + /// taskcompletion - Allow currently running tasks to complete. Schedule no new + /// tasks while waiting. Restart the node when all tasks have completed. + /// retaineddata - Allow currently running tasks to complete, then wait for all + /// task data retention periods to expire. Schedule no new tasks while waiting. + /// Restart the node when all task retention periods have expired. + /// + /// The default value is requeue. Possible values include: 'requeue', /// 'terminate', 'taskCompletion', 'retainedData' /// /// @@ -308,7 +338,7 @@ public static partial class ComputeNodeOperationsExtensions /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task RebootAsync(this IComputeNodeOperations operations, string poolId, string nodeId, ComputeNodeRebootOption? nodeRebootOption = default(ComputeNodeRebootOption?), ComputeNodeRebootOptions computeNodeRebootOptions = default(ComputeNodeRebootOptions), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task RebootAsync(this IComputeNodeOperations operations, string poolId, string nodeId, ComputeNodeRebootOption? nodeRebootOption = default(ComputeNodeRebootOption?), ComputeNodeRebootOptions computeNodeRebootOptions = default(ComputeNodeRebootOptions), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.RebootWithHttpMessagesAsync(poolId, nodeId, nodeRebootOption, computeNodeRebootOptions, null, cancellationToken).ConfigureAwait(false)) { @@ -335,7 +365,20 @@ public static partial class ComputeNodeOperationsExtensions /// /// /// When to reimage the compute node and what to do with currently running - /// tasks. The default value is requeue. Possible values include: 'requeue', + /// tasks. Values are: + /// + /// requeue - Terminate running task processes and requeue the tasks. The tasks + /// will run again when a node is available. Reimage the node as soon as tasks + /// have been terminated. + /// terminate - Terminate running tasks. The tasks will not run again. Reimage + /// the node as soon as tasks have been terminated. + /// taskcompletion - Allow currently running tasks to complete. Schedule no new + /// tasks while waiting. Reimage the node when all tasks have completed. + /// retaineddata - Allow currently running tasks to complete, then wait for all + /// task data retention periods to expire. Schedule no new tasks while waiting. + /// Reimage the node when all task retention periods have expired. + /// + /// The default value is requeue. Possible values include: 'requeue', /// 'terminate', 'taskCompletion', 'retainedData' /// /// @@ -343,7 +386,7 @@ public static partial class ComputeNodeOperationsExtensions /// public static ComputeNodeReimageHeaders Reimage(this IComputeNodeOperations operations, string poolId, string nodeId, ComputeNodeReimageOption? nodeReimageOption = default(ComputeNodeReimageOption?), ComputeNodeReimageOptions computeNodeReimageOptions = default(ComputeNodeReimageOptions)) { - return ((IComputeNodeOperations)operations).ReimageAsync(poolId, nodeId, nodeReimageOption, computeNodeReimageOptions).GetAwaiter().GetResult(); + return operations.ReimageAsync(poolId, nodeId, nodeReimageOption, computeNodeReimageOptions).GetAwaiter().GetResult(); } /// @@ -365,7 +408,20 @@ public static partial class ComputeNodeOperationsExtensions /// /// /// When to reimage the compute node and what to do with currently running - /// tasks. The default value is requeue. Possible values include: 'requeue', + /// tasks. Values are: + /// + /// requeue - Terminate running task processes and requeue the tasks. The tasks + /// will run again when a node is available. Reimage the node as soon as tasks + /// have been terminated. + /// terminate - Terminate running tasks. The tasks will not run again. Reimage + /// the node as soon as tasks have been terminated. + /// taskcompletion - Allow currently running tasks to complete. Schedule no new + /// tasks while waiting. Reimage the node when all tasks have completed. + /// retaineddata - Allow currently running tasks to complete, then wait for all + /// task data retention periods to expire. Schedule no new tasks while waiting. + /// Reimage the node when all task retention periods have expired. + /// + /// The default value is requeue. Possible values include: 'requeue', /// 'terminate', 'taskCompletion', 'retainedData' /// /// @@ -374,7 +430,7 @@ public static partial class ComputeNodeOperationsExtensions /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task ReimageAsync(this IComputeNodeOperations operations, string poolId, string nodeId, ComputeNodeReimageOption? nodeReimageOption = default(ComputeNodeReimageOption?), ComputeNodeReimageOptions computeNodeReimageOptions = default(ComputeNodeReimageOptions), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task ReimageAsync(this IComputeNodeOperations operations, string poolId, string nodeId, ComputeNodeReimageOption? nodeReimageOption = default(ComputeNodeReimageOption?), ComputeNodeReimageOptions computeNodeReimageOptions = default(ComputeNodeReimageOptions), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ReimageWithHttpMessagesAsync(poolId, nodeId, nodeReimageOption, computeNodeReimageOptions, null, cancellationToken).ConfigureAwait(false)) { @@ -385,6 +441,10 @@ public static partial class ComputeNodeOperationsExtensions /// /// Disables task scheduling on the specified compute node. /// + /// + /// You can disable task scheduling on a node only if its current scheduling + /// state is enabled. + /// /// /// The operations group for this extension method. /// @@ -396,20 +456,34 @@ public static partial class ComputeNodeOperationsExtensions /// /// /// What to do with currently running tasks when disabling task scheduling on - /// the compute node. The default value is requeue. Possible values include: - /// 'requeue', 'terminate', 'taskCompletion' + /// the compute node. Values are: + /// + /// requeue - Terminate running task processes and requeue the tasks. The tasks + /// may run again on other compute nodes, or when task scheduling is re-enabled + /// on this node. Enter offline state as soon as tasks have been terminated. + /// terminate - Terminate running tasks. The tasks will not run again. Enter + /// offline state as soon as tasks have been terminated. + /// taskcompletion - Allow currently running tasks to complete. Schedule no new + /// tasks while waiting. Enter offline state when all tasks have completed. + /// + /// The default value is requeue. Possible values include: 'requeue', + /// 'terminate', 'taskCompletion' /// /// /// Additional parameters for the operation /// public static ComputeNodeDisableSchedulingHeaders DisableScheduling(this IComputeNodeOperations operations, string poolId, string nodeId, DisableComputeNodeSchedulingOption? nodeDisableSchedulingOption = default(DisableComputeNodeSchedulingOption?), ComputeNodeDisableSchedulingOptions computeNodeDisableSchedulingOptions = default(ComputeNodeDisableSchedulingOptions)) { - return ((IComputeNodeOperations)operations).DisableSchedulingAsync(poolId, nodeId, nodeDisableSchedulingOption, computeNodeDisableSchedulingOptions).GetAwaiter().GetResult(); + return operations.DisableSchedulingAsync(poolId, nodeId, nodeDisableSchedulingOption, computeNodeDisableSchedulingOptions).GetAwaiter().GetResult(); } /// /// Disables task scheduling on the specified compute node. /// + /// + /// You can disable task scheduling on a node only if its current scheduling + /// state is enabled. + /// /// /// The operations group for this extension method. /// @@ -421,8 +495,18 @@ public static partial class ComputeNodeOperationsExtensions /// /// /// What to do with currently running tasks when disabling task scheduling on - /// the compute node. The default value is requeue. Possible values include: - /// 'requeue', 'terminate', 'taskCompletion' + /// the compute node. Values are: + /// + /// requeue - Terminate running task processes and requeue the tasks. The tasks + /// may run again on other compute nodes, or when task scheduling is re-enabled + /// on this node. Enter offline state as soon as tasks have been terminated. + /// terminate - Terminate running tasks. The tasks will not run again. Enter + /// offline state as soon as tasks have been terminated. + /// taskcompletion - Allow currently running tasks to complete. Schedule no new + /// tasks while waiting. Enter offline state when all tasks have completed. + /// + /// The default value is requeue. Possible values include: 'requeue', + /// 'terminate', 'taskCompletion' /// /// /// Additional parameters for the operation @@ -430,7 +514,7 @@ public static partial class ComputeNodeOperationsExtensions /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task DisableSchedulingAsync(this IComputeNodeOperations operations, string poolId, string nodeId, DisableComputeNodeSchedulingOption? nodeDisableSchedulingOption = default(DisableComputeNodeSchedulingOption?), ComputeNodeDisableSchedulingOptions computeNodeDisableSchedulingOptions = default(ComputeNodeDisableSchedulingOptions), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task DisableSchedulingAsync(this IComputeNodeOperations operations, string poolId, string nodeId, DisableComputeNodeSchedulingOption? nodeDisableSchedulingOption = default(DisableComputeNodeSchedulingOption?), ComputeNodeDisableSchedulingOptions computeNodeDisableSchedulingOptions = default(ComputeNodeDisableSchedulingOptions), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.DisableSchedulingWithHttpMessagesAsync(poolId, nodeId, nodeDisableSchedulingOption, computeNodeDisableSchedulingOptions, null, cancellationToken).ConfigureAwait(false)) { @@ -441,6 +525,10 @@ public static partial class ComputeNodeOperationsExtensions /// /// Enables task scheduling on the specified compute node. /// + /// + /// You can enable task scheduling on a node only if its current scheduling + /// state is disabled + /// /// /// The operations group for this extension method. /// @@ -455,12 +543,16 @@ public static partial class ComputeNodeOperationsExtensions /// public static ComputeNodeEnableSchedulingHeaders EnableScheduling(this IComputeNodeOperations operations, string poolId, string nodeId, ComputeNodeEnableSchedulingOptions computeNodeEnableSchedulingOptions = default(ComputeNodeEnableSchedulingOptions)) { - return ((IComputeNodeOperations)operations).EnableSchedulingAsync(poolId, nodeId, computeNodeEnableSchedulingOptions).GetAwaiter().GetResult(); + return operations.EnableSchedulingAsync(poolId, nodeId, computeNodeEnableSchedulingOptions).GetAwaiter().GetResult(); } /// /// Enables task scheduling on the specified compute node. /// + /// + /// You can enable task scheduling on a node only if its current scheduling + /// state is disabled + /// /// /// The operations group for this extension method. /// @@ -476,7 +568,7 @@ public static partial class ComputeNodeOperationsExtensions /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task EnableSchedulingAsync(this IComputeNodeOperations operations, string poolId, string nodeId, ComputeNodeEnableSchedulingOptions computeNodeEnableSchedulingOptions = default(ComputeNodeEnableSchedulingOptions), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task EnableSchedulingAsync(this IComputeNodeOperations operations, string poolId, string nodeId, ComputeNodeEnableSchedulingOptions computeNodeEnableSchedulingOptions = default(ComputeNodeEnableSchedulingOptions), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.EnableSchedulingWithHttpMessagesAsync(poolId, nodeId, computeNodeEnableSchedulingOptions, null, cancellationToken).ConfigureAwait(false)) { @@ -490,7 +582,8 @@ public static partial class ComputeNodeOperationsExtensions /// /// Before you can remotely login to a node using the remote login settings, /// you must create a user account on the node. This API can be invoked only on - /// pools created with the virtual machine configuration property. + /// pools created with the virtual machine configuration property. For pools + /// created with a cloud service configuration, see the GetRemoteDesktop API. /// /// /// The operations group for this extension method. @@ -506,7 +599,7 @@ public static partial class ComputeNodeOperationsExtensions /// public static ComputeNodeGetRemoteLoginSettingsResult GetRemoteLoginSettings(this IComputeNodeOperations operations, string poolId, string nodeId, ComputeNodeGetRemoteLoginSettingsOptions computeNodeGetRemoteLoginSettingsOptions = default(ComputeNodeGetRemoteLoginSettingsOptions)) { - return ((IComputeNodeOperations)operations).GetRemoteLoginSettingsAsync(poolId, nodeId, computeNodeGetRemoteLoginSettingsOptions).GetAwaiter().GetResult(); + return operations.GetRemoteLoginSettingsAsync(poolId, nodeId, computeNodeGetRemoteLoginSettingsOptions).GetAwaiter().GetResult(); } /// @@ -515,7 +608,8 @@ public static partial class ComputeNodeOperationsExtensions /// /// Before you can remotely login to a node using the remote login settings, /// you must create a user account on the node. This API can be invoked only on - /// pools created with the virtual machine configuration property. + /// pools created with the virtual machine configuration property. For pools + /// created with a cloud service configuration, see the GetRemoteDesktop API. /// /// /// The operations group for this extension method. @@ -532,7 +626,7 @@ public static partial class ComputeNodeOperationsExtensions /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task GetRemoteLoginSettingsAsync(this IComputeNodeOperations operations, string poolId, string nodeId, ComputeNodeGetRemoteLoginSettingsOptions computeNodeGetRemoteLoginSettingsOptions = default(ComputeNodeGetRemoteLoginSettingsOptions), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task GetRemoteLoginSettingsAsync(this IComputeNodeOperations operations, string poolId, string nodeId, ComputeNodeGetRemoteLoginSettingsOptions computeNodeGetRemoteLoginSettingsOptions = default(ComputeNodeGetRemoteLoginSettingsOptions), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.GetRemoteLoginSettingsWithHttpMessagesAsync(poolId, nodeId, computeNodeGetRemoteLoginSettingsOptions, null, cancellationToken).ConfigureAwait(false)) { @@ -545,8 +639,9 @@ public static partial class ComputeNodeOperationsExtensions /// /// /// Before you can access a node by using the RDP file, you must create a user - /// account on the node. This API can only be invoked on pools created with the - /// cloud service configuration property. + /// account on the node. This API can only be invoked on pools created with a + /// cloud service configuration. For pools created with a virtual machine + /// configuration, see the GetRemoteLoginSettings API. /// /// /// The operations group for this extension method. @@ -561,9 +656,9 @@ public static partial class ComputeNodeOperationsExtensions /// /// Additional parameters for the operation /// - public static System.IO.Stream GetRemoteDesktop(this IComputeNodeOperations operations, string poolId, string nodeId, ComputeNodeGetRemoteDesktopOptions computeNodeGetRemoteDesktopOptions = default(ComputeNodeGetRemoteDesktopOptions)) + public static Stream GetRemoteDesktop(this IComputeNodeOperations operations, string poolId, string nodeId, ComputeNodeGetRemoteDesktopOptions computeNodeGetRemoteDesktopOptions = default(ComputeNodeGetRemoteDesktopOptions)) { - return ((IComputeNodeOperations)operations).GetRemoteDesktopAsync(poolId, nodeId, computeNodeGetRemoteDesktopOptions).GetAwaiter().GetResult(); + return operations.GetRemoteDesktopAsync(poolId, nodeId, computeNodeGetRemoteDesktopOptions).GetAwaiter().GetResult(); } /// @@ -571,8 +666,9 @@ public static partial class ComputeNodeOperationsExtensions /// /// /// Before you can access a node by using the RDP file, you must create a user - /// account on the node. This API can only be invoked on pools created with the - /// cloud service configuration property. + /// account on the node. This API can only be invoked on pools created with a + /// cloud service configuration. For pools created with a virtual machine + /// configuration, see the GetRemoteLoginSettings API. /// /// /// The operations group for this extension method. @@ -590,7 +686,7 @@ public static partial class ComputeNodeOperationsExtensions /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task GetRemoteDesktopAsync(this IComputeNodeOperations operations, string poolId, string nodeId, ComputeNodeGetRemoteDesktopOptions computeNodeGetRemoteDesktopOptions = default(ComputeNodeGetRemoteDesktopOptions), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task GetRemoteDesktopAsync(this IComputeNodeOperations operations, string poolId, string nodeId, ComputeNodeGetRemoteDesktopOptions computeNodeGetRemoteDesktopOptions = default(ComputeNodeGetRemoteDesktopOptions), CancellationToken cancellationToken = default(CancellationToken)) { var _result = await operations.GetRemoteDesktopWithHttpMessagesAsync(poolId, nodeId, computeNodeGetRemoteDesktopOptions, null, cancellationToken).ConfigureAwait(false); _result.Request.Dispose(); @@ -609,9 +705,9 @@ public static partial class ComputeNodeOperationsExtensions /// /// Additional parameters for the operation /// - public static Microsoft.Rest.Azure.IPage List(this IComputeNodeOperations operations, string poolId, ComputeNodeListOptions computeNodeListOptions = default(ComputeNodeListOptions)) + public static IPage List(this IComputeNodeOperations operations, string poolId, ComputeNodeListOptions computeNodeListOptions = default(ComputeNodeListOptions)) { - return ((IComputeNodeOperations)operations).ListAsync(poolId, computeNodeListOptions).GetAwaiter().GetResult(); + return operations.ListAsync(poolId, computeNodeListOptions).GetAwaiter().GetResult(); } /// @@ -629,7 +725,7 @@ public static partial class ComputeNodeOperationsExtensions /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListAsync(this IComputeNodeOperations operations, string poolId, ComputeNodeListOptions computeNodeListOptions = default(ComputeNodeListOptions), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task> ListAsync(this IComputeNodeOperations operations, string poolId, ComputeNodeListOptions computeNodeListOptions = default(ComputeNodeListOptions), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListWithHttpMessagesAsync(poolId, computeNodeListOptions, null, cancellationToken).ConfigureAwait(false)) { @@ -649,9 +745,9 @@ public static partial class ComputeNodeOperationsExtensions /// /// Additional parameters for the operation /// - public static Microsoft.Rest.Azure.IPage ListNext(this IComputeNodeOperations operations, string nextPageLink, ComputeNodeListNextOptions computeNodeListNextOptions = default(ComputeNodeListNextOptions)) + public static IPage ListNext(this IComputeNodeOperations operations, string nextPageLink, ComputeNodeListNextOptions computeNodeListNextOptions = default(ComputeNodeListNextOptions)) { - return ((IComputeNodeOperations)operations).ListNextAsync(nextPageLink, computeNodeListNextOptions).GetAwaiter().GetResult(); + return operations.ListNextAsync(nextPageLink, computeNodeListNextOptions).GetAwaiter().GetResult(); } /// @@ -669,7 +765,7 @@ public static partial class ComputeNodeOperationsExtensions /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListNextAsync(this IComputeNodeOperations operations, string nextPageLink, ComputeNodeListNextOptions computeNodeListNextOptions = default(ComputeNodeListNextOptions), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task> ListNextAsync(this IComputeNodeOperations operations, string nextPageLink, ComputeNodeListNextOptions computeNodeListNextOptions = default(ComputeNodeListNextOptions), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, computeNodeListNextOptions, null, cancellationToken).ConfigureAwait(false)) { @@ -678,4 +774,4 @@ public static partial class ComputeNodeOperationsExtensions } } -} +} \ No newline at end of file diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/FileOperations.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/FileOperations.cs index 54624dd456e2..2f59a2988b9e 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/FileOperations.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/FileOperations.cs @@ -8,15 +8,24 @@ namespace Microsoft.Azure.Batch.Protocol { - 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.IO; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; /// /// FileOperations operations. /// - internal partial class FileOperations : Microsoft.Rest.IServiceOperations, IFileOperations + internal partial class FileOperations : IServiceOperations, IFileOperations { /// /// Initializes a new instance of the FileOperations class. @@ -33,7 +42,7 @@ internal FileOperations(BatchServiceClient client) { throw new System.ArgumentNullException("client"); } - this.Client = client; + Client = client; } /// @@ -51,7 +60,7 @@ internal FileOperations(BatchServiceClient client) /// The ID of the task whose file you want to delete. /// /// - /// The path to the task file that you want to delete. + /// The path to the task file or directory that you want to delete. /// /// /// Whether to delete children of a directory. If the filePath parameter @@ -71,7 +80,7 @@ internal FileOperations(BatchServiceClient client) /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -80,23 +89,23 @@ internal FileOperations(BatchServiceClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> DeleteFromTaskWithHttpMessagesAsync(string jobId, string taskId, string filePath, bool? recursive = default(bool?), FileDeleteFromTaskOptions fileDeleteFromTaskOptions = default(FileDeleteFromTaskOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> DeleteFromTaskWithHttpMessagesAsync(string jobId, string taskId, string filePath, bool? recursive = default(bool?), FileDeleteFromTaskOptions fileDeleteFromTaskOptions = default(FileDeleteFromTaskOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (jobId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "jobId"); + throw new ValidationException(ValidationRules.CannotBeNull, "jobId"); } if (taskId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "taskId"); + throw new ValidationException(ValidationRules.CannotBeNull, "taskId"); } if (filePath == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "filePath"); + throw new ValidationException(ValidationRules.CannotBeNull, "filePath"); } - 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"); } int? timeout = default(int?); if (fileDeleteFromTaskOptions != null) @@ -119,12 +128,12 @@ internal FileOperations(BatchServiceClient client) ocpDate = fileDeleteFromTaskOptions.OcpDate; } // 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("jobId", jobId); tracingParameters.Add("taskId", taskId); tracingParameters.Add("filePath", filePath); @@ -134,48 +143,48 @@ internal FileOperations(BatchServiceClient client) tracingParameters.Add("returnClientRequestId", returnClientRequestId); tracingParameters.Add("ocpDate", ocpDate); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "DeleteFromTask", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteFromTask", 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("/") ? "" : "/")), "jobs/{jobId}/tasks/{taskId}/files/{filePath}").ToString(); _url = _url.Replace("{jobId}", System.Uri.EscapeDataString(jobId)); _url = _url.Replace("{taskId}", System.Uri.EscapeDataString(taskId)); _url = _url.Replace("{filePath}", System.Uri.EscapeDataString(filePath)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + List _queryParameters = new List(); if (recursive != null) { - _queryParameters.Add(string.Format("recursive={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(recursive, this.Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("recursive={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(recursive, Client.SerializationSettings).Trim('"')))); } - 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 (timeout != null) { - _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(timeout, this.Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(timeout, Client.SerializationSettings).Trim('"')))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _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("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 (clientRequestId != null) { @@ -183,7 +192,7 @@ internal FileOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(clientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("client-request-id", SafeJsonConvert.SerializeObject(clientRequestId, Client.SerializationSettings).Trim('"')); } if (returnClientRequestId != null) { @@ -191,7 +200,7 @@ internal FileOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("return-client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(returnClientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", SafeJsonConvert.SerializeObject(returnClientRequestId, Client.SerializationSettings).Trim('"')); } if (ocpDate != null) { @@ -199,7 +208,7 @@ internal FileOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("ocp-date"); } - _httpRequest.Headers.TryAddWithoutValidation("ocp-date", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ocpDate, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("ocp-date", SafeJsonConvert.SerializeObject(ocpDate, new DateTimeRfc1123JsonConverter()).Trim('"')); } @@ -218,23 +227,23 @@ internal FileOperations(BatchServiceClient 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) @@ -243,21 +252,21 @@ internal FileOperations(BatchServiceClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - BatchError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + BatchError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -267,7 +276,7 @@ internal FileOperations(BatchServiceClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); + var _result = new AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("request-id")) @@ -276,20 +285,20 @@ internal FileOperations(BatchServiceClient client) } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(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 headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -318,10 +327,10 @@ internal FileOperations(BatchServiceClient client) /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -330,23 +339,23 @@ internal FileOperations(BatchServiceClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> GetFromTaskWithHttpMessagesAsync(string jobId, string taskId, string filePath, FileGetFromTaskOptions fileGetFromTaskOptions = default(FileGetFromTaskOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> GetFromTaskWithHttpMessagesAsync(string jobId, string taskId, string filePath, FileGetFromTaskOptions fileGetFromTaskOptions = default(FileGetFromTaskOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (jobId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "jobId"); + throw new ValidationException(ValidationRules.CannotBeNull, "jobId"); } if (taskId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "taskId"); + throw new ValidationException(ValidationRules.CannotBeNull, "taskId"); } if (filePath == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "filePath"); + throw new ValidationException(ValidationRules.CannotBeNull, "filePath"); } - 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"); } int? timeout = default(int?); if (fileGetFromTaskOptions != null) @@ -384,12 +393,12 @@ internal FileOperations(BatchServiceClient client) ifUnmodifiedSince = fileGetFromTaskOptions.IfUnmodifiedSince; } // 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("jobId", jobId); tracingParameters.Add("taskId", taskId); tracingParameters.Add("filePath", filePath); @@ -401,44 +410,44 @@ internal FileOperations(BatchServiceClient client) tracingParameters.Add("ifModifiedSince", ifModifiedSince); tracingParameters.Add("ifUnmodifiedSince", ifUnmodifiedSince); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetFromTask", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetFromTask", 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("/") ? "" : "/")), "jobs/{jobId}/tasks/{taskId}/files/{filePath}").ToString(); _url = _url.Replace("{jobId}", System.Uri.EscapeDataString(jobId)); _url = _url.Replace("{taskId}", System.Uri.EscapeDataString(taskId)); _url = _url.Replace("{filePath}", System.Uri.EscapeDataString(filePath)); - 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 (timeout != null) { - _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(timeout, this.Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(timeout, Client.SerializationSettings).Trim('"')))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _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("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 (clientRequestId != null) { @@ -446,7 +455,7 @@ internal FileOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(clientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("client-request-id", SafeJsonConvert.SerializeObject(clientRequestId, Client.SerializationSettings).Trim('"')); } if (returnClientRequestId != null) { @@ -454,7 +463,7 @@ internal FileOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("return-client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(returnClientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", SafeJsonConvert.SerializeObject(returnClientRequestId, Client.SerializationSettings).Trim('"')); } if (ocpDate != null) { @@ -462,7 +471,7 @@ internal FileOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("ocp-date"); } - _httpRequest.Headers.TryAddWithoutValidation("ocp-date", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ocpDate, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("ocp-date", SafeJsonConvert.SerializeObject(ocpDate, new DateTimeRfc1123JsonConverter()).Trim('"')); } if (ocpRange != null) { @@ -478,7 +487,7 @@ internal FileOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("If-Modified-Since"); } - _httpRequest.Headers.TryAddWithoutValidation("If-Modified-Since", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ifModifiedSince, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("If-Modified-Since", SafeJsonConvert.SerializeObject(ifModifiedSince, new DateTimeRfc1123JsonConverter()).Trim('"')); } if (ifUnmodifiedSince != null) { @@ -486,7 +495,7 @@ internal FileOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("If-Unmodified-Since"); } - _httpRequest.Headers.TryAddWithoutValidation("If-Unmodified-Since", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ifUnmodifiedSince, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("If-Unmodified-Since", SafeJsonConvert.SerializeObject(ifUnmodifiedSince, new DateTimeRfc1123JsonConverter()).Trim('"')); } @@ -505,23 +514,23 @@ internal FileOperations(BatchServiceClient 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, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, 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) @@ -530,21 +539,21 @@ internal FileOperations(BatchServiceClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - BatchError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + BatchError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -554,7 +563,7 @@ internal FileOperations(BatchServiceClient 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("request-id")) @@ -568,20 +577,20 @@ internal FileOperations(BatchServiceClient client) } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(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 headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -610,7 +619,7 @@ internal FileOperations(BatchServiceClient client) /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -619,23 +628,23 @@ internal FileOperations(BatchServiceClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> GetPropertiesFromTaskWithHttpMessagesAsync(string jobId, string taskId, string filePath, FileGetPropertiesFromTaskOptions fileGetPropertiesFromTaskOptions = default(FileGetPropertiesFromTaskOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> GetPropertiesFromTaskWithHttpMessagesAsync(string jobId, string taskId, string filePath, FileGetPropertiesFromTaskOptions fileGetPropertiesFromTaskOptions = default(FileGetPropertiesFromTaskOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (jobId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "jobId"); + throw new ValidationException(ValidationRules.CannotBeNull, "jobId"); } if (taskId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "taskId"); + throw new ValidationException(ValidationRules.CannotBeNull, "taskId"); } if (filePath == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "filePath"); + throw new ValidationException(ValidationRules.CannotBeNull, "filePath"); } - 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"); } int? timeout = default(int?); if (fileGetPropertiesFromTaskOptions != null) @@ -668,12 +677,12 @@ internal FileOperations(BatchServiceClient client) ifUnmodifiedSince = fileGetPropertiesFromTaskOptions.IfUnmodifiedSince; } // 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("jobId", jobId); tracingParameters.Add("taskId", taskId); tracingParameters.Add("filePath", filePath); @@ -684,44 +693,44 @@ internal FileOperations(BatchServiceClient client) tracingParameters.Add("ifModifiedSince", ifModifiedSince); tracingParameters.Add("ifUnmodifiedSince", ifUnmodifiedSince); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetPropertiesFromTask", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetPropertiesFromTask", 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("/") ? "" : "/")), "jobs/{jobId}/tasks/{taskId}/files/{filePath}").ToString(); _url = _url.Replace("{jobId}", System.Uri.EscapeDataString(jobId)); _url = _url.Replace("{taskId}", System.Uri.EscapeDataString(taskId)); _url = _url.Replace("{filePath}", System.Uri.EscapeDataString(filePath)); - 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 (timeout != null) { - _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(timeout, this.Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(timeout, Client.SerializationSettings).Trim('"')))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("HEAD"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("HEAD"); _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("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 (clientRequestId != null) { @@ -729,7 +738,7 @@ internal FileOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(clientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("client-request-id", SafeJsonConvert.SerializeObject(clientRequestId, Client.SerializationSettings).Trim('"')); } if (returnClientRequestId != null) { @@ -737,7 +746,7 @@ internal FileOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("return-client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(returnClientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", SafeJsonConvert.SerializeObject(returnClientRequestId, Client.SerializationSettings).Trim('"')); } if (ocpDate != null) { @@ -745,7 +754,7 @@ internal FileOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("ocp-date"); } - _httpRequest.Headers.TryAddWithoutValidation("ocp-date", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ocpDate, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("ocp-date", SafeJsonConvert.SerializeObject(ocpDate, new DateTimeRfc1123JsonConverter()).Trim('"')); } if (ifModifiedSince != null) { @@ -753,7 +762,7 @@ internal FileOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("If-Modified-Since"); } - _httpRequest.Headers.TryAddWithoutValidation("If-Modified-Since", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ifModifiedSince, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("If-Modified-Since", SafeJsonConvert.SerializeObject(ifModifiedSince, new DateTimeRfc1123JsonConverter()).Trim('"')); } if (ifUnmodifiedSince != null) { @@ -761,7 +770,7 @@ internal FileOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("If-Unmodified-Since"); } - _httpRequest.Headers.TryAddWithoutValidation("If-Unmodified-Since", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ifUnmodifiedSince, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("If-Unmodified-Since", SafeJsonConvert.SerializeObject(ifUnmodifiedSince, new DateTimeRfc1123JsonConverter()).Trim('"')); } @@ -780,23 +789,23 @@ internal FileOperations(BatchServiceClient 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, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, 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) @@ -805,21 +814,21 @@ internal FileOperations(BatchServiceClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - BatchError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + BatchError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -829,7 +838,7 @@ internal FileOperations(BatchServiceClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); + var _result = new AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("request-id")) @@ -838,20 +847,20 @@ internal FileOperations(BatchServiceClient client) } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(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 headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -866,7 +875,7 @@ internal FileOperations(BatchServiceClient client) /// The ID of the compute node from which you want to delete the file. /// /// - /// The path to the file that you want to delete. + /// The path to the file or directory that you want to delete. /// /// /// Whether to delete children of a directory. If the filePath parameter @@ -886,7 +895,7 @@ internal FileOperations(BatchServiceClient client) /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -895,23 +904,23 @@ internal FileOperations(BatchServiceClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> DeleteFromComputeNodeWithHttpMessagesAsync(string poolId, string nodeId, string filePath, bool? recursive = default(bool?), FileDeleteFromComputeNodeOptions fileDeleteFromComputeNodeOptions = default(FileDeleteFromComputeNodeOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> DeleteFromComputeNodeWithHttpMessagesAsync(string poolId, string nodeId, string filePath, bool? recursive = default(bool?), FileDeleteFromComputeNodeOptions fileDeleteFromComputeNodeOptions = default(FileDeleteFromComputeNodeOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (poolId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "poolId"); + throw new ValidationException(ValidationRules.CannotBeNull, "poolId"); } if (nodeId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nodeId"); + throw new ValidationException(ValidationRules.CannotBeNull, "nodeId"); } if (filePath == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "filePath"); + throw new ValidationException(ValidationRules.CannotBeNull, "filePath"); } - 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"); } int? timeout = default(int?); if (fileDeleteFromComputeNodeOptions != null) @@ -934,12 +943,12 @@ internal FileOperations(BatchServiceClient client) ocpDate = fileDeleteFromComputeNodeOptions.OcpDate; } // 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("poolId", poolId); tracingParameters.Add("nodeId", nodeId); tracingParameters.Add("filePath", filePath); @@ -949,48 +958,48 @@ internal FileOperations(BatchServiceClient client) tracingParameters.Add("returnClientRequestId", returnClientRequestId); tracingParameters.Add("ocpDate", ocpDate); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "DeleteFromComputeNode", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteFromComputeNode", 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("/") ? "" : "/")), "pools/{poolId}/nodes/{nodeId}/files/{filePath}").ToString(); _url = _url.Replace("{poolId}", System.Uri.EscapeDataString(poolId)); _url = _url.Replace("{nodeId}", System.Uri.EscapeDataString(nodeId)); _url = _url.Replace("{filePath}", System.Uri.EscapeDataString(filePath)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + List _queryParameters = new List(); if (recursive != null) { - _queryParameters.Add(string.Format("recursive={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(recursive, this.Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("recursive={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(recursive, Client.SerializationSettings).Trim('"')))); } - 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 (timeout != null) { - _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(timeout, this.Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(timeout, Client.SerializationSettings).Trim('"')))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _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("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 (clientRequestId != null) { @@ -998,7 +1007,7 @@ internal FileOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(clientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("client-request-id", SafeJsonConvert.SerializeObject(clientRequestId, Client.SerializationSettings).Trim('"')); } if (returnClientRequestId != null) { @@ -1006,7 +1015,7 @@ internal FileOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("return-client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(returnClientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", SafeJsonConvert.SerializeObject(returnClientRequestId, Client.SerializationSettings).Trim('"')); } if (ocpDate != null) { @@ -1014,7 +1023,7 @@ internal FileOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("ocp-date"); } - _httpRequest.Headers.TryAddWithoutValidation("ocp-date", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ocpDate, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("ocp-date", SafeJsonConvert.SerializeObject(ocpDate, new DateTimeRfc1123JsonConverter()).Trim('"')); } @@ -1033,23 +1042,23 @@ internal FileOperations(BatchServiceClient 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) @@ -1058,21 +1067,21 @@ internal FileOperations(BatchServiceClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - BatchError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + BatchError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1082,7 +1091,7 @@ internal FileOperations(BatchServiceClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); + var _result = new AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("request-id")) @@ -1091,20 +1100,20 @@ internal FileOperations(BatchServiceClient client) } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(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 headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -1133,10 +1142,10 @@ internal FileOperations(BatchServiceClient client) /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1145,23 +1154,23 @@ internal FileOperations(BatchServiceClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> GetFromComputeNodeWithHttpMessagesAsync(string poolId, string nodeId, string filePath, FileGetFromComputeNodeOptions fileGetFromComputeNodeOptions = default(FileGetFromComputeNodeOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> GetFromComputeNodeWithHttpMessagesAsync(string poolId, string nodeId, string filePath, FileGetFromComputeNodeOptions fileGetFromComputeNodeOptions = default(FileGetFromComputeNodeOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (poolId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "poolId"); + throw new ValidationException(ValidationRules.CannotBeNull, "poolId"); } if (nodeId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nodeId"); + throw new ValidationException(ValidationRules.CannotBeNull, "nodeId"); } if (filePath == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "filePath"); + throw new ValidationException(ValidationRules.CannotBeNull, "filePath"); } - 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"); } int? timeout = default(int?); if (fileGetFromComputeNodeOptions != null) @@ -1199,12 +1208,12 @@ internal FileOperations(BatchServiceClient client) ifUnmodifiedSince = fileGetFromComputeNodeOptions.IfUnmodifiedSince; } // 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("poolId", poolId); tracingParameters.Add("nodeId", nodeId); tracingParameters.Add("filePath", filePath); @@ -1216,44 +1225,44 @@ internal FileOperations(BatchServiceClient client) tracingParameters.Add("ifModifiedSince", ifModifiedSince); tracingParameters.Add("ifUnmodifiedSince", ifUnmodifiedSince); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetFromComputeNode", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetFromComputeNode", 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("/") ? "" : "/")), "pools/{poolId}/nodes/{nodeId}/files/{filePath}").ToString(); _url = _url.Replace("{poolId}", System.Uri.EscapeDataString(poolId)); _url = _url.Replace("{nodeId}", System.Uri.EscapeDataString(nodeId)); _url = _url.Replace("{filePath}", System.Uri.EscapeDataString(filePath)); - 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 (timeout != null) { - _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(timeout, this.Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(timeout, Client.SerializationSettings).Trim('"')))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _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("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 (clientRequestId != null) { @@ -1261,7 +1270,7 @@ internal FileOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(clientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("client-request-id", SafeJsonConvert.SerializeObject(clientRequestId, Client.SerializationSettings).Trim('"')); } if (returnClientRequestId != null) { @@ -1269,7 +1278,7 @@ internal FileOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("return-client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(returnClientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", SafeJsonConvert.SerializeObject(returnClientRequestId, Client.SerializationSettings).Trim('"')); } if (ocpDate != null) { @@ -1277,7 +1286,7 @@ internal FileOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("ocp-date"); } - _httpRequest.Headers.TryAddWithoutValidation("ocp-date", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ocpDate, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("ocp-date", SafeJsonConvert.SerializeObject(ocpDate, new DateTimeRfc1123JsonConverter()).Trim('"')); } if (ocpRange != null) { @@ -1293,7 +1302,7 @@ internal FileOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("If-Modified-Since"); } - _httpRequest.Headers.TryAddWithoutValidation("If-Modified-Since", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ifModifiedSince, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("If-Modified-Since", SafeJsonConvert.SerializeObject(ifModifiedSince, new DateTimeRfc1123JsonConverter()).Trim('"')); } if (ifUnmodifiedSince != null) { @@ -1301,7 +1310,7 @@ internal FileOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("If-Unmodified-Since"); } - _httpRequest.Headers.TryAddWithoutValidation("If-Unmodified-Since", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ifUnmodifiedSince, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("If-Unmodified-Since", SafeJsonConvert.SerializeObject(ifUnmodifiedSince, new DateTimeRfc1123JsonConverter()).Trim('"')); } @@ -1320,23 +1329,23 @@ internal FileOperations(BatchServiceClient 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, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, 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) @@ -1345,21 +1354,21 @@ internal FileOperations(BatchServiceClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - BatchError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + BatchError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1369,7 +1378,7 @@ internal FileOperations(BatchServiceClient 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("request-id")) @@ -1383,20 +1392,20 @@ internal FileOperations(BatchServiceClient client) } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(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 headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -1425,7 +1434,7 @@ internal FileOperations(BatchServiceClient client) /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1434,23 +1443,23 @@ internal FileOperations(BatchServiceClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> GetPropertiesFromComputeNodeWithHttpMessagesAsync(string poolId, string nodeId, string filePath, FileGetPropertiesFromComputeNodeOptions fileGetPropertiesFromComputeNodeOptions = default(FileGetPropertiesFromComputeNodeOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> GetPropertiesFromComputeNodeWithHttpMessagesAsync(string poolId, string nodeId, string filePath, FileGetPropertiesFromComputeNodeOptions fileGetPropertiesFromComputeNodeOptions = default(FileGetPropertiesFromComputeNodeOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (poolId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "poolId"); + throw new ValidationException(ValidationRules.CannotBeNull, "poolId"); } if (nodeId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nodeId"); + throw new ValidationException(ValidationRules.CannotBeNull, "nodeId"); } if (filePath == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "filePath"); + throw new ValidationException(ValidationRules.CannotBeNull, "filePath"); } - 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"); } int? timeout = default(int?); if (fileGetPropertiesFromComputeNodeOptions != null) @@ -1483,12 +1492,12 @@ internal FileOperations(BatchServiceClient client) ifUnmodifiedSince = fileGetPropertiesFromComputeNodeOptions.IfUnmodifiedSince; } // 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("poolId", poolId); tracingParameters.Add("nodeId", nodeId); tracingParameters.Add("filePath", filePath); @@ -1499,44 +1508,44 @@ internal FileOperations(BatchServiceClient client) tracingParameters.Add("ifModifiedSince", ifModifiedSince); tracingParameters.Add("ifUnmodifiedSince", ifUnmodifiedSince); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetPropertiesFromComputeNode", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetPropertiesFromComputeNode", 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("/") ? "" : "/")), "pools/{poolId}/nodes/{nodeId}/files/{filePath}").ToString(); _url = _url.Replace("{poolId}", System.Uri.EscapeDataString(poolId)); _url = _url.Replace("{nodeId}", System.Uri.EscapeDataString(nodeId)); _url = _url.Replace("{filePath}", System.Uri.EscapeDataString(filePath)); - 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 (timeout != null) { - _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(timeout, this.Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(timeout, Client.SerializationSettings).Trim('"')))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("HEAD"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("HEAD"); _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("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 (clientRequestId != null) { @@ -1544,7 +1553,7 @@ internal FileOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(clientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("client-request-id", SafeJsonConvert.SerializeObject(clientRequestId, Client.SerializationSettings).Trim('"')); } if (returnClientRequestId != null) { @@ -1552,7 +1561,7 @@ internal FileOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("return-client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(returnClientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", SafeJsonConvert.SerializeObject(returnClientRequestId, Client.SerializationSettings).Trim('"')); } if (ocpDate != null) { @@ -1560,7 +1569,7 @@ internal FileOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("ocp-date"); } - _httpRequest.Headers.TryAddWithoutValidation("ocp-date", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ocpDate, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("ocp-date", SafeJsonConvert.SerializeObject(ocpDate, new DateTimeRfc1123JsonConverter()).Trim('"')); } if (ifModifiedSince != null) { @@ -1568,7 +1577,7 @@ internal FileOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("If-Modified-Since"); } - _httpRequest.Headers.TryAddWithoutValidation("If-Modified-Since", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ifModifiedSince, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("If-Modified-Since", SafeJsonConvert.SerializeObject(ifModifiedSince, new DateTimeRfc1123JsonConverter()).Trim('"')); } if (ifUnmodifiedSince != null) { @@ -1576,7 +1585,7 @@ internal FileOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("If-Unmodified-Since"); } - _httpRequest.Headers.TryAddWithoutValidation("If-Unmodified-Since", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ifUnmodifiedSince, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("If-Unmodified-Since", SafeJsonConvert.SerializeObject(ifUnmodifiedSince, new DateTimeRfc1123JsonConverter()).Trim('"')); } @@ -1595,23 +1604,23 @@ internal FileOperations(BatchServiceClient 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, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, 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) @@ -1620,21 +1629,21 @@ internal FileOperations(BatchServiceClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - BatchError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + BatchError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1644,7 +1653,7 @@ internal FileOperations(BatchServiceClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); + var _result = new AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("request-id")) @@ -1653,20 +1662,20 @@ internal FileOperations(BatchServiceClient client) } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(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 headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -1681,8 +1690,8 @@ internal FileOperations(BatchServiceClient client) /// The ID of the task whose files you want to list. /// /// - /// Whether to list children of a directory. This parameter can be used in - /// combination with the filter parameter to list specific type of files. + /// Whether to list children of the task directory. This parameter can be used + /// in combination with the filter parameter to list specific type of files. /// /// /// Additional parameters for the operation @@ -1696,10 +1705,10 @@ internal FileOperations(BatchServiceClient client) /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1708,19 +1717,19 @@ internal FileOperations(BatchServiceClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task,FileListFromTaskHeaders>> ListFromTaskWithHttpMessagesAsync(string jobId, string taskId, bool? recursive = default(bool?), FileListFromTaskOptions fileListFromTaskOptions = default(FileListFromTaskOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task,FileListFromTaskHeaders>> ListFromTaskWithHttpMessagesAsync(string jobId, string taskId, bool? recursive = default(bool?), FileListFromTaskOptions fileListFromTaskOptions = default(FileListFromTaskOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (jobId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "jobId"); + throw new ValidationException(ValidationRules.CannotBeNull, "jobId"); } if (taskId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "taskId"); + throw new ValidationException(ValidationRules.CannotBeNull, "taskId"); } - 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"); } string filter = default(string); if (fileListFromTaskOptions != null) @@ -1753,12 +1762,12 @@ internal FileOperations(BatchServiceClient client) ocpDate = fileListFromTaskOptions.OcpDate; } // 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("jobId", jobId); tracingParameters.Add("taskId", taskId); tracingParameters.Add("recursive", recursive); @@ -1769,21 +1778,21 @@ internal FileOperations(BatchServiceClient client) tracingParameters.Add("returnClientRequestId", returnClientRequestId); tracingParameters.Add("ocpDate", ocpDate); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListFromTask", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListFromTask", 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("/") ? "" : "/")), "jobs/{jobId}/tasks/{taskId}/files").ToString(); _url = _url.Replace("{jobId}", System.Uri.EscapeDataString(jobId)); _url = _url.Replace("{taskId}", System.Uri.EscapeDataString(taskId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + List _queryParameters = new List(); if (recursive != null) { - _queryParameters.Add(string.Format("recursive={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(recursive, this.Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("recursive={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(recursive, Client.SerializationSettings).Trim('"')))); } - 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 (filter != null) { @@ -1791,33 +1800,33 @@ internal FileOperations(BatchServiceClient client) } if (maxResults != null) { - _queryParameters.Add(string.Format("maxresults={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(maxResults, this.Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("maxresults={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(maxResults, Client.SerializationSettings).Trim('"')))); } if (timeout != null) { - _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(timeout, this.Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(timeout, Client.SerializationSettings).Trim('"')))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _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("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 (clientRequestId != null) { @@ -1825,7 +1834,7 @@ internal FileOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(clientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("client-request-id", SafeJsonConvert.SerializeObject(clientRequestId, Client.SerializationSettings).Trim('"')); } if (returnClientRequestId != null) { @@ -1833,7 +1842,7 @@ internal FileOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("return-client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(returnClientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", SafeJsonConvert.SerializeObject(returnClientRequestId, Client.SerializationSettings).Trim('"')); } if (ocpDate != null) { @@ -1841,7 +1850,7 @@ internal FileOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("ocp-date"); } - _httpRequest.Headers.TryAddWithoutValidation("ocp-date", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ocpDate, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("ocp-date", SafeJsonConvert.SerializeObject(ocpDate, new DateTimeRfc1123JsonConverter()).Trim('"')); } @@ -1860,23 +1869,23 @@ internal FileOperations(BatchServiceClient 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) @@ -1885,21 +1894,21 @@ internal FileOperations(BatchServiceClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - BatchError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + BatchError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1909,7 +1918,7 @@ internal FileOperations(BatchServiceClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse,FileListFromTaskHeaders>(); + var _result = new AzureOperationResponse,FileListFromTaskHeaders>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("request-id")) @@ -1922,34 +1931,34 @@ internal FileOperations(BatchServiceClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = 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); } } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(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 headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -1978,10 +1987,10 @@ internal FileOperations(BatchServiceClient client) /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1990,19 +1999,19 @@ internal FileOperations(BatchServiceClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task,FileListFromComputeNodeHeaders>> ListFromComputeNodeWithHttpMessagesAsync(string poolId, string nodeId, bool? recursive = default(bool?), FileListFromComputeNodeOptions fileListFromComputeNodeOptions = default(FileListFromComputeNodeOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task,FileListFromComputeNodeHeaders>> ListFromComputeNodeWithHttpMessagesAsync(string poolId, string nodeId, bool? recursive = default(bool?), FileListFromComputeNodeOptions fileListFromComputeNodeOptions = default(FileListFromComputeNodeOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (poolId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "poolId"); + throw new ValidationException(ValidationRules.CannotBeNull, "poolId"); } if (nodeId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nodeId"); + throw new ValidationException(ValidationRules.CannotBeNull, "nodeId"); } - 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"); } string filter = default(string); if (fileListFromComputeNodeOptions != null) @@ -2035,12 +2044,12 @@ internal FileOperations(BatchServiceClient client) ocpDate = fileListFromComputeNodeOptions.OcpDate; } // 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("poolId", poolId); tracingParameters.Add("nodeId", nodeId); tracingParameters.Add("recursive", recursive); @@ -2051,21 +2060,21 @@ internal FileOperations(BatchServiceClient client) tracingParameters.Add("returnClientRequestId", returnClientRequestId); tracingParameters.Add("ocpDate", ocpDate); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListFromComputeNode", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListFromComputeNode", 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("/") ? "" : "/")), "pools/{poolId}/nodes/{nodeId}/files").ToString(); _url = _url.Replace("{poolId}", System.Uri.EscapeDataString(poolId)); _url = _url.Replace("{nodeId}", System.Uri.EscapeDataString(nodeId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + List _queryParameters = new List(); if (recursive != null) { - _queryParameters.Add(string.Format("recursive={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(recursive, this.Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("recursive={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(recursive, Client.SerializationSettings).Trim('"')))); } - 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 (filter != null) { @@ -2073,33 +2082,33 @@ internal FileOperations(BatchServiceClient client) } if (maxResults != null) { - _queryParameters.Add(string.Format("maxresults={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(maxResults, this.Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("maxresults={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(maxResults, Client.SerializationSettings).Trim('"')))); } if (timeout != null) { - _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(timeout, this.Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(timeout, Client.SerializationSettings).Trim('"')))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _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("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 (clientRequestId != null) { @@ -2107,7 +2116,7 @@ internal FileOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(clientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("client-request-id", SafeJsonConvert.SerializeObject(clientRequestId, Client.SerializationSettings).Trim('"')); } if (returnClientRequestId != null) { @@ -2115,7 +2124,7 @@ internal FileOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("return-client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(returnClientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", SafeJsonConvert.SerializeObject(returnClientRequestId, Client.SerializationSettings).Trim('"')); } if (ocpDate != null) { @@ -2123,7 +2132,7 @@ internal FileOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("ocp-date"); } - _httpRequest.Headers.TryAddWithoutValidation("ocp-date", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ocpDate, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("ocp-date", SafeJsonConvert.SerializeObject(ocpDate, new DateTimeRfc1123JsonConverter()).Trim('"')); } @@ -2142,23 +2151,23 @@ internal FileOperations(BatchServiceClient 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) @@ -2167,21 +2176,21 @@ internal FileOperations(BatchServiceClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - BatchError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + BatchError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2191,7 +2200,7 @@ internal FileOperations(BatchServiceClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse,FileListFromComputeNodeHeaders>(); + var _result = new AzureOperationResponse,FileListFromComputeNodeHeaders>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("request-id")) @@ -2204,34 +2213,34 @@ internal FileOperations(BatchServiceClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = 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); } } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(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 headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -2254,10 +2263,10 @@ internal FileOperations(BatchServiceClient client) /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -2266,11 +2275,11 @@ internal FileOperations(BatchServiceClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task,FileListFromTaskHeaders>> ListFromTaskNextWithHttpMessagesAsync(string nextPageLink, FileListFromTaskNextOptions fileListFromTaskNextOptions = default(FileListFromTaskNextOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task,FileListFromTaskHeaders>> ListFromTaskNextWithHttpMessagesAsync(string nextPageLink, FileListFromTaskNextOptions fileListFromTaskNextOptions = default(FileListFromTaskNextOptions), 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"); } System.Guid? clientRequestId = default(System.Guid?); if (fileListFromTaskNextOptions != null) @@ -2288,44 +2297,44 @@ internal FileOperations(BatchServiceClient client) ocpDate = fileListFromTaskNextOptions.OcpDate; } // 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("clientRequestId", clientRequestId); tracingParameters.Add("returnClientRequestId", returnClientRequestId); tracingParameters.Add("ocpDate", ocpDate); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListFromTaskNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListFromTaskNext", 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 += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _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("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 (clientRequestId != null) { @@ -2333,7 +2342,7 @@ internal FileOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(clientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("client-request-id", SafeJsonConvert.SerializeObject(clientRequestId, Client.SerializationSettings).Trim('"')); } if (returnClientRequestId != null) { @@ -2341,7 +2350,7 @@ internal FileOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("return-client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(returnClientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", SafeJsonConvert.SerializeObject(returnClientRequestId, Client.SerializationSettings).Trim('"')); } if (ocpDate != null) { @@ -2349,7 +2358,7 @@ internal FileOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("ocp-date"); } - _httpRequest.Headers.TryAddWithoutValidation("ocp-date", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ocpDate, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("ocp-date", SafeJsonConvert.SerializeObject(ocpDate, new DateTimeRfc1123JsonConverter()).Trim('"')); } @@ -2368,23 +2377,23 @@ internal FileOperations(BatchServiceClient 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) @@ -2393,21 +2402,21 @@ internal FileOperations(BatchServiceClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - BatchError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + BatchError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2417,7 +2426,7 @@ internal FileOperations(BatchServiceClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse,FileListFromTaskHeaders>(); + var _result = new AzureOperationResponse,FileListFromTaskHeaders>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("request-id")) @@ -2430,34 +2439,34 @@ internal FileOperations(BatchServiceClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = 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); } } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(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 headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -2480,10 +2489,10 @@ internal FileOperations(BatchServiceClient client) /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -2492,11 +2501,11 @@ internal FileOperations(BatchServiceClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task,FileListFromComputeNodeHeaders>> ListFromComputeNodeNextWithHttpMessagesAsync(string nextPageLink, FileListFromComputeNodeNextOptions fileListFromComputeNodeNextOptions = default(FileListFromComputeNodeNextOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task,FileListFromComputeNodeHeaders>> ListFromComputeNodeNextWithHttpMessagesAsync(string nextPageLink, FileListFromComputeNodeNextOptions fileListFromComputeNodeNextOptions = default(FileListFromComputeNodeNextOptions), 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"); } System.Guid? clientRequestId = default(System.Guid?); if (fileListFromComputeNodeNextOptions != null) @@ -2514,44 +2523,44 @@ internal FileOperations(BatchServiceClient client) ocpDate = fileListFromComputeNodeNextOptions.OcpDate; } // 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("clientRequestId", clientRequestId); tracingParameters.Add("returnClientRequestId", returnClientRequestId); tracingParameters.Add("ocpDate", ocpDate); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListFromComputeNodeNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListFromComputeNodeNext", 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 += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _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("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 (clientRequestId != null) { @@ -2559,7 +2568,7 @@ internal FileOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(clientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("client-request-id", SafeJsonConvert.SerializeObject(clientRequestId, Client.SerializationSettings).Trim('"')); } if (returnClientRequestId != null) { @@ -2567,7 +2576,7 @@ internal FileOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("return-client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(returnClientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", SafeJsonConvert.SerializeObject(returnClientRequestId, Client.SerializationSettings).Trim('"')); } if (ocpDate != null) { @@ -2575,7 +2584,7 @@ internal FileOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("ocp-date"); } - _httpRequest.Headers.TryAddWithoutValidation("ocp-date", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ocpDate, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("ocp-date", SafeJsonConvert.SerializeObject(ocpDate, new DateTimeRfc1123JsonConverter()).Trim('"')); } @@ -2594,23 +2603,23 @@ internal FileOperations(BatchServiceClient 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) @@ -2619,21 +2628,21 @@ internal FileOperations(BatchServiceClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - BatchError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + BatchError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2643,7 +2652,7 @@ internal FileOperations(BatchServiceClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse,FileListFromComputeNodeHeaders>(); + var _result = new AzureOperationResponse,FileListFromComputeNodeHeaders>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("request-id")) @@ -2656,37 +2665,37 @@ internal FileOperations(BatchServiceClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = 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); } } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(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 headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } } -} +} \ No newline at end of file diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/FileOperationsExtensions.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/FileOperationsExtensions.cs index 6d7c60adf721..7f918f14c264 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/FileOperationsExtensions.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/FileOperationsExtensions.cs @@ -8,8 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol { + using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; + using System.IO; + using System.Threading; + using System.Threading.Tasks; /// /// Extension methods for FileOperations. @@ -29,7 +33,7 @@ public static partial class FileOperationsExtensions /// The ID of the task whose file you want to delete. /// /// - /// The path to the task file that you want to delete. + /// The path to the task file or directory that you want to delete. /// /// /// Whether to delete children of a directory. If the filePath parameter @@ -42,7 +46,7 @@ public static partial class FileOperationsExtensions /// public static FileDeleteFromTaskHeaders DeleteFromTask(this IFileOperations operations, string jobId, string taskId, string filePath, bool? recursive = default(bool?), FileDeleteFromTaskOptions fileDeleteFromTaskOptions = default(FileDeleteFromTaskOptions)) { - return ((IFileOperations)operations).DeleteFromTaskAsync(jobId, taskId, filePath, recursive, fileDeleteFromTaskOptions).GetAwaiter().GetResult(); + return operations.DeleteFromTaskAsync(jobId, taskId, filePath, recursive, fileDeleteFromTaskOptions).GetAwaiter().GetResult(); } /// @@ -58,7 +62,7 @@ public static partial class FileOperationsExtensions /// The ID of the task whose file you want to delete. /// /// - /// The path to the task file that you want to delete. + /// The path to the task file or directory that you want to delete. /// /// /// Whether to delete children of a directory. If the filePath parameter @@ -72,7 +76,7 @@ public static partial class FileOperationsExtensions /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task DeleteFromTaskAsync(this IFileOperations operations, string jobId, string taskId, string filePath, bool? recursive = default(bool?), FileDeleteFromTaskOptions fileDeleteFromTaskOptions = default(FileDeleteFromTaskOptions), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task DeleteFromTaskAsync(this IFileOperations operations, string jobId, string taskId, string filePath, bool? recursive = default(bool?), FileDeleteFromTaskOptions fileDeleteFromTaskOptions = default(FileDeleteFromTaskOptions), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.DeleteFromTaskWithHttpMessagesAsync(jobId, taskId, filePath, recursive, fileDeleteFromTaskOptions, null, cancellationToken).ConfigureAwait(false)) { @@ -98,9 +102,9 @@ public static partial class FileOperationsExtensions /// /// Additional parameters for the operation /// - public static System.IO.Stream GetFromTask(this IFileOperations operations, string jobId, string taskId, string filePath, FileGetFromTaskOptions fileGetFromTaskOptions = default(FileGetFromTaskOptions)) + public static Stream GetFromTask(this IFileOperations operations, string jobId, string taskId, string filePath, FileGetFromTaskOptions fileGetFromTaskOptions = default(FileGetFromTaskOptions)) { - return ((IFileOperations)operations).GetFromTaskAsync(jobId, taskId, filePath, fileGetFromTaskOptions).GetAwaiter().GetResult(); + return operations.GetFromTaskAsync(jobId, taskId, filePath, fileGetFromTaskOptions).GetAwaiter().GetResult(); } /// @@ -124,7 +128,7 @@ public static partial class FileOperationsExtensions /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task GetFromTaskAsync(this IFileOperations operations, string jobId, string taskId, string filePath, FileGetFromTaskOptions fileGetFromTaskOptions = default(FileGetFromTaskOptions), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task GetFromTaskAsync(this IFileOperations operations, string jobId, string taskId, string filePath, FileGetFromTaskOptions fileGetFromTaskOptions = default(FileGetFromTaskOptions), CancellationToken cancellationToken = default(CancellationToken)) { var _result = await operations.GetFromTaskWithHttpMessagesAsync(jobId, taskId, filePath, fileGetFromTaskOptions, null, cancellationToken).ConfigureAwait(false); _result.Request.Dispose(); @@ -151,7 +155,7 @@ public static partial class FileOperationsExtensions /// public static FileGetPropertiesFromTaskHeaders GetPropertiesFromTask(this IFileOperations operations, string jobId, string taskId, string filePath, FileGetPropertiesFromTaskOptions fileGetPropertiesFromTaskOptions = default(FileGetPropertiesFromTaskOptions)) { - return ((IFileOperations)operations).GetPropertiesFromTaskAsync(jobId, taskId, filePath, fileGetPropertiesFromTaskOptions).GetAwaiter().GetResult(); + return operations.GetPropertiesFromTaskAsync(jobId, taskId, filePath, fileGetPropertiesFromTaskOptions).GetAwaiter().GetResult(); } /// @@ -175,7 +179,7 @@ public static partial class FileOperationsExtensions /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task GetPropertiesFromTaskAsync(this IFileOperations operations, string jobId, string taskId, string filePath, FileGetPropertiesFromTaskOptions fileGetPropertiesFromTaskOptions = default(FileGetPropertiesFromTaskOptions), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task GetPropertiesFromTaskAsync(this IFileOperations operations, string jobId, string taskId, string filePath, FileGetPropertiesFromTaskOptions fileGetPropertiesFromTaskOptions = default(FileGetPropertiesFromTaskOptions), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.GetPropertiesFromTaskWithHttpMessagesAsync(jobId, taskId, filePath, fileGetPropertiesFromTaskOptions, null, cancellationToken).ConfigureAwait(false)) { @@ -196,7 +200,7 @@ public static partial class FileOperationsExtensions /// The ID of the compute node from which you want to delete the file. /// /// - /// The path to the file that you want to delete. + /// The path to the file or directory that you want to delete. /// /// /// Whether to delete children of a directory. If the filePath parameter @@ -209,7 +213,7 @@ public static partial class FileOperationsExtensions /// public static FileDeleteFromComputeNodeHeaders DeleteFromComputeNode(this IFileOperations operations, string poolId, string nodeId, string filePath, bool? recursive = default(bool?), FileDeleteFromComputeNodeOptions fileDeleteFromComputeNodeOptions = default(FileDeleteFromComputeNodeOptions)) { - return ((IFileOperations)operations).DeleteFromComputeNodeAsync(poolId, nodeId, filePath, recursive, fileDeleteFromComputeNodeOptions).GetAwaiter().GetResult(); + return operations.DeleteFromComputeNodeAsync(poolId, nodeId, filePath, recursive, fileDeleteFromComputeNodeOptions).GetAwaiter().GetResult(); } /// @@ -225,7 +229,7 @@ public static partial class FileOperationsExtensions /// The ID of the compute node from which you want to delete the file. /// /// - /// The path to the file that you want to delete. + /// The path to the file or directory that you want to delete. /// /// /// Whether to delete children of a directory. If the filePath parameter @@ -239,7 +243,7 @@ public static partial class FileOperationsExtensions /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task DeleteFromComputeNodeAsync(this IFileOperations operations, string poolId, string nodeId, string filePath, bool? recursive = default(bool?), FileDeleteFromComputeNodeOptions fileDeleteFromComputeNodeOptions = default(FileDeleteFromComputeNodeOptions), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task DeleteFromComputeNodeAsync(this IFileOperations operations, string poolId, string nodeId, string filePath, bool? recursive = default(bool?), FileDeleteFromComputeNodeOptions fileDeleteFromComputeNodeOptions = default(FileDeleteFromComputeNodeOptions), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.DeleteFromComputeNodeWithHttpMessagesAsync(poolId, nodeId, filePath, recursive, fileDeleteFromComputeNodeOptions, null, cancellationToken).ConfigureAwait(false)) { @@ -265,9 +269,9 @@ public static partial class FileOperationsExtensions /// /// Additional parameters for the operation /// - public static System.IO.Stream GetFromComputeNode(this IFileOperations operations, string poolId, string nodeId, string filePath, FileGetFromComputeNodeOptions fileGetFromComputeNodeOptions = default(FileGetFromComputeNodeOptions)) + public static Stream GetFromComputeNode(this IFileOperations operations, string poolId, string nodeId, string filePath, FileGetFromComputeNodeOptions fileGetFromComputeNodeOptions = default(FileGetFromComputeNodeOptions)) { - return ((IFileOperations)operations).GetFromComputeNodeAsync(poolId, nodeId, filePath, fileGetFromComputeNodeOptions).GetAwaiter().GetResult(); + return operations.GetFromComputeNodeAsync(poolId, nodeId, filePath, fileGetFromComputeNodeOptions).GetAwaiter().GetResult(); } /// @@ -291,7 +295,7 @@ public static partial class FileOperationsExtensions /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task GetFromComputeNodeAsync(this IFileOperations operations, string poolId, string nodeId, string filePath, FileGetFromComputeNodeOptions fileGetFromComputeNodeOptions = default(FileGetFromComputeNodeOptions), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task GetFromComputeNodeAsync(this IFileOperations operations, string poolId, string nodeId, string filePath, FileGetFromComputeNodeOptions fileGetFromComputeNodeOptions = default(FileGetFromComputeNodeOptions), CancellationToken cancellationToken = default(CancellationToken)) { var _result = await operations.GetFromComputeNodeWithHttpMessagesAsync(poolId, nodeId, filePath, fileGetFromComputeNodeOptions, null, cancellationToken).ConfigureAwait(false); _result.Request.Dispose(); @@ -318,7 +322,7 @@ public static partial class FileOperationsExtensions /// public static FileGetPropertiesFromComputeNodeHeaders GetPropertiesFromComputeNode(this IFileOperations operations, string poolId, string nodeId, string filePath, FileGetPropertiesFromComputeNodeOptions fileGetPropertiesFromComputeNodeOptions = default(FileGetPropertiesFromComputeNodeOptions)) { - return ((IFileOperations)operations).GetPropertiesFromComputeNodeAsync(poolId, nodeId, filePath, fileGetPropertiesFromComputeNodeOptions).GetAwaiter().GetResult(); + return operations.GetPropertiesFromComputeNodeAsync(poolId, nodeId, filePath, fileGetPropertiesFromComputeNodeOptions).GetAwaiter().GetResult(); } /// @@ -342,7 +346,7 @@ public static partial class FileOperationsExtensions /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task GetPropertiesFromComputeNodeAsync(this IFileOperations operations, string poolId, string nodeId, string filePath, FileGetPropertiesFromComputeNodeOptions fileGetPropertiesFromComputeNodeOptions = default(FileGetPropertiesFromComputeNodeOptions), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task GetPropertiesFromComputeNodeAsync(this IFileOperations operations, string poolId, string nodeId, string filePath, FileGetPropertiesFromComputeNodeOptions fileGetPropertiesFromComputeNodeOptions = default(FileGetPropertiesFromComputeNodeOptions), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.GetPropertiesFromComputeNodeWithHttpMessagesAsync(poolId, nodeId, filePath, fileGetPropertiesFromComputeNodeOptions, null, cancellationToken).ConfigureAwait(false)) { @@ -363,15 +367,15 @@ public static partial class FileOperationsExtensions /// The ID of the task whose files you want to list. /// /// - /// Whether to list children of a directory. This parameter can be used in - /// combination with the filter parameter to list specific type of files. + /// Whether to list children of the task directory. This parameter can be used + /// in combination with the filter parameter to list specific type of files. /// /// /// Additional parameters for the operation /// - public static Microsoft.Rest.Azure.IPage ListFromTask(this IFileOperations operations, string jobId, string taskId, bool? recursive = default(bool?), FileListFromTaskOptions fileListFromTaskOptions = default(FileListFromTaskOptions)) + public static IPage ListFromTask(this IFileOperations operations, string jobId, string taskId, bool? recursive = default(bool?), FileListFromTaskOptions fileListFromTaskOptions = default(FileListFromTaskOptions)) { - return ((IFileOperations)operations).ListFromTaskAsync(jobId, taskId, recursive, fileListFromTaskOptions).GetAwaiter().GetResult(); + return operations.ListFromTaskAsync(jobId, taskId, recursive, fileListFromTaskOptions).GetAwaiter().GetResult(); } /// @@ -387,8 +391,8 @@ public static partial class FileOperationsExtensions /// The ID of the task whose files you want to list. /// /// - /// Whether to list children of a directory. This parameter can be used in - /// combination with the filter parameter to list specific type of files. + /// Whether to list children of the task directory. This parameter can be used + /// in combination with the filter parameter to list specific type of files. /// /// /// Additional parameters for the operation @@ -396,7 +400,7 @@ public static partial class FileOperationsExtensions /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListFromTaskAsync(this IFileOperations operations, string jobId, string taskId, bool? recursive = default(bool?), FileListFromTaskOptions fileListFromTaskOptions = default(FileListFromTaskOptions), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task> ListFromTaskAsync(this IFileOperations operations, string jobId, string taskId, bool? recursive = default(bool?), FileListFromTaskOptions fileListFromTaskOptions = default(FileListFromTaskOptions), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListFromTaskWithHttpMessagesAsync(jobId, taskId, recursive, fileListFromTaskOptions, null, cancellationToken).ConfigureAwait(false)) { @@ -422,9 +426,9 @@ public static partial class FileOperationsExtensions /// /// Additional parameters for the operation /// - public static Microsoft.Rest.Azure.IPage ListFromComputeNode(this IFileOperations operations, string poolId, string nodeId, bool? recursive = default(bool?), FileListFromComputeNodeOptions fileListFromComputeNodeOptions = default(FileListFromComputeNodeOptions)) + public static IPage ListFromComputeNode(this IFileOperations operations, string poolId, string nodeId, bool? recursive = default(bool?), FileListFromComputeNodeOptions fileListFromComputeNodeOptions = default(FileListFromComputeNodeOptions)) { - return ((IFileOperations)operations).ListFromComputeNodeAsync(poolId, nodeId, recursive, fileListFromComputeNodeOptions).GetAwaiter().GetResult(); + return operations.ListFromComputeNodeAsync(poolId, nodeId, recursive, fileListFromComputeNodeOptions).GetAwaiter().GetResult(); } /// @@ -448,7 +452,7 @@ public static partial class FileOperationsExtensions /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListFromComputeNodeAsync(this IFileOperations operations, string poolId, string nodeId, bool? recursive = default(bool?), FileListFromComputeNodeOptions fileListFromComputeNodeOptions = default(FileListFromComputeNodeOptions), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task> ListFromComputeNodeAsync(this IFileOperations operations, string poolId, string nodeId, bool? recursive = default(bool?), FileListFromComputeNodeOptions fileListFromComputeNodeOptions = default(FileListFromComputeNodeOptions), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListFromComputeNodeWithHttpMessagesAsync(poolId, nodeId, recursive, fileListFromComputeNodeOptions, null, cancellationToken).ConfigureAwait(false)) { @@ -468,9 +472,9 @@ public static partial class FileOperationsExtensions /// /// Additional parameters for the operation /// - public static Microsoft.Rest.Azure.IPage ListFromTaskNext(this IFileOperations operations, string nextPageLink, FileListFromTaskNextOptions fileListFromTaskNextOptions = default(FileListFromTaskNextOptions)) + public static IPage ListFromTaskNext(this IFileOperations operations, string nextPageLink, FileListFromTaskNextOptions fileListFromTaskNextOptions = default(FileListFromTaskNextOptions)) { - return ((IFileOperations)operations).ListFromTaskNextAsync(nextPageLink, fileListFromTaskNextOptions).GetAwaiter().GetResult(); + return operations.ListFromTaskNextAsync(nextPageLink, fileListFromTaskNextOptions).GetAwaiter().GetResult(); } /// @@ -488,7 +492,7 @@ public static partial class FileOperationsExtensions /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListFromTaskNextAsync(this IFileOperations operations, string nextPageLink, FileListFromTaskNextOptions fileListFromTaskNextOptions = default(FileListFromTaskNextOptions), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task> ListFromTaskNextAsync(this IFileOperations operations, string nextPageLink, FileListFromTaskNextOptions fileListFromTaskNextOptions = default(FileListFromTaskNextOptions), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListFromTaskNextWithHttpMessagesAsync(nextPageLink, fileListFromTaskNextOptions, null, cancellationToken).ConfigureAwait(false)) { @@ -508,9 +512,9 @@ public static partial class FileOperationsExtensions /// /// Additional parameters for the operation /// - public static Microsoft.Rest.Azure.IPage ListFromComputeNodeNext(this IFileOperations operations, string nextPageLink, FileListFromComputeNodeNextOptions fileListFromComputeNodeNextOptions = default(FileListFromComputeNodeNextOptions)) + public static IPage ListFromComputeNodeNext(this IFileOperations operations, string nextPageLink, FileListFromComputeNodeNextOptions fileListFromComputeNodeNextOptions = default(FileListFromComputeNodeNextOptions)) { - return ((IFileOperations)operations).ListFromComputeNodeNextAsync(nextPageLink, fileListFromComputeNodeNextOptions).GetAwaiter().GetResult(); + return operations.ListFromComputeNodeNextAsync(nextPageLink, fileListFromComputeNodeNextOptions).GetAwaiter().GetResult(); } /// @@ -528,7 +532,7 @@ public static partial class FileOperationsExtensions /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListFromComputeNodeNextAsync(this IFileOperations operations, string nextPageLink, FileListFromComputeNodeNextOptions fileListFromComputeNodeNextOptions = default(FileListFromComputeNodeNextOptions), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task> ListFromComputeNodeNextAsync(this IFileOperations operations, string nextPageLink, FileListFromComputeNodeNextOptions fileListFromComputeNodeNextOptions = default(FileListFromComputeNodeNextOptions), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListFromComputeNodeNextWithHttpMessagesAsync(nextPageLink, fileListFromComputeNodeNextOptions, null, cancellationToken).ConfigureAwait(false)) { @@ -537,4 +541,4 @@ public static partial class FileOperationsExtensions } } -} +} \ No newline at end of file diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/IAccountOperations.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/IAccountOperations.cs index 0cb561f32a4e..7b7cfcfce237 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/IAccountOperations.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/IAccountOperations.cs @@ -8,8 +8,13 @@ namespace Microsoft.Azure.Batch.Protocol { + using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; /// /// AccountOperations operations. @@ -37,7 +42,7 @@ public partial interface IAccountOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task,AccountListNodeAgentSkusHeaders>> ListNodeAgentSkusWithHttpMessagesAsync(AccountListNodeAgentSkusOptions accountListNodeAgentSkusOptions = default(AccountListNodeAgentSkusOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task,AccountListNodeAgentSkusHeaders>> ListNodeAgentSkusWithHttpMessagesAsync(AccountListNodeAgentSkusOptions accountListNodeAgentSkusOptions = default(AccountListNodeAgentSkusOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Lists all node agent SKUs supported by the Azure Batch service. /// @@ -62,6 +67,6 @@ public partial interface IAccountOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task,AccountListNodeAgentSkusHeaders>> ListNodeAgentSkusNextWithHttpMessagesAsync(string nextPageLink, AccountListNodeAgentSkusNextOptions accountListNodeAgentSkusNextOptions = default(AccountListNodeAgentSkusNextOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task,AccountListNodeAgentSkusHeaders>> ListNodeAgentSkusNextWithHttpMessagesAsync(string nextPageLink, AccountListNodeAgentSkusNextOptions accountListNodeAgentSkusNextOptions = default(AccountListNodeAgentSkusNextOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } -} +} \ No newline at end of file diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/IApplicationOperations.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/IApplicationOperations.cs index 7c35274999f8..442672daa3b9 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/IApplicationOperations.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/IApplicationOperations.cs @@ -8,8 +8,13 @@ namespace Microsoft.Azure.Batch.Protocol { + using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; /// /// ApplicationOperations operations. @@ -44,10 +49,17 @@ public partial interface IApplicationOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task,ApplicationListHeaders>> ListWithHttpMessagesAsync(ApplicationListOptions applicationListOptions = default(ApplicationListOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task,ApplicationListHeaders>> ListWithHttpMessagesAsync(ApplicationListOptions applicationListOptions = default(ApplicationListOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets information about the specified application. /// + /// + /// This operation returns only applications and versions that are + /// available for use on compute nodes; that is, that can be used in an + /// application package reference. For administrator information about + /// applications and versions that are not yet available to compute + /// nodes, use the Azure portal or the Azure Resource Manager API. + /// /// /// The ID of the application. /// @@ -69,7 +81,7 @@ public partial interface IApplicationOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string applicationId, ApplicationGetOptions applicationGetOptions = default(ApplicationGetOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> GetWithHttpMessagesAsync(string applicationId, ApplicationGetOptions applicationGetOptions = default(ApplicationGetOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Lists all of the applications available in the specified account. /// @@ -101,6 +113,6 @@ public partial interface IApplicationOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task,ApplicationListHeaders>> ListNextWithHttpMessagesAsync(string nextPageLink, ApplicationListNextOptions applicationListNextOptions = default(ApplicationListNextOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task,ApplicationListHeaders>> ListNextWithHttpMessagesAsync(string nextPageLink, ApplicationListNextOptions applicationListNextOptions = default(ApplicationListNextOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } -} +} \ No newline at end of file diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/IBatchServiceClient.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/IBatchServiceClient.cs index d70e6f1f4025..734563d6499d 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/IBatchServiceClient.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/IBatchServiceClient.cs @@ -8,9 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol { + using Microsoft.Azure; + using Microsoft.Azure.Batch; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; + using Newtonsoft.Json; /// /// A client for issuing REST requests to the Azure Batch service. @@ -25,17 +28,17 @@ public partial interface IBatchServiceClient : System.IDisposable /// /// 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; } /// /// Client API Version. diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/ICertificateOperations.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/ICertificateOperations.cs index 54b4ccca0999..da1a7b06b5fa 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/ICertificateOperations.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/ICertificateOperations.cs @@ -8,8 +8,13 @@ namespace Microsoft.Azure.Batch.Protocol { + using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; /// /// CertificateOperations operations. @@ -37,7 +42,7 @@ public partial interface ICertificateOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> AddWithHttpMessagesAsync(CertificateAddParameter certificate, CertificateAddOptions certificateAddOptions = default(CertificateAddOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> AddWithHttpMessagesAsync(CertificateAddParameter certificate, CertificateAddOptions certificateAddOptions = default(CertificateAddOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Lists all of the certificates that have been added to the specified /// account. @@ -60,7 +65,7 @@ public partial interface ICertificateOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task,CertificateListHeaders>> ListWithHttpMessagesAsync(CertificateListOptions certificateListOptions = default(CertificateListOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task,CertificateListHeaders>> ListWithHttpMessagesAsync(CertificateListOptions certificateListOptions = default(CertificateListOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Cancels a failed deletion of a certificate from the specified /// account. @@ -98,7 +103,7 @@ public partial interface ICertificateOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> CancelDeletionWithHttpMessagesAsync(string thumbprintAlgorithm, string thumbprint, CertificateCancelDeletionOptions certificateCancelDeletionOptions = default(CertificateCancelDeletionOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> CancelDeletionWithHttpMessagesAsync(string thumbprintAlgorithm, string thumbprint, CertificateCancelDeletionOptions certificateCancelDeletionOptions = default(CertificateCancelDeletionOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Deletes a certificate from the specified account. /// @@ -137,7 +142,7 @@ public partial interface ICertificateOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> DeleteWithHttpMessagesAsync(string thumbprintAlgorithm, string thumbprint, CertificateDeleteOptions certificateDeleteOptions = default(CertificateDeleteOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> DeleteWithHttpMessagesAsync(string thumbprintAlgorithm, string thumbprint, CertificateDeleteOptions certificateDeleteOptions = default(CertificateDeleteOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets information about the specified certificate. /// @@ -166,7 +171,7 @@ public partial interface ICertificateOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string thumbprintAlgorithm, string thumbprint, CertificateGetOptions certificateGetOptions = default(CertificateGetOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> GetWithHttpMessagesAsync(string thumbprintAlgorithm, string thumbprint, CertificateGetOptions certificateGetOptions = default(CertificateGetOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Lists all of the certificates that have been added to the specified /// account. @@ -192,6 +197,6 @@ public partial interface ICertificateOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task,CertificateListHeaders>> ListNextWithHttpMessagesAsync(string nextPageLink, CertificateListNextOptions certificateListNextOptions = default(CertificateListNextOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task,CertificateListHeaders>> ListNextWithHttpMessagesAsync(string nextPageLink, CertificateListNextOptions certificateListNextOptions = default(CertificateListNextOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } -} +} \ No newline at end of file diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/IComputeNodeOperations.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/IComputeNodeOperations.cs index 9edd2daf8c18..a95860baedb9 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/IComputeNodeOperations.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/IComputeNodeOperations.cs @@ -8,8 +8,14 @@ namespace Microsoft.Azure.Batch.Protocol { + using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; + using System.Collections; + using System.Collections.Generic; + using System.IO; + using System.Threading; + using System.Threading.Tasks; /// /// ComputeNodeOperations operations. @@ -47,7 +53,7 @@ public partial interface IComputeNodeOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> AddUserWithHttpMessagesAsync(string poolId, string nodeId, ComputeNodeUser user, ComputeNodeAddUserOptions computeNodeAddUserOptions = default(ComputeNodeAddUserOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> AddUserWithHttpMessagesAsync(string poolId, string nodeId, ComputeNodeUser user, ComputeNodeAddUserOptions computeNodeAddUserOptions = default(ComputeNodeAddUserOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Deletes a user account from the specified compute node. /// @@ -79,9 +85,9 @@ public partial interface IComputeNodeOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> DeleteUserWithHttpMessagesAsync(string poolId, string nodeId, string userName, ComputeNodeDeleteUserOptions computeNodeDeleteUserOptions = default(ComputeNodeDeleteUserOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> DeleteUserWithHttpMessagesAsync(string poolId, string nodeId, string userName, ComputeNodeDeleteUserOptions computeNodeDeleteUserOptions = default(ComputeNodeDeleteUserOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Updates the password or expiration time of a user account on the + /// Updates the password and expiration time of a user account on the /// specified compute node. /// /// @@ -118,7 +124,7 @@ public partial interface IComputeNodeOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> UpdateUserWithHttpMessagesAsync(string poolId, string nodeId, string userName, NodeUpdateUserParameter nodeUpdateUserParameter, ComputeNodeUpdateUserOptions computeNodeUpdateUserOptions = default(ComputeNodeUpdateUserOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> UpdateUserWithHttpMessagesAsync(string poolId, string nodeId, string userName, NodeUpdateUserParameter nodeUpdateUserParameter, ComputeNodeUpdateUserOptions computeNodeUpdateUserOptions = default(ComputeNodeUpdateUserOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets information about the specified compute node. /// @@ -146,7 +152,7 @@ public partial interface IComputeNodeOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string poolId, string nodeId, ComputeNodeGetOptions computeNodeGetOptions = default(ComputeNodeGetOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> GetWithHttpMessagesAsync(string poolId, string nodeId, ComputeNodeGetOptions computeNodeGetOptions = default(ComputeNodeGetOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Restarts the specified compute node. /// @@ -161,8 +167,23 @@ public partial interface IComputeNodeOperations /// /// /// When to reboot the compute node and what to do with currently - /// running tasks. The default value is requeue. Possible values - /// include: 'requeue', 'terminate', 'taskCompletion', 'retainedData' + /// running tasks. Values are: + /// + /// requeue - Terminate running task processes and requeue the tasks. + /// The tasks will run again when a node is available. Restart the node + /// as soon as tasks have been terminated. + /// terminate - Terminate running tasks. The tasks will not run again. + /// Restart the node as soon as tasks have been terminated. + /// taskcompletion - Allow currently running tasks to complete. + /// Schedule no new tasks while waiting. Restart the node when all + /// tasks have completed. + /// retaineddata - Allow currently running tasks to complete, then wait + /// for all task data retention periods to expire. Schedule no new + /// tasks while waiting. Restart the node when all task retention + /// periods have expired. + /// + /// The default value is requeue. Possible values include: 'requeue', + /// 'terminate', 'taskCompletion', 'retainedData' /// /// /// Additional parameters for the operation @@ -179,7 +200,7 @@ public partial interface IComputeNodeOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> RebootWithHttpMessagesAsync(string poolId, string nodeId, ComputeNodeRebootOption? nodeRebootOption = default(ComputeNodeRebootOption?), ComputeNodeRebootOptions computeNodeRebootOptions = default(ComputeNodeRebootOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> RebootWithHttpMessagesAsync(string poolId, string nodeId, ComputeNodeRebootOption? nodeRebootOption = default(ComputeNodeRebootOption?), ComputeNodeRebootOptions computeNodeRebootOptions = default(ComputeNodeRebootOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Reinstalls the operating system on the specified compute node. /// @@ -196,8 +217,23 @@ public partial interface IComputeNodeOperations /// /// /// When to reimage the compute node and what to do with currently - /// running tasks. The default value is requeue. Possible values - /// include: 'requeue', 'terminate', 'taskCompletion', 'retainedData' + /// running tasks. Values are: + /// + /// requeue - Terminate running task processes and requeue the tasks. + /// The tasks will run again when a node is available. Reimage the node + /// as soon as tasks have been terminated. + /// terminate - Terminate running tasks. The tasks will not run again. + /// Reimage the node as soon as tasks have been terminated. + /// taskcompletion - Allow currently running tasks to complete. + /// Schedule no new tasks while waiting. Reimage the node when all + /// tasks have completed. + /// retaineddata - Allow currently running tasks to complete, then wait + /// for all task data retention periods to expire. Schedule no new + /// tasks while waiting. Reimage the node when all task retention + /// periods have expired. + /// + /// The default value is requeue. Possible values include: 'requeue', + /// 'terminate', 'taskCompletion', 'retainedData' /// /// /// Additional parameters for the operation @@ -214,10 +250,14 @@ public partial interface IComputeNodeOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> ReimageWithHttpMessagesAsync(string poolId, string nodeId, ComputeNodeReimageOption? nodeReimageOption = default(ComputeNodeReimageOption?), ComputeNodeReimageOptions computeNodeReimageOptions = default(ComputeNodeReimageOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> ReimageWithHttpMessagesAsync(string poolId, string nodeId, ComputeNodeReimageOption? nodeReimageOption = default(ComputeNodeReimageOption?), ComputeNodeReimageOptions computeNodeReimageOptions = default(ComputeNodeReimageOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Disables task scheduling on the specified compute node. /// + /// + /// You can disable task scheduling on a node only if its current + /// scheduling state is enabled. + /// /// /// The ID of the pool that contains the compute node. /// @@ -227,8 +267,20 @@ public partial interface IComputeNodeOperations /// /// /// What to do with currently running tasks when disabling task - /// scheduling on the compute node. The default value is requeue. - /// Possible values include: 'requeue', 'terminate', 'taskCompletion' + /// scheduling on the compute node. Values are: + /// + /// requeue - Terminate running task processes and requeue the tasks. + /// The tasks may run again on other compute nodes, or when task + /// scheduling is re-enabled on this node. Enter offline state as soon + /// as tasks have been terminated. + /// terminate - Terminate running tasks. The tasks will not run again. + /// Enter offline state as soon as tasks have been terminated. + /// taskcompletion - Allow currently running tasks to complete. + /// Schedule no new tasks while waiting. Enter offline state when all + /// tasks have completed. + /// + /// The default value is requeue. Possible values include: 'requeue', + /// 'terminate', 'taskCompletion' /// /// /// Additional parameters for the operation @@ -245,10 +297,14 @@ public partial interface IComputeNodeOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> DisableSchedulingWithHttpMessagesAsync(string poolId, string nodeId, DisableComputeNodeSchedulingOption? nodeDisableSchedulingOption = default(DisableComputeNodeSchedulingOption?), ComputeNodeDisableSchedulingOptions computeNodeDisableSchedulingOptions = default(ComputeNodeDisableSchedulingOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> DisableSchedulingWithHttpMessagesAsync(string poolId, string nodeId, DisableComputeNodeSchedulingOption? nodeDisableSchedulingOption = default(DisableComputeNodeSchedulingOption?), ComputeNodeDisableSchedulingOptions computeNodeDisableSchedulingOptions = default(ComputeNodeDisableSchedulingOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Enables task scheduling on the specified compute node. /// + /// + /// You can enable task scheduling on a node only if its current + /// scheduling state is disabled + /// /// /// The ID of the pool that contains the compute node. /// @@ -271,7 +327,7 @@ public partial interface IComputeNodeOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> EnableSchedulingWithHttpMessagesAsync(string poolId, string nodeId, ComputeNodeEnableSchedulingOptions computeNodeEnableSchedulingOptions = default(ComputeNodeEnableSchedulingOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> EnableSchedulingWithHttpMessagesAsync(string poolId, string nodeId, ComputeNodeEnableSchedulingOptions computeNodeEnableSchedulingOptions = default(ComputeNodeEnableSchedulingOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets the settings required for remote login to a compute node. /// @@ -279,7 +335,8 @@ public partial interface IComputeNodeOperations /// Before you can remotely login to a node using the remote login /// settings, you must create a user account on the node. This API can /// be invoked only on pools created with the virtual machine - /// configuration property. + /// configuration property. For pools created with a cloud service + /// configuration, see the GetRemoteDesktop API. /// /// /// The ID of the pool that contains the compute node. @@ -306,7 +363,7 @@ public partial interface IComputeNodeOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> GetRemoteLoginSettingsWithHttpMessagesAsync(string poolId, string nodeId, ComputeNodeGetRemoteLoginSettingsOptions computeNodeGetRemoteLoginSettingsOptions = default(ComputeNodeGetRemoteLoginSettingsOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> GetRemoteLoginSettingsWithHttpMessagesAsync(string poolId, string nodeId, ComputeNodeGetRemoteLoginSettingsOptions computeNodeGetRemoteLoginSettingsOptions = default(ComputeNodeGetRemoteLoginSettingsOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets the Remote Desktop Protocol file for the specified compute /// node. @@ -314,7 +371,9 @@ public partial interface IComputeNodeOperations /// /// Before you can access a node by using the RDP file, you must create /// a user account on the node. This API can only be invoked on pools - /// created with the cloud service configuration property. + /// created with a cloud service configuration. For pools created with + /// a virtual machine configuration, see the GetRemoteLoginSettings + /// API. /// /// /// The ID of the pool that contains the compute node. @@ -341,7 +400,7 @@ public partial interface IComputeNodeOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> GetRemoteDesktopWithHttpMessagesAsync(string poolId, string nodeId, ComputeNodeGetRemoteDesktopOptions computeNodeGetRemoteDesktopOptions = default(ComputeNodeGetRemoteDesktopOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> GetRemoteDesktopWithHttpMessagesAsync(string poolId, string nodeId, ComputeNodeGetRemoteDesktopOptions computeNodeGetRemoteDesktopOptions = default(ComputeNodeGetRemoteDesktopOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Lists the compute nodes in the specified pool. /// @@ -366,7 +425,7 @@ public partial interface IComputeNodeOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task,ComputeNodeListHeaders>> ListWithHttpMessagesAsync(string poolId, ComputeNodeListOptions computeNodeListOptions = default(ComputeNodeListOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task,ComputeNodeListHeaders>> ListWithHttpMessagesAsync(string poolId, ComputeNodeListOptions computeNodeListOptions = default(ComputeNodeListOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Lists the compute nodes in the specified pool. /// @@ -391,6 +450,6 @@ public partial interface IComputeNodeOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task,ComputeNodeListHeaders>> ListNextWithHttpMessagesAsync(string nextPageLink, ComputeNodeListNextOptions computeNodeListNextOptions = default(ComputeNodeListNextOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task,ComputeNodeListHeaders>> ListNextWithHttpMessagesAsync(string nextPageLink, ComputeNodeListNextOptions computeNodeListNextOptions = default(ComputeNodeListNextOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } -} +} \ No newline at end of file diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/IFileOperations.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/IFileOperations.cs index 237e0713f975..5bb34985630e 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/IFileOperations.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/IFileOperations.cs @@ -8,8 +8,14 @@ namespace Microsoft.Azure.Batch.Protocol { + using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; + using System.Collections; + using System.Collections.Generic; + using System.IO; + using System.Threading; + using System.Threading.Tasks; /// /// FileOperations operations. @@ -27,7 +33,7 @@ public partial interface IFileOperations /// The ID of the task whose file you want to delete. /// /// - /// The path to the task file that you want to delete. + /// The path to the task file or directory that you want to delete. /// /// /// Whether to delete children of a directory. If the filePath @@ -51,7 +57,7 @@ public partial interface IFileOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> DeleteFromTaskWithHttpMessagesAsync(string jobId, string taskId, string filePath, bool? recursive = default(bool?), FileDeleteFromTaskOptions fileDeleteFromTaskOptions = default(FileDeleteFromTaskOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> DeleteFromTaskWithHttpMessagesAsync(string jobId, string taskId, string filePath, bool? recursive = default(bool?), FileDeleteFromTaskOptions fileDeleteFromTaskOptions = default(FileDeleteFromTaskOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Returns the content of the specified task file. /// @@ -82,7 +88,7 @@ public partial interface IFileOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> GetFromTaskWithHttpMessagesAsync(string jobId, string taskId, string filePath, FileGetFromTaskOptions fileGetFromTaskOptions = default(FileGetFromTaskOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> GetFromTaskWithHttpMessagesAsync(string jobId, string taskId, string filePath, FileGetFromTaskOptions fileGetFromTaskOptions = default(FileGetFromTaskOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets the properties of the specified task file. /// @@ -110,7 +116,7 @@ public partial interface IFileOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> GetPropertiesFromTaskWithHttpMessagesAsync(string jobId, string taskId, string filePath, FileGetPropertiesFromTaskOptions fileGetPropertiesFromTaskOptions = default(FileGetPropertiesFromTaskOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> GetPropertiesFromTaskWithHttpMessagesAsync(string jobId, string taskId, string filePath, FileGetPropertiesFromTaskOptions fileGetPropertiesFromTaskOptions = default(FileGetPropertiesFromTaskOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Deletes the specified file from the compute node. /// @@ -121,7 +127,7 @@ public partial interface IFileOperations /// The ID of the compute node from which you want to delete the file. /// /// - /// The path to the file that you want to delete. + /// The path to the file or directory that you want to delete. /// /// /// Whether to delete children of a directory. If the filePath @@ -145,7 +151,7 @@ public partial interface IFileOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> DeleteFromComputeNodeWithHttpMessagesAsync(string poolId, string nodeId, string filePath, bool? recursive = default(bool?), FileDeleteFromComputeNodeOptions fileDeleteFromComputeNodeOptions = default(FileDeleteFromComputeNodeOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> DeleteFromComputeNodeWithHttpMessagesAsync(string poolId, string nodeId, string filePath, bool? recursive = default(bool?), FileDeleteFromComputeNodeOptions fileDeleteFromComputeNodeOptions = default(FileDeleteFromComputeNodeOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Returns the content of the specified compute node file. /// @@ -177,7 +183,7 @@ public partial interface IFileOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> GetFromComputeNodeWithHttpMessagesAsync(string poolId, string nodeId, string filePath, FileGetFromComputeNodeOptions fileGetFromComputeNodeOptions = default(FileGetFromComputeNodeOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> GetFromComputeNodeWithHttpMessagesAsync(string poolId, string nodeId, string filePath, FileGetFromComputeNodeOptions fileGetFromComputeNodeOptions = default(FileGetFromComputeNodeOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets the properties of the specified compute node file. /// @@ -206,7 +212,7 @@ public partial interface IFileOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> GetPropertiesFromComputeNodeWithHttpMessagesAsync(string poolId, string nodeId, string filePath, FileGetPropertiesFromComputeNodeOptions fileGetPropertiesFromComputeNodeOptions = default(FileGetPropertiesFromComputeNodeOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> GetPropertiesFromComputeNodeWithHttpMessagesAsync(string poolId, string nodeId, string filePath, FileGetPropertiesFromComputeNodeOptions fileGetPropertiesFromComputeNodeOptions = default(FileGetPropertiesFromComputeNodeOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Lists the files in a task's directory on its compute node. /// @@ -217,9 +223,9 @@ public partial interface IFileOperations /// The ID of the task whose files you want to list. /// /// - /// Whether to list children of a directory. This parameter can be used - /// in combination with the filter parameter to list specific type of - /// files. + /// Whether to list children of the task directory. This parameter can + /// be used in combination with the filter parameter to list specific + /// type of files. /// /// /// Additional parameters for the operation @@ -239,7 +245,7 @@ public partial interface IFileOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task,FileListFromTaskHeaders>> ListFromTaskWithHttpMessagesAsync(string jobId, string taskId, bool? recursive = default(bool?), FileListFromTaskOptions fileListFromTaskOptions = default(FileListFromTaskOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task,FileListFromTaskHeaders>> ListFromTaskWithHttpMessagesAsync(string jobId, string taskId, bool? recursive = default(bool?), FileListFromTaskOptions fileListFromTaskOptions = default(FileListFromTaskOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Lists all of the files in task directories on the specified compute /// node. @@ -271,7 +277,7 @@ public partial interface IFileOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task,FileListFromComputeNodeHeaders>> ListFromComputeNodeWithHttpMessagesAsync(string poolId, string nodeId, bool? recursive = default(bool?), FileListFromComputeNodeOptions fileListFromComputeNodeOptions = default(FileListFromComputeNodeOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task,FileListFromComputeNodeHeaders>> ListFromComputeNodeWithHttpMessagesAsync(string poolId, string nodeId, bool? recursive = default(bool?), FileListFromComputeNodeOptions fileListFromComputeNodeOptions = default(FileListFromComputeNodeOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Lists the files in a task's directory on its compute node. /// @@ -296,7 +302,7 @@ public partial interface IFileOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task,FileListFromTaskHeaders>> ListFromTaskNextWithHttpMessagesAsync(string nextPageLink, FileListFromTaskNextOptions fileListFromTaskNextOptions = default(FileListFromTaskNextOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task,FileListFromTaskHeaders>> ListFromTaskNextWithHttpMessagesAsync(string nextPageLink, FileListFromTaskNextOptions fileListFromTaskNextOptions = default(FileListFromTaskNextOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Lists all of the files in task directories on the specified compute /// node. @@ -322,6 +328,6 @@ public partial interface IFileOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task,FileListFromComputeNodeHeaders>> ListFromComputeNodeNextWithHttpMessagesAsync(string nextPageLink, FileListFromComputeNodeNextOptions fileListFromComputeNodeNextOptions = default(FileListFromComputeNodeNextOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task,FileListFromComputeNodeHeaders>> ListFromComputeNodeNextWithHttpMessagesAsync(string nextPageLink, FileListFromComputeNodeNextOptions fileListFromComputeNodeNextOptions = default(FileListFromComputeNodeNextOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } -} +} \ No newline at end of file diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/IJobOperations.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/IJobOperations.cs index 2f5e4235de7d..106a91ffb2a3 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/IJobOperations.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/IJobOperations.cs @@ -8,8 +8,13 @@ namespace Microsoft.Azure.Batch.Protocol { + using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; /// /// JobOperations operations. @@ -43,7 +48,7 @@ public partial interface IJobOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> GetAllLifetimeStatisticsWithHttpMessagesAsync(JobGetAllLifetimeStatisticsOptions jobGetAllLifetimeStatisticsOptions = default(JobGetAllLifetimeStatisticsOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> GetAllLifetimeStatisticsWithHttpMessagesAsync(JobGetAllLifetimeStatisticsOptions jobGetAllLifetimeStatisticsOptions = default(JobGetAllLifetimeStatisticsOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Deletes a job. /// @@ -52,7 +57,11 @@ public partial interface IJobOperations /// and all job statistics. This also overrides the retention period /// for task data; that is, if the job contains tasks which are still /// retained on compute nodes, the Batch services deletes those tasks' - /// working directories and all their contents. + /// working directories and all their contents. When a Delete Job + /// request is received, the Batch service sets the job to the deleting + /// state. All update operations on a job that is in deleting state + /// will fail with status code 409 (Conflict), with additional + /// information indicating that the job is being deleted. /// /// /// The ID of the job to delete. @@ -72,7 +81,7 @@ public partial interface IJobOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> DeleteWithHttpMessagesAsync(string jobId, JobDeleteOptions jobDeleteOptions = default(JobDeleteOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> DeleteWithHttpMessagesAsync(string jobId, JobDeleteOptions jobDeleteOptions = default(JobDeleteOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets information about the specified job. /// @@ -97,7 +106,7 @@ public partial interface IJobOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string jobId, JobGetOptions jobGetOptions = default(JobGetOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> GetWithHttpMessagesAsync(string jobId, JobGetOptions jobGetOptions = default(JobGetOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Updates the properties of the specified job. /// @@ -128,7 +137,7 @@ public partial interface IJobOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> PatchWithHttpMessagesAsync(string jobId, JobPatchParameter jobPatchParameter, JobPatchOptions jobPatchOptions = default(JobPatchOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> PatchWithHttpMessagesAsync(string jobId, JobPatchParameter jobPatchParameter, JobPatchOptions jobPatchOptions = default(JobPatchOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Updates the properties of the specified job. /// @@ -159,7 +168,7 @@ public partial interface IJobOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string jobId, JobUpdateParameter jobUpdateParameter, JobUpdateOptions jobUpdateOptions = default(JobUpdateOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> UpdateWithHttpMessagesAsync(string jobId, JobUpdateParameter jobUpdateParameter, JobUpdateOptions jobUpdateOptions = default(JobUpdateOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Disables the specified job, preventing new tasks from running. /// @@ -178,11 +187,13 @@ public partial interface IJobOperations /// The ID of the job to disable. /// /// - /// What to do with active tasks associated with the job. requeue - - /// Terminate running tasks and requeue them. The tasks will run again - /// when the job is enabled. terminate - Terminate running tasks. The - /// tasks will not run again. wait - Allow currently running tasks to - /// complete. Possible values include: 'requeue', 'terminate', 'wait' + /// What to do with active tasks associated with the job. Values are: + /// + /// requeue - Terminate running tasks and requeue them. The tasks will + /// run again when the job is enabled. + /// terminate - Terminate running tasks. The tasks will not run again. + /// wait - Allow currently running tasks to complete. Possible values + /// include: 'requeue', 'terminate', 'wait' /// /// /// Additional parameters for the operation @@ -199,7 +210,7 @@ public partial interface IJobOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> DisableWithHttpMessagesAsync(string jobId, DisableJobOption disableTasks, JobDisableOptions jobDisableOptions = default(JobDisableOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> DisableWithHttpMessagesAsync(string jobId, DisableJobOption disableTasks, JobDisableOptions jobDisableOptions = default(JobDisableOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Enables the specified job, allowing new tasks to run. /// @@ -230,7 +241,7 @@ public partial interface IJobOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> EnableWithHttpMessagesAsync(string jobId, JobEnableOptions jobEnableOptions = default(JobEnableOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> EnableWithHttpMessagesAsync(string jobId, JobEnableOptions jobEnableOptions = default(JobEnableOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Terminates the specified job, marking it as completed. /// @@ -263,7 +274,7 @@ public partial interface IJobOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> TerminateWithHttpMessagesAsync(string jobId, string terminateReason = default(string), JobTerminateOptions jobTerminateOptions = default(JobTerminateOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> TerminateWithHttpMessagesAsync(string jobId, string terminateReason = default(string), JobTerminateOptions jobTerminateOptions = default(JobTerminateOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Adds a job to the specified account. /// @@ -297,7 +308,7 @@ public partial interface IJobOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> AddWithHttpMessagesAsync(JobAddParameter job, JobAddOptions jobAddOptions = default(JobAddOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> AddWithHttpMessagesAsync(JobAddParameter job, JobAddOptions jobAddOptions = default(JobAddOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Lists all of the jobs in the specified account. /// @@ -319,7 +330,7 @@ public partial interface IJobOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task,JobListHeaders>> ListWithHttpMessagesAsync(JobListOptions jobListOptions = default(JobListOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task,JobListHeaders>> ListWithHttpMessagesAsync(JobListOptions jobListOptions = default(JobListOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Lists the jobs that have been created under the specified job /// schedule. @@ -346,7 +357,7 @@ public partial interface IJobOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task,JobListFromJobScheduleHeaders>> ListFromJobScheduleWithHttpMessagesAsync(string jobScheduleId, JobListFromJobScheduleOptions jobListFromJobScheduleOptions = default(JobListFromJobScheduleOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task,JobListFromJobScheduleHeaders>> ListFromJobScheduleWithHttpMessagesAsync(string jobScheduleId, JobListFromJobScheduleOptions jobListFromJobScheduleOptions = default(JobListFromJobScheduleOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Lists the execution status of the Job Preparation and Job Release /// task for the specified job across the compute nodes where the job @@ -356,7 +367,9 @@ public partial interface IJobOperations /// This API returns the Job Preparation and Job Release task status on /// all compute nodes that have run the Job Preparation or Job Release /// task. This includes nodes which have since been removed from the - /// pool. + /// pool. If this API is invoked on a job which has no Job Preparation + /// or Job Release task, the Batch service returns HTTP status code 409 + /// (Conflict) with an error code of JobPreparationTaskNotSpecified. /// /// /// The ID of the job. @@ -379,7 +392,7 @@ public partial interface IJobOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task,JobListPreparationAndReleaseTaskStatusHeaders>> ListPreparationAndReleaseTaskStatusWithHttpMessagesAsync(string jobId, JobListPreparationAndReleaseTaskStatusOptions jobListPreparationAndReleaseTaskStatusOptions = default(JobListPreparationAndReleaseTaskStatusOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task,JobListPreparationAndReleaseTaskStatusHeaders>> ListPreparationAndReleaseTaskStatusWithHttpMessagesAsync(string jobId, JobListPreparationAndReleaseTaskStatusOptions jobListPreparationAndReleaseTaskStatusOptions = default(JobListPreparationAndReleaseTaskStatusOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets the task counts for the specified job. /// @@ -413,7 +426,7 @@ public partial interface IJobOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> GetTaskCountsWithHttpMessagesAsync(string jobId, JobGetTaskCountsOptions jobGetTaskCountsOptions = default(JobGetTaskCountsOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> GetTaskCountsWithHttpMessagesAsync(string jobId, JobGetTaskCountsOptions jobGetTaskCountsOptions = default(JobGetTaskCountsOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Lists all of the jobs in the specified account. /// @@ -438,7 +451,7 @@ public partial interface IJobOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task,JobListHeaders>> ListNextWithHttpMessagesAsync(string nextPageLink, JobListNextOptions jobListNextOptions = default(JobListNextOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task,JobListHeaders>> ListNextWithHttpMessagesAsync(string nextPageLink, JobListNextOptions jobListNextOptions = default(JobListNextOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Lists the jobs that have been created under the specified job /// schedule. @@ -464,7 +477,7 @@ public partial interface IJobOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task,JobListFromJobScheduleHeaders>> ListFromJobScheduleNextWithHttpMessagesAsync(string nextPageLink, JobListFromJobScheduleNextOptions jobListFromJobScheduleNextOptions = default(JobListFromJobScheduleNextOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task,JobListFromJobScheduleHeaders>> ListFromJobScheduleNextWithHttpMessagesAsync(string nextPageLink, JobListFromJobScheduleNextOptions jobListFromJobScheduleNextOptions = default(JobListFromJobScheduleNextOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Lists the execution status of the Job Preparation and Job Release /// task for the specified job across the compute nodes where the job @@ -474,7 +487,9 @@ public partial interface IJobOperations /// This API returns the Job Preparation and Job Release task status on /// all compute nodes that have run the Job Preparation or Job Release /// task. This includes nodes which have since been removed from the - /// pool. + /// pool. If this API is invoked on a job which has no Job Preparation + /// or Job Release task, the Batch service returns HTTP status code 409 + /// (Conflict) with an error code of JobPreparationTaskNotSpecified. /// /// /// The NextLink from the previous successful call to List operation. @@ -497,6 +512,6 @@ public partial interface IJobOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task,JobListPreparationAndReleaseTaskStatusHeaders>> ListPreparationAndReleaseTaskStatusNextWithHttpMessagesAsync(string nextPageLink, JobListPreparationAndReleaseTaskStatusNextOptions jobListPreparationAndReleaseTaskStatusNextOptions = default(JobListPreparationAndReleaseTaskStatusNextOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task,JobListPreparationAndReleaseTaskStatusHeaders>> ListPreparationAndReleaseTaskStatusNextWithHttpMessagesAsync(string nextPageLink, JobListPreparationAndReleaseTaskStatusNextOptions jobListPreparationAndReleaseTaskStatusNextOptions = default(JobListPreparationAndReleaseTaskStatusNextOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } -} +} \ No newline at end of file diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/IJobScheduleOperations.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/IJobScheduleOperations.cs index 4c7ffe210d5b..4115a43fd49c 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/IJobScheduleOperations.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/IJobScheduleOperations.cs @@ -8,8 +8,13 @@ namespace Microsoft.Azure.Batch.Protocol { + using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; /// /// JobScheduleOperations operations. @@ -37,7 +42,7 @@ public partial interface IJobScheduleOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> ExistsWithHttpMessagesAsync(string jobScheduleId, JobScheduleExistsOptions jobScheduleExistsOptions = default(JobScheduleExistsOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> ExistsWithHttpMessagesAsync(string jobScheduleId, JobScheduleExistsOptions jobScheduleExistsOptions = default(JobScheduleExistsOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Deletes a job schedule from the specified account. /// @@ -67,7 +72,7 @@ public partial interface IJobScheduleOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> DeleteWithHttpMessagesAsync(string jobScheduleId, JobScheduleDeleteOptions jobScheduleDeleteOptions = default(JobScheduleDeleteOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> DeleteWithHttpMessagesAsync(string jobScheduleId, JobScheduleDeleteOptions jobScheduleDeleteOptions = default(JobScheduleDeleteOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets information about the specified job schedule. /// @@ -92,7 +97,7 @@ public partial interface IJobScheduleOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string jobScheduleId, JobScheduleGetOptions jobScheduleGetOptions = default(JobScheduleGetOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> GetWithHttpMessagesAsync(string jobScheduleId, JobScheduleGetOptions jobScheduleGetOptions = default(JobScheduleGetOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Updates the properties of the specified job schedule. /// @@ -125,7 +130,7 @@ public partial interface IJobScheduleOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> PatchWithHttpMessagesAsync(string jobScheduleId, JobSchedulePatchParameter jobSchedulePatchParameter, JobSchedulePatchOptions jobSchedulePatchOptions = default(JobSchedulePatchOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> PatchWithHttpMessagesAsync(string jobScheduleId, JobSchedulePatchParameter jobSchedulePatchParameter, JobSchedulePatchOptions jobSchedulePatchOptions = default(JobSchedulePatchOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Updates the properties of the specified job schedule. /// @@ -158,7 +163,7 @@ public partial interface IJobScheduleOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string jobScheduleId, JobScheduleUpdateParameter jobScheduleUpdateParameter, JobScheduleUpdateOptions jobScheduleUpdateOptions = default(JobScheduleUpdateOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> UpdateWithHttpMessagesAsync(string jobScheduleId, JobScheduleUpdateParameter jobScheduleUpdateParameter, JobScheduleUpdateOptions jobScheduleUpdateOptions = default(JobScheduleUpdateOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Disables a job schedule. /// @@ -184,7 +189,7 @@ public partial interface IJobScheduleOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> DisableWithHttpMessagesAsync(string jobScheduleId, JobScheduleDisableOptions jobScheduleDisableOptions = default(JobScheduleDisableOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> DisableWithHttpMessagesAsync(string jobScheduleId, JobScheduleDisableOptions jobScheduleDisableOptions = default(JobScheduleDisableOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Enables a job schedule. /// @@ -206,7 +211,7 @@ public partial interface IJobScheduleOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> EnableWithHttpMessagesAsync(string jobScheduleId, JobScheduleEnableOptions jobScheduleEnableOptions = default(JobScheduleEnableOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> EnableWithHttpMessagesAsync(string jobScheduleId, JobScheduleEnableOptions jobScheduleEnableOptions = default(JobScheduleEnableOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Terminates a job schedule. /// @@ -228,7 +233,7 @@ public partial interface IJobScheduleOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> TerminateWithHttpMessagesAsync(string jobScheduleId, JobScheduleTerminateOptions jobScheduleTerminateOptions = default(JobScheduleTerminateOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> TerminateWithHttpMessagesAsync(string jobScheduleId, JobScheduleTerminateOptions jobScheduleTerminateOptions = default(JobScheduleTerminateOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Adds a job schedule to the specified account. /// @@ -250,7 +255,7 @@ public partial interface IJobScheduleOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> AddWithHttpMessagesAsync(JobScheduleAddParameter cloudJobSchedule, JobScheduleAddOptions jobScheduleAddOptions = default(JobScheduleAddOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> AddWithHttpMessagesAsync(JobScheduleAddParameter cloudJobSchedule, JobScheduleAddOptions jobScheduleAddOptions = default(JobScheduleAddOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Lists all of the job schedules in the specified account. /// @@ -272,7 +277,7 @@ public partial interface IJobScheduleOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task,JobScheduleListHeaders>> ListWithHttpMessagesAsync(JobScheduleListOptions jobScheduleListOptions = default(JobScheduleListOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task,JobScheduleListHeaders>> ListWithHttpMessagesAsync(JobScheduleListOptions jobScheduleListOptions = default(JobScheduleListOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Lists all of the job schedules in the specified account. /// @@ -297,6 +302,6 @@ public partial interface IJobScheduleOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task,JobScheduleListHeaders>> ListNextWithHttpMessagesAsync(string nextPageLink, JobScheduleListNextOptions jobScheduleListNextOptions = default(JobScheduleListNextOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task,JobScheduleListHeaders>> ListNextWithHttpMessagesAsync(string nextPageLink, JobScheduleListNextOptions jobScheduleListNextOptions = default(JobScheduleListNextOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } -} +} \ No newline at end of file diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/IPoolOperations.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/IPoolOperations.cs index 650ffcddfbbd..9b2333385cb4 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/IPoolOperations.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/IPoolOperations.cs @@ -8,8 +8,13 @@ namespace Microsoft.Azure.Batch.Protocol { + using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; /// /// PoolOperations operations. @@ -23,7 +28,11 @@ public partial interface IPoolOperations /// /// If you do not specify a $filter clause including a poolId, the /// response includes all pools that existed in the account in the time - /// range of the returned aggregation intervals. + /// range of the returned aggregation intervals. If you do not specify + /// a $filter clause including a startTime or endTime these filters + /// default to the start and end times of the last aggregation interval + /// currently available; that is, only the last aggregation interval is + /// returned. /// /// /// Additional parameters for the operation @@ -43,7 +52,7 @@ public partial interface IPoolOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task,PoolListUsageMetricsHeaders>> ListUsageMetricsWithHttpMessagesAsync(PoolListUsageMetricsOptions poolListUsageMetricsOptions = default(PoolListUsageMetricsOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task,PoolListUsageMetricsHeaders>> ListUsageMetricsWithHttpMessagesAsync(PoolListUsageMetricsOptions poolListUsageMetricsOptions = default(PoolListUsageMetricsOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets lifetime summary statistics for all of the pools in the /// specified account. @@ -71,7 +80,7 @@ public partial interface IPoolOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> GetAllLifetimeStatisticsWithHttpMessagesAsync(PoolGetAllLifetimeStatisticsOptions poolGetAllLifetimeStatisticsOptions = default(PoolGetAllLifetimeStatisticsOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> GetAllLifetimeStatisticsWithHttpMessagesAsync(PoolGetAllLifetimeStatisticsOptions poolGetAllLifetimeStatisticsOptions = default(PoolGetAllLifetimeStatisticsOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Adds a pool to the specified account. /// @@ -98,7 +107,7 @@ public partial interface IPoolOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> AddWithHttpMessagesAsync(PoolAddParameter pool, PoolAddOptions poolAddOptions = default(PoolAddOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> AddWithHttpMessagesAsync(PoolAddParameter pool, PoolAddOptions poolAddOptions = default(PoolAddOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Lists all of the pools in the specified account. /// @@ -120,7 +129,7 @@ public partial interface IPoolOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task,PoolListHeaders>> ListWithHttpMessagesAsync(PoolListOptions poolListOptions = default(PoolListOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task,PoolListHeaders>> ListWithHttpMessagesAsync(PoolListOptions poolListOptions = default(PoolListOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Deletes a pool from the specified account. /// @@ -158,7 +167,7 @@ public partial interface IPoolOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> DeleteWithHttpMessagesAsync(string poolId, PoolDeleteOptions poolDeleteOptions = default(PoolDeleteOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> DeleteWithHttpMessagesAsync(string poolId, PoolDeleteOptions poolDeleteOptions = default(PoolDeleteOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets basic properties of a pool. /// @@ -180,7 +189,7 @@ public partial interface IPoolOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> ExistsWithHttpMessagesAsync(string poolId, PoolExistsOptions poolExistsOptions = default(PoolExistsOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> ExistsWithHttpMessagesAsync(string poolId, PoolExistsOptions poolExistsOptions = default(PoolExistsOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets information about the specified pool. /// @@ -205,7 +214,7 @@ public partial interface IPoolOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string poolId, PoolGetOptions poolGetOptions = default(PoolGetOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> GetWithHttpMessagesAsync(string poolId, PoolGetOptions poolGetOptions = default(PoolGetOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Updates the properties of the specified pool. /// @@ -236,7 +245,7 @@ public partial interface IPoolOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> PatchWithHttpMessagesAsync(string poolId, PoolPatchParameter poolPatchParameter, PoolPatchOptions poolPatchOptions = default(PoolPatchOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> PatchWithHttpMessagesAsync(string poolId, PoolPatchParameter poolPatchParameter, PoolPatchOptions poolPatchOptions = default(PoolPatchOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Disables automatic scaling for a pool. /// @@ -258,7 +267,7 @@ public partial interface IPoolOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> DisableAutoScaleWithHttpMessagesAsync(string poolId, PoolDisableAutoScaleOptions poolDisableAutoScaleOptions = default(PoolDisableAutoScaleOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> DisableAutoScaleWithHttpMessagesAsync(string poolId, PoolDisableAutoScaleOptions poolDisableAutoScaleOptions = default(PoolDisableAutoScaleOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Enables automatic scaling for a pool. /// @@ -292,7 +301,7 @@ public partial interface IPoolOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> EnableAutoScaleWithHttpMessagesAsync(string poolId, PoolEnableAutoScaleParameter poolEnableAutoScaleParameter, PoolEnableAutoScaleOptions poolEnableAutoScaleOptions = default(PoolEnableAutoScaleOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> EnableAutoScaleWithHttpMessagesAsync(string poolId, PoolEnableAutoScaleParameter poolEnableAutoScaleParameter, PoolEnableAutoScaleOptions poolEnableAutoScaleOptions = default(PoolEnableAutoScaleOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets the result of evaluating an automatic scaling formula on the /// pool. @@ -300,6 +309,8 @@ public partial interface IPoolOperations /// /// This API is primarily for validating an autoscale formula, as it /// simply returns the result without applying the formula to the pool. + /// The pool must have auto scaling enabled in order to evaluate a + /// formula. /// /// /// The ID of the pool on which to evaluate the automatic scaling @@ -332,7 +343,7 @@ public partial interface IPoolOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> EvaluateAutoScaleWithHttpMessagesAsync(string poolId, string autoScaleFormula, PoolEvaluateAutoScaleOptions poolEvaluateAutoScaleOptions = default(PoolEvaluateAutoScaleOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> EvaluateAutoScaleWithHttpMessagesAsync(string poolId, string autoScaleFormula, PoolEvaluateAutoScaleOptions poolEvaluateAutoScaleOptions = default(PoolEvaluateAutoScaleOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Changes the number of compute nodes that are assigned to a pool. /// @@ -367,16 +378,19 @@ public partial interface IPoolOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> ResizeWithHttpMessagesAsync(string poolId, PoolResizeParameter poolResizeParameter, PoolResizeOptions poolResizeOptions = default(PoolResizeOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> ResizeWithHttpMessagesAsync(string poolId, PoolResizeParameter poolResizeParameter, PoolResizeOptions poolResizeOptions = default(PoolResizeOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Stops an ongoing resize operation on the pool. /// /// /// This does not restore the pool to its previous state before the /// resize operation: it only stops any further changes being made, and - /// the pool maintains its current state. A resize operation need not - /// be an explicit resize pool request; this API can also be used to - /// halt the initial sizing of the pool when it is created. + /// the pool maintains its current state. After stopping, the pool + /// stabilizes at the number of nodes it was at when the stop operation + /// was done. During the stop operation, the pool allocation state + /// changes first to stopping and then to steady. A resize operation + /// need not be an explicit resize pool request; this API can also be + /// used to halt the initial sizing of the pool when it is created. /// /// /// The ID of the pool whose resizing you want to stop. @@ -396,7 +410,7 @@ public partial interface IPoolOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> StopResizeWithHttpMessagesAsync(string poolId, PoolStopResizeOptions poolStopResizeOptions = default(PoolStopResizeOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> StopResizeWithHttpMessagesAsync(string poolId, PoolStopResizeOptions poolStopResizeOptions = default(PoolStopResizeOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Updates the properties of the specified pool. /// @@ -427,7 +441,7 @@ public partial interface IPoolOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> UpdatePropertiesWithHttpMessagesAsync(string poolId, PoolUpdatePropertiesParameter poolUpdatePropertiesParameter, PoolUpdatePropertiesOptions poolUpdatePropertiesOptions = default(PoolUpdatePropertiesOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> UpdatePropertiesWithHttpMessagesAsync(string poolId, PoolUpdatePropertiesParameter poolUpdatePropertiesParameter, PoolUpdatePropertiesOptions poolUpdatePropertiesOptions = default(PoolUpdatePropertiesOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Upgrades the operating system of the specified pool. /// @@ -444,7 +458,13 @@ public partial interface IPoolOperations /// pool may be temporarily unavailable to run tasks. When this /// operation runs, the pool state changes to upgrading. When all /// compute nodes have finished upgrading, the pool state returns to - /// active. + /// active. While the upgrade is in progress, the pool's + /// currentOSVersion reflects the OS version that nodes are upgrading + /// from, and targetOSVersion reflects the OS version that nodes are + /// upgrading to. Once the upgrade is complete, currentOSVersion is + /// updated to reflect the OS version now running on all nodes. This + /// operation can only be invoked on pools created with the + /// cloudServiceConfiguration property. /// /// /// The ID of the pool to upgrade. @@ -468,7 +488,7 @@ public partial interface IPoolOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> UpgradeOSWithHttpMessagesAsync(string poolId, string targetOSVersion, PoolUpgradeOSOptions poolUpgradeOSOptions = default(PoolUpgradeOSOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> UpgradeOSWithHttpMessagesAsync(string poolId, string targetOSVersion, PoolUpgradeOSOptions poolUpgradeOSOptions = default(PoolUpgradeOSOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Removes compute nodes from the specified pool. /// @@ -498,7 +518,7 @@ public partial interface IPoolOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> RemoveNodesWithHttpMessagesAsync(string poolId, NodeRemoveParameter nodeRemoveParameter, PoolRemoveNodesOptions poolRemoveNodesOptions = default(PoolRemoveNodesOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> RemoveNodesWithHttpMessagesAsync(string poolId, NodeRemoveParameter nodeRemoveParameter, PoolRemoveNodesOptions poolRemoveNodesOptions = default(PoolRemoveNodesOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Lists the usage metrics, aggregated by pool across individual time /// intervals, for the specified account. @@ -506,7 +526,11 @@ public partial interface IPoolOperations /// /// If you do not specify a $filter clause including a poolId, the /// response includes all pools that existed in the account in the time - /// range of the returned aggregation intervals. + /// range of the returned aggregation intervals. If you do not specify + /// a $filter clause including a startTime or endTime these filters + /// default to the start and end times of the last aggregation interval + /// currently available; that is, only the last aggregation interval is + /// returned. /// /// /// The NextLink from the previous successful call to List operation. @@ -529,7 +553,7 @@ public partial interface IPoolOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task,PoolListUsageMetricsHeaders>> ListUsageMetricsNextWithHttpMessagesAsync(string nextPageLink, PoolListUsageMetricsNextOptions poolListUsageMetricsNextOptions = default(PoolListUsageMetricsNextOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task,PoolListUsageMetricsHeaders>> ListUsageMetricsNextWithHttpMessagesAsync(string nextPageLink, PoolListUsageMetricsNextOptions poolListUsageMetricsNextOptions = default(PoolListUsageMetricsNextOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Lists all of the pools in the specified account. /// @@ -554,6 +578,6 @@ public partial interface IPoolOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task,PoolListHeaders>> ListNextWithHttpMessagesAsync(string nextPageLink, PoolListNextOptions poolListNextOptions = default(PoolListNextOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task,PoolListHeaders>> ListNextWithHttpMessagesAsync(string nextPageLink, PoolListNextOptions poolListNextOptions = default(PoolListNextOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } -} +} \ No newline at end of file diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/ITaskOperations.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/ITaskOperations.cs index f21a40c08f3f..41b5b0ca2f08 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/ITaskOperations.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/ITaskOperations.cs @@ -8,8 +8,13 @@ namespace Microsoft.Azure.Batch.Protocol { + using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; /// /// TaskOperations operations. @@ -40,7 +45,7 @@ public partial interface ITaskOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> AddWithHttpMessagesAsync(string jobId, TaskAddParameter task, TaskAddOptions taskAddOptions = default(TaskAddOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> AddWithHttpMessagesAsync(string jobId, TaskAddParameter task, TaskAddOptions taskAddOptions = default(TaskAddOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Lists all of the tasks that are associated with the specified job. /// @@ -70,7 +75,7 @@ public partial interface ITaskOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task,TaskListHeaders>> ListWithHttpMessagesAsync(string jobId, TaskListOptions taskListOptions = default(TaskListOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task,TaskListHeaders>> ListWithHttpMessagesAsync(string jobId, TaskListOptions taskListOptions = default(TaskListOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Adds a collection of tasks to the specified job. /// @@ -82,15 +87,22 @@ public partial interface ITaskOperations /// partially or fully processed, or not at all. In such cases, the /// user should re-issue the request. Note that it is up to the user to /// correctly handle failures when re-issuing a request. For example, - /// you should use the same task ids during a retry so that if the + /// you should use the same task IDs during a retry so that if the /// prior operation succeeded, the retry will not create extra tasks - /// unexpectedly. + /// unexpectedly. If the response contains any tasks which failed to + /// add, a client can retry the request. In a retry, it is most + /// efficient to resubmit only tasks that failed to add, and to omit + /// tasks that were successfully added on the first attempt. /// /// /// The ID of the job to which the task collection is to be added. /// /// - /// The collection of tasks to add. + /// The collection of tasks to add. The total serialized size of this + /// collection must be less than 4MB. If it is greater than 4MB (for + /// example if each task has 100's of resource files or environment + /// variables), the request will fail with code 'RequestBodyTooLarge' + /// and should be retried again with fewer tasks. /// /// /// Additional parameters for the operation @@ -110,7 +122,7 @@ public partial interface ITaskOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> AddCollectionWithHttpMessagesAsync(string jobId, System.Collections.Generic.IList value, TaskAddCollectionOptions taskAddCollectionOptions = default(TaskAddCollectionOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> AddCollectionWithHttpMessagesAsync(string jobId, IList value, TaskAddCollectionOptions taskAddCollectionOptions = default(TaskAddCollectionOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Deletes a task from the specified job. /// @@ -142,7 +154,7 @@ public partial interface ITaskOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> DeleteWithHttpMessagesAsync(string jobId, string taskId, TaskDeleteOptions taskDeleteOptions = default(TaskDeleteOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> DeleteWithHttpMessagesAsync(string jobId, string taskId, TaskDeleteOptions taskDeleteOptions = default(TaskDeleteOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets information about the specified task. /// @@ -175,7 +187,7 @@ public partial interface ITaskOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string jobId, string taskId, TaskGetOptions taskGetOptions = default(TaskGetOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> GetWithHttpMessagesAsync(string jobId, string taskId, TaskGetOptions taskGetOptions = default(TaskGetOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Updates the properties of the specified task. /// @@ -187,7 +199,8 @@ public partial interface ITaskOperations /// /// /// Constraints that apply to this task. If omitted, the task is given - /// the default constraints. + /// the default constraints. For multi-instance tasks, updating the + /// retention time applies only to the primary task and not subtasks. /// /// /// Additional parameters for the operation @@ -204,7 +217,7 @@ public partial interface ITaskOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string jobId, string taskId, TaskConstraints constraints = default(TaskConstraints), TaskUpdateOptions taskUpdateOptions = default(TaskUpdateOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> UpdateWithHttpMessagesAsync(string jobId, string taskId, TaskConstraints constraints = default(TaskConstraints), TaskUpdateOptions taskUpdateOptions = default(TaskUpdateOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Lists all of the subtasks that are associated with the specified /// multi-instance task. @@ -237,7 +250,7 @@ public partial interface ITaskOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> ListSubtasksWithHttpMessagesAsync(string jobId, string taskId, TaskListSubtasksOptions taskListSubtasksOptions = default(TaskListSubtasksOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> ListSubtasksWithHttpMessagesAsync(string jobId, string taskId, TaskListSubtasksOptions taskListSubtasksOptions = default(TaskListSubtasksOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Terminates the specified task. /// @@ -268,18 +281,21 @@ public partial interface ITaskOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> TerminateWithHttpMessagesAsync(string jobId, string taskId, TaskTerminateOptions taskTerminateOptions = default(TaskTerminateOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> TerminateWithHttpMessagesAsync(string jobId, string taskId, TaskTerminateOptions taskTerminateOptions = default(TaskTerminateOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Reactivates the specified task. + /// Reactivates a task, allowing it to run again even if its retry + /// count has been exhausted. /// /// /// Reactivation makes a task eligible to be retried again up to its /// maximum retry count. The task's state is changed to active. As the /// task is no longer in the completed state, any previous exit code or - /// scheduling error is no longer available after reactivation. This - /// will fail for tasks that are not completed or that previously - /// completed successfully (with an exit code of 0). Additionally, this - /// will fail if the job has completed (or is terminating or deleting). + /// failure information is no longer available after reactivation. Each + /// time a task is reactivated, its retry count is reset to 0. + /// Reactivation will fail for tasks that are not completed or that + /// previously completed successfully (with an exit code of 0). + /// Additionally, it will fail if the job has completed (or is + /// terminating or deleting). /// /// /// The ID of the job containing the task. @@ -302,7 +318,7 @@ public partial interface ITaskOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> ReactivateWithHttpMessagesAsync(string jobId, string taskId, TaskReactivateOptions taskReactivateOptions = default(TaskReactivateOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> ReactivateWithHttpMessagesAsync(string jobId, string taskId, TaskReactivateOptions taskReactivateOptions = default(TaskReactivateOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Lists all of the tasks that are associated with the specified job. /// @@ -332,6 +348,6 @@ public partial interface ITaskOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task,TaskListHeaders>> ListNextWithHttpMessagesAsync(string nextPageLink, TaskListNextOptions taskListNextOptions = default(TaskListNextOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task,TaskListHeaders>> ListNextWithHttpMessagesAsync(string nextPageLink, TaskListNextOptions taskListNextOptions = default(TaskListNextOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } -} +} \ No newline at end of file diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/JobOperations.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/JobOperations.cs index c21c0b82c1ca..bc296088da5e 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/JobOperations.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/JobOperations.cs @@ -8,15 +8,23 @@ namespace Microsoft.Azure.Batch.Protocol { - 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; + using System.Threading; + using System.Threading.Tasks; /// /// JobOperations operations. /// - internal partial class JobOperations : Microsoft.Rest.IServiceOperations, IJobOperations + internal partial class JobOperations : IServiceOperations, IJobOperations { /// /// Initializes a new instance of the JobOperations class. @@ -33,7 +41,7 @@ internal JobOperations(BatchServiceClient client) { throw new System.ArgumentNullException("client"); } - this.Client = client; + Client = client; } /// @@ -61,10 +69,10 @@ internal JobOperations(BatchServiceClient client) /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -73,11 +81,11 @@ internal JobOperations(BatchServiceClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> GetAllLifetimeStatisticsWithHttpMessagesAsync(JobGetAllLifetimeStatisticsOptions jobGetAllLifetimeStatisticsOptions = default(JobGetAllLifetimeStatisticsOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> GetAllLifetimeStatisticsWithHttpMessagesAsync(JobGetAllLifetimeStatisticsOptions jobGetAllLifetimeStatisticsOptions = default(JobGetAllLifetimeStatisticsOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - 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"); } int? timeout = default(int?); if (jobGetAllLifetimeStatisticsOptions != null) @@ -100,52 +108,52 @@ internal JobOperations(BatchServiceClient client) ocpDate = jobGetAllLifetimeStatisticsOptions.OcpDate; } // 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("timeout", timeout); tracingParameters.Add("clientRequestId", clientRequestId); tracingParameters.Add("returnClientRequestId", returnClientRequestId); tracingParameters.Add("ocpDate", ocpDate); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetAllLifetimeStatistics", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetAllLifetimeStatistics", 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("/") ? "" : "/")), "lifetimejobstats").ToString(); - 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 (timeout != null) { - _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(timeout, this.Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(timeout, Client.SerializationSettings).Trim('"')))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _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("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 (clientRequestId != null) { @@ -153,7 +161,7 @@ internal JobOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(clientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("client-request-id", SafeJsonConvert.SerializeObject(clientRequestId, Client.SerializationSettings).Trim('"')); } if (returnClientRequestId != null) { @@ -161,7 +169,7 @@ internal JobOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("return-client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(returnClientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", SafeJsonConvert.SerializeObject(returnClientRequestId, Client.SerializationSettings).Trim('"')); } if (ocpDate != null) { @@ -169,7 +177,7 @@ internal JobOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("ocp-date"); } - _httpRequest.Headers.TryAddWithoutValidation("ocp-date", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ocpDate, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("ocp-date", SafeJsonConvert.SerializeObject(ocpDate, new DateTimeRfc1123JsonConverter()).Trim('"')); } @@ -188,23 +196,23 @@ internal JobOperations(BatchServiceClient 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) @@ -213,21 +221,21 @@ internal JobOperations(BatchServiceClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - BatchError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + BatchError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -237,7 +245,7 @@ internal JobOperations(BatchServiceClient 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("request-id")) @@ -250,34 +258,34 @@ internal JobOperations(BatchServiceClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = 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); } } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(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 headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -290,7 +298,10 @@ internal JobOperations(BatchServiceClient client) /// job statistics. This also overrides the retention period for task data; /// that is, if the job contains tasks which are still retained on compute /// nodes, the Batch services deletes those tasks' working directories and all - /// their contents. + /// their contents. When a Delete Job request is received, the Batch service + /// sets the job to the deleting state. All update operations on a job that is + /// in deleting state will fail with status code 409 (Conflict), with + /// additional information indicating that the job is being deleted. /// /// /// The ID of the job to delete. @@ -307,7 +318,7 @@ internal JobOperations(BatchServiceClient client) /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -316,15 +327,15 @@ internal JobOperations(BatchServiceClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> DeleteWithHttpMessagesAsync(string jobId, JobDeleteOptions jobDeleteOptions = default(JobDeleteOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> DeleteWithHttpMessagesAsync(string jobId, JobDeleteOptions jobDeleteOptions = default(JobDeleteOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (jobId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "jobId"); + throw new ValidationException(ValidationRules.CannotBeNull, "jobId"); } - 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"); } int? timeout = default(int?); if (jobDeleteOptions != null) @@ -367,12 +378,12 @@ internal JobOperations(BatchServiceClient client) ifUnmodifiedSince = jobDeleteOptions.IfUnmodifiedSince; } // 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("jobId", jobId); tracingParameters.Add("timeout", timeout); tracingParameters.Add("clientRequestId", clientRequestId); @@ -383,42 +394,42 @@ internal JobOperations(BatchServiceClient client) tracingParameters.Add("ifModifiedSince", ifModifiedSince); tracingParameters.Add("ifUnmodifiedSince", ifUnmodifiedSince); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Delete", 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("/") ? "" : "/")), "jobs/{jobId}").ToString(); _url = _url.Replace("{jobId}", System.Uri.EscapeDataString(jobId)); - 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 (timeout != null) { - _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(timeout, this.Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(timeout, Client.SerializationSettings).Trim('"')))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _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("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 (clientRequestId != null) { @@ -426,7 +437,7 @@ internal JobOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(clientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("client-request-id", SafeJsonConvert.SerializeObject(clientRequestId, Client.SerializationSettings).Trim('"')); } if (returnClientRequestId != null) { @@ -434,7 +445,7 @@ internal JobOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("return-client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(returnClientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", SafeJsonConvert.SerializeObject(returnClientRequestId, Client.SerializationSettings).Trim('"')); } if (ocpDate != null) { @@ -442,7 +453,7 @@ internal JobOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("ocp-date"); } - _httpRequest.Headers.TryAddWithoutValidation("ocp-date", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ocpDate, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("ocp-date", SafeJsonConvert.SerializeObject(ocpDate, new DateTimeRfc1123JsonConverter()).Trim('"')); } if (ifMatch != null) { @@ -466,7 +477,7 @@ internal JobOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("If-Modified-Since"); } - _httpRequest.Headers.TryAddWithoutValidation("If-Modified-Since", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ifModifiedSince, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("If-Modified-Since", SafeJsonConvert.SerializeObject(ifModifiedSince, new DateTimeRfc1123JsonConverter()).Trim('"')); } if (ifUnmodifiedSince != null) { @@ -474,7 +485,7 @@ internal JobOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("If-Unmodified-Since"); } - _httpRequest.Headers.TryAddWithoutValidation("If-Unmodified-Since", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ifUnmodifiedSince, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("If-Unmodified-Since", SafeJsonConvert.SerializeObject(ifUnmodifiedSince, new DateTimeRfc1123JsonConverter()).Trim('"')); } @@ -493,23 +504,23 @@ internal JobOperations(BatchServiceClient 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 != 202) @@ -518,21 +529,21 @@ internal JobOperations(BatchServiceClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - BatchError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + BatchError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -542,7 +553,7 @@ internal JobOperations(BatchServiceClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); + var _result = new AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("request-id")) @@ -551,20 +562,20 @@ internal JobOperations(BatchServiceClient client) } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(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 headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -587,10 +598,10 @@ internal JobOperations(BatchServiceClient client) /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -599,15 +610,15 @@ internal JobOperations(BatchServiceClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string jobId, JobGetOptions jobGetOptions = default(JobGetOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string jobId, JobGetOptions jobGetOptions = default(JobGetOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (jobId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "jobId"); + throw new ValidationException(ValidationRules.CannotBeNull, "jobId"); } - 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"); } string select = default(string); if (jobGetOptions != null) @@ -660,12 +671,12 @@ internal JobOperations(BatchServiceClient client) ifUnmodifiedSince = jobGetOptions.IfUnmodifiedSince; } // 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("jobId", jobId); tracingParameters.Add("select", select); tracingParameters.Add("expand", expand); @@ -678,16 +689,16 @@ internal JobOperations(BatchServiceClient client) tracingParameters.Add("ifModifiedSince", ifModifiedSince); tracingParameters.Add("ifUnmodifiedSince", ifUnmodifiedSince); 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("/") ? "" : "/")), "jobs/{jobId}").ToString(); _url = _url.Replace("{jobId}", System.Uri.EscapeDataString(jobId)); - 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 (select != null) { @@ -699,29 +710,29 @@ internal JobOperations(BatchServiceClient client) } if (timeout != null) { - _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(timeout, this.Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(timeout, Client.SerializationSettings).Trim('"')))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _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("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 (clientRequestId != null) { @@ -729,7 +740,7 @@ internal JobOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(clientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("client-request-id", SafeJsonConvert.SerializeObject(clientRequestId, Client.SerializationSettings).Trim('"')); } if (returnClientRequestId != null) { @@ -737,7 +748,7 @@ internal JobOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("return-client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(returnClientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", SafeJsonConvert.SerializeObject(returnClientRequestId, Client.SerializationSettings).Trim('"')); } if (ocpDate != null) { @@ -745,7 +756,7 @@ internal JobOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("ocp-date"); } - _httpRequest.Headers.TryAddWithoutValidation("ocp-date", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ocpDate, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("ocp-date", SafeJsonConvert.SerializeObject(ocpDate, new DateTimeRfc1123JsonConverter()).Trim('"')); } if (ifMatch != null) { @@ -769,7 +780,7 @@ internal JobOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("If-Modified-Since"); } - _httpRequest.Headers.TryAddWithoutValidation("If-Modified-Since", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ifModifiedSince, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("If-Modified-Since", SafeJsonConvert.SerializeObject(ifModifiedSince, new DateTimeRfc1123JsonConverter()).Trim('"')); } if (ifUnmodifiedSince != null) { @@ -777,7 +788,7 @@ internal JobOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("If-Unmodified-Since"); } - _httpRequest.Headers.TryAddWithoutValidation("If-Unmodified-Since", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ifUnmodifiedSince, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("If-Unmodified-Since", SafeJsonConvert.SerializeObject(ifUnmodifiedSince, new DateTimeRfc1123JsonConverter()).Trim('"')); } @@ -796,23 +807,23 @@ internal JobOperations(BatchServiceClient 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) @@ -821,21 +832,21 @@ internal JobOperations(BatchServiceClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - BatchError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + BatchError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -845,7 +856,7 @@ internal JobOperations(BatchServiceClient 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("request-id")) @@ -858,34 +869,34 @@ internal JobOperations(BatchServiceClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = 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); } } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(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 headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -916,7 +927,7 @@ internal JobOperations(BatchServiceClient client) /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -925,19 +936,19 @@ internal JobOperations(BatchServiceClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> PatchWithHttpMessagesAsync(string jobId, JobPatchParameter jobPatchParameter, JobPatchOptions jobPatchOptions = default(JobPatchOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> PatchWithHttpMessagesAsync(string jobId, JobPatchParameter jobPatchParameter, JobPatchOptions jobPatchOptions = default(JobPatchOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (jobId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "jobId"); + throw new ValidationException(ValidationRules.CannotBeNull, "jobId"); } if (jobPatchParameter == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "jobPatchParameter"); + throw new ValidationException(ValidationRules.CannotBeNull, "jobPatchParameter"); } - 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"); } int? timeout = default(int?); if (jobPatchOptions != null) @@ -980,12 +991,12 @@ internal JobOperations(BatchServiceClient client) ifUnmodifiedSince = jobPatchOptions.IfUnmodifiedSince; } // 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("jobId", jobId); tracingParameters.Add("jobPatchParameter", jobPatchParameter); tracingParameters.Add("timeout", timeout); @@ -997,42 +1008,42 @@ internal JobOperations(BatchServiceClient client) tracingParameters.Add("ifModifiedSince", ifModifiedSince); tracingParameters.Add("ifUnmodifiedSince", ifUnmodifiedSince); 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("/") ? "" : "/")), "jobs/{jobId}").ToString(); _url = _url.Replace("{jobId}", System.Uri.EscapeDataString(jobId)); - 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 (timeout != null) { - _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(timeout, this.Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(timeout, Client.SerializationSettings).Trim('"')))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _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("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 (clientRequestId != null) { @@ -1040,7 +1051,7 @@ internal JobOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(clientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("client-request-id", SafeJsonConvert.SerializeObject(clientRequestId, Client.SerializationSettings).Trim('"')); } if (returnClientRequestId != null) { @@ -1048,7 +1059,7 @@ internal JobOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("return-client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(returnClientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", SafeJsonConvert.SerializeObject(returnClientRequestId, Client.SerializationSettings).Trim('"')); } if (ocpDate != null) { @@ -1056,7 +1067,7 @@ internal JobOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("ocp-date"); } - _httpRequest.Headers.TryAddWithoutValidation("ocp-date", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ocpDate, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("ocp-date", SafeJsonConvert.SerializeObject(ocpDate, new DateTimeRfc1123JsonConverter()).Trim('"')); } if (ifMatch != null) { @@ -1080,7 +1091,7 @@ internal JobOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("If-Modified-Since"); } - _httpRequest.Headers.TryAddWithoutValidation("If-Modified-Since", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ifModifiedSince, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("If-Modified-Since", SafeJsonConvert.SerializeObject(ifModifiedSince, new DateTimeRfc1123JsonConverter()).Trim('"')); } if (ifUnmodifiedSince != null) { @@ -1088,7 +1099,7 @@ internal JobOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("If-Unmodified-Since"); } - _httpRequest.Headers.TryAddWithoutValidation("If-Unmodified-Since", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ifUnmodifiedSince, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("If-Unmodified-Since", SafeJsonConvert.SerializeObject(ifUnmodifiedSince, new DateTimeRfc1123JsonConverter()).Trim('"')); } @@ -1108,28 +1119,28 @@ internal JobOperations(BatchServiceClient client) string _requestContent = null; if(jobPatchParameter != null) { - _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(jobPatchParameter, this.Client.SerializationSettings); - _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = SafeJsonConvert.SerializeObject(jobPatchParameter, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; odata=minimalmetadata; 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) @@ -1138,21 +1149,21 @@ internal JobOperations(BatchServiceClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - BatchError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + BatchError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1162,7 +1173,7 @@ internal JobOperations(BatchServiceClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); + var _result = new AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("request-id")) @@ -1171,20 +1182,20 @@ internal JobOperations(BatchServiceClient client) } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(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 headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -1216,7 +1227,7 @@ internal JobOperations(BatchServiceClient client) /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1225,23 +1236,23 @@ internal JobOperations(BatchServiceClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string jobId, JobUpdateParameter jobUpdateParameter, JobUpdateOptions jobUpdateOptions = default(JobUpdateOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> UpdateWithHttpMessagesAsync(string jobId, JobUpdateParameter jobUpdateParameter, JobUpdateOptions jobUpdateOptions = default(JobUpdateOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (jobId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "jobId"); + throw new ValidationException(ValidationRules.CannotBeNull, "jobId"); } if (jobUpdateParameter == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "jobUpdateParameter"); + throw new ValidationException(ValidationRules.CannotBeNull, "jobUpdateParameter"); } if (jobUpdateParameter != null) { jobUpdateParameter.Validate(); } - 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"); } int? timeout = default(int?); if (jobUpdateOptions != null) @@ -1284,12 +1295,12 @@ internal JobOperations(BatchServiceClient client) ifUnmodifiedSince = jobUpdateOptions.IfUnmodifiedSince; } // 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("jobId", jobId); tracingParameters.Add("jobUpdateParameter", jobUpdateParameter); tracingParameters.Add("timeout", timeout); @@ -1301,42 +1312,42 @@ internal JobOperations(BatchServiceClient client) tracingParameters.Add("ifModifiedSince", ifModifiedSince); tracingParameters.Add("ifUnmodifiedSince", ifUnmodifiedSince); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Update", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Update", 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("/") ? "" : "/")), "jobs/{jobId}").ToString(); _url = _url.Replace("{jobId}", System.Uri.EscapeDataString(jobId)); - 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 (timeout != null) { - _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(timeout, this.Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(timeout, Client.SerializationSettings).Trim('"')))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _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("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 (clientRequestId != null) { @@ -1344,7 +1355,7 @@ internal JobOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(clientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("client-request-id", SafeJsonConvert.SerializeObject(clientRequestId, Client.SerializationSettings).Trim('"')); } if (returnClientRequestId != null) { @@ -1352,7 +1363,7 @@ internal JobOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("return-client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(returnClientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", SafeJsonConvert.SerializeObject(returnClientRequestId, Client.SerializationSettings).Trim('"')); } if (ocpDate != null) { @@ -1360,7 +1371,7 @@ internal JobOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("ocp-date"); } - _httpRequest.Headers.TryAddWithoutValidation("ocp-date", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ocpDate, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("ocp-date", SafeJsonConvert.SerializeObject(ocpDate, new DateTimeRfc1123JsonConverter()).Trim('"')); } if (ifMatch != null) { @@ -1384,7 +1395,7 @@ internal JobOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("If-Modified-Since"); } - _httpRequest.Headers.TryAddWithoutValidation("If-Modified-Since", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ifModifiedSince, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("If-Modified-Since", SafeJsonConvert.SerializeObject(ifModifiedSince, new DateTimeRfc1123JsonConverter()).Trim('"')); } if (ifUnmodifiedSince != null) { @@ -1392,7 +1403,7 @@ internal JobOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("If-Unmodified-Since"); } - _httpRequest.Headers.TryAddWithoutValidation("If-Unmodified-Since", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ifUnmodifiedSince, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("If-Unmodified-Since", SafeJsonConvert.SerializeObject(ifUnmodifiedSince, new DateTimeRfc1123JsonConverter()).Trim('"')); } @@ -1412,28 +1423,28 @@ internal JobOperations(BatchServiceClient client) string _requestContent = null; if(jobUpdateParameter != null) { - _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(jobUpdateParameter, this.Client.SerializationSettings); - _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = SafeJsonConvert.SerializeObject(jobUpdateParameter, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; odata=minimalmetadata; 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) @@ -1442,21 +1453,21 @@ internal JobOperations(BatchServiceClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - BatchError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + BatchError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1466,7 +1477,7 @@ internal JobOperations(BatchServiceClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); + var _result = new AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("request-id")) @@ -1475,20 +1486,20 @@ internal JobOperations(BatchServiceClient client) } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(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 headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -1510,9 +1521,11 @@ internal JobOperations(BatchServiceClient client) /// The ID of the job to disable. /// /// - /// What to do with active tasks associated with the job. requeue - Terminate - /// running tasks and requeue them. The tasks will run again when the job is - /// enabled. terminate - Terminate running tasks. The tasks will not run again. + /// What to do with active tasks associated with the job. Values are: + /// + /// requeue - Terminate running tasks and requeue them. The tasks will run + /// again when the job is enabled. + /// terminate - Terminate running tasks. The tasks will not run again. /// wait - Allow currently running tasks to complete. Possible values include: /// 'requeue', 'terminate', 'wait' /// @@ -1528,7 +1541,7 @@ internal JobOperations(BatchServiceClient client) /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1537,15 +1550,15 @@ internal JobOperations(BatchServiceClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> DisableWithHttpMessagesAsync(string jobId, DisableJobOption disableTasks, JobDisableOptions jobDisableOptions = default(JobDisableOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> DisableWithHttpMessagesAsync(string jobId, DisableJobOption disableTasks, JobDisableOptions jobDisableOptions = default(JobDisableOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (jobId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "jobId"); + throw new ValidationException(ValidationRules.CannotBeNull, "jobId"); } - 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"); } int? timeout = default(int?); if (jobDisableOptions != null) @@ -1590,12 +1603,12 @@ internal JobOperations(BatchServiceClient client) JobDisableParameter jobDisableParameter = new JobDisableParameter(); jobDisableParameter.DisableTasks = disableTasks; // 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("jobId", jobId); tracingParameters.Add("timeout", timeout); tracingParameters.Add("clientRequestId", clientRequestId); @@ -1607,42 +1620,42 @@ internal JobOperations(BatchServiceClient client) tracingParameters.Add("ifUnmodifiedSince", ifUnmodifiedSince); tracingParameters.Add("jobDisableParameter", jobDisableParameter); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Disable", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Disable", 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("/") ? "" : "/")), "jobs/{jobId}/disable").ToString(); _url = _url.Replace("{jobId}", System.Uri.EscapeDataString(jobId)); - 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 (timeout != null) { - _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(timeout, this.Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(timeout, Client.SerializationSettings).Trim('"')))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _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("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 (clientRequestId != null) { @@ -1650,7 +1663,7 @@ internal JobOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(clientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("client-request-id", SafeJsonConvert.SerializeObject(clientRequestId, Client.SerializationSettings).Trim('"')); } if (returnClientRequestId != null) { @@ -1658,7 +1671,7 @@ internal JobOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("return-client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(returnClientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", SafeJsonConvert.SerializeObject(returnClientRequestId, Client.SerializationSettings).Trim('"')); } if (ocpDate != null) { @@ -1666,7 +1679,7 @@ internal JobOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("ocp-date"); } - _httpRequest.Headers.TryAddWithoutValidation("ocp-date", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ocpDate, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("ocp-date", SafeJsonConvert.SerializeObject(ocpDate, new DateTimeRfc1123JsonConverter()).Trim('"')); } if (ifMatch != null) { @@ -1690,7 +1703,7 @@ internal JobOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("If-Modified-Since"); } - _httpRequest.Headers.TryAddWithoutValidation("If-Modified-Since", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ifModifiedSince, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("If-Modified-Since", SafeJsonConvert.SerializeObject(ifModifiedSince, new DateTimeRfc1123JsonConverter()).Trim('"')); } if (ifUnmodifiedSince != null) { @@ -1698,7 +1711,7 @@ internal JobOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("If-Unmodified-Since"); } - _httpRequest.Headers.TryAddWithoutValidation("If-Unmodified-Since", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ifUnmodifiedSince, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("If-Unmodified-Since", SafeJsonConvert.SerializeObject(ifUnmodifiedSince, new DateTimeRfc1123JsonConverter()).Trim('"')); } @@ -1718,28 +1731,28 @@ internal JobOperations(BatchServiceClient client) string _requestContent = null; if(jobDisableParameter != null) { - _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(jobDisableParameter, this.Client.SerializationSettings); - _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = SafeJsonConvert.SerializeObject(jobDisableParameter, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; odata=minimalmetadata; 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 != 202) @@ -1748,21 +1761,21 @@ internal JobOperations(BatchServiceClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - BatchError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + BatchError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1772,7 +1785,7 @@ internal JobOperations(BatchServiceClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); + var _result = new AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("request-id")) @@ -1781,20 +1794,20 @@ internal JobOperations(BatchServiceClient client) } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(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 headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -1825,7 +1838,7 @@ internal JobOperations(BatchServiceClient client) /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1834,15 +1847,15 @@ internal JobOperations(BatchServiceClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> EnableWithHttpMessagesAsync(string jobId, JobEnableOptions jobEnableOptions = default(JobEnableOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> EnableWithHttpMessagesAsync(string jobId, JobEnableOptions jobEnableOptions = default(JobEnableOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (jobId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "jobId"); + throw new ValidationException(ValidationRules.CannotBeNull, "jobId"); } - 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"); } int? timeout = default(int?); if (jobEnableOptions != null) @@ -1885,12 +1898,12 @@ internal JobOperations(BatchServiceClient client) ifUnmodifiedSince = jobEnableOptions.IfUnmodifiedSince; } // 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("jobId", jobId); tracingParameters.Add("timeout", timeout); tracingParameters.Add("clientRequestId", clientRequestId); @@ -1901,42 +1914,42 @@ internal JobOperations(BatchServiceClient client) tracingParameters.Add("ifModifiedSince", ifModifiedSince); tracingParameters.Add("ifUnmodifiedSince", ifUnmodifiedSince); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Enable", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Enable", 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("/") ? "" : "/")), "jobs/{jobId}/enable").ToString(); _url = _url.Replace("{jobId}", System.Uri.EscapeDataString(jobId)); - 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 (timeout != null) { - _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(timeout, this.Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(timeout, Client.SerializationSettings).Trim('"')))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _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("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 (clientRequestId != null) { @@ -1944,7 +1957,7 @@ internal JobOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(clientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("client-request-id", SafeJsonConvert.SerializeObject(clientRequestId, Client.SerializationSettings).Trim('"')); } if (returnClientRequestId != null) { @@ -1952,7 +1965,7 @@ internal JobOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("return-client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(returnClientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", SafeJsonConvert.SerializeObject(returnClientRequestId, Client.SerializationSettings).Trim('"')); } if (ocpDate != null) { @@ -1960,7 +1973,7 @@ internal JobOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("ocp-date"); } - _httpRequest.Headers.TryAddWithoutValidation("ocp-date", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ocpDate, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("ocp-date", SafeJsonConvert.SerializeObject(ocpDate, new DateTimeRfc1123JsonConverter()).Trim('"')); } if (ifMatch != null) { @@ -1984,7 +1997,7 @@ internal JobOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("If-Modified-Since"); } - _httpRequest.Headers.TryAddWithoutValidation("If-Modified-Since", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ifModifiedSince, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("If-Modified-Since", SafeJsonConvert.SerializeObject(ifModifiedSince, new DateTimeRfc1123JsonConverter()).Trim('"')); } if (ifUnmodifiedSince != null) { @@ -1992,7 +2005,7 @@ internal JobOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("If-Unmodified-Since"); } - _httpRequest.Headers.TryAddWithoutValidation("If-Unmodified-Since", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ifUnmodifiedSince, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("If-Unmodified-Since", SafeJsonConvert.SerializeObject(ifUnmodifiedSince, new DateTimeRfc1123JsonConverter()).Trim('"')); } @@ -2011,23 +2024,23 @@ internal JobOperations(BatchServiceClient 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 != 202) @@ -2036,21 +2049,21 @@ internal JobOperations(BatchServiceClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - BatchError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + BatchError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2060,7 +2073,7 @@ internal JobOperations(BatchServiceClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); + var _result = new AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("request-id")) @@ -2069,20 +2082,20 @@ internal JobOperations(BatchServiceClient client) } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(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 headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -2115,7 +2128,7 @@ internal JobOperations(BatchServiceClient client) /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -2124,15 +2137,15 @@ internal JobOperations(BatchServiceClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> TerminateWithHttpMessagesAsync(string jobId, string terminateReason = default(string), JobTerminateOptions jobTerminateOptions = default(JobTerminateOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> TerminateWithHttpMessagesAsync(string jobId, string terminateReason = default(string), JobTerminateOptions jobTerminateOptions = default(JobTerminateOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (jobId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "jobId"); + throw new ValidationException(ValidationRules.CannotBeNull, "jobId"); } - 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"); } int? timeout = default(int?); if (jobTerminateOptions != null) @@ -2181,12 +2194,12 @@ internal JobOperations(BatchServiceClient client) jobTerminateParameter.TerminateReason = terminateReason; } // 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("jobId", jobId); tracingParameters.Add("timeout", timeout); tracingParameters.Add("clientRequestId", clientRequestId); @@ -2198,42 +2211,42 @@ internal JobOperations(BatchServiceClient client) tracingParameters.Add("ifUnmodifiedSince", ifUnmodifiedSince); tracingParameters.Add("jobTerminateParameter", jobTerminateParameter); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Terminate", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Terminate", 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("/") ? "" : "/")), "jobs/{jobId}/terminate").ToString(); _url = _url.Replace("{jobId}", System.Uri.EscapeDataString(jobId)); - 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 (timeout != null) { - _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(timeout, this.Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(timeout, Client.SerializationSettings).Trim('"')))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _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("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 (clientRequestId != null) { @@ -2241,7 +2254,7 @@ internal JobOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(clientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("client-request-id", SafeJsonConvert.SerializeObject(clientRequestId, Client.SerializationSettings).Trim('"')); } if (returnClientRequestId != null) { @@ -2249,7 +2262,7 @@ internal JobOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("return-client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(returnClientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", SafeJsonConvert.SerializeObject(returnClientRequestId, Client.SerializationSettings).Trim('"')); } if (ocpDate != null) { @@ -2257,7 +2270,7 @@ internal JobOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("ocp-date"); } - _httpRequest.Headers.TryAddWithoutValidation("ocp-date", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ocpDate, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("ocp-date", SafeJsonConvert.SerializeObject(ocpDate, new DateTimeRfc1123JsonConverter()).Trim('"')); } if (ifMatch != null) { @@ -2281,7 +2294,7 @@ internal JobOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("If-Modified-Since"); } - _httpRequest.Headers.TryAddWithoutValidation("If-Modified-Since", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ifModifiedSince, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("If-Modified-Since", SafeJsonConvert.SerializeObject(ifModifiedSince, new DateTimeRfc1123JsonConverter()).Trim('"')); } if (ifUnmodifiedSince != null) { @@ -2289,7 +2302,7 @@ internal JobOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("If-Unmodified-Since"); } - _httpRequest.Headers.TryAddWithoutValidation("If-Unmodified-Since", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ifUnmodifiedSince, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("If-Unmodified-Since", SafeJsonConvert.SerializeObject(ifUnmodifiedSince, new DateTimeRfc1123JsonConverter()).Trim('"')); } @@ -2309,28 +2322,28 @@ internal JobOperations(BatchServiceClient client) string _requestContent = null; if(jobTerminateParameter != null) { - _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(jobTerminateParameter, this.Client.SerializationSettings); - _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = SafeJsonConvert.SerializeObject(jobTerminateParameter, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; odata=minimalmetadata; 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 != 202) @@ -2339,21 +2352,21 @@ internal JobOperations(BatchServiceClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - BatchError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + BatchError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2363,7 +2376,7 @@ internal JobOperations(BatchServiceClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); + var _result = new AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("request-id")) @@ -2372,20 +2385,20 @@ internal JobOperations(BatchServiceClient client) } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(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 headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -2419,7 +2432,7 @@ internal JobOperations(BatchServiceClient client) /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -2428,19 +2441,19 @@ internal JobOperations(BatchServiceClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> AddWithHttpMessagesAsync(JobAddParameter job, JobAddOptions jobAddOptions = default(JobAddOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> AddWithHttpMessagesAsync(JobAddParameter job, JobAddOptions jobAddOptions = default(JobAddOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (job == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "job"); + throw new ValidationException(ValidationRules.CannotBeNull, "job"); } if (job != null) { job.Validate(); } - 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"); } int? timeout = default(int?); if (jobAddOptions != null) @@ -2463,53 +2476,53 @@ internal JobOperations(BatchServiceClient client) ocpDate = jobAddOptions.OcpDate; } // 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("job", job); tracingParameters.Add("timeout", timeout); tracingParameters.Add("clientRequestId", clientRequestId); tracingParameters.Add("returnClientRequestId", returnClientRequestId); tracingParameters.Add("ocpDate", ocpDate); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Add", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Add", 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("/") ? "" : "/")), "jobs").ToString(); - 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 (timeout != null) { - _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(timeout, this.Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(timeout, Client.SerializationSettings).Trim('"')))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _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("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 (clientRequestId != null) { @@ -2517,7 +2530,7 @@ internal JobOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(clientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("client-request-id", SafeJsonConvert.SerializeObject(clientRequestId, Client.SerializationSettings).Trim('"')); } if (returnClientRequestId != null) { @@ -2525,7 +2538,7 @@ internal JobOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("return-client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(returnClientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", SafeJsonConvert.SerializeObject(returnClientRequestId, Client.SerializationSettings).Trim('"')); } if (ocpDate != null) { @@ -2533,7 +2546,7 @@ internal JobOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("ocp-date"); } - _httpRequest.Headers.TryAddWithoutValidation("ocp-date", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ocpDate, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("ocp-date", SafeJsonConvert.SerializeObject(ocpDate, new DateTimeRfc1123JsonConverter()).Trim('"')); } @@ -2553,28 +2566,28 @@ internal JobOperations(BatchServiceClient client) string _requestContent = null; if(job != null) { - _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(job, this.Client.SerializationSettings); - _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = SafeJsonConvert.SerializeObject(job, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; odata=minimalmetadata; 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 != 201) @@ -2583,21 +2596,21 @@ internal JobOperations(BatchServiceClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - BatchError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + BatchError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2607,7 +2620,7 @@ internal JobOperations(BatchServiceClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); + var _result = new AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("request-id")) @@ -2616,20 +2629,20 @@ internal JobOperations(BatchServiceClient client) } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(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 headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -2649,10 +2662,10 @@ internal JobOperations(BatchServiceClient client) /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -2661,11 +2674,11 @@ internal JobOperations(BatchServiceClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task,JobListHeaders>> ListWithHttpMessagesAsync(JobListOptions jobListOptions = default(JobListOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task,JobListHeaders>> ListWithHttpMessagesAsync(JobListOptions jobListOptions = default(JobListOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - 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"); } string filter = default(string); if (jobListOptions != null) @@ -2708,12 +2721,12 @@ internal JobOperations(BatchServiceClient client) ocpDate = jobListOptions.OcpDate; } // 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("filter", filter); tracingParameters.Add("select", select); tracingParameters.Add("expand", expand); @@ -2723,15 +2736,15 @@ internal JobOperations(BatchServiceClient client) tracingParameters.Add("returnClientRequestId", returnClientRequestId); tracingParameters.Add("ocpDate", ocpDate); 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("/") ? "" : "/")), "jobs").ToString(); - 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 (filter != null) { @@ -2747,33 +2760,33 @@ internal JobOperations(BatchServiceClient client) } if (maxResults != null) { - _queryParameters.Add(string.Format("maxresults={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(maxResults, this.Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("maxresults={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(maxResults, Client.SerializationSettings).Trim('"')))); } if (timeout != null) { - _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(timeout, this.Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(timeout, Client.SerializationSettings).Trim('"')))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _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("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 (clientRequestId != null) { @@ -2781,7 +2794,7 @@ internal JobOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(clientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("client-request-id", SafeJsonConvert.SerializeObject(clientRequestId, Client.SerializationSettings).Trim('"')); } if (returnClientRequestId != null) { @@ -2789,7 +2802,7 @@ internal JobOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("return-client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(returnClientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", SafeJsonConvert.SerializeObject(returnClientRequestId, Client.SerializationSettings).Trim('"')); } if (ocpDate != null) { @@ -2797,7 +2810,7 @@ internal JobOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("ocp-date"); } - _httpRequest.Headers.TryAddWithoutValidation("ocp-date", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ocpDate, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("ocp-date", SafeJsonConvert.SerializeObject(ocpDate, new DateTimeRfc1123JsonConverter()).Trim('"')); } @@ -2816,23 +2829,23 @@ internal JobOperations(BatchServiceClient 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) @@ -2841,21 +2854,21 @@ internal JobOperations(BatchServiceClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - BatchError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + BatchError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2865,7 +2878,7 @@ internal JobOperations(BatchServiceClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse,JobListHeaders>(); + var _result = new AzureOperationResponse,JobListHeaders>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("request-id")) @@ -2878,34 +2891,34 @@ internal JobOperations(BatchServiceClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = 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); } } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(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 headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -2928,10 +2941,10 @@ internal JobOperations(BatchServiceClient client) /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -2940,15 +2953,15 @@ internal JobOperations(BatchServiceClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task,JobListFromJobScheduleHeaders>> ListFromJobScheduleWithHttpMessagesAsync(string jobScheduleId, JobListFromJobScheduleOptions jobListFromJobScheduleOptions = default(JobListFromJobScheduleOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task,JobListFromJobScheduleHeaders>> ListFromJobScheduleWithHttpMessagesAsync(string jobScheduleId, JobListFromJobScheduleOptions jobListFromJobScheduleOptions = default(JobListFromJobScheduleOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (jobScheduleId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "jobScheduleId"); + throw new ValidationException(ValidationRules.CannotBeNull, "jobScheduleId"); } - 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"); } string filter = default(string); if (jobListFromJobScheduleOptions != null) @@ -2991,12 +3004,12 @@ internal JobOperations(BatchServiceClient client) ocpDate = jobListFromJobScheduleOptions.OcpDate; } // 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("jobScheduleId", jobScheduleId); tracingParameters.Add("filter", filter); tracingParameters.Add("select", select); @@ -3007,16 +3020,16 @@ internal JobOperations(BatchServiceClient client) tracingParameters.Add("returnClientRequestId", returnClientRequestId); tracingParameters.Add("ocpDate", ocpDate); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListFromJobSchedule", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListFromJobSchedule", 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("/") ? "" : "/")), "jobschedules/{jobScheduleId}/jobs").ToString(); _url = _url.Replace("{jobScheduleId}", System.Uri.EscapeDataString(jobScheduleId)); - 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 (filter != null) { @@ -3032,33 +3045,33 @@ internal JobOperations(BatchServiceClient client) } if (maxResults != null) { - _queryParameters.Add(string.Format("maxresults={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(maxResults, this.Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("maxresults={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(maxResults, Client.SerializationSettings).Trim('"')))); } if (timeout != null) { - _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(timeout, this.Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(timeout, Client.SerializationSettings).Trim('"')))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _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("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 (clientRequestId != null) { @@ -3066,7 +3079,7 @@ internal JobOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(clientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("client-request-id", SafeJsonConvert.SerializeObject(clientRequestId, Client.SerializationSettings).Trim('"')); } if (returnClientRequestId != null) { @@ -3074,7 +3087,7 @@ internal JobOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("return-client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(returnClientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", SafeJsonConvert.SerializeObject(returnClientRequestId, Client.SerializationSettings).Trim('"')); } if (ocpDate != null) { @@ -3082,7 +3095,7 @@ internal JobOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("ocp-date"); } - _httpRequest.Headers.TryAddWithoutValidation("ocp-date", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ocpDate, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("ocp-date", SafeJsonConvert.SerializeObject(ocpDate, new DateTimeRfc1123JsonConverter()).Trim('"')); } @@ -3101,23 +3114,23 @@ internal JobOperations(BatchServiceClient 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) @@ -3126,21 +3139,21 @@ internal JobOperations(BatchServiceClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - BatchError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + BatchError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -3150,7 +3163,7 @@ internal JobOperations(BatchServiceClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse,JobListFromJobScheduleHeaders>(); + var _result = new AzureOperationResponse,JobListFromJobScheduleHeaders>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("request-id")) @@ -3163,34 +3176,34 @@ internal JobOperations(BatchServiceClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = 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); } } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(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 headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -3202,7 +3215,10 @@ internal JobOperations(BatchServiceClient client) /// /// This API returns the Job Preparation and Job Release task status on all /// compute nodes that have run the Job Preparation or Job Release task. This - /// includes nodes which have since been removed from the pool. + /// includes nodes which have since been removed from the pool. If this API is + /// invoked on a job which has no Job Preparation or Job Release task, the + /// Batch service returns HTTP status code 409 (Conflict) with an error code of + /// JobPreparationTaskNotSpecified. /// /// /// The ID of the job. @@ -3219,10 +3235,10 @@ internal JobOperations(BatchServiceClient client) /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -3231,15 +3247,15 @@ internal JobOperations(BatchServiceClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task,JobListPreparationAndReleaseTaskStatusHeaders>> ListPreparationAndReleaseTaskStatusWithHttpMessagesAsync(string jobId, JobListPreparationAndReleaseTaskStatusOptions jobListPreparationAndReleaseTaskStatusOptions = default(JobListPreparationAndReleaseTaskStatusOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task,JobListPreparationAndReleaseTaskStatusHeaders>> ListPreparationAndReleaseTaskStatusWithHttpMessagesAsync(string jobId, JobListPreparationAndReleaseTaskStatusOptions jobListPreparationAndReleaseTaskStatusOptions = default(JobListPreparationAndReleaseTaskStatusOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (jobId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "jobId"); + throw new ValidationException(ValidationRules.CannotBeNull, "jobId"); } - 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"); } string filter = default(string); if (jobListPreparationAndReleaseTaskStatusOptions != null) @@ -3277,12 +3293,12 @@ internal JobOperations(BatchServiceClient client) ocpDate = jobListPreparationAndReleaseTaskStatusOptions.OcpDate; } // 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("jobId", jobId); tracingParameters.Add("filter", filter); tracingParameters.Add("select", select); @@ -3292,16 +3308,16 @@ internal JobOperations(BatchServiceClient client) tracingParameters.Add("returnClientRequestId", returnClientRequestId); tracingParameters.Add("ocpDate", ocpDate); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListPreparationAndReleaseTaskStatus", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListPreparationAndReleaseTaskStatus", 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("/") ? "" : "/")), "jobs/{jobId}/jobpreparationandreleasetaskstatus").ToString(); _url = _url.Replace("{jobId}", System.Uri.EscapeDataString(jobId)); - 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 (filter != null) { @@ -3313,33 +3329,33 @@ internal JobOperations(BatchServiceClient client) } if (maxResults != null) { - _queryParameters.Add(string.Format("maxresults={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(maxResults, this.Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("maxresults={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(maxResults, Client.SerializationSettings).Trim('"')))); } if (timeout != null) { - _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(timeout, this.Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(timeout, Client.SerializationSettings).Trim('"')))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _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("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 (clientRequestId != null) { @@ -3347,7 +3363,7 @@ internal JobOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(clientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("client-request-id", SafeJsonConvert.SerializeObject(clientRequestId, Client.SerializationSettings).Trim('"')); } if (returnClientRequestId != null) { @@ -3355,7 +3371,7 @@ internal JobOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("return-client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(returnClientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", SafeJsonConvert.SerializeObject(returnClientRequestId, Client.SerializationSettings).Trim('"')); } if (ocpDate != null) { @@ -3363,7 +3379,7 @@ internal JobOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("ocp-date"); } - _httpRequest.Headers.TryAddWithoutValidation("ocp-date", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ocpDate, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("ocp-date", SafeJsonConvert.SerializeObject(ocpDate, new DateTimeRfc1123JsonConverter()).Trim('"')); } @@ -3382,23 +3398,23 @@ internal JobOperations(BatchServiceClient 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) @@ -3407,21 +3423,21 @@ internal JobOperations(BatchServiceClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - BatchError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + BatchError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -3431,7 +3447,7 @@ internal JobOperations(BatchServiceClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse,JobListPreparationAndReleaseTaskStatusHeaders>(); + var _result = new AzureOperationResponse,JobListPreparationAndReleaseTaskStatusHeaders>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("request-id")) @@ -3444,34 +3460,34 @@ internal JobOperations(BatchServiceClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = 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); } } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(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 headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -3503,10 +3519,10 @@ internal JobOperations(BatchServiceClient client) /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -3515,15 +3531,15 @@ internal JobOperations(BatchServiceClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> GetTaskCountsWithHttpMessagesAsync(string jobId, JobGetTaskCountsOptions jobGetTaskCountsOptions = default(JobGetTaskCountsOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> GetTaskCountsWithHttpMessagesAsync(string jobId, JobGetTaskCountsOptions jobGetTaskCountsOptions = default(JobGetTaskCountsOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (jobId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "jobId"); + throw new ValidationException(ValidationRules.CannotBeNull, "jobId"); } - 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"); } int? timeout = default(int?); if (jobGetTaskCountsOptions != null) @@ -3546,54 +3562,54 @@ internal JobOperations(BatchServiceClient client) ocpDate = jobGetTaskCountsOptions.OcpDate; } // 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("jobId", jobId); tracingParameters.Add("timeout", timeout); tracingParameters.Add("clientRequestId", clientRequestId); tracingParameters.Add("returnClientRequestId", returnClientRequestId); tracingParameters.Add("ocpDate", ocpDate); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetTaskCounts", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetTaskCounts", 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("/") ? "" : "/")), "jobs/{jobId}/taskcounts").ToString(); _url = _url.Replace("{jobId}", System.Uri.EscapeDataString(jobId)); - 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 (timeout != null) { - _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(timeout, this.Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(timeout, Client.SerializationSettings).Trim('"')))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _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("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 (clientRequestId != null) { @@ -3601,7 +3617,7 @@ internal JobOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(clientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("client-request-id", SafeJsonConvert.SerializeObject(clientRequestId, Client.SerializationSettings).Trim('"')); } if (returnClientRequestId != null) { @@ -3609,7 +3625,7 @@ internal JobOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("return-client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(returnClientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", SafeJsonConvert.SerializeObject(returnClientRequestId, Client.SerializationSettings).Trim('"')); } if (ocpDate != null) { @@ -3617,7 +3633,7 @@ internal JobOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("ocp-date"); } - _httpRequest.Headers.TryAddWithoutValidation("ocp-date", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ocpDate, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("ocp-date", SafeJsonConvert.SerializeObject(ocpDate, new DateTimeRfc1123JsonConverter()).Trim('"')); } @@ -3636,23 +3652,23 @@ internal JobOperations(BatchServiceClient 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) @@ -3661,21 +3677,21 @@ internal JobOperations(BatchServiceClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - BatchError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + BatchError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -3685,7 +3701,7 @@ internal JobOperations(BatchServiceClient 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("request-id")) @@ -3698,34 +3714,34 @@ internal JobOperations(BatchServiceClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = 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); } } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(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 headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -3748,10 +3764,10 @@ internal JobOperations(BatchServiceClient client) /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -3760,11 +3776,11 @@ internal JobOperations(BatchServiceClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task,JobListHeaders>> ListNextWithHttpMessagesAsync(string nextPageLink, JobListNextOptions jobListNextOptions = default(JobListNextOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task,JobListHeaders>> ListNextWithHttpMessagesAsync(string nextPageLink, JobListNextOptions jobListNextOptions = default(JobListNextOptions), 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"); } System.Guid? clientRequestId = default(System.Guid?); if (jobListNextOptions != null) @@ -3782,44 +3798,44 @@ internal JobOperations(BatchServiceClient client) ocpDate = jobListNextOptions.OcpDate; } // 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("clientRequestId", clientRequestId); tracingParameters.Add("returnClientRequestId", returnClientRequestId); tracingParameters.Add("ocpDate", ocpDate); 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 += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _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("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 (clientRequestId != null) { @@ -3827,7 +3843,7 @@ internal JobOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(clientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("client-request-id", SafeJsonConvert.SerializeObject(clientRequestId, Client.SerializationSettings).Trim('"')); } if (returnClientRequestId != null) { @@ -3835,7 +3851,7 @@ internal JobOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("return-client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(returnClientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", SafeJsonConvert.SerializeObject(returnClientRequestId, Client.SerializationSettings).Trim('"')); } if (ocpDate != null) { @@ -3843,7 +3859,7 @@ internal JobOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("ocp-date"); } - _httpRequest.Headers.TryAddWithoutValidation("ocp-date", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ocpDate, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("ocp-date", SafeJsonConvert.SerializeObject(ocpDate, new DateTimeRfc1123JsonConverter()).Trim('"')); } @@ -3862,23 +3878,23 @@ internal JobOperations(BatchServiceClient 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) @@ -3887,21 +3903,21 @@ internal JobOperations(BatchServiceClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - BatchError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + BatchError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -3911,7 +3927,7 @@ internal JobOperations(BatchServiceClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse,JobListHeaders>(); + var _result = new AzureOperationResponse,JobListHeaders>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("request-id")) @@ -3924,34 +3940,34 @@ internal JobOperations(BatchServiceClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = 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); } } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(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 headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -3974,10 +3990,10 @@ internal JobOperations(BatchServiceClient client) /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -3986,11 +4002,11 @@ internal JobOperations(BatchServiceClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task,JobListFromJobScheduleHeaders>> ListFromJobScheduleNextWithHttpMessagesAsync(string nextPageLink, JobListFromJobScheduleNextOptions jobListFromJobScheduleNextOptions = default(JobListFromJobScheduleNextOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task,JobListFromJobScheduleHeaders>> ListFromJobScheduleNextWithHttpMessagesAsync(string nextPageLink, JobListFromJobScheduleNextOptions jobListFromJobScheduleNextOptions = default(JobListFromJobScheduleNextOptions), 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"); } System.Guid? clientRequestId = default(System.Guid?); if (jobListFromJobScheduleNextOptions != null) @@ -4008,44 +4024,44 @@ internal JobOperations(BatchServiceClient client) ocpDate = jobListFromJobScheduleNextOptions.OcpDate; } // 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("clientRequestId", clientRequestId); tracingParameters.Add("returnClientRequestId", returnClientRequestId); tracingParameters.Add("ocpDate", ocpDate); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListFromJobScheduleNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListFromJobScheduleNext", 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 += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _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("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 (clientRequestId != null) { @@ -4053,7 +4069,7 @@ internal JobOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(clientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("client-request-id", SafeJsonConvert.SerializeObject(clientRequestId, Client.SerializationSettings).Trim('"')); } if (returnClientRequestId != null) { @@ -4061,7 +4077,7 @@ internal JobOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("return-client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(returnClientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", SafeJsonConvert.SerializeObject(returnClientRequestId, Client.SerializationSettings).Trim('"')); } if (ocpDate != null) { @@ -4069,7 +4085,7 @@ internal JobOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("ocp-date"); } - _httpRequest.Headers.TryAddWithoutValidation("ocp-date", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ocpDate, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("ocp-date", SafeJsonConvert.SerializeObject(ocpDate, new DateTimeRfc1123JsonConverter()).Trim('"')); } @@ -4088,23 +4104,23 @@ internal JobOperations(BatchServiceClient 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) @@ -4113,21 +4129,21 @@ internal JobOperations(BatchServiceClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - BatchError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + BatchError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -4137,7 +4153,7 @@ internal JobOperations(BatchServiceClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse,JobListFromJobScheduleHeaders>(); + var _result = new AzureOperationResponse,JobListFromJobScheduleHeaders>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("request-id")) @@ -4150,34 +4166,34 @@ internal JobOperations(BatchServiceClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = 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); } } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(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 headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -4189,7 +4205,10 @@ internal JobOperations(BatchServiceClient client) /// /// This API returns the Job Preparation and Job Release task status on all /// compute nodes that have run the Job Preparation or Job Release task. This - /// includes nodes which have since been removed from the pool. + /// includes nodes which have since been removed from the pool. If this API is + /// invoked on a job which has no Job Preparation or Job Release task, the + /// Batch service returns HTTP status code 409 (Conflict) with an error code of + /// JobPreparationTaskNotSpecified. /// /// /// The NextLink from the previous successful call to List operation. @@ -4206,10 +4225,10 @@ internal JobOperations(BatchServiceClient client) /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -4218,11 +4237,11 @@ internal JobOperations(BatchServiceClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task,JobListPreparationAndReleaseTaskStatusHeaders>> ListPreparationAndReleaseTaskStatusNextWithHttpMessagesAsync(string nextPageLink, JobListPreparationAndReleaseTaskStatusNextOptions jobListPreparationAndReleaseTaskStatusNextOptions = default(JobListPreparationAndReleaseTaskStatusNextOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task,JobListPreparationAndReleaseTaskStatusHeaders>> ListPreparationAndReleaseTaskStatusNextWithHttpMessagesAsync(string nextPageLink, JobListPreparationAndReleaseTaskStatusNextOptions jobListPreparationAndReleaseTaskStatusNextOptions = default(JobListPreparationAndReleaseTaskStatusNextOptions), 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"); } System.Guid? clientRequestId = default(System.Guid?); if (jobListPreparationAndReleaseTaskStatusNextOptions != null) @@ -4240,44 +4259,44 @@ internal JobOperations(BatchServiceClient client) ocpDate = jobListPreparationAndReleaseTaskStatusNextOptions.OcpDate; } // 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("clientRequestId", clientRequestId); tracingParameters.Add("returnClientRequestId", returnClientRequestId); tracingParameters.Add("ocpDate", ocpDate); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListPreparationAndReleaseTaskStatusNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListPreparationAndReleaseTaskStatusNext", 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 += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _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("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 (clientRequestId != null) { @@ -4285,7 +4304,7 @@ internal JobOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(clientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("client-request-id", SafeJsonConvert.SerializeObject(clientRequestId, Client.SerializationSettings).Trim('"')); } if (returnClientRequestId != null) { @@ -4293,7 +4312,7 @@ internal JobOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("return-client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(returnClientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", SafeJsonConvert.SerializeObject(returnClientRequestId, Client.SerializationSettings).Trim('"')); } if (ocpDate != null) { @@ -4301,7 +4320,7 @@ internal JobOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("ocp-date"); } - _httpRequest.Headers.TryAddWithoutValidation("ocp-date", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ocpDate, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("ocp-date", SafeJsonConvert.SerializeObject(ocpDate, new DateTimeRfc1123JsonConverter()).Trim('"')); } @@ -4320,23 +4339,23 @@ internal JobOperations(BatchServiceClient 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) @@ -4345,21 +4364,21 @@ internal JobOperations(BatchServiceClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - BatchError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + BatchError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -4369,7 +4388,7 @@ internal JobOperations(BatchServiceClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse,JobListPreparationAndReleaseTaskStatusHeaders>(); + var _result = new AzureOperationResponse,JobListPreparationAndReleaseTaskStatusHeaders>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("request-id")) @@ -4382,37 +4401,37 @@ internal JobOperations(BatchServiceClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = 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); } } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(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 headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } } -} +} \ No newline at end of file diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/JobOperationsExtensions.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/JobOperationsExtensions.cs index 18ca51e1ec7d..c8f29fee1e86 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/JobOperationsExtensions.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/JobOperationsExtensions.cs @@ -8,8 +8,11 @@ namespace Microsoft.Azure.Batch.Protocol { + using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; + using System.Threading; + using System.Threading.Tasks; /// /// Extension methods for JobOperations. @@ -32,7 +35,7 @@ public static partial class JobOperationsExtensions /// public static JobStatistics GetAllLifetimeStatistics(this IJobOperations operations, JobGetAllLifetimeStatisticsOptions jobGetAllLifetimeStatisticsOptions = default(JobGetAllLifetimeStatisticsOptions)) { - return ((IJobOperations)operations).GetAllLifetimeStatisticsAsync(jobGetAllLifetimeStatisticsOptions).GetAwaiter().GetResult(); + return operations.GetAllLifetimeStatisticsAsync(jobGetAllLifetimeStatisticsOptions).GetAwaiter().GetResult(); } /// @@ -52,7 +55,7 @@ public static partial class JobOperationsExtensions /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task GetAllLifetimeStatisticsAsync(this IJobOperations operations, JobGetAllLifetimeStatisticsOptions jobGetAllLifetimeStatisticsOptions = default(JobGetAllLifetimeStatisticsOptions), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task GetAllLifetimeStatisticsAsync(this IJobOperations operations, JobGetAllLifetimeStatisticsOptions jobGetAllLifetimeStatisticsOptions = default(JobGetAllLifetimeStatisticsOptions), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.GetAllLifetimeStatisticsWithHttpMessagesAsync(jobGetAllLifetimeStatisticsOptions, null, cancellationToken).ConfigureAwait(false)) { @@ -68,7 +71,10 @@ public static partial class JobOperationsExtensions /// job statistics. This also overrides the retention period for task data; /// that is, if the job contains tasks which are still retained on compute /// nodes, the Batch services deletes those tasks' working directories and all - /// their contents. + /// their contents. When a Delete Job request is received, the Batch service + /// sets the job to the deleting state. All update operations on a job that is + /// in deleting state will fail with status code 409 (Conflict), with + /// additional information indicating that the job is being deleted. /// /// /// The operations group for this extension method. @@ -81,7 +87,7 @@ public static partial class JobOperationsExtensions /// public static JobDeleteHeaders Delete(this IJobOperations operations, string jobId, JobDeleteOptions jobDeleteOptions = default(JobDeleteOptions)) { - return ((IJobOperations)operations).DeleteAsync(jobId, jobDeleteOptions).GetAwaiter().GetResult(); + return operations.DeleteAsync(jobId, jobDeleteOptions).GetAwaiter().GetResult(); } /// @@ -92,7 +98,10 @@ public static partial class JobOperationsExtensions /// job statistics. This also overrides the retention period for task data; /// that is, if the job contains tasks which are still retained on compute /// nodes, the Batch services deletes those tasks' working directories and all - /// their contents. + /// their contents. When a Delete Job request is received, the Batch service + /// sets the job to the deleting state. All update operations on a job that is + /// in deleting state will fail with status code 409 (Conflict), with + /// additional information indicating that the job is being deleted. /// /// /// The operations group for this extension method. @@ -106,7 +115,7 @@ public static partial class JobOperationsExtensions /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task DeleteAsync(this IJobOperations operations, string jobId, JobDeleteOptions jobDeleteOptions = default(JobDeleteOptions), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task DeleteAsync(this IJobOperations operations, string jobId, JobDeleteOptions jobDeleteOptions = default(JobDeleteOptions), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.DeleteWithHttpMessagesAsync(jobId, jobDeleteOptions, null, cancellationToken).ConfigureAwait(false)) { @@ -128,7 +137,7 @@ public static partial class JobOperationsExtensions /// public static CloudJob Get(this IJobOperations operations, string jobId, JobGetOptions jobGetOptions = default(JobGetOptions)) { - return ((IJobOperations)operations).GetAsync(jobId, jobGetOptions).GetAwaiter().GetResult(); + return operations.GetAsync(jobId, jobGetOptions).GetAwaiter().GetResult(); } /// @@ -146,7 +155,7 @@ public static partial class JobOperationsExtensions /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task GetAsync(this IJobOperations operations, string jobId, JobGetOptions jobGetOptions = default(JobGetOptions), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task GetAsync(this IJobOperations operations, string jobId, JobGetOptions jobGetOptions = default(JobGetOptions), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.GetWithHttpMessagesAsync(jobId, jobGetOptions, null, cancellationToken).ConfigureAwait(false)) { @@ -176,7 +185,7 @@ public static partial class JobOperationsExtensions /// public static JobPatchHeaders Patch(this IJobOperations operations, string jobId, JobPatchParameter jobPatchParameter, JobPatchOptions jobPatchOptions = default(JobPatchOptions)) { - return ((IJobOperations)operations).PatchAsync(jobId, jobPatchParameter, jobPatchOptions).GetAwaiter().GetResult(); + return operations.PatchAsync(jobId, jobPatchParameter, jobPatchOptions).GetAwaiter().GetResult(); } /// @@ -202,7 +211,7 @@ public static partial class JobOperationsExtensions /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task PatchAsync(this IJobOperations operations, string jobId, JobPatchParameter jobPatchParameter, JobPatchOptions jobPatchOptions = default(JobPatchOptions), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task PatchAsync(this IJobOperations operations, string jobId, JobPatchParameter jobPatchParameter, JobPatchOptions jobPatchOptions = default(JobPatchOptions), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.PatchWithHttpMessagesAsync(jobId, jobPatchParameter, jobPatchOptions, null, cancellationToken).ConfigureAwait(false)) { @@ -233,7 +242,7 @@ public static partial class JobOperationsExtensions /// public static JobUpdateHeaders Update(this IJobOperations operations, string jobId, JobUpdateParameter jobUpdateParameter, JobUpdateOptions jobUpdateOptions = default(JobUpdateOptions)) { - return ((IJobOperations)operations).UpdateAsync(jobId, jobUpdateParameter, jobUpdateOptions).GetAwaiter().GetResult(); + return operations.UpdateAsync(jobId, jobUpdateParameter, jobUpdateOptions).GetAwaiter().GetResult(); } /// @@ -260,7 +269,7 @@ public static partial class JobOperationsExtensions /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task UpdateAsync(this IJobOperations operations, string jobId, JobUpdateParameter jobUpdateParameter, JobUpdateOptions jobUpdateOptions = default(JobUpdateOptions), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task UpdateAsync(this IJobOperations operations, string jobId, JobUpdateParameter jobUpdateParameter, JobUpdateOptions jobUpdateOptions = default(JobUpdateOptions), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.UpdateWithHttpMessagesAsync(jobId, jobUpdateParameter, jobUpdateOptions, null, cancellationToken).ConfigureAwait(false)) { @@ -288,9 +297,11 @@ public static partial class JobOperationsExtensions /// The ID of the job to disable. /// /// - /// What to do with active tasks associated with the job. requeue - Terminate - /// running tasks and requeue them. The tasks will run again when the job is - /// enabled. terminate - Terminate running tasks. The tasks will not run again. + /// What to do with active tasks associated with the job. Values are: + /// + /// requeue - Terminate running tasks and requeue them. The tasks will run + /// again when the job is enabled. + /// terminate - Terminate running tasks. The tasks will not run again. /// wait - Allow currently running tasks to complete. Possible values include: /// 'requeue', 'terminate', 'wait' /// @@ -299,7 +310,7 @@ public static partial class JobOperationsExtensions /// public static JobDisableHeaders Disable(this IJobOperations operations, string jobId, DisableJobOption disableTasks, JobDisableOptions jobDisableOptions = default(JobDisableOptions)) { - return ((IJobOperations)operations).DisableAsync(jobId, disableTasks, jobDisableOptions).GetAwaiter().GetResult(); + return operations.DisableAsync(jobId, disableTasks, jobDisableOptions).GetAwaiter().GetResult(); } /// @@ -322,9 +333,11 @@ public static partial class JobOperationsExtensions /// The ID of the job to disable. /// /// - /// What to do with active tasks associated with the job. requeue - Terminate - /// running tasks and requeue them. The tasks will run again when the job is - /// enabled. terminate - Terminate running tasks. The tasks will not run again. + /// What to do with active tasks associated with the job. Values are: + /// + /// requeue - Terminate running tasks and requeue them. The tasks will run + /// again when the job is enabled. + /// terminate - Terminate running tasks. The tasks will not run again. /// wait - Allow currently running tasks to complete. Possible values include: /// 'requeue', 'terminate', 'wait' /// @@ -334,7 +347,7 @@ public static partial class JobOperationsExtensions /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task DisableAsync(this IJobOperations operations, string jobId, DisableJobOption disableTasks, JobDisableOptions jobDisableOptions = default(JobDisableOptions), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task DisableAsync(this IJobOperations operations, string jobId, DisableJobOption disableTasks, JobDisableOptions jobDisableOptions = default(JobDisableOptions), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.DisableWithHttpMessagesAsync(jobId, disableTasks, jobDisableOptions, null, cancellationToken).ConfigureAwait(false)) { @@ -364,7 +377,7 @@ public static partial class JobOperationsExtensions /// public static JobEnableHeaders Enable(this IJobOperations operations, string jobId, JobEnableOptions jobEnableOptions = default(JobEnableOptions)) { - return ((IJobOperations)operations).EnableAsync(jobId, jobEnableOptions).GetAwaiter().GetResult(); + return operations.EnableAsync(jobId, jobEnableOptions).GetAwaiter().GetResult(); } /// @@ -390,7 +403,7 @@ public static partial class JobOperationsExtensions /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task EnableAsync(this IJobOperations operations, string jobId, JobEnableOptions jobEnableOptions = default(JobEnableOptions), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task EnableAsync(this IJobOperations operations, string jobId, JobEnableOptions jobEnableOptions = default(JobEnableOptions), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.EnableWithHttpMessagesAsync(jobId, jobEnableOptions, null, cancellationToken).ConfigureAwait(false)) { @@ -422,7 +435,7 @@ public static partial class JobOperationsExtensions /// public static JobTerminateHeaders Terminate(this IJobOperations operations, string jobId, string terminateReason = default(string), JobTerminateOptions jobTerminateOptions = default(JobTerminateOptions)) { - return ((IJobOperations)operations).TerminateAsync(jobId, terminateReason, jobTerminateOptions).GetAwaiter().GetResult(); + return operations.TerminateAsync(jobId, terminateReason, jobTerminateOptions).GetAwaiter().GetResult(); } /// @@ -450,7 +463,7 @@ public static partial class JobOperationsExtensions /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task TerminateAsync(this IJobOperations operations, string jobId, string terminateReason = default(string), JobTerminateOptions jobTerminateOptions = default(JobTerminateOptions), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task TerminateAsync(this IJobOperations operations, string jobId, string terminateReason = default(string), JobTerminateOptions jobTerminateOptions = default(JobTerminateOptions), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.TerminateWithHttpMessagesAsync(jobId, terminateReason, jobTerminateOptions, null, cancellationToken).ConfigureAwait(false)) { @@ -483,7 +496,7 @@ public static partial class JobOperationsExtensions /// public static JobAddHeaders Add(this IJobOperations operations, JobAddParameter job, JobAddOptions jobAddOptions = default(JobAddOptions)) { - return ((IJobOperations)operations).AddAsync(job, jobAddOptions).GetAwaiter().GetResult(); + return operations.AddAsync(job, jobAddOptions).GetAwaiter().GetResult(); } /// @@ -512,7 +525,7 @@ public static partial class JobOperationsExtensions /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task AddAsync(this IJobOperations operations, JobAddParameter job, JobAddOptions jobAddOptions = default(JobAddOptions), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task AddAsync(this IJobOperations operations, JobAddParameter job, JobAddOptions jobAddOptions = default(JobAddOptions), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.AddWithHttpMessagesAsync(job, jobAddOptions, null, cancellationToken).ConfigureAwait(false)) { @@ -529,9 +542,9 @@ public static partial class JobOperationsExtensions /// /// Additional parameters for the operation /// - public static Microsoft.Rest.Azure.IPage List(this IJobOperations operations, JobListOptions jobListOptions = default(JobListOptions)) + public static IPage List(this IJobOperations operations, JobListOptions jobListOptions = default(JobListOptions)) { - return ((IJobOperations)operations).ListAsync(jobListOptions).GetAwaiter().GetResult(); + return operations.ListAsync(jobListOptions).GetAwaiter().GetResult(); } /// @@ -546,7 +559,7 @@ public static partial class JobOperationsExtensions /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListAsync(this IJobOperations operations, JobListOptions jobListOptions = default(JobListOptions), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task> ListAsync(this IJobOperations operations, JobListOptions jobListOptions = default(JobListOptions), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListWithHttpMessagesAsync(jobListOptions, null, cancellationToken).ConfigureAwait(false)) { @@ -566,9 +579,9 @@ public static partial class JobOperationsExtensions /// /// Additional parameters for the operation /// - public static Microsoft.Rest.Azure.IPage ListFromJobSchedule(this IJobOperations operations, string jobScheduleId, JobListFromJobScheduleOptions jobListFromJobScheduleOptions = default(JobListFromJobScheduleOptions)) + public static IPage ListFromJobSchedule(this IJobOperations operations, string jobScheduleId, JobListFromJobScheduleOptions jobListFromJobScheduleOptions = default(JobListFromJobScheduleOptions)) { - return ((IJobOperations)operations).ListFromJobScheduleAsync(jobScheduleId, jobListFromJobScheduleOptions).GetAwaiter().GetResult(); + return operations.ListFromJobScheduleAsync(jobScheduleId, jobListFromJobScheduleOptions).GetAwaiter().GetResult(); } /// @@ -586,7 +599,7 @@ public static partial class JobOperationsExtensions /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListFromJobScheduleAsync(this IJobOperations operations, string jobScheduleId, JobListFromJobScheduleOptions jobListFromJobScheduleOptions = default(JobListFromJobScheduleOptions), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task> ListFromJobScheduleAsync(this IJobOperations operations, string jobScheduleId, JobListFromJobScheduleOptions jobListFromJobScheduleOptions = default(JobListFromJobScheduleOptions), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListFromJobScheduleWithHttpMessagesAsync(jobScheduleId, jobListFromJobScheduleOptions, null, cancellationToken).ConfigureAwait(false)) { @@ -601,7 +614,10 @@ public static partial class JobOperationsExtensions /// /// This API returns the Job Preparation and Job Release task status on all /// compute nodes that have run the Job Preparation or Job Release task. This - /// includes nodes which have since been removed from the pool. + /// includes nodes which have since been removed from the pool. If this API is + /// invoked on a job which has no Job Preparation or Job Release task, the + /// Batch service returns HTTP status code 409 (Conflict) with an error code of + /// JobPreparationTaskNotSpecified. /// /// /// The operations group for this extension method. @@ -612,9 +628,9 @@ public static partial class JobOperationsExtensions /// /// Additional parameters for the operation /// - public static Microsoft.Rest.Azure.IPage ListPreparationAndReleaseTaskStatus(this IJobOperations operations, string jobId, JobListPreparationAndReleaseTaskStatusOptions jobListPreparationAndReleaseTaskStatusOptions = default(JobListPreparationAndReleaseTaskStatusOptions)) + public static IPage ListPreparationAndReleaseTaskStatus(this IJobOperations operations, string jobId, JobListPreparationAndReleaseTaskStatusOptions jobListPreparationAndReleaseTaskStatusOptions = default(JobListPreparationAndReleaseTaskStatusOptions)) { - return ((IJobOperations)operations).ListPreparationAndReleaseTaskStatusAsync(jobId, jobListPreparationAndReleaseTaskStatusOptions).GetAwaiter().GetResult(); + return operations.ListPreparationAndReleaseTaskStatusAsync(jobId, jobListPreparationAndReleaseTaskStatusOptions).GetAwaiter().GetResult(); } /// @@ -624,7 +640,10 @@ public static partial class JobOperationsExtensions /// /// This API returns the Job Preparation and Job Release task status on all /// compute nodes that have run the Job Preparation or Job Release task. This - /// includes nodes which have since been removed from the pool. + /// includes nodes which have since been removed from the pool. If this API is + /// invoked on a job which has no Job Preparation or Job Release task, the + /// Batch service returns HTTP status code 409 (Conflict) with an error code of + /// JobPreparationTaskNotSpecified. /// /// /// The operations group for this extension method. @@ -638,7 +657,7 @@ public static partial class JobOperationsExtensions /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListPreparationAndReleaseTaskStatusAsync(this IJobOperations operations, string jobId, JobListPreparationAndReleaseTaskStatusOptions jobListPreparationAndReleaseTaskStatusOptions = default(JobListPreparationAndReleaseTaskStatusOptions), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task> ListPreparationAndReleaseTaskStatusAsync(this IJobOperations operations, string jobId, JobListPreparationAndReleaseTaskStatusOptions jobListPreparationAndReleaseTaskStatusOptions = default(JobListPreparationAndReleaseTaskStatusOptions), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListPreparationAndReleaseTaskStatusWithHttpMessagesAsync(jobId, jobListPreparationAndReleaseTaskStatusOptions, null, cancellationToken).ConfigureAwait(false)) { @@ -669,7 +688,7 @@ public static partial class JobOperationsExtensions /// public static TaskCounts GetTaskCounts(this IJobOperations operations, string jobId, JobGetTaskCountsOptions jobGetTaskCountsOptions = default(JobGetTaskCountsOptions)) { - return ((IJobOperations)operations).GetTaskCountsAsync(jobId, jobGetTaskCountsOptions).GetAwaiter().GetResult(); + return operations.GetTaskCountsAsync(jobId, jobGetTaskCountsOptions).GetAwaiter().GetResult(); } /// @@ -696,7 +715,7 @@ public static partial class JobOperationsExtensions /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task GetTaskCountsAsync(this IJobOperations operations, string jobId, JobGetTaskCountsOptions jobGetTaskCountsOptions = default(JobGetTaskCountsOptions), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task GetTaskCountsAsync(this IJobOperations operations, string jobId, JobGetTaskCountsOptions jobGetTaskCountsOptions = default(JobGetTaskCountsOptions), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.GetTaskCountsWithHttpMessagesAsync(jobId, jobGetTaskCountsOptions, null, cancellationToken).ConfigureAwait(false)) { @@ -716,9 +735,9 @@ public static partial class JobOperationsExtensions /// /// Additional parameters for the operation /// - public static Microsoft.Rest.Azure.IPage ListNext(this IJobOperations operations, string nextPageLink, JobListNextOptions jobListNextOptions = default(JobListNextOptions)) + public static IPage ListNext(this IJobOperations operations, string nextPageLink, JobListNextOptions jobListNextOptions = default(JobListNextOptions)) { - return ((IJobOperations)operations).ListNextAsync(nextPageLink, jobListNextOptions).GetAwaiter().GetResult(); + return operations.ListNextAsync(nextPageLink, jobListNextOptions).GetAwaiter().GetResult(); } /// @@ -736,7 +755,7 @@ public static partial class JobOperationsExtensions /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListNextAsync(this IJobOperations operations, string nextPageLink, JobListNextOptions jobListNextOptions = default(JobListNextOptions), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task> ListNextAsync(this IJobOperations operations, string nextPageLink, JobListNextOptions jobListNextOptions = default(JobListNextOptions), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, jobListNextOptions, null, cancellationToken).ConfigureAwait(false)) { @@ -756,9 +775,9 @@ public static partial class JobOperationsExtensions /// /// Additional parameters for the operation /// - public static Microsoft.Rest.Azure.IPage ListFromJobScheduleNext(this IJobOperations operations, string nextPageLink, JobListFromJobScheduleNextOptions jobListFromJobScheduleNextOptions = default(JobListFromJobScheduleNextOptions)) + public static IPage ListFromJobScheduleNext(this IJobOperations operations, string nextPageLink, JobListFromJobScheduleNextOptions jobListFromJobScheduleNextOptions = default(JobListFromJobScheduleNextOptions)) { - return ((IJobOperations)operations).ListFromJobScheduleNextAsync(nextPageLink, jobListFromJobScheduleNextOptions).GetAwaiter().GetResult(); + return operations.ListFromJobScheduleNextAsync(nextPageLink, jobListFromJobScheduleNextOptions).GetAwaiter().GetResult(); } /// @@ -776,7 +795,7 @@ public static partial class JobOperationsExtensions /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListFromJobScheduleNextAsync(this IJobOperations operations, string nextPageLink, JobListFromJobScheduleNextOptions jobListFromJobScheduleNextOptions = default(JobListFromJobScheduleNextOptions), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task> ListFromJobScheduleNextAsync(this IJobOperations operations, string nextPageLink, JobListFromJobScheduleNextOptions jobListFromJobScheduleNextOptions = default(JobListFromJobScheduleNextOptions), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListFromJobScheduleNextWithHttpMessagesAsync(nextPageLink, jobListFromJobScheduleNextOptions, null, cancellationToken).ConfigureAwait(false)) { @@ -791,7 +810,10 @@ public static partial class JobOperationsExtensions /// /// This API returns the Job Preparation and Job Release task status on all /// compute nodes that have run the Job Preparation or Job Release task. This - /// includes nodes which have since been removed from the pool. + /// includes nodes which have since been removed from the pool. If this API is + /// invoked on a job which has no Job Preparation or Job Release task, the + /// Batch service returns HTTP status code 409 (Conflict) with an error code of + /// JobPreparationTaskNotSpecified. /// /// /// The operations group for this extension method. @@ -802,9 +824,9 @@ public static partial class JobOperationsExtensions /// /// Additional parameters for the operation /// - public static Microsoft.Rest.Azure.IPage ListPreparationAndReleaseTaskStatusNext(this IJobOperations operations, string nextPageLink, JobListPreparationAndReleaseTaskStatusNextOptions jobListPreparationAndReleaseTaskStatusNextOptions = default(JobListPreparationAndReleaseTaskStatusNextOptions)) + public static IPage ListPreparationAndReleaseTaskStatusNext(this IJobOperations operations, string nextPageLink, JobListPreparationAndReleaseTaskStatusNextOptions jobListPreparationAndReleaseTaskStatusNextOptions = default(JobListPreparationAndReleaseTaskStatusNextOptions)) { - return ((IJobOperations)operations).ListPreparationAndReleaseTaskStatusNextAsync(nextPageLink, jobListPreparationAndReleaseTaskStatusNextOptions).GetAwaiter().GetResult(); + return operations.ListPreparationAndReleaseTaskStatusNextAsync(nextPageLink, jobListPreparationAndReleaseTaskStatusNextOptions).GetAwaiter().GetResult(); } /// @@ -814,7 +836,10 @@ public static partial class JobOperationsExtensions /// /// This API returns the Job Preparation and Job Release task status on all /// compute nodes that have run the Job Preparation or Job Release task. This - /// includes nodes which have since been removed from the pool. + /// includes nodes which have since been removed from the pool. If this API is + /// invoked on a job which has no Job Preparation or Job Release task, the + /// Batch service returns HTTP status code 409 (Conflict) with an error code of + /// JobPreparationTaskNotSpecified. /// /// /// The operations group for this extension method. @@ -828,7 +853,7 @@ public static partial class JobOperationsExtensions /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListPreparationAndReleaseTaskStatusNextAsync(this IJobOperations operations, string nextPageLink, JobListPreparationAndReleaseTaskStatusNextOptions jobListPreparationAndReleaseTaskStatusNextOptions = default(JobListPreparationAndReleaseTaskStatusNextOptions), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task> ListPreparationAndReleaseTaskStatusNextAsync(this IJobOperations operations, string nextPageLink, JobListPreparationAndReleaseTaskStatusNextOptions jobListPreparationAndReleaseTaskStatusNextOptions = default(JobListPreparationAndReleaseTaskStatusNextOptions), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListPreparationAndReleaseTaskStatusNextWithHttpMessagesAsync(nextPageLink, jobListPreparationAndReleaseTaskStatusNextOptions, null, cancellationToken).ConfigureAwait(false)) { @@ -837,4 +862,4 @@ public static partial class JobOperationsExtensions } } -} +} \ No newline at end of file diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/JobScheduleOperations.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/JobScheduleOperations.cs index 6c1f736df873..befbb8282a21 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/JobScheduleOperations.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/JobScheduleOperations.cs @@ -8,15 +8,23 @@ namespace Microsoft.Azure.Batch.Protocol { - 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; + using System.Threading; + using System.Threading.Tasks; /// /// JobScheduleOperations operations. /// - internal partial class JobScheduleOperations : Microsoft.Rest.IServiceOperations, IJobScheduleOperations + internal partial class JobScheduleOperations : IServiceOperations, IJobScheduleOperations { /// /// Initializes a new instance of the JobScheduleOperations class. @@ -33,7 +41,7 @@ internal JobScheduleOperations(BatchServiceClient client) { throw new System.ArgumentNullException("client"); } - this.Client = client; + Client = client; } /// @@ -59,7 +67,7 @@ internal JobScheduleOperations(BatchServiceClient client) /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -68,15 +76,15 @@ internal JobScheduleOperations(BatchServiceClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> ExistsWithHttpMessagesAsync(string jobScheduleId, JobScheduleExistsOptions jobScheduleExistsOptions = default(JobScheduleExistsOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> ExistsWithHttpMessagesAsync(string jobScheduleId, JobScheduleExistsOptions jobScheduleExistsOptions = default(JobScheduleExistsOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (jobScheduleId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "jobScheduleId"); + throw new ValidationException(ValidationRules.CannotBeNull, "jobScheduleId"); } - 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"); } int? timeout = default(int?); if (jobScheduleExistsOptions != null) @@ -119,12 +127,12 @@ internal JobScheduleOperations(BatchServiceClient client) ifUnmodifiedSince = jobScheduleExistsOptions.IfUnmodifiedSince; } // 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("jobScheduleId", jobScheduleId); tracingParameters.Add("timeout", timeout); tracingParameters.Add("clientRequestId", clientRequestId); @@ -135,42 +143,42 @@ internal JobScheduleOperations(BatchServiceClient client) tracingParameters.Add("ifModifiedSince", ifModifiedSince); tracingParameters.Add("ifUnmodifiedSince", ifUnmodifiedSince); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Exists", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Exists", 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("/") ? "" : "/")), "jobschedules/{jobScheduleId}").ToString(); _url = _url.Replace("{jobScheduleId}", System.Uri.EscapeDataString(jobScheduleId)); - 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 (timeout != null) { - _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(timeout, this.Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(timeout, Client.SerializationSettings).Trim('"')))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("HEAD"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("HEAD"); _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("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 (clientRequestId != null) { @@ -178,7 +186,7 @@ internal JobScheduleOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(clientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("client-request-id", SafeJsonConvert.SerializeObject(clientRequestId, Client.SerializationSettings).Trim('"')); } if (returnClientRequestId != null) { @@ -186,7 +194,7 @@ internal JobScheduleOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("return-client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(returnClientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", SafeJsonConvert.SerializeObject(returnClientRequestId, Client.SerializationSettings).Trim('"')); } if (ocpDate != null) { @@ -194,7 +202,7 @@ internal JobScheduleOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("ocp-date"); } - _httpRequest.Headers.TryAddWithoutValidation("ocp-date", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ocpDate, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("ocp-date", SafeJsonConvert.SerializeObject(ocpDate, new DateTimeRfc1123JsonConverter()).Trim('"')); } if (ifMatch != null) { @@ -218,7 +226,7 @@ internal JobScheduleOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("If-Modified-Since"); } - _httpRequest.Headers.TryAddWithoutValidation("If-Modified-Since", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ifModifiedSince, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("If-Modified-Since", SafeJsonConvert.SerializeObject(ifModifiedSince, new DateTimeRfc1123JsonConverter()).Trim('"')); } if (ifUnmodifiedSince != null) { @@ -226,7 +234,7 @@ internal JobScheduleOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("If-Unmodified-Since"); } - _httpRequest.Headers.TryAddWithoutValidation("If-Unmodified-Since", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ifUnmodifiedSince, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("If-Unmodified-Since", SafeJsonConvert.SerializeObject(ifUnmodifiedSince, new DateTimeRfc1123JsonConverter()).Trim('"')); } @@ -245,23 +253,23 @@ internal JobScheduleOperations(BatchServiceClient 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, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, 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 != 404) @@ -270,21 +278,21 @@ internal JobScheduleOperations(BatchServiceClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - BatchError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + BatchError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -294,30 +302,30 @@ internal JobScheduleOperations(BatchServiceClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; - _result.Body = (_statusCode == System.Net.HttpStatusCode.OK); + _result.Body = _statusCode == System.Net.HttpStatusCode.OK; if (_httpResponse.Headers.Contains("request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("request-id").FirstOrDefault(); } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(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 headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -348,7 +356,7 @@ internal JobScheduleOperations(BatchServiceClient client) /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -357,15 +365,15 @@ internal JobScheduleOperations(BatchServiceClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> DeleteWithHttpMessagesAsync(string jobScheduleId, JobScheduleDeleteOptions jobScheduleDeleteOptions = default(JobScheduleDeleteOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> DeleteWithHttpMessagesAsync(string jobScheduleId, JobScheduleDeleteOptions jobScheduleDeleteOptions = default(JobScheduleDeleteOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (jobScheduleId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "jobScheduleId"); + throw new ValidationException(ValidationRules.CannotBeNull, "jobScheduleId"); } - 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"); } int? timeout = default(int?); if (jobScheduleDeleteOptions != null) @@ -408,12 +416,12 @@ internal JobScheduleOperations(BatchServiceClient client) ifUnmodifiedSince = jobScheduleDeleteOptions.IfUnmodifiedSince; } // 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("jobScheduleId", jobScheduleId); tracingParameters.Add("timeout", timeout); tracingParameters.Add("clientRequestId", clientRequestId); @@ -424,42 +432,42 @@ internal JobScheduleOperations(BatchServiceClient client) tracingParameters.Add("ifModifiedSince", ifModifiedSince); tracingParameters.Add("ifUnmodifiedSince", ifUnmodifiedSince); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Delete", 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("/") ? "" : "/")), "jobschedules/{jobScheduleId}").ToString(); _url = _url.Replace("{jobScheduleId}", System.Uri.EscapeDataString(jobScheduleId)); - 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 (timeout != null) { - _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(timeout, this.Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(timeout, Client.SerializationSettings).Trim('"')))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _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("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 (clientRequestId != null) { @@ -467,7 +475,7 @@ internal JobScheduleOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(clientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("client-request-id", SafeJsonConvert.SerializeObject(clientRequestId, Client.SerializationSettings).Trim('"')); } if (returnClientRequestId != null) { @@ -475,7 +483,7 @@ internal JobScheduleOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("return-client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(returnClientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", SafeJsonConvert.SerializeObject(returnClientRequestId, Client.SerializationSettings).Trim('"')); } if (ocpDate != null) { @@ -483,7 +491,7 @@ internal JobScheduleOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("ocp-date"); } - _httpRequest.Headers.TryAddWithoutValidation("ocp-date", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ocpDate, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("ocp-date", SafeJsonConvert.SerializeObject(ocpDate, new DateTimeRfc1123JsonConverter()).Trim('"')); } if (ifMatch != null) { @@ -507,7 +515,7 @@ internal JobScheduleOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("If-Modified-Since"); } - _httpRequest.Headers.TryAddWithoutValidation("If-Modified-Since", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ifModifiedSince, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("If-Modified-Since", SafeJsonConvert.SerializeObject(ifModifiedSince, new DateTimeRfc1123JsonConverter()).Trim('"')); } if (ifUnmodifiedSince != null) { @@ -515,7 +523,7 @@ internal JobScheduleOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("If-Unmodified-Since"); } - _httpRequest.Headers.TryAddWithoutValidation("If-Unmodified-Since", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ifUnmodifiedSince, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("If-Unmodified-Since", SafeJsonConvert.SerializeObject(ifUnmodifiedSince, new DateTimeRfc1123JsonConverter()).Trim('"')); } @@ -534,23 +542,23 @@ internal JobScheduleOperations(BatchServiceClient 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 != 202) @@ -559,21 +567,21 @@ internal JobScheduleOperations(BatchServiceClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - BatchError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + BatchError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -583,7 +591,7 @@ internal JobScheduleOperations(BatchServiceClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); + var _result = new AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("request-id")) @@ -592,20 +600,20 @@ internal JobScheduleOperations(BatchServiceClient client) } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(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 headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -628,10 +636,10 @@ internal JobScheduleOperations(BatchServiceClient client) /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -640,15 +648,15 @@ internal JobScheduleOperations(BatchServiceClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string jobScheduleId, JobScheduleGetOptions jobScheduleGetOptions = default(JobScheduleGetOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string jobScheduleId, JobScheduleGetOptions jobScheduleGetOptions = default(JobScheduleGetOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (jobScheduleId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "jobScheduleId"); + throw new ValidationException(ValidationRules.CannotBeNull, "jobScheduleId"); } - 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"); } string select = default(string); if (jobScheduleGetOptions != null) @@ -701,12 +709,12 @@ internal JobScheduleOperations(BatchServiceClient client) ifUnmodifiedSince = jobScheduleGetOptions.IfUnmodifiedSince; } // 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("jobScheduleId", jobScheduleId); tracingParameters.Add("select", select); tracingParameters.Add("expand", expand); @@ -719,16 +727,16 @@ internal JobScheduleOperations(BatchServiceClient client) tracingParameters.Add("ifModifiedSince", ifModifiedSince); tracingParameters.Add("ifUnmodifiedSince", ifUnmodifiedSince); 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("/") ? "" : "/")), "jobschedules/{jobScheduleId}").ToString(); _url = _url.Replace("{jobScheduleId}", System.Uri.EscapeDataString(jobScheduleId)); - 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 (select != null) { @@ -740,29 +748,29 @@ internal JobScheduleOperations(BatchServiceClient client) } if (timeout != null) { - _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(timeout, this.Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(timeout, Client.SerializationSettings).Trim('"')))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _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("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 (clientRequestId != null) { @@ -770,7 +778,7 @@ internal JobScheduleOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(clientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("client-request-id", SafeJsonConvert.SerializeObject(clientRequestId, Client.SerializationSettings).Trim('"')); } if (returnClientRequestId != null) { @@ -778,7 +786,7 @@ internal JobScheduleOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("return-client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(returnClientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", SafeJsonConvert.SerializeObject(returnClientRequestId, Client.SerializationSettings).Trim('"')); } if (ocpDate != null) { @@ -786,7 +794,7 @@ internal JobScheduleOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("ocp-date"); } - _httpRequest.Headers.TryAddWithoutValidation("ocp-date", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ocpDate, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("ocp-date", SafeJsonConvert.SerializeObject(ocpDate, new DateTimeRfc1123JsonConverter()).Trim('"')); } if (ifMatch != null) { @@ -810,7 +818,7 @@ internal JobScheduleOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("If-Modified-Since"); } - _httpRequest.Headers.TryAddWithoutValidation("If-Modified-Since", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ifModifiedSince, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("If-Modified-Since", SafeJsonConvert.SerializeObject(ifModifiedSince, new DateTimeRfc1123JsonConverter()).Trim('"')); } if (ifUnmodifiedSince != null) { @@ -818,7 +826,7 @@ internal JobScheduleOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("If-Unmodified-Since"); } - _httpRequest.Headers.TryAddWithoutValidation("If-Unmodified-Since", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ifUnmodifiedSince, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("If-Unmodified-Since", SafeJsonConvert.SerializeObject(ifUnmodifiedSince, new DateTimeRfc1123JsonConverter()).Trim('"')); } @@ -837,23 +845,23 @@ internal JobScheduleOperations(BatchServiceClient 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) @@ -862,21 +870,21 @@ internal JobScheduleOperations(BatchServiceClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - BatchError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + BatchError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -886,7 +894,7 @@ internal JobScheduleOperations(BatchServiceClient 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("request-id")) @@ -899,34 +907,34 @@ internal JobScheduleOperations(BatchServiceClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = 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); } } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(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 headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -959,7 +967,7 @@ internal JobScheduleOperations(BatchServiceClient client) /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -968,19 +976,19 @@ internal JobScheduleOperations(BatchServiceClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> PatchWithHttpMessagesAsync(string jobScheduleId, JobSchedulePatchParameter jobSchedulePatchParameter, JobSchedulePatchOptions jobSchedulePatchOptions = default(JobSchedulePatchOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> PatchWithHttpMessagesAsync(string jobScheduleId, JobSchedulePatchParameter jobSchedulePatchParameter, JobSchedulePatchOptions jobSchedulePatchOptions = default(JobSchedulePatchOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (jobScheduleId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "jobScheduleId"); + throw new ValidationException(ValidationRules.CannotBeNull, "jobScheduleId"); } if (jobSchedulePatchParameter == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "jobSchedulePatchParameter"); + throw new ValidationException(ValidationRules.CannotBeNull, "jobSchedulePatchParameter"); } - 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"); } int? timeout = default(int?); if (jobSchedulePatchOptions != null) @@ -1023,12 +1031,12 @@ internal JobScheduleOperations(BatchServiceClient client) ifUnmodifiedSince = jobSchedulePatchOptions.IfUnmodifiedSince; } // 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("jobScheduleId", jobScheduleId); tracingParameters.Add("jobSchedulePatchParameter", jobSchedulePatchParameter); tracingParameters.Add("timeout", timeout); @@ -1040,42 +1048,42 @@ internal JobScheduleOperations(BatchServiceClient client) tracingParameters.Add("ifModifiedSince", ifModifiedSince); tracingParameters.Add("ifUnmodifiedSince", ifUnmodifiedSince); 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("/") ? "" : "/")), "jobschedules/{jobScheduleId}").ToString(); _url = _url.Replace("{jobScheduleId}", System.Uri.EscapeDataString(jobScheduleId)); - 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 (timeout != null) { - _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(timeout, this.Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(timeout, Client.SerializationSettings).Trim('"')))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _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("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 (clientRequestId != null) { @@ -1083,7 +1091,7 @@ internal JobScheduleOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(clientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("client-request-id", SafeJsonConvert.SerializeObject(clientRequestId, Client.SerializationSettings).Trim('"')); } if (returnClientRequestId != null) { @@ -1091,7 +1099,7 @@ internal JobScheduleOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("return-client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(returnClientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", SafeJsonConvert.SerializeObject(returnClientRequestId, Client.SerializationSettings).Trim('"')); } if (ocpDate != null) { @@ -1099,7 +1107,7 @@ internal JobScheduleOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("ocp-date"); } - _httpRequest.Headers.TryAddWithoutValidation("ocp-date", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ocpDate, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("ocp-date", SafeJsonConvert.SerializeObject(ocpDate, new DateTimeRfc1123JsonConverter()).Trim('"')); } if (ifMatch != null) { @@ -1123,7 +1131,7 @@ internal JobScheduleOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("If-Modified-Since"); } - _httpRequest.Headers.TryAddWithoutValidation("If-Modified-Since", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ifModifiedSince, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("If-Modified-Since", SafeJsonConvert.SerializeObject(ifModifiedSince, new DateTimeRfc1123JsonConverter()).Trim('"')); } if (ifUnmodifiedSince != null) { @@ -1131,7 +1139,7 @@ internal JobScheduleOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("If-Unmodified-Since"); } - _httpRequest.Headers.TryAddWithoutValidation("If-Unmodified-Since", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ifUnmodifiedSince, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("If-Unmodified-Since", SafeJsonConvert.SerializeObject(ifUnmodifiedSince, new DateTimeRfc1123JsonConverter()).Trim('"')); } @@ -1151,28 +1159,28 @@ internal JobScheduleOperations(BatchServiceClient client) string _requestContent = null; if(jobSchedulePatchParameter != null) { - _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(jobSchedulePatchParameter, this.Client.SerializationSettings); - _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = SafeJsonConvert.SerializeObject(jobSchedulePatchParameter, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; odata=minimalmetadata; 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) @@ -1181,21 +1189,21 @@ internal JobScheduleOperations(BatchServiceClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - BatchError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + BatchError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1205,7 +1213,7 @@ internal JobScheduleOperations(BatchServiceClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); + var _result = new AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("request-id")) @@ -1214,20 +1222,20 @@ internal JobScheduleOperations(BatchServiceClient client) } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(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 headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -1260,7 +1268,7 @@ internal JobScheduleOperations(BatchServiceClient client) /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1269,23 +1277,23 @@ internal JobScheduleOperations(BatchServiceClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string jobScheduleId, JobScheduleUpdateParameter jobScheduleUpdateParameter, JobScheduleUpdateOptions jobScheduleUpdateOptions = default(JobScheduleUpdateOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> UpdateWithHttpMessagesAsync(string jobScheduleId, JobScheduleUpdateParameter jobScheduleUpdateParameter, JobScheduleUpdateOptions jobScheduleUpdateOptions = default(JobScheduleUpdateOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (jobScheduleId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "jobScheduleId"); + throw new ValidationException(ValidationRules.CannotBeNull, "jobScheduleId"); } if (jobScheduleUpdateParameter == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "jobScheduleUpdateParameter"); + throw new ValidationException(ValidationRules.CannotBeNull, "jobScheduleUpdateParameter"); } if (jobScheduleUpdateParameter != null) { jobScheduleUpdateParameter.Validate(); } - 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"); } int? timeout = default(int?); if (jobScheduleUpdateOptions != null) @@ -1328,12 +1336,12 @@ internal JobScheduleOperations(BatchServiceClient client) ifUnmodifiedSince = jobScheduleUpdateOptions.IfUnmodifiedSince; } // 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("jobScheduleId", jobScheduleId); tracingParameters.Add("jobScheduleUpdateParameter", jobScheduleUpdateParameter); tracingParameters.Add("timeout", timeout); @@ -1345,42 +1353,42 @@ internal JobScheduleOperations(BatchServiceClient client) tracingParameters.Add("ifModifiedSince", ifModifiedSince); tracingParameters.Add("ifUnmodifiedSince", ifUnmodifiedSince); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Update", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Update", 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("/") ? "" : "/")), "jobschedules/{jobScheduleId}").ToString(); _url = _url.Replace("{jobScheduleId}", System.Uri.EscapeDataString(jobScheduleId)); - 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 (timeout != null) { - _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(timeout, this.Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(timeout, Client.SerializationSettings).Trim('"')))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _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("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 (clientRequestId != null) { @@ -1388,7 +1396,7 @@ internal JobScheduleOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(clientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("client-request-id", SafeJsonConvert.SerializeObject(clientRequestId, Client.SerializationSettings).Trim('"')); } if (returnClientRequestId != null) { @@ -1396,7 +1404,7 @@ internal JobScheduleOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("return-client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(returnClientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", SafeJsonConvert.SerializeObject(returnClientRequestId, Client.SerializationSettings).Trim('"')); } if (ocpDate != null) { @@ -1404,7 +1412,7 @@ internal JobScheduleOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("ocp-date"); } - _httpRequest.Headers.TryAddWithoutValidation("ocp-date", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ocpDate, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("ocp-date", SafeJsonConvert.SerializeObject(ocpDate, new DateTimeRfc1123JsonConverter()).Trim('"')); } if (ifMatch != null) { @@ -1428,7 +1436,7 @@ internal JobScheduleOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("If-Modified-Since"); } - _httpRequest.Headers.TryAddWithoutValidation("If-Modified-Since", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ifModifiedSince, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("If-Modified-Since", SafeJsonConvert.SerializeObject(ifModifiedSince, new DateTimeRfc1123JsonConverter()).Trim('"')); } if (ifUnmodifiedSince != null) { @@ -1436,7 +1444,7 @@ internal JobScheduleOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("If-Unmodified-Since"); } - _httpRequest.Headers.TryAddWithoutValidation("If-Unmodified-Since", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ifUnmodifiedSince, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("If-Unmodified-Since", SafeJsonConvert.SerializeObject(ifUnmodifiedSince, new DateTimeRfc1123JsonConverter()).Trim('"')); } @@ -1456,28 +1464,28 @@ internal JobScheduleOperations(BatchServiceClient client) string _requestContent = null; if(jobScheduleUpdateParameter != null) { - _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(jobScheduleUpdateParameter, this.Client.SerializationSettings); - _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = SafeJsonConvert.SerializeObject(jobScheduleUpdateParameter, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; odata=minimalmetadata; 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) @@ -1486,21 +1494,21 @@ internal JobScheduleOperations(BatchServiceClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - BatchError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + BatchError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1510,7 +1518,7 @@ internal JobScheduleOperations(BatchServiceClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); + var _result = new AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("request-id")) @@ -1519,20 +1527,20 @@ internal JobScheduleOperations(BatchServiceClient client) } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(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 headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -1558,7 +1566,7 @@ internal JobScheduleOperations(BatchServiceClient client) /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1567,15 +1575,15 @@ internal JobScheduleOperations(BatchServiceClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> DisableWithHttpMessagesAsync(string jobScheduleId, JobScheduleDisableOptions jobScheduleDisableOptions = default(JobScheduleDisableOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> DisableWithHttpMessagesAsync(string jobScheduleId, JobScheduleDisableOptions jobScheduleDisableOptions = default(JobScheduleDisableOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (jobScheduleId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "jobScheduleId"); + throw new ValidationException(ValidationRules.CannotBeNull, "jobScheduleId"); } - 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"); } int? timeout = default(int?); if (jobScheduleDisableOptions != null) @@ -1618,12 +1626,12 @@ internal JobScheduleOperations(BatchServiceClient client) ifUnmodifiedSince = jobScheduleDisableOptions.IfUnmodifiedSince; } // 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("jobScheduleId", jobScheduleId); tracingParameters.Add("timeout", timeout); tracingParameters.Add("clientRequestId", clientRequestId); @@ -1634,42 +1642,42 @@ internal JobScheduleOperations(BatchServiceClient client) tracingParameters.Add("ifModifiedSince", ifModifiedSince); tracingParameters.Add("ifUnmodifiedSince", ifUnmodifiedSince); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Disable", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Disable", 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("/") ? "" : "/")), "jobschedules/{jobScheduleId}/disable").ToString(); _url = _url.Replace("{jobScheduleId}", System.Uri.EscapeDataString(jobScheduleId)); - 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 (timeout != null) { - _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(timeout, this.Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(timeout, Client.SerializationSettings).Trim('"')))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _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("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 (clientRequestId != null) { @@ -1677,7 +1685,7 @@ internal JobScheduleOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(clientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("client-request-id", SafeJsonConvert.SerializeObject(clientRequestId, Client.SerializationSettings).Trim('"')); } if (returnClientRequestId != null) { @@ -1685,7 +1693,7 @@ internal JobScheduleOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("return-client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(returnClientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", SafeJsonConvert.SerializeObject(returnClientRequestId, Client.SerializationSettings).Trim('"')); } if (ocpDate != null) { @@ -1693,7 +1701,7 @@ internal JobScheduleOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("ocp-date"); } - _httpRequest.Headers.TryAddWithoutValidation("ocp-date", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ocpDate, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("ocp-date", SafeJsonConvert.SerializeObject(ocpDate, new DateTimeRfc1123JsonConverter()).Trim('"')); } if (ifMatch != null) { @@ -1717,7 +1725,7 @@ internal JobScheduleOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("If-Modified-Since"); } - _httpRequest.Headers.TryAddWithoutValidation("If-Modified-Since", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ifModifiedSince, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("If-Modified-Since", SafeJsonConvert.SerializeObject(ifModifiedSince, new DateTimeRfc1123JsonConverter()).Trim('"')); } if (ifUnmodifiedSince != null) { @@ -1725,7 +1733,7 @@ internal JobScheduleOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("If-Unmodified-Since"); } - _httpRequest.Headers.TryAddWithoutValidation("If-Unmodified-Since", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ifUnmodifiedSince, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("If-Unmodified-Since", SafeJsonConvert.SerializeObject(ifUnmodifiedSince, new DateTimeRfc1123JsonConverter()).Trim('"')); } @@ -1744,23 +1752,23 @@ internal JobScheduleOperations(BatchServiceClient 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 != 204) @@ -1769,21 +1777,21 @@ internal JobScheduleOperations(BatchServiceClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - BatchError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + BatchError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1793,7 +1801,7 @@ internal JobScheduleOperations(BatchServiceClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); + var _result = new AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("request-id")) @@ -1802,20 +1810,20 @@ internal JobScheduleOperations(BatchServiceClient client) } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(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 headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -1838,7 +1846,7 @@ internal JobScheduleOperations(BatchServiceClient client) /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1847,15 +1855,15 @@ internal JobScheduleOperations(BatchServiceClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> EnableWithHttpMessagesAsync(string jobScheduleId, JobScheduleEnableOptions jobScheduleEnableOptions = default(JobScheduleEnableOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> EnableWithHttpMessagesAsync(string jobScheduleId, JobScheduleEnableOptions jobScheduleEnableOptions = default(JobScheduleEnableOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (jobScheduleId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "jobScheduleId"); + throw new ValidationException(ValidationRules.CannotBeNull, "jobScheduleId"); } - 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"); } int? timeout = default(int?); if (jobScheduleEnableOptions != null) @@ -1898,12 +1906,12 @@ internal JobScheduleOperations(BatchServiceClient client) ifUnmodifiedSince = jobScheduleEnableOptions.IfUnmodifiedSince; } // 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("jobScheduleId", jobScheduleId); tracingParameters.Add("timeout", timeout); tracingParameters.Add("clientRequestId", clientRequestId); @@ -1914,42 +1922,42 @@ internal JobScheduleOperations(BatchServiceClient client) tracingParameters.Add("ifModifiedSince", ifModifiedSince); tracingParameters.Add("ifUnmodifiedSince", ifUnmodifiedSince); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Enable", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Enable", 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("/") ? "" : "/")), "jobschedules/{jobScheduleId}/enable").ToString(); _url = _url.Replace("{jobScheduleId}", System.Uri.EscapeDataString(jobScheduleId)); - 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 (timeout != null) { - _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(timeout, this.Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(timeout, Client.SerializationSettings).Trim('"')))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _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("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 (clientRequestId != null) { @@ -1957,7 +1965,7 @@ internal JobScheduleOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(clientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("client-request-id", SafeJsonConvert.SerializeObject(clientRequestId, Client.SerializationSettings).Trim('"')); } if (returnClientRequestId != null) { @@ -1965,7 +1973,7 @@ internal JobScheduleOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("return-client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(returnClientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", SafeJsonConvert.SerializeObject(returnClientRequestId, Client.SerializationSettings).Trim('"')); } if (ocpDate != null) { @@ -1973,7 +1981,7 @@ internal JobScheduleOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("ocp-date"); } - _httpRequest.Headers.TryAddWithoutValidation("ocp-date", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ocpDate, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("ocp-date", SafeJsonConvert.SerializeObject(ocpDate, new DateTimeRfc1123JsonConverter()).Trim('"')); } if (ifMatch != null) { @@ -1997,7 +2005,7 @@ internal JobScheduleOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("If-Modified-Since"); } - _httpRequest.Headers.TryAddWithoutValidation("If-Modified-Since", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ifModifiedSince, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("If-Modified-Since", SafeJsonConvert.SerializeObject(ifModifiedSince, new DateTimeRfc1123JsonConverter()).Trim('"')); } if (ifUnmodifiedSince != null) { @@ -2005,7 +2013,7 @@ internal JobScheduleOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("If-Unmodified-Since"); } - _httpRequest.Headers.TryAddWithoutValidation("If-Unmodified-Since", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ifUnmodifiedSince, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("If-Unmodified-Since", SafeJsonConvert.SerializeObject(ifUnmodifiedSince, new DateTimeRfc1123JsonConverter()).Trim('"')); } @@ -2024,23 +2032,23 @@ internal JobScheduleOperations(BatchServiceClient 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 != 204) @@ -2049,21 +2057,21 @@ internal JobScheduleOperations(BatchServiceClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - BatchError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + BatchError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2073,7 +2081,7 @@ internal JobScheduleOperations(BatchServiceClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); + var _result = new AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("request-id")) @@ -2082,20 +2090,20 @@ internal JobScheduleOperations(BatchServiceClient client) } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(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 headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -2118,7 +2126,7 @@ internal JobScheduleOperations(BatchServiceClient client) /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -2127,15 +2135,15 @@ internal JobScheduleOperations(BatchServiceClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> TerminateWithHttpMessagesAsync(string jobScheduleId, JobScheduleTerminateOptions jobScheduleTerminateOptions = default(JobScheduleTerminateOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> TerminateWithHttpMessagesAsync(string jobScheduleId, JobScheduleTerminateOptions jobScheduleTerminateOptions = default(JobScheduleTerminateOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (jobScheduleId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "jobScheduleId"); + throw new ValidationException(ValidationRules.CannotBeNull, "jobScheduleId"); } - 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"); } int? timeout = default(int?); if (jobScheduleTerminateOptions != null) @@ -2178,12 +2186,12 @@ internal JobScheduleOperations(BatchServiceClient client) ifUnmodifiedSince = jobScheduleTerminateOptions.IfUnmodifiedSince; } // 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("jobScheduleId", jobScheduleId); tracingParameters.Add("timeout", timeout); tracingParameters.Add("clientRequestId", clientRequestId); @@ -2194,42 +2202,42 @@ internal JobScheduleOperations(BatchServiceClient client) tracingParameters.Add("ifModifiedSince", ifModifiedSince); tracingParameters.Add("ifUnmodifiedSince", ifUnmodifiedSince); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Terminate", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Terminate", 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("/") ? "" : "/")), "jobschedules/{jobScheduleId}/terminate").ToString(); _url = _url.Replace("{jobScheduleId}", System.Uri.EscapeDataString(jobScheduleId)); - 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 (timeout != null) { - _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(timeout, this.Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(timeout, Client.SerializationSettings).Trim('"')))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _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("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 (clientRequestId != null) { @@ -2237,7 +2245,7 @@ internal JobScheduleOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(clientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("client-request-id", SafeJsonConvert.SerializeObject(clientRequestId, Client.SerializationSettings).Trim('"')); } if (returnClientRequestId != null) { @@ -2245,7 +2253,7 @@ internal JobScheduleOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("return-client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(returnClientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", SafeJsonConvert.SerializeObject(returnClientRequestId, Client.SerializationSettings).Trim('"')); } if (ocpDate != null) { @@ -2253,7 +2261,7 @@ internal JobScheduleOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("ocp-date"); } - _httpRequest.Headers.TryAddWithoutValidation("ocp-date", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ocpDate, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("ocp-date", SafeJsonConvert.SerializeObject(ocpDate, new DateTimeRfc1123JsonConverter()).Trim('"')); } if (ifMatch != null) { @@ -2277,7 +2285,7 @@ internal JobScheduleOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("If-Modified-Since"); } - _httpRequest.Headers.TryAddWithoutValidation("If-Modified-Since", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ifModifiedSince, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("If-Modified-Since", SafeJsonConvert.SerializeObject(ifModifiedSince, new DateTimeRfc1123JsonConverter()).Trim('"')); } if (ifUnmodifiedSince != null) { @@ -2285,7 +2293,7 @@ internal JobScheduleOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("If-Unmodified-Since"); } - _httpRequest.Headers.TryAddWithoutValidation("If-Unmodified-Since", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ifUnmodifiedSince, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("If-Unmodified-Since", SafeJsonConvert.SerializeObject(ifUnmodifiedSince, new DateTimeRfc1123JsonConverter()).Trim('"')); } @@ -2304,23 +2312,23 @@ internal JobScheduleOperations(BatchServiceClient 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 != 202) @@ -2329,21 +2337,21 @@ internal JobScheduleOperations(BatchServiceClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - BatchError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + BatchError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2353,7 +2361,7 @@ internal JobScheduleOperations(BatchServiceClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); + var _result = new AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("request-id")) @@ -2362,20 +2370,20 @@ internal JobScheduleOperations(BatchServiceClient client) } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(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 headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -2398,7 +2406,7 @@ internal JobScheduleOperations(BatchServiceClient client) /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -2407,19 +2415,19 @@ internal JobScheduleOperations(BatchServiceClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> AddWithHttpMessagesAsync(JobScheduleAddParameter cloudJobSchedule, JobScheduleAddOptions jobScheduleAddOptions = default(JobScheduleAddOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> AddWithHttpMessagesAsync(JobScheduleAddParameter cloudJobSchedule, JobScheduleAddOptions jobScheduleAddOptions = default(JobScheduleAddOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (cloudJobSchedule == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "cloudJobSchedule"); + throw new ValidationException(ValidationRules.CannotBeNull, "cloudJobSchedule"); } if (cloudJobSchedule != null) { cloudJobSchedule.Validate(); } - 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"); } int? timeout = default(int?); if (jobScheduleAddOptions != null) @@ -2442,53 +2450,53 @@ internal JobScheduleOperations(BatchServiceClient client) ocpDate = jobScheduleAddOptions.OcpDate; } // 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("cloudJobSchedule", cloudJobSchedule); tracingParameters.Add("timeout", timeout); tracingParameters.Add("clientRequestId", clientRequestId); tracingParameters.Add("returnClientRequestId", returnClientRequestId); tracingParameters.Add("ocpDate", ocpDate); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Add", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Add", 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("/") ? "" : "/")), "jobschedules").ToString(); - 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 (timeout != null) { - _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(timeout, this.Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(timeout, Client.SerializationSettings).Trim('"')))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _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("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 (clientRequestId != null) { @@ -2496,7 +2504,7 @@ internal JobScheduleOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(clientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("client-request-id", SafeJsonConvert.SerializeObject(clientRequestId, Client.SerializationSettings).Trim('"')); } if (returnClientRequestId != null) { @@ -2504,7 +2512,7 @@ internal JobScheduleOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("return-client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(returnClientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", SafeJsonConvert.SerializeObject(returnClientRequestId, Client.SerializationSettings).Trim('"')); } if (ocpDate != null) { @@ -2512,7 +2520,7 @@ internal JobScheduleOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("ocp-date"); } - _httpRequest.Headers.TryAddWithoutValidation("ocp-date", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ocpDate, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("ocp-date", SafeJsonConvert.SerializeObject(ocpDate, new DateTimeRfc1123JsonConverter()).Trim('"')); } @@ -2532,28 +2540,28 @@ internal JobScheduleOperations(BatchServiceClient client) string _requestContent = null; if(cloudJobSchedule != null) { - _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(cloudJobSchedule, this.Client.SerializationSettings); - _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = SafeJsonConvert.SerializeObject(cloudJobSchedule, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; odata=minimalmetadata; 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 != 201) @@ -2562,21 +2570,21 @@ internal JobScheduleOperations(BatchServiceClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - BatchError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + BatchError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2586,7 +2594,7 @@ internal JobScheduleOperations(BatchServiceClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); + var _result = new AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("request-id")) @@ -2595,20 +2603,20 @@ internal JobScheduleOperations(BatchServiceClient client) } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(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 headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -2628,10 +2636,10 @@ internal JobScheduleOperations(BatchServiceClient client) /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -2640,11 +2648,11 @@ internal JobScheduleOperations(BatchServiceClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task,JobScheduleListHeaders>> ListWithHttpMessagesAsync(JobScheduleListOptions jobScheduleListOptions = default(JobScheduleListOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task,JobScheduleListHeaders>> ListWithHttpMessagesAsync(JobScheduleListOptions jobScheduleListOptions = default(JobScheduleListOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - 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"); } string filter = default(string); if (jobScheduleListOptions != null) @@ -2687,12 +2695,12 @@ internal JobScheduleOperations(BatchServiceClient client) ocpDate = jobScheduleListOptions.OcpDate; } // 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("filter", filter); tracingParameters.Add("select", select); tracingParameters.Add("expand", expand); @@ -2702,15 +2710,15 @@ internal JobScheduleOperations(BatchServiceClient client) tracingParameters.Add("returnClientRequestId", returnClientRequestId); tracingParameters.Add("ocpDate", ocpDate); 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("/") ? "" : "/")), "jobschedules").ToString(); - 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 (filter != null) { @@ -2726,33 +2734,33 @@ internal JobScheduleOperations(BatchServiceClient client) } if (maxResults != null) { - _queryParameters.Add(string.Format("maxresults={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(maxResults, this.Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("maxresults={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(maxResults, Client.SerializationSettings).Trim('"')))); } if (timeout != null) { - _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(timeout, this.Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(timeout, Client.SerializationSettings).Trim('"')))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _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("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 (clientRequestId != null) { @@ -2760,7 +2768,7 @@ internal JobScheduleOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(clientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("client-request-id", SafeJsonConvert.SerializeObject(clientRequestId, Client.SerializationSettings).Trim('"')); } if (returnClientRequestId != null) { @@ -2768,7 +2776,7 @@ internal JobScheduleOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("return-client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(returnClientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", SafeJsonConvert.SerializeObject(returnClientRequestId, Client.SerializationSettings).Trim('"')); } if (ocpDate != null) { @@ -2776,7 +2784,7 @@ internal JobScheduleOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("ocp-date"); } - _httpRequest.Headers.TryAddWithoutValidation("ocp-date", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ocpDate, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("ocp-date", SafeJsonConvert.SerializeObject(ocpDate, new DateTimeRfc1123JsonConverter()).Trim('"')); } @@ -2795,23 +2803,23 @@ internal JobScheduleOperations(BatchServiceClient 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) @@ -2820,21 +2828,21 @@ internal JobScheduleOperations(BatchServiceClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - BatchError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + BatchError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2844,7 +2852,7 @@ internal JobScheduleOperations(BatchServiceClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse,JobScheduleListHeaders>(); + var _result = new AzureOperationResponse,JobScheduleListHeaders>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("request-id")) @@ -2857,34 +2865,34 @@ internal JobScheduleOperations(BatchServiceClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = 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); } } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(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 headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -2907,10 +2915,10 @@ internal JobScheduleOperations(BatchServiceClient client) /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -2919,11 +2927,11 @@ internal JobScheduleOperations(BatchServiceClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task,JobScheduleListHeaders>> ListNextWithHttpMessagesAsync(string nextPageLink, JobScheduleListNextOptions jobScheduleListNextOptions = default(JobScheduleListNextOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task,JobScheduleListHeaders>> ListNextWithHttpMessagesAsync(string nextPageLink, JobScheduleListNextOptions jobScheduleListNextOptions = default(JobScheduleListNextOptions), 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"); } System.Guid? clientRequestId = default(System.Guid?); if (jobScheduleListNextOptions != null) @@ -2941,44 +2949,44 @@ internal JobScheduleOperations(BatchServiceClient client) ocpDate = jobScheduleListNextOptions.OcpDate; } // 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("clientRequestId", clientRequestId); tracingParameters.Add("returnClientRequestId", returnClientRequestId); tracingParameters.Add("ocpDate", ocpDate); 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 += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _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("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 (clientRequestId != null) { @@ -2986,7 +2994,7 @@ internal JobScheduleOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(clientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("client-request-id", SafeJsonConvert.SerializeObject(clientRequestId, Client.SerializationSettings).Trim('"')); } if (returnClientRequestId != null) { @@ -2994,7 +3002,7 @@ internal JobScheduleOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("return-client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(returnClientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", SafeJsonConvert.SerializeObject(returnClientRequestId, Client.SerializationSettings).Trim('"')); } if (ocpDate != null) { @@ -3002,7 +3010,7 @@ internal JobScheduleOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("ocp-date"); } - _httpRequest.Headers.TryAddWithoutValidation("ocp-date", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ocpDate, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("ocp-date", SafeJsonConvert.SerializeObject(ocpDate, new DateTimeRfc1123JsonConverter()).Trim('"')); } @@ -3021,23 +3029,23 @@ internal JobScheduleOperations(BatchServiceClient 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) @@ -3046,21 +3054,21 @@ internal JobScheduleOperations(BatchServiceClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - BatchError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + BatchError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -3070,7 +3078,7 @@ internal JobScheduleOperations(BatchServiceClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse,JobScheduleListHeaders>(); + var _result = new AzureOperationResponse,JobScheduleListHeaders>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("request-id")) @@ -3083,37 +3091,37 @@ internal JobScheduleOperations(BatchServiceClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = 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); } } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(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 headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } } -} +} \ No newline at end of file diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/JobScheduleOperationsExtensions.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/JobScheduleOperationsExtensions.cs index 0118572f5ab5..d431dba28655 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/JobScheduleOperationsExtensions.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/JobScheduleOperationsExtensions.cs @@ -8,8 +8,11 @@ namespace Microsoft.Azure.Batch.Protocol { + using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; + using System.Threading; + using System.Threading.Tasks; /// /// Extension methods for JobScheduleOperations. @@ -30,7 +33,7 @@ public static partial class JobScheduleOperationsExtensions /// public static bool Exists(this IJobScheduleOperations operations, string jobScheduleId, JobScheduleExistsOptions jobScheduleExistsOptions = default(JobScheduleExistsOptions)) { - return ((IJobScheduleOperations)operations).ExistsAsync(jobScheduleId, jobScheduleExistsOptions).GetAwaiter().GetResult(); + return operations.ExistsAsync(jobScheduleId, jobScheduleExistsOptions).GetAwaiter().GetResult(); } /// @@ -48,7 +51,7 @@ public static partial class JobScheduleOperationsExtensions /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task ExistsAsync(this IJobScheduleOperations operations, string jobScheduleId, JobScheduleExistsOptions jobScheduleExistsOptions = default(JobScheduleExistsOptions), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task ExistsAsync(this IJobScheduleOperations operations, string jobScheduleId, JobScheduleExistsOptions jobScheduleExistsOptions = default(JobScheduleExistsOptions), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ExistsWithHttpMessagesAsync(jobScheduleId, jobScheduleExistsOptions, null, cancellationToken).ConfigureAwait(false)) { @@ -78,7 +81,7 @@ public static partial class JobScheduleOperationsExtensions /// public static JobScheduleDeleteHeaders Delete(this IJobScheduleOperations operations, string jobScheduleId, JobScheduleDeleteOptions jobScheduleDeleteOptions = default(JobScheduleDeleteOptions)) { - return ((IJobScheduleOperations)operations).DeleteAsync(jobScheduleId, jobScheduleDeleteOptions).GetAwaiter().GetResult(); + return operations.DeleteAsync(jobScheduleId, jobScheduleDeleteOptions).GetAwaiter().GetResult(); } /// @@ -104,7 +107,7 @@ public static partial class JobScheduleOperationsExtensions /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task DeleteAsync(this IJobScheduleOperations operations, string jobScheduleId, JobScheduleDeleteOptions jobScheduleDeleteOptions = default(JobScheduleDeleteOptions), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task DeleteAsync(this IJobScheduleOperations operations, string jobScheduleId, JobScheduleDeleteOptions jobScheduleDeleteOptions = default(JobScheduleDeleteOptions), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.DeleteWithHttpMessagesAsync(jobScheduleId, jobScheduleDeleteOptions, null, cancellationToken).ConfigureAwait(false)) { @@ -126,7 +129,7 @@ public static partial class JobScheduleOperationsExtensions /// public static CloudJobSchedule Get(this IJobScheduleOperations operations, string jobScheduleId, JobScheduleGetOptions jobScheduleGetOptions = default(JobScheduleGetOptions)) { - return ((IJobScheduleOperations)operations).GetAsync(jobScheduleId, jobScheduleGetOptions).GetAwaiter().GetResult(); + return operations.GetAsync(jobScheduleId, jobScheduleGetOptions).GetAwaiter().GetResult(); } /// @@ -144,7 +147,7 @@ public static partial class JobScheduleOperationsExtensions /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task GetAsync(this IJobScheduleOperations operations, string jobScheduleId, JobScheduleGetOptions jobScheduleGetOptions = default(JobScheduleGetOptions), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task GetAsync(this IJobScheduleOperations operations, string jobScheduleId, JobScheduleGetOptions jobScheduleGetOptions = default(JobScheduleGetOptions), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.GetWithHttpMessagesAsync(jobScheduleId, jobScheduleGetOptions, null, cancellationToken).ConfigureAwait(false)) { @@ -176,7 +179,7 @@ public static partial class JobScheduleOperationsExtensions /// public static JobSchedulePatchHeaders Patch(this IJobScheduleOperations operations, string jobScheduleId, JobSchedulePatchParameter jobSchedulePatchParameter, JobSchedulePatchOptions jobSchedulePatchOptions = default(JobSchedulePatchOptions)) { - return ((IJobScheduleOperations)operations).PatchAsync(jobScheduleId, jobSchedulePatchParameter, jobSchedulePatchOptions).GetAwaiter().GetResult(); + return operations.PatchAsync(jobScheduleId, jobSchedulePatchParameter, jobSchedulePatchOptions).GetAwaiter().GetResult(); } /// @@ -204,7 +207,7 @@ public static partial class JobScheduleOperationsExtensions /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task PatchAsync(this IJobScheduleOperations operations, string jobScheduleId, JobSchedulePatchParameter jobSchedulePatchParameter, JobSchedulePatchOptions jobSchedulePatchOptions = default(JobSchedulePatchOptions), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task PatchAsync(this IJobScheduleOperations operations, string jobScheduleId, JobSchedulePatchParameter jobSchedulePatchParameter, JobSchedulePatchOptions jobSchedulePatchOptions = default(JobSchedulePatchOptions), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.PatchWithHttpMessagesAsync(jobScheduleId, jobSchedulePatchParameter, jobSchedulePatchOptions, null, cancellationToken).ConfigureAwait(false)) { @@ -236,7 +239,7 @@ public static partial class JobScheduleOperationsExtensions /// public static JobScheduleUpdateHeaders Update(this IJobScheduleOperations operations, string jobScheduleId, JobScheduleUpdateParameter jobScheduleUpdateParameter, JobScheduleUpdateOptions jobScheduleUpdateOptions = default(JobScheduleUpdateOptions)) { - return ((IJobScheduleOperations)operations).UpdateAsync(jobScheduleId, jobScheduleUpdateParameter, jobScheduleUpdateOptions).GetAwaiter().GetResult(); + return operations.UpdateAsync(jobScheduleId, jobScheduleUpdateParameter, jobScheduleUpdateOptions).GetAwaiter().GetResult(); } /// @@ -264,7 +267,7 @@ public static partial class JobScheduleOperationsExtensions /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task UpdateAsync(this IJobScheduleOperations operations, string jobScheduleId, JobScheduleUpdateParameter jobScheduleUpdateParameter, JobScheduleUpdateOptions jobScheduleUpdateOptions = default(JobScheduleUpdateOptions), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task UpdateAsync(this IJobScheduleOperations operations, string jobScheduleId, JobScheduleUpdateParameter jobScheduleUpdateParameter, JobScheduleUpdateOptions jobScheduleUpdateOptions = default(JobScheduleUpdateOptions), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.UpdateWithHttpMessagesAsync(jobScheduleId, jobScheduleUpdateParameter, jobScheduleUpdateOptions, null, cancellationToken).ConfigureAwait(false)) { @@ -289,7 +292,7 @@ public static partial class JobScheduleOperationsExtensions /// public static JobScheduleDisableHeaders Disable(this IJobScheduleOperations operations, string jobScheduleId, JobScheduleDisableOptions jobScheduleDisableOptions = default(JobScheduleDisableOptions)) { - return ((IJobScheduleOperations)operations).DisableAsync(jobScheduleId, jobScheduleDisableOptions).GetAwaiter().GetResult(); + return operations.DisableAsync(jobScheduleId, jobScheduleDisableOptions).GetAwaiter().GetResult(); } /// @@ -310,7 +313,7 @@ public static partial class JobScheduleOperationsExtensions /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task DisableAsync(this IJobScheduleOperations operations, string jobScheduleId, JobScheduleDisableOptions jobScheduleDisableOptions = default(JobScheduleDisableOptions), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task DisableAsync(this IJobScheduleOperations operations, string jobScheduleId, JobScheduleDisableOptions jobScheduleDisableOptions = default(JobScheduleDisableOptions), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.DisableWithHttpMessagesAsync(jobScheduleId, jobScheduleDisableOptions, null, cancellationToken).ConfigureAwait(false)) { @@ -332,7 +335,7 @@ public static partial class JobScheduleOperationsExtensions /// public static JobScheduleEnableHeaders Enable(this IJobScheduleOperations operations, string jobScheduleId, JobScheduleEnableOptions jobScheduleEnableOptions = default(JobScheduleEnableOptions)) { - return ((IJobScheduleOperations)operations).EnableAsync(jobScheduleId, jobScheduleEnableOptions).GetAwaiter().GetResult(); + return operations.EnableAsync(jobScheduleId, jobScheduleEnableOptions).GetAwaiter().GetResult(); } /// @@ -350,7 +353,7 @@ public static partial class JobScheduleOperationsExtensions /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task EnableAsync(this IJobScheduleOperations operations, string jobScheduleId, JobScheduleEnableOptions jobScheduleEnableOptions = default(JobScheduleEnableOptions), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task EnableAsync(this IJobScheduleOperations operations, string jobScheduleId, JobScheduleEnableOptions jobScheduleEnableOptions = default(JobScheduleEnableOptions), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.EnableWithHttpMessagesAsync(jobScheduleId, jobScheduleEnableOptions, null, cancellationToken).ConfigureAwait(false)) { @@ -372,7 +375,7 @@ public static partial class JobScheduleOperationsExtensions /// public static JobScheduleTerminateHeaders Terminate(this IJobScheduleOperations operations, string jobScheduleId, JobScheduleTerminateOptions jobScheduleTerminateOptions = default(JobScheduleTerminateOptions)) { - return ((IJobScheduleOperations)operations).TerminateAsync(jobScheduleId, jobScheduleTerminateOptions).GetAwaiter().GetResult(); + return operations.TerminateAsync(jobScheduleId, jobScheduleTerminateOptions).GetAwaiter().GetResult(); } /// @@ -390,7 +393,7 @@ public static partial class JobScheduleOperationsExtensions /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task TerminateAsync(this IJobScheduleOperations operations, string jobScheduleId, JobScheduleTerminateOptions jobScheduleTerminateOptions = default(JobScheduleTerminateOptions), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task TerminateAsync(this IJobScheduleOperations operations, string jobScheduleId, JobScheduleTerminateOptions jobScheduleTerminateOptions = default(JobScheduleTerminateOptions), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.TerminateWithHttpMessagesAsync(jobScheduleId, jobScheduleTerminateOptions, null, cancellationToken).ConfigureAwait(false)) { @@ -412,7 +415,7 @@ public static partial class JobScheduleOperationsExtensions /// public static JobScheduleAddHeaders Add(this IJobScheduleOperations operations, JobScheduleAddParameter cloudJobSchedule, JobScheduleAddOptions jobScheduleAddOptions = default(JobScheduleAddOptions)) { - return ((IJobScheduleOperations)operations).AddAsync(cloudJobSchedule, jobScheduleAddOptions).GetAwaiter().GetResult(); + return operations.AddAsync(cloudJobSchedule, jobScheduleAddOptions).GetAwaiter().GetResult(); } /// @@ -430,7 +433,7 @@ public static partial class JobScheduleOperationsExtensions /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task AddAsync(this IJobScheduleOperations operations, JobScheduleAddParameter cloudJobSchedule, JobScheduleAddOptions jobScheduleAddOptions = default(JobScheduleAddOptions), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task AddAsync(this IJobScheduleOperations operations, JobScheduleAddParameter cloudJobSchedule, JobScheduleAddOptions jobScheduleAddOptions = default(JobScheduleAddOptions), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.AddWithHttpMessagesAsync(cloudJobSchedule, jobScheduleAddOptions, null, cancellationToken).ConfigureAwait(false)) { @@ -447,9 +450,9 @@ public static partial class JobScheduleOperationsExtensions /// /// Additional parameters for the operation /// - public static Microsoft.Rest.Azure.IPage List(this IJobScheduleOperations operations, JobScheduleListOptions jobScheduleListOptions = default(JobScheduleListOptions)) + public static IPage List(this IJobScheduleOperations operations, JobScheduleListOptions jobScheduleListOptions = default(JobScheduleListOptions)) { - return ((IJobScheduleOperations)operations).ListAsync(jobScheduleListOptions).GetAwaiter().GetResult(); + return operations.ListAsync(jobScheduleListOptions).GetAwaiter().GetResult(); } /// @@ -464,7 +467,7 @@ public static partial class JobScheduleOperationsExtensions /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListAsync(this IJobScheduleOperations operations, JobScheduleListOptions jobScheduleListOptions = default(JobScheduleListOptions), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task> ListAsync(this IJobScheduleOperations operations, JobScheduleListOptions jobScheduleListOptions = default(JobScheduleListOptions), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListWithHttpMessagesAsync(jobScheduleListOptions, null, cancellationToken).ConfigureAwait(false)) { @@ -484,9 +487,9 @@ public static partial class JobScheduleOperationsExtensions /// /// Additional parameters for the operation /// - public static Microsoft.Rest.Azure.IPage ListNext(this IJobScheduleOperations operations, string nextPageLink, JobScheduleListNextOptions jobScheduleListNextOptions = default(JobScheduleListNextOptions)) + public static IPage ListNext(this IJobScheduleOperations operations, string nextPageLink, JobScheduleListNextOptions jobScheduleListNextOptions = default(JobScheduleListNextOptions)) { - return ((IJobScheduleOperations)operations).ListNextAsync(nextPageLink, jobScheduleListNextOptions).GetAwaiter().GetResult(); + return operations.ListNextAsync(nextPageLink, jobScheduleListNextOptions).GetAwaiter().GetResult(); } /// @@ -504,7 +507,7 @@ public static partial class JobScheduleOperationsExtensions /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListNextAsync(this IJobScheduleOperations operations, string nextPageLink, JobScheduleListNextOptions jobScheduleListNextOptions = default(JobScheduleListNextOptions), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task> ListNextAsync(this IJobScheduleOperations operations, string nextPageLink, JobScheduleListNextOptions jobScheduleListNextOptions = default(JobScheduleListNextOptions), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, jobScheduleListNextOptions, null, cancellationToken).ConfigureAwait(false)) { @@ -513,4 +516,4 @@ public static partial class JobScheduleOperationsExtensions } } -} +} \ No newline at end of file diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/AccessScope.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/AccessScope.cs index 8f07f365b81e..e2a54492b179 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/AccessScope.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/AccessScope.cs @@ -8,14 +8,46 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; /// /// Defines values for AccessScope. /// - [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + [JsonConverter(typeof(StringEnumConverter))] public enum AccessScope { - [System.Runtime.Serialization.EnumMember(Value = "job")] + [EnumMember(Value = "job")] Job } + internal static class AccessScopeEnumExtension + { + internal static string ToSerializedValue(this AccessScope? value) => + value == null ? null : ((AccessScope)value).ToSerializedValue(); + + internal static string ToSerializedValue(this AccessScope value) + { + switch( value ) + { + case AccessScope.Job: + return "job"; + } + return null; + } + + internal static AccessScope? ParseAccessScope(this string value) + { + switch( value ) + { + case "job": + return AccessScope.Job; + } + return null; + } + } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/AccountListNodeAgentSkusHeaders.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/AccountListNodeAgentSkusHeaders.cs index 1cf2c9c9eae0..603151020359 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/AccountListNodeAgentSkusHeaders.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/AccountListNodeAgentSkusHeaders.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -19,7 +25,10 @@ public partial class AccountListNodeAgentSkusHeaders /// Initializes a new instance of the AccountListNodeAgentSkusHeaders /// class. /// - public AccountListNodeAgentSkusHeaders() { } + public AccountListNodeAgentSkusHeaders() + { + CustomInit(); + } /// /// Initializes a new instance of the AccountListNodeAgentSkusHeaders @@ -44,18 +53,24 @@ public AccountListNodeAgentSkusHeaders() { } /// modified. public AccountListNodeAgentSkusHeaders(System.Guid? clientRequestId = default(System.Guid?), System.Guid? requestId = default(System.Guid?), string eTag = default(string), System.DateTime? lastModified = default(System.DateTime?)) { - this.ClientRequestId = clientRequestId; - this.RequestId = requestId; - this.ETag = eTag; - this.LastModified = lastModified; + ClientRequestId = clientRequestId; + RequestId = requestId; + ETag = eTag; + LastModified = lastModified; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the client-request-id provided by the client during /// the request. This will be returned only if the /// return-client-request-id parameter was set to true. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "client-request-id")] + [JsonProperty(PropertyName = "client-request-id")] public System.Guid? ClientRequestId { get; set; } /// @@ -67,7 +82,7 @@ public AccountListNodeAgentSkusHeaders() { } /// request was made, the Batch account against which the request was /// made, and the region that account resides in. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "request-id")] + [JsonProperty(PropertyName = "request-id")] public System.Guid? RequestId { get; set; } /// @@ -77,14 +92,14 @@ public AccountListNodeAgentSkusHeaders() { } /// the If-Modified-Since, If-Unmodified-Since, If-Match or /// If-None-Match headers. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "ETag")] + [JsonProperty(PropertyName = "ETag")] public string ETag { get; set; } /// /// Gets or sets the time at which the resource was last modified. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "Last-Modified")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "Last-Modified")] public System.DateTime? LastModified { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/AccountListNodeAgentSkusNextOptions.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/AccountListNodeAgentSkusNextOptions.cs index 39a0955a43ba..28719b1897b7 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/AccountListNodeAgentSkusNextOptions.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/AccountListNodeAgentSkusNextOptions.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -19,7 +25,10 @@ public partial class AccountListNodeAgentSkusNextOptions /// Initializes a new instance of the /// AccountListNodeAgentSkusNextOptions class. /// - public AccountListNodeAgentSkusNextOptions() { } + public AccountListNodeAgentSkusNextOptions() + { + CustomInit(); + } /// /// Initializes a new instance of the @@ -35,24 +44,30 @@ public AccountListNodeAgentSkusNextOptions() { } /// it explicitly if you are calling the REST API directly. public AccountListNodeAgentSkusNextOptions(System.Guid? clientRequestId = default(System.Guid?), bool? returnClientRequestId = default(bool?), System.DateTime? ocpDate = default(System.DateTime?)) { - this.ClientRequestId = clientRequestId; - this.ReturnClientRequestId = returnClientRequestId; - this.OcpDate = ocpDate; + ClientRequestId = clientRequestId; + ReturnClientRequestId = returnClientRequestId; + OcpDate = ocpDate; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the caller-generated request identity, in the form of /// a GUID with no decoration such as curly braces, e.g. /// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public System.Guid? ClientRequestId { get; set; } /// /// Gets or sets whether the server should return the client-request-id /// in the response. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public bool? ReturnClientRequestId { get; set; } /// @@ -60,8 +75,8 @@ public AccountListNodeAgentSkusNextOptions() { } /// typically set this to the current system clock time; set it /// explicitly if you are calling the REST API directly. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? OcpDate { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/AccountListNodeAgentSkusOptions.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/AccountListNodeAgentSkusOptions.cs index 6bf7af2f40e2..218da9ab7a8d 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/AccountListNodeAgentSkusOptions.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/AccountListNodeAgentSkusOptions.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -19,7 +25,10 @@ public partial class AccountListNodeAgentSkusOptions /// Initializes a new instance of the AccountListNodeAgentSkusOptions /// class. /// - public AccountListNodeAgentSkusOptions() { } + public AccountListNodeAgentSkusOptions() + { + CustomInit(); + } /// /// Initializes a new instance of the AccountListNodeAgentSkusOptions @@ -41,32 +50,38 @@ public AccountListNodeAgentSkusOptions() { } /// it explicitly if you are calling the REST API directly. public AccountListNodeAgentSkusOptions(string filter = default(string), int? maxResults = default(int?), int? timeout = default(int?), System.Guid? clientRequestId = default(System.Guid?), bool? returnClientRequestId = default(bool?), System.DateTime? ocpDate = default(System.DateTime?)) { - this.Filter = filter; - this.MaxResults = maxResults; - this.Timeout = timeout; - this.ClientRequestId = clientRequestId; - this.ReturnClientRequestId = returnClientRequestId; - this.OcpDate = ocpDate; + Filter = filter; + MaxResults = maxResults; + Timeout = timeout; + ClientRequestId = clientRequestId; + ReturnClientRequestId = returnClientRequestId; + OcpDate = ocpDate; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets an OData $filter clause. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public string Filter { get; set; } /// /// Gets or sets the maximum number of items to return in the response. /// A maximum of 1000 results will be returned. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public int? MaxResults { get; set; } /// /// Gets or sets the maximum time that the server can spend processing /// the request, in seconds. The default is 30 seconds. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public int? Timeout { get; set; } /// @@ -74,14 +89,14 @@ public AccountListNodeAgentSkusOptions() { } /// a GUID with no decoration such as curly braces, e.g. /// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public System.Guid? ClientRequestId { get; set; } /// /// Gets or sets whether the server should return the client-request-id /// in the response. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public bool? ReturnClientRequestId { get; set; } /// @@ -89,8 +104,8 @@ public AccountListNodeAgentSkusOptions() { } /// typically set this to the current system clock time; set it /// explicitly if you are calling the REST API directly. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? OcpDate { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/AffinityInformation.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/AffinityInformation.cs index 5f7233c2a3f6..1a600275befc 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/AffinityInformation.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/AffinityInformation.cs @@ -8,6 +8,11 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Newtonsoft.Json; using System.Linq; /// @@ -19,7 +24,10 @@ public partial class AffinityInformation /// /// Initializes a new instance of the AffinityInformation class. /// - public AffinityInformation() { } + public AffinityInformation() + { + CustomInit(); + } /// /// Initializes a new instance of the AffinityInformation class. @@ -28,31 +36,40 @@ public AffinityInformation() { } /// of a compute node or a task that has run previously. public AffinityInformation(string affinityId) { - this.AffinityId = affinityId; + AffinityId = affinityId; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets an opaque string representing the location of a /// compute node or a task that has run previously. /// /// - /// You can pass the affinityId of a compute node or task to indicate - /// that this task needs to be placed close to the node or task. + /// You can pass the affinityId of a compute node to indicate that this + /// task needs to run on that compute node. Note that this is just a + /// soft affinity. If the target node is busy or unavailable at the + /// time the task is scheduled, then the task will be scheduled + /// elsewhere. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "affinityId")] + [JsonProperty(PropertyName = "affinityId")] public string AffinityId { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (this.AffinityId == null) + if (AffinityId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "AffinityId"); + throw new ValidationException(ValidationRules.CannotBeNull, "AffinityId"); } } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/AllocationState.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/AllocationState.cs index 61084084d9b9..9176a1279e9c 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/AllocationState.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/AllocationState.cs @@ -8,18 +8,58 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; /// /// Defines values for AllocationState. /// - [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + [JsonConverter(typeof(StringEnumConverter))] public enum AllocationState { - [System.Runtime.Serialization.EnumMember(Value = "steady")] + [EnumMember(Value = "steady")] Steady, - [System.Runtime.Serialization.EnumMember(Value = "resizing")] + [EnumMember(Value = "resizing")] Resizing, - [System.Runtime.Serialization.EnumMember(Value = "stopping")] + [EnumMember(Value = "stopping")] Stopping } + internal static class AllocationStateEnumExtension + { + internal static string ToSerializedValue(this AllocationState? value) => + value == null ? null : ((AllocationState)value).ToSerializedValue(); + + internal static string ToSerializedValue(this AllocationState value) + { + switch( value ) + { + case AllocationState.Steady: + return "steady"; + case AllocationState.Resizing: + return "resizing"; + case AllocationState.Stopping: + return "stopping"; + } + return null; + } + + internal static AllocationState? ParseAllocationState(this string value) + { + switch( value ) + { + case "steady": + return AllocationState.Steady; + case "resizing": + return AllocationState.Resizing; + case "stopping": + return AllocationState.Stopping; + } + return null; + } + } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ApplicationGetHeaders.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ApplicationGetHeaders.cs index a828a9649020..134bbdfb2951 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ApplicationGetHeaders.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ApplicationGetHeaders.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class ApplicationGetHeaders /// /// Initializes a new instance of the ApplicationGetHeaders class. /// - public ApplicationGetHeaders() { } + public ApplicationGetHeaders() + { + CustomInit(); + } /// /// Initializes a new instance of the ApplicationGetHeaders class. @@ -42,18 +51,24 @@ public ApplicationGetHeaders() { } /// modified. public ApplicationGetHeaders(System.Guid? clientRequestId = default(System.Guid?), System.Guid? requestId = default(System.Guid?), string eTag = default(string), System.DateTime? lastModified = default(System.DateTime?)) { - this.ClientRequestId = clientRequestId; - this.RequestId = requestId; - this.ETag = eTag; - this.LastModified = lastModified; + ClientRequestId = clientRequestId; + RequestId = requestId; + ETag = eTag; + LastModified = lastModified; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the client-request-id provided by the client during /// the request. This will be returned only if the /// return-client-request-id parameter was set to true. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "client-request-id")] + [JsonProperty(PropertyName = "client-request-id")] public System.Guid? ClientRequestId { get; set; } /// @@ -65,7 +80,7 @@ public ApplicationGetHeaders() { } /// request was made, the Batch account against which the request was /// made, and the region that account resides in. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "request-id")] + [JsonProperty(PropertyName = "request-id")] public System.Guid? RequestId { get; set; } /// @@ -75,14 +90,14 @@ public ApplicationGetHeaders() { } /// the If-Modified-Since, If-Unmodified-Since, If-Match or /// If-None-Match headers. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "ETag")] + [JsonProperty(PropertyName = "ETag")] public string ETag { get; set; } /// /// Gets or sets the time at which the resource was last modified. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "Last-Modified")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "Last-Modified")] public System.DateTime? LastModified { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ApplicationGetOptions.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ApplicationGetOptions.cs index e714dd3fea61..a89a4a99a243 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ApplicationGetOptions.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ApplicationGetOptions.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class ApplicationGetOptions /// /// Initializes a new instance of the ApplicationGetOptions class. /// - public ApplicationGetOptions() { } + public ApplicationGetOptions() + { + CustomInit(); + } /// /// Initializes a new instance of the ApplicationGetOptions class. @@ -36,17 +45,23 @@ public ApplicationGetOptions() { } /// it explicitly if you are calling the REST API directly. public ApplicationGetOptions(int? timeout = default(int?), System.Guid? clientRequestId = default(System.Guid?), bool? returnClientRequestId = default(bool?), System.DateTime? ocpDate = default(System.DateTime?)) { - this.Timeout = timeout; - this.ClientRequestId = clientRequestId; - this.ReturnClientRequestId = returnClientRequestId; - this.OcpDate = ocpDate; + Timeout = timeout; + ClientRequestId = clientRequestId; + ReturnClientRequestId = returnClientRequestId; + OcpDate = ocpDate; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the maximum time that the server can spend processing /// the request, in seconds. The default is 30 seconds. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public int? Timeout { get; set; } /// @@ -54,14 +69,14 @@ public ApplicationGetOptions() { } /// a GUID with no decoration such as curly braces, e.g. /// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public System.Guid? ClientRequestId { get; set; } /// /// Gets or sets whether the server should return the client-request-id /// in the response. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public bool? ReturnClientRequestId { get; set; } /// @@ -69,8 +84,8 @@ public ApplicationGetOptions() { } /// typically set this to the current system clock time; set it /// explicitly if you are calling the REST API directly. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? OcpDate { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ApplicationListHeaders.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ApplicationListHeaders.cs index ea835ed8306a..eb9ca04b397e 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ApplicationListHeaders.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ApplicationListHeaders.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class ApplicationListHeaders /// /// Initializes a new instance of the ApplicationListHeaders class. /// - public ApplicationListHeaders() { } + public ApplicationListHeaders() + { + CustomInit(); + } /// /// Initializes a new instance of the ApplicationListHeaders class. @@ -42,18 +51,24 @@ public ApplicationListHeaders() { } /// modified. public ApplicationListHeaders(System.Guid? clientRequestId = default(System.Guid?), System.Guid? requestId = default(System.Guid?), string eTag = default(string), System.DateTime? lastModified = default(System.DateTime?)) { - this.ClientRequestId = clientRequestId; - this.RequestId = requestId; - this.ETag = eTag; - this.LastModified = lastModified; + ClientRequestId = clientRequestId; + RequestId = requestId; + ETag = eTag; + LastModified = lastModified; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the client-request-id provided by the client during /// the request. This will be returned only if the /// return-client-request-id parameter was set to true. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "client-request-id")] + [JsonProperty(PropertyName = "client-request-id")] public System.Guid? ClientRequestId { get; set; } /// @@ -65,7 +80,7 @@ public ApplicationListHeaders() { } /// request was made, the Batch account against which the request was /// made, and the region that account resides in. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "request-id")] + [JsonProperty(PropertyName = "request-id")] public System.Guid? RequestId { get; set; } /// @@ -75,14 +90,14 @@ public ApplicationListHeaders() { } /// the If-Modified-Since, If-Unmodified-Since, If-Match or /// If-None-Match headers. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "ETag")] + [JsonProperty(PropertyName = "ETag")] public string ETag { get; set; } /// /// Gets or sets the time at which the resource was last modified. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "Last-Modified")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "Last-Modified")] public System.DateTime? LastModified { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ApplicationListNextOptions.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ApplicationListNextOptions.cs index 1d73879f621b..05f558f13d10 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ApplicationListNextOptions.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ApplicationListNextOptions.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class ApplicationListNextOptions /// /// Initializes a new instance of the ApplicationListNextOptions class. /// - public ApplicationListNextOptions() { } + public ApplicationListNextOptions() + { + CustomInit(); + } /// /// Initializes a new instance of the ApplicationListNextOptions class. @@ -33,24 +42,30 @@ public ApplicationListNextOptions() { } /// it explicitly if you are calling the REST API directly. public ApplicationListNextOptions(System.Guid? clientRequestId = default(System.Guid?), bool? returnClientRequestId = default(bool?), System.DateTime? ocpDate = default(System.DateTime?)) { - this.ClientRequestId = clientRequestId; - this.ReturnClientRequestId = returnClientRequestId; - this.OcpDate = ocpDate; + ClientRequestId = clientRequestId; + ReturnClientRequestId = returnClientRequestId; + OcpDate = ocpDate; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the caller-generated request identity, in the form of /// a GUID with no decoration such as curly braces, e.g. /// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public System.Guid? ClientRequestId { get; set; } /// /// Gets or sets whether the server should return the client-request-id /// in the response. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public bool? ReturnClientRequestId { get; set; } /// @@ -58,8 +73,8 @@ public ApplicationListNextOptions() { } /// typically set this to the current system clock time; set it /// explicitly if you are calling the REST API directly. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? OcpDate { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ApplicationListOptions.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ApplicationListOptions.cs index afd99c4d957c..eb8faf51fb14 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ApplicationListOptions.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ApplicationListOptions.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class ApplicationListOptions /// /// Initializes a new instance of the ApplicationListOptions class. /// - public ApplicationListOptions() { } + public ApplicationListOptions() + { + CustomInit(); + } /// /// Initializes a new instance of the ApplicationListOptions class. @@ -39,25 +48,31 @@ public ApplicationListOptions() { } /// it explicitly if you are calling the REST API directly. public ApplicationListOptions(int? maxResults = default(int?), int? timeout = default(int?), System.Guid? clientRequestId = default(System.Guid?), bool? returnClientRequestId = default(bool?), System.DateTime? ocpDate = default(System.DateTime?)) { - this.MaxResults = maxResults; - this.Timeout = timeout; - this.ClientRequestId = clientRequestId; - this.ReturnClientRequestId = returnClientRequestId; - this.OcpDate = ocpDate; + MaxResults = maxResults; + Timeout = timeout; + ClientRequestId = clientRequestId; + ReturnClientRequestId = returnClientRequestId; + OcpDate = ocpDate; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the maximum number of items to return in the response. /// A maximum of 1000 applications can be returned. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public int? MaxResults { get; set; } /// /// Gets or sets the maximum time that the server can spend processing /// the request, in seconds. The default is 30 seconds. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public int? Timeout { get; set; } /// @@ -65,14 +80,14 @@ public ApplicationListOptions() { } /// a GUID with no decoration such as curly braces, e.g. /// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public System.Guid? ClientRequestId { get; set; } /// /// Gets or sets whether the server should return the client-request-id /// in the response. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public bool? ReturnClientRequestId { get; set; } /// @@ -80,8 +95,8 @@ public ApplicationListOptions() { } /// typically set this to the current system clock time; set it /// explicitly if you are calling the REST API directly. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? OcpDate { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ApplicationPackageReference.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ApplicationPackageReference.cs index d2dd2a032258..5ceb43d84f0e 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ApplicationPackageReference.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ApplicationPackageReference.cs @@ -8,6 +8,11 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Newtonsoft.Json; using System.Linq; /// @@ -19,7 +24,10 @@ public partial class ApplicationPackageReference /// Initializes a new instance of the ApplicationPackageReference /// class. /// - public ApplicationPackageReference() { } + public ApplicationPackageReference() + { + CustomInit(); + } /// /// Initializes a new instance of the ApplicationPackageReference @@ -31,14 +39,20 @@ public ApplicationPackageReference() { } /// omitted, the default version is deployed. public ApplicationPackageReference(string applicationId, string version = default(string)) { - this.ApplicationId = applicationId; - this.Version = version; + ApplicationId = applicationId; + Version = version; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the ID of the application to deploy. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "applicationId")] + [JsonProperty(PropertyName = "applicationId")] public string ApplicationId { get; set; } /// @@ -46,25 +60,26 @@ public ApplicationPackageReference() { } /// the default version is deployed. /// /// - /// If this is omitted, and no default version is specified for this - /// application, the request fails with the error code - /// InvalidApplicationPackageReferences. If you are calling the REST - /// API directly, the HTTP status code is 409. + /// If this is omitted on a pool, and no default version is specified + /// for this application, the request fails with the error code + /// InvalidApplicationPackageReferences and HTTP status code 409. If + /// this is omitted on a task, and no default version is specified for + /// this application, the task fails with a pre-processing error. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "version")] + [JsonProperty(PropertyName = "version")] public string Version { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (this.ApplicationId == null) + if (ApplicationId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "ApplicationId"); + throw new ValidationException(ValidationRules.CannotBeNull, "ApplicationId"); } } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ApplicationSummary.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ApplicationSummary.cs index 914e4b2052f0..f41bc96412ce 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ApplicationSummary.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ApplicationSummary.cs @@ -8,6 +8,13 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// @@ -18,7 +25,10 @@ public partial class ApplicationSummary /// /// Initializes a new instance of the ApplicationSummary class. /// - public ApplicationSummary() { } + public ApplicationSummary() + { + CustomInit(); + } /// /// Initializes a new instance of the ApplicationSummary class. @@ -27,53 +37,59 @@ public ApplicationSummary() { } /// within the account. /// The display name for the /// application. - /// The versions of the application which are - /// available. - public ApplicationSummary(string id, string displayName, System.Collections.Generic.IList versions) + /// The list of available versions of the + /// application. + public ApplicationSummary(string id, string displayName, IList versions) { - this.Id = id; - this.DisplayName = displayName; - this.Versions = versions; + Id = id; + DisplayName = displayName; + Versions = versions; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets a string that uniquely identifies the application /// within the account. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + [JsonProperty(PropertyName = "id")] public string Id { get; set; } /// /// Gets or sets the display name for the application. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "displayName")] + [JsonProperty(PropertyName = "displayName")] public string DisplayName { get; set; } /// - /// Gets or sets the versions of the application which are available. + /// Gets or sets the list of available versions of the application. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "versions")] - public System.Collections.Generic.IList Versions { get; set; } + [JsonProperty(PropertyName = "versions")] + public IList Versions { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (this.Id == null) + if (Id == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Id"); + throw new ValidationException(ValidationRules.CannotBeNull, "Id"); } - if (this.DisplayName == null) + if (DisplayName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "DisplayName"); + throw new ValidationException(ValidationRules.CannotBeNull, "DisplayName"); } - if (this.Versions == null) + if (Versions == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Versions"); + throw new ValidationException(ValidationRules.CannotBeNull, "Versions"); } } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/AuthenticationTokenSettings.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/AuthenticationTokenSettings.cs index 84560921f3a0..8f54efcbb48a 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/AuthenticationTokenSettings.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/AuthenticationTokenSettings.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// @@ -20,7 +26,10 @@ public partial class AuthenticationTokenSettings /// Initializes a new instance of the AuthenticationTokenSettings /// class. /// - public AuthenticationTokenSettings() { } + public AuthenticationTokenSettings() + { + CustomInit(); + } /// /// Initializes a new instance of the AuthenticationTokenSettings @@ -28,11 +37,17 @@ public AuthenticationTokenSettings() { } /// /// The Batch resources to which the token grants /// access. - public AuthenticationTokenSettings(System.Collections.Generic.IList access = default(System.Collections.Generic.IList)) + public AuthenticationTokenSettings(IList access = default(IList)) { - this.Access = access; + Access = access; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the Batch resources to which the token grants access. /// @@ -42,8 +57,8 @@ public AuthenticationTokenSettings() { } /// access property is 'job', which grants access to all operations /// related to the job which contains the task. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "access")] - public System.Collections.Generic.IList Access { get; set; } + [JsonProperty(PropertyName = "access")] + public IList Access { get; set; } } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/AutoPoolSpecification.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/AutoPoolSpecification.cs index 0be6110d17da..053159057107 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/AutoPoolSpecification.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/AutoPoolSpecification.cs @@ -8,6 +8,10 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; using System.Linq; /// @@ -19,7 +23,10 @@ public partial class AutoPoolSpecification /// /// Initializes a new instance of the AutoPoolSpecification class. /// - public AutoPoolSpecification() { } + public AutoPoolSpecification() + { + CustomInit(); + } /// /// Initializes a new instance of the AutoPoolSpecification class. @@ -35,12 +42,18 @@ public AutoPoolSpecification() { } /// pool. public AutoPoolSpecification(PoolLifetimeOption poolLifetimeOption, string autoPoolIdPrefix = default(string), bool? keepAlive = default(bool?), PoolSpecification pool = default(PoolSpecification)) { - this.AutoPoolIdPrefix = autoPoolIdPrefix; - this.PoolLifetimeOption = poolLifetimeOption; - this.KeepAlive = keepAlive; - this.Pool = pool; + AutoPoolIdPrefix = autoPoolIdPrefix; + PoolLifetimeOption = poolLifetimeOption; + KeepAlive = keepAlive; + Pool = pool; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets a prefix to be added to the unique identifier when a /// pool is automatically created. @@ -48,10 +61,10 @@ public AutoPoolSpecification() { } /// /// The Batch service assigns each auto pool a unique identifier on /// creation. To distinguish between pools created for different - /// purposes, you can specify this element to add a prefix to the id + /// purposes, you can specify this element to add a prefix to the ID /// that is assigned. The prefix can be up to 20 characters long. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "autoPoolIdPrefix")] + [JsonProperty(PropertyName = "autoPoolIdPrefix")] public string AutoPoolIdPrefix { get; set; } /// @@ -59,14 +72,17 @@ public AutoPoolSpecification() { } /// multiple jobs on a schedule are assigned to pools. /// /// - /// When the pool lifetime scope is jobSchedule level, the Batch - /// service keeps track of the last autopool created for the job - /// schedule, and deletes that pool when the job schedule completes. - /// Batch will also delete this pool if the user updates the auto pool - /// specification in a way that changes this lifetime. Possible values - /// include: 'jobSchedule', 'job' + /// When the pool lifetime is jobSchedule the pool exists for the + /// lifetime of the job schedule. The Batch Service creates the pool + /// when it creates the first job on the schedule. You may apply this + /// option only to job schedules, not to jobs. When the pool lifetime + /// is job the pool exists for the lifetime of the job to which it is + /// dedicated. The Batch service creates the pool when it creates the + /// job. If the 'job' option is applied to a job schedule, the Batch + /// service creates a new auto pool for every job created on the + /// schedule. Possible values include: 'jobSchedule', 'job' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "poolLifetimeOption")] + [JsonProperty(PropertyName = "poolLifetimeOption")] public PoolLifetimeOption PoolLifetimeOption { get; set; } /// @@ -80,26 +96,26 @@ public AutoPoolSpecification() { } /// does not delete the pool automatically. It is up to the user to /// delete auto pools created with this option. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "keepAlive")] + [JsonProperty(PropertyName = "keepAlive")] public bool? KeepAlive { get; set; } /// /// Gets or sets the pool specification for the auto pool. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "pool")] + [JsonProperty(PropertyName = "pool")] public PoolSpecification Pool { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (this.Pool != null) + if (Pool != null) { - this.Pool.Validate(); + Pool.Validate(); } } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/AutoScaleRun.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/AutoScaleRun.cs index 9bb0f538f7ca..45d383351e2e 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/AutoScaleRun.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/AutoScaleRun.cs @@ -8,6 +8,10 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +22,10 @@ public partial class AutoScaleRun /// /// Initializes a new instance of the AutoScaleRun class. /// - public AutoScaleRun() { } + public AutoScaleRun() + { + CustomInit(); + } /// /// Initializes a new instance of the AutoScaleRun class. @@ -32,16 +39,22 @@ public AutoScaleRun() { } /// unsuccessful. public AutoScaleRun(System.DateTime timestamp, string results = default(string), AutoScaleRunError error = default(AutoScaleRunError)) { - this.Timestamp = timestamp; - this.Results = results; - this.Error = error; + Timestamp = timestamp; + Results = results; + Error = error; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the time at which the autoscale formula was last /// evaluated. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "timestamp")] + [JsonProperty(PropertyName = "timestamp")] public System.DateTime Timestamp { get; set; } /// @@ -52,20 +65,20 @@ public AutoScaleRun() { } /// Each variable value is returned in the form $variable=value, and /// variables are separated by semicolons. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "results")] + [JsonProperty(PropertyName = "results")] public string Results { get; set; } /// /// Gets or sets details of the error encountered evaluating the /// autoscale formula on the pool, if the evaluation was unsuccessful. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "error")] + [JsonProperty(PropertyName = "error")] public AutoScaleRunError Error { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/AutoScaleRunError.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/AutoScaleRunError.cs index f53e73e9b0f4..01edff3321c5 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/AutoScaleRunError.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/AutoScaleRunError.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// @@ -19,7 +25,10 @@ public partial class AutoScaleRunError /// /// Initializes a new instance of the AutoScaleRunError class. /// - public AutoScaleRunError() { } + public AutoScaleRunError() + { + CustomInit(); + } /// /// Initializes a new instance of the AutoScaleRunError class. @@ -30,33 +39,39 @@ public AutoScaleRunError() { } /// intended to be suitable for display in a user interface. /// A list of additional error details related to /// the autoscale error. - public AutoScaleRunError(string code = default(string), string message = default(string), System.Collections.Generic.IList values = default(System.Collections.Generic.IList)) + public AutoScaleRunError(string code = default(string), string message = default(string), IList values = default(IList)) { - this.Code = code; - this.Message = message; - this.Values = values; + Code = code; + Message = message; + Values = values; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets an identifier for the autoscale error. Codes are /// invariant and are intended to be consumed programmatically. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "code")] + [JsonProperty(PropertyName = "code")] public string Code { get; set; } /// /// Gets or sets a message describing the autoscale error, intended to /// be suitable for display in a user interface. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "message")] + [JsonProperty(PropertyName = "message")] public string Message { get; set; } /// /// Gets or sets a list of additional error details related to the /// autoscale error. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "values")] - public System.Collections.Generic.IList Values { get; set; } + [JsonProperty(PropertyName = "values")] + public IList Values { get; set; } } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/AutoUserScope.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/AutoUserScope.cs index 04113024772a..658580bfa86c 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/AutoUserScope.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/AutoUserScope.cs @@ -8,16 +8,52 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; /// /// Defines values for AutoUserScope. /// - [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + [JsonConverter(typeof(StringEnumConverter))] public enum AutoUserScope { - [System.Runtime.Serialization.EnumMember(Value = "task")] + [EnumMember(Value = "task")] Task, - [System.Runtime.Serialization.EnumMember(Value = "pool")] + [EnumMember(Value = "pool")] Pool } + internal static class AutoUserScopeEnumExtension + { + internal static string ToSerializedValue(this AutoUserScope? value) => + value == null ? null : ((AutoUserScope)value).ToSerializedValue(); + + internal static string ToSerializedValue(this AutoUserScope value) + { + switch( value ) + { + case AutoUserScope.Task: + return "task"; + case AutoUserScope.Pool: + return "pool"; + } + return null; + } + + internal static AutoUserScope? ParseAutoUserScope(this string value) + { + switch( value ) + { + case "task": + return AutoUserScope.Task; + case "pool": + return AutoUserScope.Pool; + } + return null; + } + } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/AutoUserSpecification.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/AutoUserSpecification.cs index f50d18197433..901bebffd13d 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/AutoUserSpecification.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/AutoUserSpecification.cs @@ -8,6 +8,10 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; using System.Linq; /// @@ -19,7 +23,10 @@ public partial class AutoUserSpecification /// /// Initializes a new instance of the AutoUserSpecification class. /// - public AutoUserSpecification() { } + public AutoUserSpecification() + { + CustomInit(); + } /// /// Initializes a new instance of the AutoUserSpecification class. @@ -29,20 +36,29 @@ public AutoUserSpecification() { } /// user. public AutoUserSpecification(AutoUserScope? scope = default(AutoUserScope?), ElevationLevel? elevationLevel = default(ElevationLevel?)) { - this.Scope = scope; - this.ElevationLevel = elevationLevel; + Scope = scope; + ElevationLevel = elevationLevel; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the scope for the auto user /// /// + /// Values are: + /// /// pool - specifies that the task runs as the common auto user account - /// which is created on every node in a pool. task - specifies that the - /// service should create a new user for the task. The default value is - /// task. Possible values include: 'task', 'pool' + /// which is created on every node in a pool. + /// task - specifies that the service should create a new user for the + /// task. + /// The default value is task. Possible values include: 'task', 'pool' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "scope")] + [JsonProperty(PropertyName = "scope")] public AutoUserScope? Scope { get; set; } /// @@ -54,7 +70,7 @@ public AutoUserSpecification() { } /// operates with full Administrator permissions. The default value is /// nonAdmin. Possible values include: 'nonAdmin', 'admin' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "elevationLevel")] + [JsonProperty(PropertyName = "elevationLevel")] public ElevationLevel? ElevationLevel { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/BatchError.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/BatchError.cs index 839c3380ea9d..66871e3bd94f 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/BatchError.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/BatchError.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class BatchError /// /// Initializes a new instance of the BatchError class. /// - public BatchError() { } + public BatchError() + { + CustomInit(); + } /// /// Initializes a new instance of the BatchError class. @@ -29,33 +38,39 @@ public BatchError() { } /// be suitable for display in a user interface. /// A collection of key-value pairs containing /// additional details about the error. - public BatchError(string code = default(string), ErrorMessage message = default(ErrorMessage), System.Collections.Generic.IList values = default(System.Collections.Generic.IList)) + public BatchError(string code = default(string), ErrorMessage message = default(ErrorMessage), IList values = default(IList)) { - this.Code = code; - this.Message = message; - this.Values = values; + Code = code; + Message = message; + Values = values; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets an identifier for the error. Codes are invariant and /// are intended to be consumed programmatically. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "code")] + [JsonProperty(PropertyName = "code")] public string Code { get; set; } /// /// Gets or sets a message describing the error, intended to be /// suitable for display in a user interface. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "message")] + [JsonProperty(PropertyName = "message")] public ErrorMessage Message { get; set; } /// /// Gets or sets a collection of key-value pairs containing additional /// details about the error. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "values")] - public System.Collections.Generic.IList Values { get; set; } + [JsonProperty(PropertyName = "values")] + public IList Values { get; set; } } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/BatchErrorDetail.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/BatchErrorDetail.cs index 133a77ff62a2..426bdab0b868 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/BatchErrorDetail.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/BatchErrorDetail.cs @@ -8,6 +8,10 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; using System.Linq; /// @@ -19,7 +23,10 @@ public partial class BatchErrorDetail /// /// Initializes a new instance of the BatchErrorDetail class. /// - public BatchErrorDetail() { } + public BatchErrorDetail() + { + CustomInit(); + } /// /// Initializes a new instance of the BatchErrorDetail class. @@ -30,22 +37,28 @@ public BatchErrorDetail() { } /// error response. public BatchErrorDetail(string key = default(string), string value = default(string)) { - this.Key = key; - this.Value = value; + Key = key; + Value = value; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets an identifier specifying the meaning of the Value /// property. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "key")] + [JsonProperty(PropertyName = "key")] public string Key { get; set; } /// /// Gets or sets the additional information included with the error /// response. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "value")] + [JsonProperty(PropertyName = "value")] public string Value { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/BatchErrorException.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/BatchErrorException.cs index 2ce944bd0d26..b987b29ffd59 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/BatchErrorException.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/BatchErrorException.cs @@ -8,24 +8,25 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; /// /// Exception thrown for an invalid response with BatchError information. /// -#if !PORTABLE - [System.Serializable] -#endif - public class BatchErrorException : Microsoft.Rest.RestException + public class BatchErrorException : RestException { /// /// Gets information about the associated HTTP request. /// - public Microsoft.Rest.HttpRequestMessageWrapper Request { get; set; } + public HttpRequestMessageWrapper Request { get; set; } /// /// Gets information about the associated HTTP response. /// - public Microsoft.Rest.HttpResponseMessageWrapper Response { get; set; } + public HttpResponseMessageWrapper Response { get; set; } /// /// Gets or sets the body object. @@ -57,39 +58,5 @@ public BatchErrorException(string message, System.Exception innerException) : base(message, innerException) { } - -#if !PORTABLE - /// - /// Initializes a new instance of the BatchErrorException class. - /// - /// Serialization info. - /// Streaming context. - protected BatchErrorException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) - : base(info, context) - { - } - - /// - /// Serializes content of the exception. - /// - /// Serialization info. - /// Streaming context. - /// - /// Thrown when a required parameter is null - /// - [System.Security.Permissions.SecurityPermission(System.Security.Permissions.SecurityAction.Demand, SerializationFormatter = true)] - public override void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) - { - base.GetObjectData(info, context); - if (info == null) - { - throw new System.ArgumentNullException("info"); - } - - info.AddValue("Request", Request); - info.AddValue("Response", Response); - info.AddValue("Body", Body); - } -#endif } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/CachingType.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/CachingType.cs index 2cfe1af97ab0..9791085aa1fb 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/CachingType.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/CachingType.cs @@ -8,18 +8,58 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; /// /// Defines values for CachingType. /// - [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + [JsonConverter(typeof(StringEnumConverter))] public enum CachingType { - [System.Runtime.Serialization.EnumMember(Value = "none")] + [EnumMember(Value = "none")] None, - [System.Runtime.Serialization.EnumMember(Value = "readOnly")] + [EnumMember(Value = "readOnly")] ReadOnly, - [System.Runtime.Serialization.EnumMember(Value = "readWrite")] + [EnumMember(Value = "readWrite")] ReadWrite } + internal static class CachingTypeEnumExtension + { + internal static string ToSerializedValue(this CachingType? value) => + value == null ? null : ((CachingType)value).ToSerializedValue(); + + internal static string ToSerializedValue(this CachingType value) + { + switch( value ) + { + case CachingType.None: + return "none"; + case CachingType.ReadOnly: + return "readOnly"; + case CachingType.ReadWrite: + return "readWrite"; + } + return null; + } + + internal static CachingType? ParseCachingType(this string value) + { + switch( value ) + { + case "none": + return CachingType.None; + case "readOnly": + return CachingType.ReadOnly; + case "readWrite": + return CachingType.ReadWrite; + } + return null; + } + } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/Certificate.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/Certificate.cs index e944c0a87d6b..028dd02d13b9 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/Certificate.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/Certificate.cs @@ -8,6 +8,10 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; using System.Linq; /// @@ -19,7 +23,10 @@ public partial class Certificate /// /// Initializes a new instance of the Certificate class. /// - public Certificate() { } + public Certificate() + { + CustomInit(); + } /// /// Initializes a new instance of the Certificate class. @@ -42,34 +49,40 @@ public Certificate() { } /// last attempt to delete this certificate. public Certificate(string thumbprint = default(string), string thumbprintAlgorithm = default(string), string url = default(string), CertificateState? state = default(CertificateState?), System.DateTime? stateTransitionTime = default(System.DateTime?), CertificateState? previousState = default(CertificateState?), System.DateTime? previousStateTransitionTime = default(System.DateTime?), string publicData = default(string), DeleteCertificateError deleteCertificateError = default(DeleteCertificateError)) { - this.Thumbprint = thumbprint; - this.ThumbprintAlgorithm = thumbprintAlgorithm; - this.Url = url; - this.State = state; - this.StateTransitionTime = stateTransitionTime; - this.PreviousState = previousState; - this.PreviousStateTransitionTime = previousStateTransitionTime; - this.PublicData = publicData; - this.DeleteCertificateError = deleteCertificateError; + Thumbprint = thumbprint; + ThumbprintAlgorithm = thumbprintAlgorithm; + Url = url; + State = state; + StateTransitionTime = stateTransitionTime; + PreviousState = previousState; + PreviousStateTransitionTime = previousStateTransitionTime; + PublicData = publicData; + DeleteCertificateError = deleteCertificateError; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the X.509 thumbprint of the certificate. This is a /// sequence of up to 40 hex digits. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "thumbprint")] + [JsonProperty(PropertyName = "thumbprint")] public string Thumbprint { get; set; } /// /// Gets or sets the algorithm used to derive the thumbprint. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "thumbprintAlgorithm")] + [JsonProperty(PropertyName = "thumbprintAlgorithm")] public string ThumbprintAlgorithm { get; set; } /// /// Gets or sets the URL of the certificate. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "url")] + [JsonProperty(PropertyName = "url")] public string Url { get; set; } /// @@ -78,14 +91,14 @@ public Certificate() { } /// /// Possible values include: 'active', 'deleting', 'deleteFailed' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "state")] + [JsonProperty(PropertyName = "state")] public CertificateState? State { get; set; } /// /// Gets or sets the time at which the certificate entered its current /// state. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "stateTransitionTime")] + [JsonProperty(PropertyName = "stateTransitionTime")] public System.DateTime? StateTransitionTime { get; set; } /// @@ -96,7 +109,7 @@ public Certificate() { } /// active state. Possible values include: 'active', 'deleting', /// 'deleteFailed' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "previousState")] + [JsonProperty(PropertyName = "previousState")] public CertificateState? PreviousState { get; set; } /// @@ -107,14 +120,14 @@ public Certificate() { } /// This property is not set if the certificate is in its initial /// Active state. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "previousStateTransitionTime")] + [JsonProperty(PropertyName = "previousStateTransitionTime")] public System.DateTime? PreviousStateTransitionTime { get; set; } /// /// Gets or sets the public part of the certificate as a base-64 /// encoded .cer file. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "publicData")] + [JsonProperty(PropertyName = "publicData")] public string PublicData { get; set; } /// @@ -125,7 +138,7 @@ public Certificate() { } /// This property is set only if the certificate is in the DeleteFailed /// state. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "deleteCertificateError")] + [JsonProperty(PropertyName = "deleteCertificateError")] public DeleteCertificateError DeleteCertificateError { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/CertificateAddHeaders.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/CertificateAddHeaders.cs index 036474572a2d..1d9e80683556 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/CertificateAddHeaders.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/CertificateAddHeaders.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class CertificateAddHeaders /// /// Initializes a new instance of the CertificateAddHeaders class. /// - public CertificateAddHeaders() { } + public CertificateAddHeaders() + { + CustomInit(); + } /// /// Initializes a new instance of the CertificateAddHeaders class. @@ -44,19 +53,25 @@ public CertificateAddHeaders() { } /// the request applied. public CertificateAddHeaders(System.Guid? clientRequestId = default(System.Guid?), System.Guid? requestId = default(System.Guid?), string eTag = default(string), System.DateTime? lastModified = default(System.DateTime?), string dataServiceId = default(string)) { - this.ClientRequestId = clientRequestId; - this.RequestId = requestId; - this.ETag = eTag; - this.LastModified = lastModified; - this.DataServiceId = dataServiceId; + ClientRequestId = clientRequestId; + RequestId = requestId; + ETag = eTag; + LastModified = lastModified; + DataServiceId = dataServiceId; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the client-request-id provided by the client during /// the request. This will be returned only if the /// return-client-request-id parameter was set to true. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "client-request-id")] + [JsonProperty(PropertyName = "client-request-id")] public System.Guid? ClientRequestId { get; set; } /// @@ -68,7 +83,7 @@ public CertificateAddHeaders() { } /// request was made, the Batch account against which the request was /// made, and the region that account resides in. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "request-id")] + [JsonProperty(PropertyName = "request-id")] public System.Guid? RequestId { get; set; } /// @@ -78,21 +93,21 @@ public CertificateAddHeaders() { } /// the If-Modified-Since, If-Unmodified-Since, If-Match or /// If-None-Match headers. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "ETag")] + [JsonProperty(PropertyName = "ETag")] public string ETag { get; set; } /// /// Gets or sets the time at which the resource was last modified. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "Last-Modified")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "Last-Modified")] public System.DateTime? LastModified { get; set; } /// /// Gets or sets the OData ID of the resource to which the request /// applied. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "DataServiceId")] + [JsonProperty(PropertyName = "DataServiceId")] public string DataServiceId { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/CertificateAddOptions.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/CertificateAddOptions.cs index fc9c8ef0083a..9edd9ef7b604 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/CertificateAddOptions.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/CertificateAddOptions.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class CertificateAddOptions /// /// Initializes a new instance of the CertificateAddOptions class. /// - public CertificateAddOptions() { } + public CertificateAddOptions() + { + CustomInit(); + } /// /// Initializes a new instance of the CertificateAddOptions class. @@ -36,17 +45,23 @@ public CertificateAddOptions() { } /// it explicitly if you are calling the REST API directly. public CertificateAddOptions(int? timeout = default(int?), System.Guid? clientRequestId = default(System.Guid?), bool? returnClientRequestId = default(bool?), System.DateTime? ocpDate = default(System.DateTime?)) { - this.Timeout = timeout; - this.ClientRequestId = clientRequestId; - this.ReturnClientRequestId = returnClientRequestId; - this.OcpDate = ocpDate; + Timeout = timeout; + ClientRequestId = clientRequestId; + ReturnClientRequestId = returnClientRequestId; + OcpDate = ocpDate; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the maximum time that the server can spend processing /// the request, in seconds. The default is 30 seconds. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public int? Timeout { get; set; } /// @@ -54,14 +69,14 @@ public CertificateAddOptions() { } /// a GUID with no decoration such as curly braces, e.g. /// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public System.Guid? ClientRequestId { get; set; } /// /// Gets or sets whether the server should return the client-request-id /// in the response. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public bool? ReturnClientRequestId { get; set; } /// @@ -69,8 +84,8 @@ public CertificateAddOptions() { } /// typically set this to the current system clock time; set it /// explicitly if you are calling the REST API directly. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? OcpDate { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/CertificateAddParameter.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/CertificateAddParameter.cs index 604e2f3db780..8648416558b4 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/CertificateAddParameter.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/CertificateAddParameter.cs @@ -8,6 +8,11 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Newtonsoft.Json; using System.Linq; /// @@ -19,7 +24,10 @@ public partial class CertificateAddParameter /// /// Initializes a new instance of the CertificateAddParameter class. /// - public CertificateAddParameter() { } + public CertificateAddParameter() + { + CustomInit(); + } /// /// Initializes a new instance of the CertificateAddParameter class. @@ -37,33 +45,39 @@ public CertificateAddParameter() { } /// private key. public CertificateAddParameter(string thumbprint, string thumbprintAlgorithm, string data, CertificateFormat? certificateFormat = default(CertificateFormat?), string password = default(string)) { - this.Thumbprint = thumbprint; - this.ThumbprintAlgorithm = thumbprintAlgorithm; - this.Data = data; - this.CertificateFormat = certificateFormat; - this.Password = password; + Thumbprint = thumbprint; + ThumbprintAlgorithm = thumbprintAlgorithm; + Data = data; + CertificateFormat = certificateFormat; + Password = password; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the X.509 thumbprint of the certificate. This is a /// sequence of up to 40 hex digits (it may include spaces but these /// are removed). /// - [Newtonsoft.Json.JsonProperty(PropertyName = "thumbprint")] + [JsonProperty(PropertyName = "thumbprint")] public string Thumbprint { get; set; } /// /// Gets or sets the algorithm used to derive the thumbprint. This must /// be sha1. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "thumbprintAlgorithm")] + [JsonProperty(PropertyName = "thumbprintAlgorithm")] public string ThumbprintAlgorithm { get; set; } /// /// Gets or sets the base64-encoded contents of the certificate. The /// maximum size is 10KB. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "data")] + [JsonProperty(PropertyName = "data")] public string Data { get; set; } /// @@ -72,7 +86,7 @@ public CertificateAddParameter() { } /// /// Possible values include: 'pfx', 'cer' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "certificateFormat")] + [JsonProperty(PropertyName = "certificateFormat")] public CertificateFormat? CertificateFormat { get; set; } /// @@ -82,28 +96,28 @@ public CertificateAddParameter() { } /// This is required if the certificate format is pfx. It should be /// omitted if the certificate format is cer. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "password")] + [JsonProperty(PropertyName = "password")] public string Password { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (this.Thumbprint == null) + if (Thumbprint == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Thumbprint"); + throw new ValidationException(ValidationRules.CannotBeNull, "Thumbprint"); } - if (this.ThumbprintAlgorithm == null) + if (ThumbprintAlgorithm == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "ThumbprintAlgorithm"); + throw new ValidationException(ValidationRules.CannotBeNull, "ThumbprintAlgorithm"); } - if (this.Data == null) + if (Data == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Data"); + throw new ValidationException(ValidationRules.CannotBeNull, "Data"); } } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/CertificateCancelDeletionHeaders.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/CertificateCancelDeletionHeaders.cs index ddf9acb48d07..fe01fc1f9b8b 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/CertificateCancelDeletionHeaders.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/CertificateCancelDeletionHeaders.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -19,7 +25,10 @@ public partial class CertificateCancelDeletionHeaders /// Initializes a new instance of the CertificateCancelDeletionHeaders /// class. /// - public CertificateCancelDeletionHeaders() { } + public CertificateCancelDeletionHeaders() + { + CustomInit(); + } /// /// Initializes a new instance of the CertificateCancelDeletionHeaders @@ -46,19 +55,25 @@ public CertificateCancelDeletionHeaders() { } /// the request applied. public CertificateCancelDeletionHeaders(System.Guid? clientRequestId = default(System.Guid?), System.Guid? requestId = default(System.Guid?), string eTag = default(string), System.DateTime? lastModified = default(System.DateTime?), string dataServiceId = default(string)) { - this.ClientRequestId = clientRequestId; - this.RequestId = requestId; - this.ETag = eTag; - this.LastModified = lastModified; - this.DataServiceId = dataServiceId; + ClientRequestId = clientRequestId; + RequestId = requestId; + ETag = eTag; + LastModified = lastModified; + DataServiceId = dataServiceId; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the client-request-id provided by the client during /// the request. This will be returned only if the /// return-client-request-id parameter was set to true. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "client-request-id")] + [JsonProperty(PropertyName = "client-request-id")] public System.Guid? ClientRequestId { get; set; } /// @@ -70,7 +85,7 @@ public CertificateCancelDeletionHeaders() { } /// request was made, the Batch account against which the request was /// made, and the region that account resides in. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "request-id")] + [JsonProperty(PropertyName = "request-id")] public System.Guid? RequestId { get; set; } /// @@ -80,21 +95,21 @@ public CertificateCancelDeletionHeaders() { } /// the If-Modified-Since, If-Unmodified-Since, If-Match or /// If-None-Match headers. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "ETag")] + [JsonProperty(PropertyName = "ETag")] public string ETag { get; set; } /// /// Gets or sets the time at which the resource was last modified. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "Last-Modified")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "Last-Modified")] public System.DateTime? LastModified { get; set; } /// /// Gets or sets the OData ID of the resource to which the request /// applied. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "DataServiceId")] + [JsonProperty(PropertyName = "DataServiceId")] public string DataServiceId { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/CertificateCancelDeletionOptions.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/CertificateCancelDeletionOptions.cs index 2c991c75b811..2c52bf441cc8 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/CertificateCancelDeletionOptions.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/CertificateCancelDeletionOptions.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -19,7 +25,10 @@ public partial class CertificateCancelDeletionOptions /// Initializes a new instance of the CertificateCancelDeletionOptions /// class. /// - public CertificateCancelDeletionOptions() { } + public CertificateCancelDeletionOptions() + { + CustomInit(); + } /// /// Initializes a new instance of the CertificateCancelDeletionOptions @@ -38,17 +47,23 @@ public CertificateCancelDeletionOptions() { } /// it explicitly if you are calling the REST API directly. public CertificateCancelDeletionOptions(int? timeout = default(int?), System.Guid? clientRequestId = default(System.Guid?), bool? returnClientRequestId = default(bool?), System.DateTime? ocpDate = default(System.DateTime?)) { - this.Timeout = timeout; - this.ClientRequestId = clientRequestId; - this.ReturnClientRequestId = returnClientRequestId; - this.OcpDate = ocpDate; + Timeout = timeout; + ClientRequestId = clientRequestId; + ReturnClientRequestId = returnClientRequestId; + OcpDate = ocpDate; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the maximum time that the server can spend processing /// the request, in seconds. The default is 30 seconds. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public int? Timeout { get; set; } /// @@ -56,14 +71,14 @@ public CertificateCancelDeletionOptions() { } /// a GUID with no decoration such as curly braces, e.g. /// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public System.Guid? ClientRequestId { get; set; } /// /// Gets or sets whether the server should return the client-request-id /// in the response. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public bool? ReturnClientRequestId { get; set; } /// @@ -71,8 +86,8 @@ public CertificateCancelDeletionOptions() { } /// typically set this to the current system clock time; set it /// explicitly if you are calling the REST API directly. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? OcpDate { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/CertificateDeleteHeaders.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/CertificateDeleteHeaders.cs index 87309a04d7b5..1f00f87fb3ee 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/CertificateDeleteHeaders.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/CertificateDeleteHeaders.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class CertificateDeleteHeaders /// /// Initializes a new instance of the CertificateDeleteHeaders class. /// - public CertificateDeleteHeaders() { } + public CertificateDeleteHeaders() + { + CustomInit(); + } /// /// Initializes a new instance of the CertificateDeleteHeaders class. @@ -42,18 +51,24 @@ public CertificateDeleteHeaders() { } /// modified. public CertificateDeleteHeaders(System.Guid? clientRequestId = default(System.Guid?), System.Guid? requestId = default(System.Guid?), string eTag = default(string), System.DateTime? lastModified = default(System.DateTime?)) { - this.ClientRequestId = clientRequestId; - this.RequestId = requestId; - this.ETag = eTag; - this.LastModified = lastModified; + ClientRequestId = clientRequestId; + RequestId = requestId; + ETag = eTag; + LastModified = lastModified; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the client-request-id provided by the client during /// the request. This will be returned only if the /// return-client-request-id parameter was set to true. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "client-request-id")] + [JsonProperty(PropertyName = "client-request-id")] public System.Guid? ClientRequestId { get; set; } /// @@ -65,7 +80,7 @@ public CertificateDeleteHeaders() { } /// request was made, the Batch account against which the request was /// made, and the region that account resides in. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "request-id")] + [JsonProperty(PropertyName = "request-id")] public System.Guid? RequestId { get; set; } /// @@ -75,14 +90,14 @@ public CertificateDeleteHeaders() { } /// the If-Modified-Since, If-Unmodified-Since, If-Match or /// If-None-Match headers. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "ETag")] + [JsonProperty(PropertyName = "ETag")] public string ETag { get; set; } /// /// Gets or sets the time at which the resource was last modified. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "Last-Modified")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "Last-Modified")] public System.DateTime? LastModified { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/CertificateDeleteOptions.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/CertificateDeleteOptions.cs index ed45807f8349..b53903110b7b 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/CertificateDeleteOptions.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/CertificateDeleteOptions.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class CertificateDeleteOptions /// /// Initializes a new instance of the CertificateDeleteOptions class. /// - public CertificateDeleteOptions() { } + public CertificateDeleteOptions() + { + CustomInit(); + } /// /// Initializes a new instance of the CertificateDeleteOptions class. @@ -36,17 +45,23 @@ public CertificateDeleteOptions() { } /// it explicitly if you are calling the REST API directly. public CertificateDeleteOptions(int? timeout = default(int?), System.Guid? clientRequestId = default(System.Guid?), bool? returnClientRequestId = default(bool?), System.DateTime? ocpDate = default(System.DateTime?)) { - this.Timeout = timeout; - this.ClientRequestId = clientRequestId; - this.ReturnClientRequestId = returnClientRequestId; - this.OcpDate = ocpDate; + Timeout = timeout; + ClientRequestId = clientRequestId; + ReturnClientRequestId = returnClientRequestId; + OcpDate = ocpDate; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the maximum time that the server can spend processing /// the request, in seconds. The default is 30 seconds. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public int? Timeout { get; set; } /// @@ -54,14 +69,14 @@ public CertificateDeleteOptions() { } /// a GUID with no decoration such as curly braces, e.g. /// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public System.Guid? ClientRequestId { get; set; } /// /// Gets or sets whether the server should return the client-request-id /// in the response. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public bool? ReturnClientRequestId { get; set; } /// @@ -69,8 +84,8 @@ public CertificateDeleteOptions() { } /// typically set this to the current system clock time; set it /// explicitly if you are calling the REST API directly. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? OcpDate { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/CertificateFormat.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/CertificateFormat.cs index 8596f073dbb8..8106c337c3c1 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/CertificateFormat.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/CertificateFormat.cs @@ -8,16 +8,52 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; /// /// Defines values for CertificateFormat. /// - [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + [JsonConverter(typeof(StringEnumConverter))] public enum CertificateFormat { - [System.Runtime.Serialization.EnumMember(Value = "pfx")] + [EnumMember(Value = "pfx")] Pfx, - [System.Runtime.Serialization.EnumMember(Value = "cer")] + [EnumMember(Value = "cer")] Cer } + internal static class CertificateFormatEnumExtension + { + internal static string ToSerializedValue(this CertificateFormat? value) => + value == null ? null : ((CertificateFormat)value).ToSerializedValue(); + + internal static string ToSerializedValue(this CertificateFormat value) + { + switch( value ) + { + case CertificateFormat.Pfx: + return "pfx"; + case CertificateFormat.Cer: + return "cer"; + } + return null; + } + + internal static CertificateFormat? ParseCertificateFormat(this string value) + { + switch( value ) + { + case "pfx": + return CertificateFormat.Pfx; + case "cer": + return CertificateFormat.Cer; + } + return null; + } + } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/CertificateGetHeaders.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/CertificateGetHeaders.cs index a062d6d5584c..ef3525d70a43 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/CertificateGetHeaders.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/CertificateGetHeaders.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class CertificateGetHeaders /// /// Initializes a new instance of the CertificateGetHeaders class. /// - public CertificateGetHeaders() { } + public CertificateGetHeaders() + { + CustomInit(); + } /// /// Initializes a new instance of the CertificateGetHeaders class. @@ -42,18 +51,24 @@ public CertificateGetHeaders() { } /// modified. public CertificateGetHeaders(System.Guid? clientRequestId = default(System.Guid?), System.Guid? requestId = default(System.Guid?), string eTag = default(string), System.DateTime? lastModified = default(System.DateTime?)) { - this.ClientRequestId = clientRequestId; - this.RequestId = requestId; - this.ETag = eTag; - this.LastModified = lastModified; + ClientRequestId = clientRequestId; + RequestId = requestId; + ETag = eTag; + LastModified = lastModified; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the client-request-id provided by the client during /// the request. This will be returned only if the /// return-client-request-id parameter was set to true. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "client-request-id")] + [JsonProperty(PropertyName = "client-request-id")] public System.Guid? ClientRequestId { get; set; } /// @@ -65,7 +80,7 @@ public CertificateGetHeaders() { } /// request was made, the Batch account against which the request was /// made, and the region that account resides in. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "request-id")] + [JsonProperty(PropertyName = "request-id")] public System.Guid? RequestId { get; set; } /// @@ -75,14 +90,14 @@ public CertificateGetHeaders() { } /// the If-Modified-Since, If-Unmodified-Since, If-Match or /// If-None-Match headers. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "ETag")] + [JsonProperty(PropertyName = "ETag")] public string ETag { get; set; } /// /// Gets or sets the time at which the resource was last modified. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "Last-Modified")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "Last-Modified")] public System.DateTime? LastModified { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/CertificateGetOptions.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/CertificateGetOptions.cs index 12d51f9acffb..f7262e185aa5 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/CertificateGetOptions.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/CertificateGetOptions.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class CertificateGetOptions /// /// Initializes a new instance of the CertificateGetOptions class. /// - public CertificateGetOptions() { } + public CertificateGetOptions() + { + CustomInit(); + } /// /// Initializes a new instance of the CertificateGetOptions class. @@ -37,24 +46,30 @@ public CertificateGetOptions() { } /// it explicitly if you are calling the REST API directly. public CertificateGetOptions(string select = default(string), int? timeout = default(int?), System.Guid? clientRequestId = default(System.Guid?), bool? returnClientRequestId = default(bool?), System.DateTime? ocpDate = default(System.DateTime?)) { - this.Select = select; - this.Timeout = timeout; - this.ClientRequestId = clientRequestId; - this.ReturnClientRequestId = returnClientRequestId; - this.OcpDate = ocpDate; + Select = select; + Timeout = timeout; + ClientRequestId = clientRequestId; + ReturnClientRequestId = returnClientRequestId; + OcpDate = ocpDate; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets an OData $select clause. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public string Select { get; set; } /// /// Gets or sets the maximum time that the server can spend processing /// the request, in seconds. The default is 30 seconds. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public int? Timeout { get; set; } /// @@ -62,14 +77,14 @@ public CertificateGetOptions() { } /// a GUID with no decoration such as curly braces, e.g. /// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public System.Guid? ClientRequestId { get; set; } /// /// Gets or sets whether the server should return the client-request-id /// in the response. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public bool? ReturnClientRequestId { get; set; } /// @@ -77,8 +92,8 @@ public CertificateGetOptions() { } /// typically set this to the current system clock time; set it /// explicitly if you are calling the REST API directly. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? OcpDate { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/CertificateListHeaders.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/CertificateListHeaders.cs index f830858f5c6e..a32d2643b5b6 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/CertificateListHeaders.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/CertificateListHeaders.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class CertificateListHeaders /// /// Initializes a new instance of the CertificateListHeaders class. /// - public CertificateListHeaders() { } + public CertificateListHeaders() + { + CustomInit(); + } /// /// Initializes a new instance of the CertificateListHeaders class. @@ -42,18 +51,24 @@ public CertificateListHeaders() { } /// modified. public CertificateListHeaders(System.Guid? clientRequestId = default(System.Guid?), System.Guid? requestId = default(System.Guid?), string eTag = default(string), System.DateTime? lastModified = default(System.DateTime?)) { - this.ClientRequestId = clientRequestId; - this.RequestId = requestId; - this.ETag = eTag; - this.LastModified = lastModified; + ClientRequestId = clientRequestId; + RequestId = requestId; + ETag = eTag; + LastModified = lastModified; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the client-request-id provided by the client during /// the request. This will be returned only if the /// return-client-request-id parameter was set to true. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "client-request-id")] + [JsonProperty(PropertyName = "client-request-id")] public System.Guid? ClientRequestId { get; set; } /// @@ -65,7 +80,7 @@ public CertificateListHeaders() { } /// request was made, the Batch account against which the request was /// made, and the region that account resides in. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "request-id")] + [JsonProperty(PropertyName = "request-id")] public System.Guid? RequestId { get; set; } /// @@ -75,14 +90,14 @@ public CertificateListHeaders() { } /// the If-Modified-Since, If-Unmodified-Since, If-Match or /// If-None-Match headers. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "ETag")] + [JsonProperty(PropertyName = "ETag")] public string ETag { get; set; } /// /// Gets or sets the time at which the resource was last modified. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "Last-Modified")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "Last-Modified")] public System.DateTime? LastModified { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/CertificateListNextOptions.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/CertificateListNextOptions.cs index f71b3cbc7b13..c7fc536425ea 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/CertificateListNextOptions.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/CertificateListNextOptions.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class CertificateListNextOptions /// /// Initializes a new instance of the CertificateListNextOptions class. /// - public CertificateListNextOptions() { } + public CertificateListNextOptions() + { + CustomInit(); + } /// /// Initializes a new instance of the CertificateListNextOptions class. @@ -33,24 +42,30 @@ public CertificateListNextOptions() { } /// it explicitly if you are calling the REST API directly. public CertificateListNextOptions(System.Guid? clientRequestId = default(System.Guid?), bool? returnClientRequestId = default(bool?), System.DateTime? ocpDate = default(System.DateTime?)) { - this.ClientRequestId = clientRequestId; - this.ReturnClientRequestId = returnClientRequestId; - this.OcpDate = ocpDate; + ClientRequestId = clientRequestId; + ReturnClientRequestId = returnClientRequestId; + OcpDate = ocpDate; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the caller-generated request identity, in the form of /// a GUID with no decoration such as curly braces, e.g. /// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public System.Guid? ClientRequestId { get; set; } /// /// Gets or sets whether the server should return the client-request-id /// in the response. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public bool? ReturnClientRequestId { get; set; } /// @@ -58,8 +73,8 @@ public CertificateListNextOptions() { } /// typically set this to the current system clock time; set it /// explicitly if you are calling the REST API directly. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? OcpDate { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/CertificateListOptions.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/CertificateListOptions.cs index 69322b27dd79..f00bb3d94b56 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/CertificateListOptions.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/CertificateListOptions.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class CertificateListOptions /// /// Initializes a new instance of the CertificateListOptions class. /// - public CertificateListOptions() { } + public CertificateListOptions() + { + CustomInit(); + } /// /// Initializes a new instance of the CertificateListOptions class. @@ -41,39 +50,45 @@ public CertificateListOptions() { } /// it explicitly if you are calling the REST API directly. public CertificateListOptions(string filter = default(string), string select = default(string), int? maxResults = default(int?), int? timeout = default(int?), System.Guid? clientRequestId = default(System.Guid?), bool? returnClientRequestId = default(bool?), System.DateTime? ocpDate = default(System.DateTime?)) { - this.Filter = filter; - this.Select = select; - this.MaxResults = maxResults; - this.Timeout = timeout; - this.ClientRequestId = clientRequestId; - this.ReturnClientRequestId = returnClientRequestId; - this.OcpDate = ocpDate; + Filter = filter; + Select = select; + MaxResults = maxResults; + Timeout = timeout; + ClientRequestId = clientRequestId; + ReturnClientRequestId = returnClientRequestId; + OcpDate = ocpDate; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets an OData $filter clause. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public string Filter { get; set; } /// /// Gets or sets an OData $select clause. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public string Select { get; set; } /// /// Gets or sets the maximum number of items to return in the response. /// A maximum of 1000 certificates can be returned. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public int? MaxResults { get; set; } /// /// Gets or sets the maximum time that the server can spend processing /// the request, in seconds. The default is 30 seconds. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public int? Timeout { get; set; } /// @@ -81,14 +96,14 @@ public CertificateListOptions() { } /// a GUID with no decoration such as curly braces, e.g. /// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public System.Guid? ClientRequestId { get; set; } /// /// Gets or sets whether the server should return the client-request-id /// in the response. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public bool? ReturnClientRequestId { get; set; } /// @@ -96,8 +111,8 @@ public CertificateListOptions() { } /// typically set this to the current system clock time; set it /// explicitly if you are calling the REST API directly. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? OcpDate { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/CertificateReference.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/CertificateReference.cs index b77f449ac75d..4ef9499b430f 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/CertificateReference.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/CertificateReference.cs @@ -8,6 +8,13 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// @@ -19,7 +26,10 @@ public partial class CertificateReference /// /// Initializes a new instance of the CertificateReference class. /// - public CertificateReference() { } + public CertificateReference() + { + CustomInit(); + } /// /// Initializes a new instance of the CertificateReference class. @@ -33,26 +43,32 @@ public CertificateReference() { } /// compute node into which to install the certificate. /// Which user accounts on the compute node /// should have access to the private data of the certificate. - public CertificateReference(string thumbprint, string thumbprintAlgorithm, CertificateStoreLocation? storeLocation = default(CertificateStoreLocation?), string storeName = default(string), System.Collections.Generic.IList visibility = default(System.Collections.Generic.IList)) + public CertificateReference(string thumbprint, string thumbprintAlgorithm, CertificateStoreLocation? storeLocation = default(CertificateStoreLocation?), string storeName = default(string), IList visibility = default(IList)) { - this.Thumbprint = thumbprint; - this.ThumbprintAlgorithm = thumbprintAlgorithm; - this.StoreLocation = storeLocation; - this.StoreName = storeName; - this.Visibility = visibility; + Thumbprint = thumbprint; + ThumbprintAlgorithm = thumbprintAlgorithm; + StoreLocation = storeLocation; + StoreName = storeName; + Visibility = visibility; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the thumbprint of the certificate. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "thumbprint")] + [JsonProperty(PropertyName = "thumbprint")] public string Thumbprint { get; set; } /// /// Gets or sets the algorithm with which the thumbprint is associated. /// This must be sha1. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "thumbprintAlgorithm")] + [JsonProperty(PropertyName = "thumbprintAlgorithm")] public string ThumbprintAlgorithm { get; set; } /// @@ -72,7 +88,7 @@ public CertificateReference() { } /// certificates are placed in that directory. Possible values include: /// 'currentUser', 'localMachine' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "storeLocation")] + [JsonProperty(PropertyName = "storeLocation")] public CertificateStoreLocation? StoreLocation { get; set; } /// @@ -80,12 +96,14 @@ public CertificateReference() { } /// into which to install the certificate. /// /// - /// The default value is My. This property is applicable only for pools - /// configured with Windows nodes (that is, created with - /// cloudServiceConfiguration, or with virtualMachineConfiguration - /// using a Windows image reference). + /// This property is applicable only for pools configured with Windows + /// nodes (that is, created with cloudServiceConfiguration, or with + /// virtualMachineConfiguration using a Windows image reference). + /// Common store names include: My, Root, CA, Trust, Disallowed, + /// TrustedPeople, TrustedPublisher, AuthRoot, AddressBook, but any + /// custom store name can also be used. The default value is My. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "storeName")] + [JsonProperty(PropertyName = "storeName")] public string StoreName { get; set; } /// @@ -93,26 +111,34 @@ public CertificateReference() { } /// access to the private data of the certificate. /// /// - /// The default is all accounts. + /// Values are: + /// + /// starttask - The user account under which the start task is run. + /// task - The accounts under which job tasks are run. + /// remoteuser - The accounts under which users remotely access the + /// node. + /// + /// You can specify more than one visibility in this collection. The + /// default is all accounts. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "visibility")] - public System.Collections.Generic.IList Visibility { get; set; } + [JsonProperty(PropertyName = "visibility")] + public IList Visibility { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (this.Thumbprint == null) + if (Thumbprint == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Thumbprint"); + throw new ValidationException(ValidationRules.CannotBeNull, "Thumbprint"); } - if (this.ThumbprintAlgorithm == null) + if (ThumbprintAlgorithm == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "ThumbprintAlgorithm"); + throw new ValidationException(ValidationRules.CannotBeNull, "ThumbprintAlgorithm"); } } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/CertificateState.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/CertificateState.cs index 4e8884cd6b75..1210a9bb20d8 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/CertificateState.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/CertificateState.cs @@ -8,18 +8,58 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; /// /// Defines values for CertificateState. /// - [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + [JsonConverter(typeof(StringEnumConverter))] public enum CertificateState { - [System.Runtime.Serialization.EnumMember(Value = "active")] + [EnumMember(Value = "active")] Active, - [System.Runtime.Serialization.EnumMember(Value = "deleting")] + [EnumMember(Value = "deleting")] Deleting, - [System.Runtime.Serialization.EnumMember(Value = "deleteFailed")] + [EnumMember(Value = "deleteFailed")] DeleteFailed } + internal static class CertificateStateEnumExtension + { + internal static string ToSerializedValue(this CertificateState? value) => + value == null ? null : ((CertificateState)value).ToSerializedValue(); + + internal static string ToSerializedValue(this CertificateState value) + { + switch( value ) + { + case CertificateState.Active: + return "active"; + case CertificateState.Deleting: + return "deleting"; + case CertificateState.DeleteFailed: + return "deleteFailed"; + } + return null; + } + + internal static CertificateState? ParseCertificateState(this string value) + { + switch( value ) + { + case "active": + return CertificateState.Active; + case "deleting": + return CertificateState.Deleting; + case "deleteFailed": + return CertificateState.DeleteFailed; + } + return null; + } + } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/CertificateStoreLocation.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/CertificateStoreLocation.cs index 3ef3f8883317..7f83f0aeb585 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/CertificateStoreLocation.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/CertificateStoreLocation.cs @@ -8,16 +8,52 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; /// /// Defines values for CertificateStoreLocation. /// - [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + [JsonConverter(typeof(StringEnumConverter))] public enum CertificateStoreLocation { - [System.Runtime.Serialization.EnumMember(Value = "currentUser")] + [EnumMember(Value = "currentUser")] CurrentUser, - [System.Runtime.Serialization.EnumMember(Value = "localMachine")] + [EnumMember(Value = "localMachine")] LocalMachine } + internal static class CertificateStoreLocationEnumExtension + { + internal static string ToSerializedValue(this CertificateStoreLocation? value) => + value == null ? null : ((CertificateStoreLocation)value).ToSerializedValue(); + + internal static string ToSerializedValue(this CertificateStoreLocation value) + { + switch( value ) + { + case CertificateStoreLocation.CurrentUser: + return "currentUser"; + case CertificateStoreLocation.LocalMachine: + return "localMachine"; + } + return null; + } + + internal static CertificateStoreLocation? ParseCertificateStoreLocation(this string value) + { + switch( value ) + { + case "currentUser": + return CertificateStoreLocation.CurrentUser; + case "localMachine": + return CertificateStoreLocation.LocalMachine; + } + return null; + } + } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/CertificateVisibility.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/CertificateVisibility.cs index 52e22a383bc1..2e1696ccdb2b 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/CertificateVisibility.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/CertificateVisibility.cs @@ -8,18 +8,58 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; /// /// Defines values for CertificateVisibility. /// - [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + [JsonConverter(typeof(StringEnumConverter))] public enum CertificateVisibility { - [System.Runtime.Serialization.EnumMember(Value = "startTask")] + [EnumMember(Value = "startTask")] StartTask, - [System.Runtime.Serialization.EnumMember(Value = "task")] + [EnumMember(Value = "task")] Task, - [System.Runtime.Serialization.EnumMember(Value = "remoteUser")] + [EnumMember(Value = "remoteUser")] RemoteUser } + internal static class CertificateVisibilityEnumExtension + { + internal static string ToSerializedValue(this CertificateVisibility? value) => + value == null ? null : ((CertificateVisibility)value).ToSerializedValue(); + + internal static string ToSerializedValue(this CertificateVisibility value) + { + switch( value ) + { + case CertificateVisibility.StartTask: + return "startTask"; + case CertificateVisibility.Task: + return "task"; + case CertificateVisibility.RemoteUser: + return "remoteUser"; + } + return null; + } + + internal static CertificateVisibility? ParseCertificateVisibility(this string value) + { + switch( value ) + { + case "startTask": + return CertificateVisibility.StartTask; + case "task": + return CertificateVisibility.Task; + case "remoteUser": + return CertificateVisibility.RemoteUser; + } + return null; + } + } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/CloudJob.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/CloudJob.cs index dfc3e4ad8176..c3ecab64b695 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/CloudJob.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/CloudJob.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class CloudJob /// /// Initializes a new instance of the CloudJob class. /// - public CloudJob() { } + public CloudJob() + { + CustomInit(); + } /// /// Initializes a new instance of the CloudJob class. @@ -26,8 +35,8 @@ public CloudJob() { } /// A string that uniquely identifies the job within /// the account. /// The display name for the job. - /// The flag that determines if this - /// job will use tasks with dependencies. + /// Whether tasks in the job can + /// define dependencies on each other. The default is false. /// The URL of the job. /// The ETag of the job. /// The last modified time of the @@ -56,71 +65,74 @@ public CloudJob() { } /// should take when all tasks in the job are in the completed /// state. /// The action the Batch service should - /// take when any task in the job fails. A task is considered to have - /// failed if it completes with a non-zero exit code and has exhausted - /// its retry count, or if it had a scheduling error. + /// take when any task in the job fails. /// A list of name-value pairs associated with /// the job as metadata. /// The execution information for the /// job. /// Resource usage statistics for the entire /// lifetime of the job. - public CloudJob(string id = default(string), string displayName = default(string), bool? usesTaskDependencies = default(bool?), string url = default(string), string eTag = default(string), System.DateTime? lastModified = default(System.DateTime?), System.DateTime? creationTime = default(System.DateTime?), JobState? state = default(JobState?), System.DateTime? stateTransitionTime = default(System.DateTime?), JobState? previousState = default(JobState?), System.DateTime? previousStateTransitionTime = default(System.DateTime?), int? priority = default(int?), JobConstraints constraints = default(JobConstraints), JobManagerTask jobManagerTask = default(JobManagerTask), JobPreparationTask jobPreparationTask = default(JobPreparationTask), JobReleaseTask jobReleaseTask = default(JobReleaseTask), System.Collections.Generic.IList commonEnvironmentSettings = default(System.Collections.Generic.IList), PoolInformation poolInfo = default(PoolInformation), OnAllTasksComplete? onAllTasksComplete = default(OnAllTasksComplete?), OnTaskFailure? onTaskFailure = default(OnTaskFailure?), System.Collections.Generic.IList metadata = default(System.Collections.Generic.IList), JobExecutionInformation executionInfo = default(JobExecutionInformation), JobStatistics stats = default(JobStatistics)) + public CloudJob(string id = default(string), string displayName = default(string), bool? usesTaskDependencies = default(bool?), string url = default(string), string eTag = default(string), System.DateTime? lastModified = default(System.DateTime?), System.DateTime? creationTime = default(System.DateTime?), JobState? state = default(JobState?), System.DateTime? stateTransitionTime = default(System.DateTime?), JobState? previousState = default(JobState?), System.DateTime? previousStateTransitionTime = default(System.DateTime?), int? priority = default(int?), JobConstraints constraints = default(JobConstraints), JobManagerTask jobManagerTask = default(JobManagerTask), JobPreparationTask jobPreparationTask = default(JobPreparationTask), JobReleaseTask jobReleaseTask = default(JobReleaseTask), IList commonEnvironmentSettings = default(IList), PoolInformation poolInfo = default(PoolInformation), OnAllTasksComplete? onAllTasksComplete = default(OnAllTasksComplete?), OnTaskFailure? onTaskFailure = default(OnTaskFailure?), IList metadata = default(IList), JobExecutionInformation executionInfo = default(JobExecutionInformation), JobStatistics stats = default(JobStatistics)) { - this.Id = id; - this.DisplayName = displayName; - this.UsesTaskDependencies = usesTaskDependencies; - this.Url = url; - this.ETag = eTag; - this.LastModified = lastModified; - this.CreationTime = creationTime; - this.State = state; - this.StateTransitionTime = stateTransitionTime; - this.PreviousState = previousState; - this.PreviousStateTransitionTime = previousStateTransitionTime; - this.Priority = priority; - this.Constraints = constraints; - this.JobManagerTask = jobManagerTask; - this.JobPreparationTask = jobPreparationTask; - this.JobReleaseTask = jobReleaseTask; - this.CommonEnvironmentSettings = commonEnvironmentSettings; - this.PoolInfo = poolInfo; - this.OnAllTasksComplete = onAllTasksComplete; - this.OnTaskFailure = onTaskFailure; - this.Metadata = metadata; - this.ExecutionInfo = executionInfo; - this.Stats = stats; + Id = id; + DisplayName = displayName; + UsesTaskDependencies = usesTaskDependencies; + Url = url; + ETag = eTag; + LastModified = lastModified; + CreationTime = creationTime; + State = state; + StateTransitionTime = stateTransitionTime; + PreviousState = previousState; + PreviousStateTransitionTime = previousStateTransitionTime; + Priority = priority; + Constraints = constraints; + JobManagerTask = jobManagerTask; + JobPreparationTask = jobPreparationTask; + JobReleaseTask = jobReleaseTask; + CommonEnvironmentSettings = commonEnvironmentSettings; + PoolInfo = poolInfo; + OnAllTasksComplete = onAllTasksComplete; + OnTaskFailure = onTaskFailure; + Metadata = metadata; + ExecutionInfo = executionInfo; + Stats = stats; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets a string that uniquely identifies the job within the /// account. /// /// - /// The ID can contain any combination of alphanumeric characters - /// including hyphens and underscores, and cannot contain more than 64 - /// characters. It is common to use a GUID for the id. + /// The ID is case-preserving and case-insensitive (that is, you may + /// not have two IDs within an account that differ only by case). /// - [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + [JsonProperty(PropertyName = "id")] public string Id { get; set; } /// /// Gets or sets the display name for the job. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "displayName")] + [JsonProperty(PropertyName = "displayName")] public string DisplayName { get; set; } /// - /// Gets or sets the flag that determines if this job will use tasks - /// with dependencies. + /// Gets or sets whether tasks in the job can define dependencies on + /// each other. The default is false. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "usesTaskDependencies")] + [JsonProperty(PropertyName = "usesTaskDependencies")] public bool? UsesTaskDependencies { get; set; } /// /// Gets or sets the URL of the job. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "url")] + [JsonProperty(PropertyName = "url")] public string Url { get; set; } /// @@ -132,7 +144,7 @@ public CloudJob() { } /// ETag when updating a job to specify that your changes should take /// effect only if nobody else has modified the job in the meantime. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "eTag")] + [JsonProperty(PropertyName = "eTag")] public string ETag { get; set; } /// @@ -143,13 +155,13 @@ public CloudJob() { } /// state or priority, changed. It does not factor in task-level /// changes such as adding new tasks or tasks changing state. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "lastModified")] + [JsonProperty(PropertyName = "lastModified")] public System.DateTime? LastModified { get; set; } /// /// Gets or sets the creation time of the job. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "creationTime")] + [JsonProperty(PropertyName = "creationTime")] public System.DateTime? CreationTime { get; set; } /// @@ -159,13 +171,13 @@ public CloudJob() { } /// Possible values include: 'active', 'disabling', 'disabled', /// 'enabling', 'terminating', 'completed', 'deleting' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "state")] + [JsonProperty(PropertyName = "state")] public JobState? State { get; set; } /// /// Gets or sets the time at which the job entered its current state. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "stateTransitionTime")] + [JsonProperty(PropertyName = "stateTransitionTime")] public System.DateTime? StateTransitionTime { get; set; } /// @@ -176,7 +188,7 @@ public CloudJob() { } /// Possible values include: 'active', 'disabling', 'disabled', /// 'enabling', 'terminating', 'completed', 'deleting' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "previousState")] + [JsonProperty(PropertyName = "previousState")] public JobState? PreviousState { get; set; } /// @@ -185,7 +197,7 @@ public CloudJob() { } /// /// This property is not set if the job is in its initial Active state. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "previousStateTransitionTime")] + [JsonProperty(PropertyName = "previousStateTransitionTime")] public System.DateTime? PreviousStateTransitionTime { get; set; } /// @@ -196,20 +208,20 @@ public CloudJob() { } /// lowest priority and 1000 being the highest priority. The default /// value is 0. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "priority")] + [JsonProperty(PropertyName = "priority")] public int? Priority { get; set; } /// /// Gets or sets the execution constraints for the job. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "constraints")] + [JsonProperty(PropertyName = "constraints")] public JobConstraints Constraints { get; set; } /// /// Gets or sets details of a Job Manager task to be launched when the /// job is started. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "jobManagerTask")] + [JsonProperty(PropertyName = "jobManagerTask")] public JobManagerTask JobManagerTask { get; set; } /// @@ -219,7 +231,7 @@ public CloudJob() { } /// The Job Preparation task is a special task run on each node before /// any other task of the job. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "jobPreparationTask")] + [JsonProperty(PropertyName = "jobPreparationTask")] public JobPreparationTask JobPreparationTask { get; set; } /// @@ -229,7 +241,7 @@ public CloudJob() { } /// The Job Release task is a special task run at the end of the job on /// each node that has run any other task of the job. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "jobReleaseTask")] + [JsonProperty(PropertyName = "jobReleaseTask")] public JobReleaseTask JobReleaseTask { get; set; } /// @@ -237,13 +249,17 @@ public CloudJob() { } /// These environment variables are set for all tasks in the job /// (including the Job Manager, Job Preparation and Job Release tasks). /// - [Newtonsoft.Json.JsonProperty(PropertyName = "commonEnvironmentSettings")] - public System.Collections.Generic.IList CommonEnvironmentSettings { get; set; } + /// + /// Individual tasks can override an environment setting specified here + /// by specifying the same setting name with a different value. + /// + [JsonProperty(PropertyName = "commonEnvironmentSettings")] + public IList CommonEnvironmentSettings { get; set; } /// /// Gets or sets the pool settings associated with the job. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "poolInfo")] + [JsonProperty(PropertyName = "poolInfo")] public PoolInformation PoolInfo { get; set; } /// @@ -256,16 +272,18 @@ public CloudJob() { } /// job's terminateReason is set to 'AllTasksComplete'. The default is /// noAction. Possible values include: 'noAction', 'terminateJob' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "onAllTasksComplete")] + [JsonProperty(PropertyName = "onAllTasksComplete")] public OnAllTasksComplete? OnAllTasksComplete { get; set; } /// /// Gets or sets the action the Batch service should take when any task - /// in the job fails. A task is considered to have failed if it - /// completes with a non-zero exit code and has exhausted its retry - /// count, or if it had a scheduling error. + /// in the job fails. /// /// + /// A task is considered to have failed if has a failureInfo. A + /// failureInfo is set if the task completes with a non-zero exit code + /// after exhausting its retry count, or if there was an error starting + /// the task, for example due to a resource file download error. /// noAction - do nothing. performExitOptionsJobAction - take the /// action associated with the task exit condition in the task's /// exitConditions collection. (This may still result in no action @@ -273,7 +291,7 @@ public CloudJob() { } /// noAction. Possible values include: 'noAction', /// 'performExitOptionsJobAction' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "onTaskFailure")] + [JsonProperty(PropertyName = "onTaskFailure")] public OnTaskFailure? OnTaskFailure { get; set; } /// @@ -284,45 +302,45 @@ public CloudJob() { } /// The Batch service does not assign any meaning to metadata; it is /// solely for the use of user code. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "metadata")] - public System.Collections.Generic.IList Metadata { get; set; } + [JsonProperty(PropertyName = "metadata")] + public IList Metadata { get; set; } /// /// Gets or sets the execution information for the job. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "executionInfo")] + [JsonProperty(PropertyName = "executionInfo")] public JobExecutionInformation ExecutionInfo { get; set; } /// /// Gets or sets resource usage statistics for the entire lifetime of /// the job. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "stats")] + [JsonProperty(PropertyName = "stats")] public JobStatistics Stats { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (this.JobManagerTask != null) + if (JobManagerTask != null) { - this.JobManagerTask.Validate(); + JobManagerTask.Validate(); } - if (this.JobPreparationTask != null) + if (JobPreparationTask != null) { - this.JobPreparationTask.Validate(); + JobPreparationTask.Validate(); } - if (this.JobReleaseTask != null) + if (JobReleaseTask != null) { - this.JobReleaseTask.Validate(); + JobReleaseTask.Validate(); } - if (this.CommonEnvironmentSettings != null) + if (CommonEnvironmentSettings != null) { - foreach (var element in this.CommonEnvironmentSettings) + foreach (var element in CommonEnvironmentSettings) { if (element != null) { @@ -330,13 +348,13 @@ public virtual void Validate() } } } - if (this.PoolInfo != null) + if (PoolInfo != null) { - this.PoolInfo.Validate(); + PoolInfo.Validate(); } - if (this.Metadata != null) + if (Metadata != null) { - foreach (var element1 in this.Metadata) + foreach (var element1 in Metadata) { if (element1 != null) { @@ -344,13 +362,13 @@ public virtual void Validate() } } } - if (this.ExecutionInfo != null) + if (ExecutionInfo != null) { - this.ExecutionInfo.Validate(); + ExecutionInfo.Validate(); } - if (this.Stats != null) + if (Stats != null) { - this.Stats.Validate(); + Stats.Validate(); } } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/CloudJobSchedule.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/CloudJobSchedule.cs index 4744821cc229..423e49d06cde 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/CloudJobSchedule.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/CloudJobSchedule.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// @@ -19,7 +25,10 @@ public partial class CloudJobSchedule /// /// Initializes a new instance of the CloudJobSchedule class. /// - public CloudJobSchedule() { } + public CloudJobSchedule() + { + CustomInit(); + } /// /// Initializes a new instance of the CloudJobSchedule class. @@ -51,45 +60,48 @@ public CloudJobSchedule() { } /// the schedule as metadata. /// The lifetime resource usage statistics for the /// job schedule. - public CloudJobSchedule(string id = default(string), string displayName = default(string), string url = default(string), string eTag = default(string), System.DateTime? lastModified = default(System.DateTime?), System.DateTime? creationTime = default(System.DateTime?), JobScheduleState? state = default(JobScheduleState?), System.DateTime? stateTransitionTime = default(System.DateTime?), JobScheduleState? previousState = default(JobScheduleState?), System.DateTime? previousStateTransitionTime = default(System.DateTime?), Schedule schedule = default(Schedule), JobSpecification jobSpecification = default(JobSpecification), JobScheduleExecutionInformation executionInfo = default(JobScheduleExecutionInformation), System.Collections.Generic.IList metadata = default(System.Collections.Generic.IList), JobScheduleStatistics stats = default(JobScheduleStatistics)) + public CloudJobSchedule(string id = default(string), string displayName = default(string), string url = default(string), string eTag = default(string), System.DateTime? lastModified = default(System.DateTime?), System.DateTime? creationTime = default(System.DateTime?), JobScheduleState? state = default(JobScheduleState?), System.DateTime? stateTransitionTime = default(System.DateTime?), JobScheduleState? previousState = default(JobScheduleState?), System.DateTime? previousStateTransitionTime = default(System.DateTime?), Schedule schedule = default(Schedule), JobSpecification jobSpecification = default(JobSpecification), JobScheduleExecutionInformation executionInfo = default(JobScheduleExecutionInformation), IList metadata = default(IList), JobScheduleStatistics stats = default(JobScheduleStatistics)) { - this.Id = id; - this.DisplayName = displayName; - this.Url = url; - this.ETag = eTag; - this.LastModified = lastModified; - this.CreationTime = creationTime; - this.State = state; - this.StateTransitionTime = stateTransitionTime; - this.PreviousState = previousState; - this.PreviousStateTransitionTime = previousStateTransitionTime; - this.Schedule = schedule; - this.JobSpecification = jobSpecification; - this.ExecutionInfo = executionInfo; - this.Metadata = metadata; - this.Stats = stats; + Id = id; + DisplayName = displayName; + Url = url; + ETag = eTag; + LastModified = lastModified; + CreationTime = creationTime; + State = state; + StateTransitionTime = stateTransitionTime; + PreviousState = previousState; + PreviousStateTransitionTime = previousStateTransitionTime; + Schedule = schedule; + JobSpecification = jobSpecification; + ExecutionInfo = executionInfo; + Metadata = metadata; + Stats = stats; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets a string that uniquely identifies the schedule within /// the account. /// - /// - /// It is common to use a GUID for the id. - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + [JsonProperty(PropertyName = "id")] public string Id { get; set; } /// /// Gets or sets the display name for the schedule. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "displayName")] + [JsonProperty(PropertyName = "displayName")] public string DisplayName { get; set; } /// /// Gets or sets the URL of the job schedule. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "url")] + [JsonProperty(PropertyName = "url")] public string Url { get; set; } /// @@ -102,7 +114,7 @@ public CloudJobSchedule() { } /// your changes should take effect only if nobody else has modified /// the schedule in the meantime. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "eTag")] + [JsonProperty(PropertyName = "eTag")] public string ETag { get; set; } /// @@ -114,13 +126,13 @@ public CloudJobSchedule() { } /// factor in job-level changes such as new jobs being created or jobs /// changing state. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "lastModified")] + [JsonProperty(PropertyName = "lastModified")] public System.DateTime? LastModified { get; set; } /// /// Gets or sets the creation time of the job schedule. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "creationTime")] + [JsonProperty(PropertyName = "creationTime")] public System.DateTime? CreationTime { get; set; } /// @@ -130,14 +142,14 @@ public CloudJobSchedule() { } /// Possible values include: 'active', 'completed', 'disabled', /// 'terminating', 'deleting' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "state")] + [JsonProperty(PropertyName = "state")] public JobScheduleState? State { get; set; } /// /// Gets or sets the time at which the job schedule entered the current /// state. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "stateTransitionTime")] + [JsonProperty(PropertyName = "stateTransitionTime")] public System.DateTime? StateTransitionTime { get; set; } /// @@ -148,7 +160,7 @@ public CloudJobSchedule() { } /// active state. Possible values include: 'active', 'completed', /// 'disabled', 'terminating', 'deleting' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "previousState")] + [JsonProperty(PropertyName = "previousState")] public JobScheduleState? PreviousState { get; set; } /// @@ -159,27 +171,27 @@ public CloudJobSchedule() { } /// This property is not present if the job schedule is in its initial /// active state. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "previousStateTransitionTime")] + [JsonProperty(PropertyName = "previousStateTransitionTime")] public System.DateTime? PreviousStateTransitionTime { get; set; } /// /// Gets or sets the schedule according to which jobs will be created. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "schedule")] + [JsonProperty(PropertyName = "schedule")] public Schedule Schedule { get; set; } /// /// Gets or sets the details of the jobs to be created on this /// schedule. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "jobSpecification")] + [JsonProperty(PropertyName = "jobSpecification")] public JobSpecification JobSpecification { get; set; } /// /// Gets or sets information about jobs that have been and will be run /// under this schedule. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "executionInfo")] + [JsonProperty(PropertyName = "executionInfo")] public JobScheduleExecutionInformation ExecutionInfo { get; set; } /// @@ -190,31 +202,31 @@ public CloudJobSchedule() { } /// The Batch service does not assign any meaning to metadata; it is /// solely for the use of user code. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "metadata")] - public System.Collections.Generic.IList Metadata { get; set; } + [JsonProperty(PropertyName = "metadata")] + public IList Metadata { get; set; } /// /// Gets or sets the lifetime resource usage statistics for the job /// schedule. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "stats")] + [JsonProperty(PropertyName = "stats")] public JobScheduleStatistics Stats { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (this.JobSpecification != null) + if (JobSpecification != null) { - this.JobSpecification.Validate(); + JobSpecification.Validate(); } - if (this.Metadata != null) + if (Metadata != null) { - foreach (var element in this.Metadata) + foreach (var element in Metadata) { if (element != null) { @@ -222,9 +234,9 @@ public virtual void Validate() } } } - if (this.Stats != null) + if (Stats != null) { - this.Stats.Validate(); + Stats.Validate(); } } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/CloudPool.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/CloudPool.cs index c1a822e8f53d..fe81ce91b89d 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/CloudPool.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/CloudPool.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class CloudPool /// /// Initializes a new instance of the CloudPool class. /// - public CloudPool() { } + public CloudPool() + { + CustomInit(); + } /// /// Initializes a new instance of the CloudPool class. @@ -79,52 +88,58 @@ public CloudPool() { } /// pool. /// The maximum number of tasks that can /// run concurrently on a single compute node in the pool. - /// How the Batch service - /// distributes tasks between compute nodes in the pool. + /// How tasks are distributed across + /// compute nodes in a pool. /// The list of user accounts to be created /// on each node in the pool. /// A list of name-value pairs associated with /// the pool as metadata. /// Utilization and resource usage statistics for /// the entire lifetime of the pool. - public CloudPool(string id = default(string), string displayName = default(string), string url = default(string), string eTag = default(string), System.DateTime? lastModified = default(System.DateTime?), System.DateTime? creationTime = default(System.DateTime?), PoolState? state = default(PoolState?), System.DateTime? stateTransitionTime = default(System.DateTime?), AllocationState? allocationState = default(AllocationState?), System.DateTime? allocationStateTransitionTime = default(System.DateTime?), string vmSize = default(string), CloudServiceConfiguration cloudServiceConfiguration = default(CloudServiceConfiguration), VirtualMachineConfiguration virtualMachineConfiguration = default(VirtualMachineConfiguration), System.TimeSpan? resizeTimeout = default(System.TimeSpan?), System.Collections.Generic.IList resizeErrors = default(System.Collections.Generic.IList), int? currentDedicatedNodes = default(int?), int? currentLowPriorityNodes = default(int?), int? targetDedicatedNodes = default(int?), int? targetLowPriorityNodes = default(int?), bool? enableAutoScale = default(bool?), string autoScaleFormula = default(string), System.TimeSpan? autoScaleEvaluationInterval = default(System.TimeSpan?), AutoScaleRun autoScaleRun = default(AutoScaleRun), bool? enableInterNodeCommunication = default(bool?), NetworkConfiguration networkConfiguration = default(NetworkConfiguration), StartTask startTask = default(StartTask), System.Collections.Generic.IList certificateReferences = default(System.Collections.Generic.IList), System.Collections.Generic.IList applicationPackageReferences = default(System.Collections.Generic.IList), System.Collections.Generic.IList applicationLicenses = default(System.Collections.Generic.IList), int? maxTasksPerNode = default(int?), TaskSchedulingPolicy taskSchedulingPolicy = default(TaskSchedulingPolicy), System.Collections.Generic.IList userAccounts = default(System.Collections.Generic.IList), System.Collections.Generic.IList metadata = default(System.Collections.Generic.IList), PoolStatistics stats = default(PoolStatistics)) + public CloudPool(string id = default(string), string displayName = default(string), string url = default(string), string eTag = default(string), System.DateTime? lastModified = default(System.DateTime?), System.DateTime? creationTime = default(System.DateTime?), PoolState? state = default(PoolState?), System.DateTime? stateTransitionTime = default(System.DateTime?), AllocationState? allocationState = default(AllocationState?), System.DateTime? allocationStateTransitionTime = default(System.DateTime?), string vmSize = default(string), CloudServiceConfiguration cloudServiceConfiguration = default(CloudServiceConfiguration), VirtualMachineConfiguration virtualMachineConfiguration = default(VirtualMachineConfiguration), System.TimeSpan? resizeTimeout = default(System.TimeSpan?), IList resizeErrors = default(IList), int? currentDedicatedNodes = default(int?), int? currentLowPriorityNodes = default(int?), int? targetDedicatedNodes = default(int?), int? targetLowPriorityNodes = default(int?), bool? enableAutoScale = default(bool?), string autoScaleFormula = default(string), System.TimeSpan? autoScaleEvaluationInterval = default(System.TimeSpan?), AutoScaleRun autoScaleRun = default(AutoScaleRun), bool? enableInterNodeCommunication = default(bool?), NetworkConfiguration networkConfiguration = default(NetworkConfiguration), StartTask startTask = default(StartTask), IList certificateReferences = default(IList), IList applicationPackageReferences = default(IList), IList applicationLicenses = default(IList), int? maxTasksPerNode = default(int?), TaskSchedulingPolicy taskSchedulingPolicy = default(TaskSchedulingPolicy), IList userAccounts = default(IList), IList metadata = default(IList), PoolStatistics stats = default(PoolStatistics)) { - this.Id = id; - this.DisplayName = displayName; - this.Url = url; - this.ETag = eTag; - this.LastModified = lastModified; - this.CreationTime = creationTime; - this.State = state; - this.StateTransitionTime = stateTransitionTime; - this.AllocationState = allocationState; - this.AllocationStateTransitionTime = allocationStateTransitionTime; - this.VmSize = vmSize; - this.CloudServiceConfiguration = cloudServiceConfiguration; - this.VirtualMachineConfiguration = virtualMachineConfiguration; - this.ResizeTimeout = resizeTimeout; - this.ResizeErrors = resizeErrors; - this.CurrentDedicatedNodes = currentDedicatedNodes; - this.CurrentLowPriorityNodes = currentLowPriorityNodes; - this.TargetDedicatedNodes = targetDedicatedNodes; - this.TargetLowPriorityNodes = targetLowPriorityNodes; - this.EnableAutoScale = enableAutoScale; - this.AutoScaleFormula = autoScaleFormula; - this.AutoScaleEvaluationInterval = autoScaleEvaluationInterval; - this.AutoScaleRun = autoScaleRun; - this.EnableInterNodeCommunication = enableInterNodeCommunication; - this.NetworkConfiguration = networkConfiguration; - this.StartTask = startTask; - this.CertificateReferences = certificateReferences; - this.ApplicationPackageReferences = applicationPackageReferences; - this.ApplicationLicenses = applicationLicenses; - this.MaxTasksPerNode = maxTasksPerNode; - this.TaskSchedulingPolicy = taskSchedulingPolicy; - this.UserAccounts = userAccounts; - this.Metadata = metadata; - this.Stats = stats; + Id = id; + DisplayName = displayName; + Url = url; + ETag = eTag; + LastModified = lastModified; + CreationTime = creationTime; + State = state; + StateTransitionTime = stateTransitionTime; + AllocationState = allocationState; + AllocationStateTransitionTime = allocationStateTransitionTime; + VmSize = vmSize; + CloudServiceConfiguration = cloudServiceConfiguration; + VirtualMachineConfiguration = virtualMachineConfiguration; + ResizeTimeout = resizeTimeout; + ResizeErrors = resizeErrors; + CurrentDedicatedNodes = currentDedicatedNodes; + CurrentLowPriorityNodes = currentLowPriorityNodes; + TargetDedicatedNodes = targetDedicatedNodes; + TargetLowPriorityNodes = targetLowPriorityNodes; + EnableAutoScale = enableAutoScale; + AutoScaleFormula = autoScaleFormula; + AutoScaleEvaluationInterval = autoScaleEvaluationInterval; + AutoScaleRun = autoScaleRun; + EnableInterNodeCommunication = enableInterNodeCommunication; + NetworkConfiguration = networkConfiguration; + StartTask = startTask; + CertificateReferences = certificateReferences; + ApplicationPackageReferences = applicationPackageReferences; + ApplicationLicenses = applicationLicenses; + MaxTasksPerNode = maxTasksPerNode; + TaskSchedulingPolicy = taskSchedulingPolicy; + UserAccounts = userAccounts; + Metadata = metadata; + Stats = stats; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets a string that uniquely identifies the pool within the /// account. @@ -132,9 +147,11 @@ public CloudPool() { } /// /// The ID can contain any combination of alphanumeric characters /// including hyphens and underscores, and cannot contain more than 64 - /// characters. It is common to use a GUID for the id. + /// characters. The ID is case-preserving and case-insensitive (that + /// is, you may not have two IDs within an account that differ only by + /// case). /// - [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + [JsonProperty(PropertyName = "id")] public string Id { get; set; } /// @@ -144,13 +161,13 @@ public CloudPool() { } /// The display name need not be unique and can contain any Unicode /// characters up to a maximum length of 1024. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "displayName")] + [JsonProperty(PropertyName = "displayName")] public string DisplayName { get; set; } /// /// Gets or sets the URL of the pool. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "url")] + [JsonProperty(PropertyName = "url")] public string Url { get; set; } /// @@ -162,7 +179,7 @@ public CloudPool() { } /// ETag when updating a pool to specify that your changes should take /// effect only if nobody else has modified the pool in the meantime. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "eTag")] + [JsonProperty(PropertyName = "eTag")] public string ETag { get; set; } /// @@ -174,60 +191,66 @@ public CloudPool() { } /// not factor in node-level changes such as a compute node changing /// state. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "lastModified")] + [JsonProperty(PropertyName = "lastModified")] public System.DateTime? LastModified { get; set; } /// /// Gets or sets the creation time of the pool. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "creationTime")] + [JsonProperty(PropertyName = "creationTime")] public System.DateTime? CreationTime { get; set; } /// /// Gets or sets the current state of the pool. /// /// + /// Values are: + /// /// active - The pool is available to run tasks subject to the - /// availability of compute nodes. deleting - The user has requested - /// that the pool be deleted, but the delete operation has not yet - /// completed. upgrading - The user has requested that the operating - /// system of the pool's nodes be upgraded, but the upgrade operation - /// has not yet completed (that is, some nodes in the pool have not yet - /// been upgraded). While upgrading, the pool may be able to run tasks - /// (with reduced capacity) but this is not guaranteed. Possible values + /// availability of compute nodes. + /// deleting - The user has requested that the pool be deleted, but the + /// delete operation has not yet completed. + /// upgrading - The user has requested that the operating system of the + /// pool's nodes be upgraded, but the upgrade operation has not yet + /// completed (that is, some nodes in the pool have not yet been + /// upgraded). While upgrading, the pool may be able to run tasks (with + /// reduced capacity) but this is not guaranteed. Possible values /// include: 'active', 'deleting', 'upgrading' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "state")] + [JsonProperty(PropertyName = "state")] public PoolState? State { get; set; } /// /// Gets or sets the time at which the pool entered its current state. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "stateTransitionTime")] + [JsonProperty(PropertyName = "stateTransitionTime")] public System.DateTime? StateTransitionTime { get; set; } /// /// Gets or sets whether the pool is resizing. /// /// + /// Values are: + /// /// steady - The pool is not resizing. There are no changes to the /// number of nodes in the pool in progress. A pool enters this state /// when it is created and when no operations are being performed on - /// the pool to change the number of dedicated nodes. resizing - The - /// pool is resizing; that is, compute nodes are being added to or - /// removed from the pool. stopping - The pool was resizing, but the - /// user has requested that the resize be stopped, but the stop request - /// has not yet been completed. Possible values include: 'steady', - /// 'resizing', 'stopping' + /// the pool to change the number of dedicated nodes. + /// resizing - The pool is resizing; that is, compute nodes are being + /// added to or removed from the pool. + /// stopping - The pool was resizing, but the user has requested that + /// the resize be stopped, but the stop request has not yet been + /// completed. Possible values include: 'steady', 'resizing', + /// 'stopping' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "allocationState")] + [JsonProperty(PropertyName = "allocationState")] public AllocationState? AllocationState { get; set; } /// /// Gets or sets the time at which the pool entered its current /// allocation state. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "allocationStateTransitionTime")] + [JsonProperty(PropertyName = "allocationStateTransitionTime")] public System.DateTime? AllocationStateTransitionTime { get; set; } /// @@ -250,7 +273,7 @@ public CloudPool() { } /// premium storage (STANDARD_GS, STANDARD_DS, and STANDARD_DSV2 /// series). /// - [Newtonsoft.Json.JsonProperty(PropertyName = "vmSize")] + [JsonProperty(PropertyName = "vmSize")] public string VmSize { get; set; } /// @@ -262,7 +285,7 @@ public CloudPool() { } /// property cannot be specified if the Batch account was created with /// its poolAllocationMode property set to 'UserSubscription'. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "cloudServiceConfiguration")] + [JsonProperty(PropertyName = "cloudServiceConfiguration")] public CloudServiceConfiguration CloudServiceConfiguration { get; set; } /// @@ -272,7 +295,7 @@ public CloudPool() { } /// This property and cloudServiceConfiguration are mutually exclusive /// and one of the properties must be specified. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "virtualMachineConfiguration")] + [JsonProperty(PropertyName = "virtualMachineConfiguration")] public VirtualMachineConfiguration VirtualMachineConfiguration { get; set; } /// @@ -284,7 +307,7 @@ public CloudPool() { } /// initial sizing when the pool is created counts as a resize.) The /// default value is 15 minutes. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "resizeTimeout")] + [JsonProperty(PropertyName = "resizeTimeout")] public System.TimeSpan? ResizeTimeout { get; set; } /// @@ -295,14 +318,14 @@ public CloudPool() { } /// This property is set only if one or more errors occurred during the /// last pool resize, and only when the pool allocationState is Steady. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "resizeErrors")] - public System.Collections.Generic.IList ResizeErrors { get; set; } + [JsonProperty(PropertyName = "resizeErrors")] + public IList ResizeErrors { get; set; } /// /// Gets or sets the number of dedicated compute nodes currently in the /// pool. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "currentDedicatedNodes")] + [JsonProperty(PropertyName = "currentDedicatedNodes")] public int? CurrentDedicatedNodes { get; set; } /// @@ -313,21 +336,21 @@ public CloudPool() { } /// Low-priority compute nodes which have been preempted are included /// in this count. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "currentLowPriorityNodes")] + [JsonProperty(PropertyName = "currentLowPriorityNodes")] public int? CurrentLowPriorityNodes { get; set; } /// /// Gets or sets the desired number of dedicated compute nodes in the /// pool. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "targetDedicatedNodes")] + [JsonProperty(PropertyName = "targetDedicatedNodes")] public int? TargetDedicatedNodes { get; set; } /// /// Gets or sets the desired number of low-priority compute nodes in /// the pool. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "targetLowPriorityNodes")] + [JsonProperty(PropertyName = "targetLowPriorityNodes")] public int? TargetLowPriorityNodes { get; set; } /// @@ -340,7 +363,7 @@ public CloudPool() { } /// autoScaleFormula property is required and the pool automatically /// resizes according to the formula. The default value is false. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "enableAutoScale")] + [JsonProperty(PropertyName = "enableAutoScale")] public bool? EnableAutoScale { get; set; } /// @@ -351,7 +374,7 @@ public CloudPool() { } /// This property is set only if the pool automatically scales, i.e. /// enableAutoScale is true. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "autoScaleFormula")] + [JsonProperty(PropertyName = "autoScaleFormula")] public string AutoScaleFormula { get; set; } /// @@ -362,7 +385,7 @@ public CloudPool() { } /// This property is set only if the pool automatically scales, i.e. /// enableAutoScale is true. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "autoScaleEvaluationInterval")] + [JsonProperty(PropertyName = "autoScaleEvaluationInterval")] public System.TimeSpan? AutoScaleEvaluationInterval { get; set; } /// @@ -373,7 +396,7 @@ public CloudPool() { } /// This property is set only if the pool automatically scales, i.e. /// enableAutoScale is true. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "autoScaleRun")] + [JsonProperty(PropertyName = "autoScaleRun")] public AutoScaleRun AutoScaleRun { get; set; } /// @@ -385,20 +408,20 @@ public CloudPool() { } /// pool. Specifying this value can reduce the chance of the requested /// number of nodes to be allocated in the pool. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "enableInterNodeCommunication")] + [JsonProperty(PropertyName = "enableInterNodeCommunication")] public bool? EnableInterNodeCommunication { get; set; } /// /// Gets or sets the network configuration for the pool. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "networkConfiguration")] + [JsonProperty(PropertyName = "networkConfiguration")] public NetworkConfiguration NetworkConfiguration { get; set; } /// /// Gets or sets a task specified to run on each compute node as it /// joins the pool. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "startTask")] + [JsonProperty(PropertyName = "startTask")] public StartTask StartTask { get; set; } /// @@ -416,15 +439,15 @@ public CloudPool() { } /// /home/{user-name}/certs) and certificates are placed in that /// directory. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "certificateReferences")] - public System.Collections.Generic.IList CertificateReferences { get; set; } + [JsonProperty(PropertyName = "certificateReferences")] + public IList CertificateReferences { get; set; } /// /// Gets or sets the list of application packages to be installed on /// each compute node in the pool. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "applicationPackageReferences")] - public System.Collections.Generic.IList ApplicationPackageReferences { get; set; } + [JsonProperty(PropertyName = "applicationPackageReferences")] + public IList ApplicationPackageReferences { get; set; } /// /// Gets or sets the list of application licenses the Batch service @@ -435,75 +458,75 @@ public CloudPool() { } /// Batch service application licenses. If a license is requested which /// is not supported, pool creation will fail. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "applicationLicenses")] - public System.Collections.Generic.IList ApplicationLicenses { get; set; } + [JsonProperty(PropertyName = "applicationLicenses")] + public IList ApplicationLicenses { get; set; } /// /// Gets or sets the maximum number of tasks that can run concurrently /// on a single compute node in the pool. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "maxTasksPerNode")] + [JsonProperty(PropertyName = "maxTasksPerNode")] public int? MaxTasksPerNode { get; set; } /// - /// Gets or sets how the Batch service distributes tasks between - /// compute nodes in the pool. + /// Gets or sets how tasks are distributed across compute nodes in a + /// pool. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "taskSchedulingPolicy")] + [JsonProperty(PropertyName = "taskSchedulingPolicy")] public TaskSchedulingPolicy TaskSchedulingPolicy { get; set; } /// /// Gets or sets the list of user accounts to be created on each node /// in the pool. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "userAccounts")] - public System.Collections.Generic.IList UserAccounts { get; set; } + [JsonProperty(PropertyName = "userAccounts")] + public IList UserAccounts { get; set; } /// /// Gets or sets a list of name-value pairs associated with the pool as /// metadata. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "metadata")] - public System.Collections.Generic.IList Metadata { get; set; } + [JsonProperty(PropertyName = "metadata")] + public IList Metadata { get; set; } /// /// Gets or sets utilization and resource usage statistics for the /// entire lifetime of the pool. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "stats")] + [JsonProperty(PropertyName = "stats")] public PoolStatistics Stats { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (this.CloudServiceConfiguration != null) + if (CloudServiceConfiguration != null) { - this.CloudServiceConfiguration.Validate(); + CloudServiceConfiguration.Validate(); } - if (this.VirtualMachineConfiguration != null) + if (VirtualMachineConfiguration != null) { - this.VirtualMachineConfiguration.Validate(); + VirtualMachineConfiguration.Validate(); } - if (this.AutoScaleRun != null) + if (AutoScaleRun != null) { - this.AutoScaleRun.Validate(); + AutoScaleRun.Validate(); } - if (this.NetworkConfiguration != null) + if (NetworkConfiguration != null) { - this.NetworkConfiguration.Validate(); + NetworkConfiguration.Validate(); } - if (this.StartTask != null) + if (StartTask != null) { - this.StartTask.Validate(); + StartTask.Validate(); } - if (this.CertificateReferences != null) + if (CertificateReferences != null) { - foreach (var element in this.CertificateReferences) + foreach (var element in CertificateReferences) { if (element != null) { @@ -511,9 +534,9 @@ public virtual void Validate() } } } - if (this.ApplicationPackageReferences != null) + if (ApplicationPackageReferences != null) { - foreach (var element1 in this.ApplicationPackageReferences) + foreach (var element1 in ApplicationPackageReferences) { if (element1 != null) { @@ -521,13 +544,13 @@ public virtual void Validate() } } } - if (this.TaskSchedulingPolicy != null) + if (TaskSchedulingPolicy != null) { - this.TaskSchedulingPolicy.Validate(); + TaskSchedulingPolicy.Validate(); } - if (this.UserAccounts != null) + if (UserAccounts != null) { - foreach (var element2 in this.UserAccounts) + foreach (var element2 in UserAccounts) { if (element2 != null) { @@ -535,9 +558,9 @@ public virtual void Validate() } } } - if (this.Metadata != null) + if (Metadata != null) { - foreach (var element3 in this.Metadata) + foreach (var element3 in Metadata) { if (element3 != null) { @@ -545,9 +568,9 @@ public virtual void Validate() } } } - if (this.Stats != null) + if (Stats != null) { - this.Stats.Validate(); + Stats.Validate(); } } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/CloudServiceConfiguration.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/CloudServiceConfiguration.cs index d6ee26ac8abc..5224a8667c03 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/CloudServiceConfiguration.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/CloudServiceConfiguration.cs @@ -8,6 +8,11 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Newtonsoft.Json; using System.Linq; /// @@ -19,7 +24,10 @@ public partial class CloudServiceConfiguration /// /// Initializes a new instance of the CloudServiceConfiguration class. /// - public CloudServiceConfiguration() { } + public CloudServiceConfiguration() + { + CustomInit(); + } /// /// Initializes a new instance of the CloudServiceConfiguration class. @@ -32,11 +40,17 @@ public CloudServiceConfiguration() { } /// installed on the virtual machines in the pool. public CloudServiceConfiguration(string osFamily, string targetOSVersion = default(string), string currentOSVersion = default(string)) { - this.OsFamily = osFamily; - this.TargetOSVersion = targetOSVersion; - this.CurrentOSVersion = currentOSVersion; + OsFamily = osFamily; + TargetOSVersion = targetOSVersion; + CurrentOSVersion = currentOSVersion; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the Azure Guest OS family to be installed on the /// virtual machines in the pool. @@ -49,7 +63,7 @@ public CloudServiceConfiguration() { } /// Azure Guest OS Releases /// (https://azure.microsoft.com/documentation/articles/cloud-services-guestos-update-matrix/#releases). /// - [Newtonsoft.Json.JsonProperty(PropertyName = "osFamily")] + [JsonProperty(PropertyName = "osFamily")] public string OsFamily { get; set; } /// @@ -60,7 +74,7 @@ public CloudServiceConfiguration() { } /// The default value is * which specifies the latest operating system /// version for the specified OS family. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "targetOSVersion")] + [JsonProperty(PropertyName = "targetOSVersion")] public string TargetOSVersion { get; set; } /// @@ -74,20 +88,20 @@ public CloudServiceConfiguration() { } /// upgrade process. Once all virtual machines have upgraded, /// currentOSVersion is updated to be the same as targetOSVersion. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "currentOSVersion")] + [JsonProperty(PropertyName = "currentOSVersion")] public string CurrentOSVersion { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (this.OsFamily == null) + if (OsFamily == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "OsFamily"); + throw new ValidationException(ValidationRules.CannotBeNull, "OsFamily"); } } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/CloudTask.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/CloudTask.cs index add515cf39df..3eef9a2d3f84 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/CloudTask.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/CloudTask.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class CloudTask /// /// Initializes a new instance of the CloudTask class. /// - public CloudTask() { } + public CloudTask() + { + CustomInit(); + } /// /// Initializes a new instance of the CloudTask class. @@ -71,35 +80,41 @@ public CloudTask() { } /// The settings for an /// authentication token that the task can use to perform Batch service /// operations. - public CloudTask(string id = default(string), string displayName = default(string), string url = default(string), string eTag = default(string), System.DateTime? lastModified = default(System.DateTime?), System.DateTime? creationTime = default(System.DateTime?), ExitConditions exitConditions = default(ExitConditions), TaskState? state = default(TaskState?), System.DateTime? stateTransitionTime = default(System.DateTime?), TaskState? previousState = default(TaskState?), System.DateTime? previousStateTransitionTime = default(System.DateTime?), string commandLine = default(string), System.Collections.Generic.IList resourceFiles = default(System.Collections.Generic.IList), System.Collections.Generic.IList outputFiles = default(System.Collections.Generic.IList), System.Collections.Generic.IList environmentSettings = default(System.Collections.Generic.IList), AffinityInformation affinityInfo = default(AffinityInformation), TaskConstraints constraints = default(TaskConstraints), UserIdentity userIdentity = default(UserIdentity), TaskExecutionInformation executionInfo = default(TaskExecutionInformation), ComputeNodeInformation nodeInfo = default(ComputeNodeInformation), MultiInstanceSettings multiInstanceSettings = default(MultiInstanceSettings), TaskStatistics stats = default(TaskStatistics), TaskDependencies dependsOn = default(TaskDependencies), System.Collections.Generic.IList applicationPackageReferences = default(System.Collections.Generic.IList), AuthenticationTokenSettings authenticationTokenSettings = default(AuthenticationTokenSettings)) + public CloudTask(string id = default(string), string displayName = default(string), string url = default(string), string eTag = default(string), System.DateTime? lastModified = default(System.DateTime?), System.DateTime? creationTime = default(System.DateTime?), ExitConditions exitConditions = default(ExitConditions), TaskState? state = default(TaskState?), System.DateTime? stateTransitionTime = default(System.DateTime?), TaskState? previousState = default(TaskState?), System.DateTime? previousStateTransitionTime = default(System.DateTime?), string commandLine = default(string), IList resourceFiles = default(IList), IList outputFiles = default(IList), IList environmentSettings = default(IList), AffinityInformation affinityInfo = default(AffinityInformation), TaskConstraints constraints = default(TaskConstraints), UserIdentity userIdentity = default(UserIdentity), TaskExecutionInformation executionInfo = default(TaskExecutionInformation), ComputeNodeInformation nodeInfo = default(ComputeNodeInformation), MultiInstanceSettings multiInstanceSettings = default(MultiInstanceSettings), TaskStatistics stats = default(TaskStatistics), TaskDependencies dependsOn = default(TaskDependencies), IList applicationPackageReferences = default(IList), AuthenticationTokenSettings authenticationTokenSettings = default(AuthenticationTokenSettings)) { - this.Id = id; - this.DisplayName = displayName; - this.Url = url; - this.ETag = eTag; - this.LastModified = lastModified; - this.CreationTime = creationTime; - this.ExitConditions = exitConditions; - this.State = state; - this.StateTransitionTime = stateTransitionTime; - this.PreviousState = previousState; - this.PreviousStateTransitionTime = previousStateTransitionTime; - this.CommandLine = commandLine; - this.ResourceFiles = resourceFiles; - this.OutputFiles = outputFiles; - this.EnvironmentSettings = environmentSettings; - this.AffinityInfo = affinityInfo; - this.Constraints = constraints; - this.UserIdentity = userIdentity; - this.ExecutionInfo = executionInfo; - this.NodeInfo = nodeInfo; - this.MultiInstanceSettings = multiInstanceSettings; - this.Stats = stats; - this.DependsOn = dependsOn; - this.ApplicationPackageReferences = applicationPackageReferences; - this.AuthenticationTokenSettings = authenticationTokenSettings; + Id = id; + DisplayName = displayName; + Url = url; + ETag = eTag; + LastModified = lastModified; + CreationTime = creationTime; + ExitConditions = exitConditions; + State = state; + StateTransitionTime = stateTransitionTime; + PreviousState = previousState; + PreviousStateTransitionTime = previousStateTransitionTime; + CommandLine = commandLine; + ResourceFiles = resourceFiles; + OutputFiles = outputFiles; + EnvironmentSettings = environmentSettings; + AffinityInfo = affinityInfo; + Constraints = constraints; + UserIdentity = userIdentity; + ExecutionInfo = executionInfo; + NodeInfo = nodeInfo; + MultiInstanceSettings = multiInstanceSettings; + Stats = stats; + DependsOn = dependsOn; + ApplicationPackageReferences = applicationPackageReferences; + AuthenticationTokenSettings = authenticationTokenSettings; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets a string that uniquely identifies the task within the /// job. @@ -109,7 +124,7 @@ public CloudTask() { } /// including hyphens and underscores, and cannot contain more than 64 /// characters. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + [JsonProperty(PropertyName = "id")] public string Id { get; set; } /// @@ -119,13 +134,13 @@ public CloudTask() { } /// The display name need not be unique and can contain any Unicode /// characters up to a maximum length of 1024. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "displayName")] + [JsonProperty(PropertyName = "displayName")] public string DisplayName { get; set; } /// /// Gets or sets the URL of the task. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "url")] + [JsonProperty(PropertyName = "url")] public string Url { get; set; } /// @@ -137,26 +152,26 @@ public CloudTask() { } /// ETag when updating a task to specify that your changes should take /// effect only if nobody else has modified the task in the meantime. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "eTag")] + [JsonProperty(PropertyName = "eTag")] public string ETag { get; set; } /// /// Gets or sets the last modified time of the task. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "lastModified")] + [JsonProperty(PropertyName = "lastModified")] public System.DateTime? LastModified { get; set; } /// /// Gets or sets the creation time of the task. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "creationTime")] + [JsonProperty(PropertyName = "creationTime")] public System.DateTime? CreationTime { get; set; } /// /// Gets or sets how the Batch service should respond when the task /// completes. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "exitConditions")] + [JsonProperty(PropertyName = "exitConditions")] public ExitConditions ExitConditions { get; set; } /// @@ -166,13 +181,13 @@ public CloudTask() { } /// Possible values include: 'active', 'preparing', 'running', /// 'completed' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "state")] + [JsonProperty(PropertyName = "state")] public TaskState? State { get; set; } /// /// Gets or sets the time at which the task entered its current state. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "stateTransitionTime")] + [JsonProperty(PropertyName = "stateTransitionTime")] public System.DateTime? StateTransitionTime { get; set; } /// @@ -183,7 +198,7 @@ public CloudTask() { } /// state. Possible values include: 'active', 'preparing', 'running', /// 'completed' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "previousState")] + [JsonProperty(PropertyName = "previousState")] public TaskState? PreviousState { get; set; } /// @@ -193,7 +208,7 @@ public CloudTask() { } /// This property is not set if the task is in its initial Active /// state. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "previousStateTransitionTime")] + [JsonProperty(PropertyName = "previousStateTransitionTime")] public System.DateTime? PreviousStateTransitionTime { get; set; } /// @@ -209,7 +224,7 @@ public CloudTask() { } /// command line, for example using "cmd /c MyCommand" in Windows or /// "/bin/sh -c MyCommand" in Linux. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "commandLine")] + [JsonProperty(PropertyName = "commandLine")] public string CommandLine { get; set; } /// @@ -221,8 +236,8 @@ public CloudTask() { } /// downloaded to the compute node on which the primary task is /// executed. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "resourceFiles")] - public System.Collections.Generic.IList ResourceFiles { get; set; } + [JsonProperty(PropertyName = "resourceFiles")] + public IList ResourceFiles { get; set; } /// /// Gets or sets a list of files that the Batch service will upload @@ -232,26 +247,26 @@ public CloudTask() { } /// For multi-instance tasks, the files will only be uploaded from the /// compute node on which the primary task is executed. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "outputFiles")] - public System.Collections.Generic.IList OutputFiles { get; set; } + [JsonProperty(PropertyName = "outputFiles")] + public IList OutputFiles { get; set; } /// /// Gets or sets a list of environment variable settings for the task. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "environmentSettings")] - public System.Collections.Generic.IList EnvironmentSettings { get; set; } + [JsonProperty(PropertyName = "environmentSettings")] + public IList EnvironmentSettings { get; set; } /// /// Gets or sets a locality hint that can be used by the Batch service /// to select a compute node on which to start the new task. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "affinityInfo")] + [JsonProperty(PropertyName = "affinityInfo")] public AffinityInformation AffinityInfo { get; set; } /// /// Gets or sets the execution constraints that apply to this task. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "constraints")] + [JsonProperty(PropertyName = "constraints")] public TaskConstraints Constraints { get; set; } /// @@ -261,20 +276,20 @@ public CloudTask() { } /// If omitted, the task runs as a non-administrative user unique to /// the task. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "userIdentity")] + [JsonProperty(PropertyName = "userIdentity")] public UserIdentity UserIdentity { get; set; } /// /// Gets or sets information about the execution of the task. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "executionInfo")] + [JsonProperty(PropertyName = "executionInfo")] public TaskExecutionInformation ExecutionInfo { get; set; } /// /// Gets or sets information about the compute node on which the task /// ran. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "nodeInfo")] + [JsonProperty(PropertyName = "nodeInfo")] public ComputeNodeInformation NodeInfo { get; set; } /// @@ -282,13 +297,13 @@ public CloudTask() { } /// multi-instance task, and contains information about how to run the /// multi-instance task. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "multiInstanceSettings")] + [JsonProperty(PropertyName = "multiInstanceSettings")] public MultiInstanceSettings MultiInstanceSettings { get; set; } /// /// Gets or sets resource usage statistics for the task. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "stats")] + [JsonProperty(PropertyName = "stats")] public TaskStatistics Stats { get; set; } /// @@ -299,15 +314,24 @@ public CloudTask() { } /// have completed successfully. If any of those tasks fail and exhaust /// their retry counts, this task will never be scheduled. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "dependsOn")] + [JsonProperty(PropertyName = "dependsOn")] public TaskDependencies DependsOn { get; set; } /// /// Gets or sets a list of application packages that the Batch service /// will deploy to the compute node before running the command line. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "applicationPackageReferences")] - public System.Collections.Generic.IList ApplicationPackageReferences { get; set; } + /// + /// Application packages are downloaded and deployed to a shared + /// directory, not the task working directory. Therefore, if a + /// referenced package is already on the compute node, and is up to + /// date, then it is not re-downloaded; the existing copy on the + /// compute node is used. If a referenced application package cannot be + /// installed, for example because the package has been deleted or + /// because download failed, the task fails. + /// + [JsonProperty(PropertyName = "applicationPackageReferences")] + public IList ApplicationPackageReferences { get; set; } /// /// Gets or sets the settings for an authentication token that the task @@ -323,20 +347,20 @@ public CloudTask() { } /// permissions in order to add other tasks to the job, or check the /// status of the job or of other tasks under the job. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "authenticationTokenSettings")] + [JsonProperty(PropertyName = "authenticationTokenSettings")] public AuthenticationTokenSettings AuthenticationTokenSettings { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (this.ResourceFiles != null) + if (ResourceFiles != null) { - foreach (var element in this.ResourceFiles) + foreach (var element in ResourceFiles) { if (element != null) { @@ -344,9 +368,9 @@ public virtual void Validate() } } } - if (this.OutputFiles != null) + if (OutputFiles != null) { - foreach (var element1 in this.OutputFiles) + foreach (var element1 in OutputFiles) { if (element1 != null) { @@ -354,9 +378,9 @@ public virtual void Validate() } } } - if (this.EnvironmentSettings != null) + if (EnvironmentSettings != null) { - foreach (var element2 in this.EnvironmentSettings) + foreach (var element2 in EnvironmentSettings) { if (element2 != null) { @@ -364,25 +388,25 @@ public virtual void Validate() } } } - if (this.AffinityInfo != null) + if (AffinityInfo != null) { - this.AffinityInfo.Validate(); + AffinityInfo.Validate(); } - if (this.ExecutionInfo != null) + if (ExecutionInfo != null) { - this.ExecutionInfo.Validate(); + ExecutionInfo.Validate(); } - if (this.MultiInstanceSettings != null) + if (MultiInstanceSettings != null) { - this.MultiInstanceSettings.Validate(); + MultiInstanceSettings.Validate(); } - if (this.Stats != null) + if (Stats != null) { - this.Stats.Validate(); + Stats.Validate(); } - if (this.ApplicationPackageReferences != null) + if (ApplicationPackageReferences != null) { - foreach (var element3 in this.ApplicationPackageReferences) + foreach (var element3 in ApplicationPackageReferences) { if (element3 != null) { diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/CloudTaskListSubtasksResult.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/CloudTaskListSubtasksResult.cs index 22588767b703..7e3fb9dcf782 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/CloudTaskListSubtasksResult.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/CloudTaskListSubtasksResult.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// @@ -19,23 +25,32 @@ public partial class CloudTaskListSubtasksResult /// Initializes a new instance of the CloudTaskListSubtasksResult /// class. /// - public CloudTaskListSubtasksResult() { } + public CloudTaskListSubtasksResult() + { + CustomInit(); + } /// /// Initializes a new instance of the CloudTaskListSubtasksResult /// class. /// /// The list of subtasks. - public CloudTaskListSubtasksResult(System.Collections.Generic.IList value = default(System.Collections.Generic.IList)) + public CloudTaskListSubtasksResult(IList value = default(IList)) { - this.Value = value; + Value = value; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the list of subtasks. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "value")] - public System.Collections.Generic.IList Value { get; set; } + [JsonProperty(PropertyName = "value")] + public IList Value { get; set; } } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNode.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNode.cs index f272c8a5ccf8..1728e23fde54 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNode.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNode.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class ComputeNode /// /// Initializes a new instance of the ComputeNode class. /// - public ComputeNode() { } + public ComputeNode() + { + CustomInit(); + } /// /// Initializes a new instance of the ComputeNode class. @@ -37,8 +46,8 @@ public ComputeNode() { } /// The IP address that other compute nodes can /// use to communicate with this compute node. /// An identifier which can be passed when - /// adding a task to request that the task be scheduled close to this - /// compute node. + /// adding a task to request that the task be scheduled on this + /// node. /// The size of the virtual machine hosting the /// compute node. /// The total number of job tasks completed @@ -52,8 +61,8 @@ public ComputeNode() { } /// which completed successfully (with exitCode 0) on the compute node. /// This includes Job Preparation, Job Release, and Job Manager tasks, /// but not the pool start task. - /// The list of tasks that are currently - /// running on the compute node. + /// A list of tasks whose state has recently + /// changed. /// The task specified to run on the compute /// node as it joins the pool. /// Runtime information about the execution @@ -66,30 +75,36 @@ public ComputeNode() { } /// node. If false, the node is a low-priority node. /// The endpoint configuration for /// the compute node. - public ComputeNode(string id = default(string), string url = default(string), ComputeNodeState? state = default(ComputeNodeState?), SchedulingState? schedulingState = default(SchedulingState?), System.DateTime? stateTransitionTime = default(System.DateTime?), System.DateTime? lastBootTime = default(System.DateTime?), System.DateTime? allocationTime = default(System.DateTime?), string ipAddress = default(string), string affinityId = default(string), string vmSize = default(string), int? totalTasksRun = default(int?), int? runningTasksCount = default(int?), int? totalTasksSucceeded = default(int?), System.Collections.Generic.IList recentTasks = default(System.Collections.Generic.IList), StartTask startTask = default(StartTask), StartTaskInformation startTaskInfo = default(StartTaskInformation), System.Collections.Generic.IList certificateReferences = default(System.Collections.Generic.IList), System.Collections.Generic.IList errors = default(System.Collections.Generic.IList), bool? isDedicated = default(bool?), ComputeNodeEndpointConfiguration endpointConfiguration = default(ComputeNodeEndpointConfiguration)) + public ComputeNode(string id = default(string), string url = default(string), ComputeNodeState? state = default(ComputeNodeState?), SchedulingState? schedulingState = default(SchedulingState?), System.DateTime? stateTransitionTime = default(System.DateTime?), System.DateTime? lastBootTime = default(System.DateTime?), System.DateTime? allocationTime = default(System.DateTime?), string ipAddress = default(string), string affinityId = default(string), string vmSize = default(string), int? totalTasksRun = default(int?), int? runningTasksCount = default(int?), int? totalTasksSucceeded = default(int?), IList recentTasks = default(IList), StartTask startTask = default(StartTask), StartTaskInformation startTaskInfo = default(StartTaskInformation), IList certificateReferences = default(IList), IList errors = default(IList), bool? isDedicated = default(bool?), ComputeNodeEndpointConfiguration endpointConfiguration = default(ComputeNodeEndpointConfiguration)) { - this.Id = id; - this.Url = url; - this.State = state; - this.SchedulingState = schedulingState; - this.StateTransitionTime = stateTransitionTime; - this.LastBootTime = lastBootTime; - this.AllocationTime = allocationTime; - this.IpAddress = ipAddress; - this.AffinityId = affinityId; - this.VmSize = vmSize; - this.TotalTasksRun = totalTasksRun; - this.RunningTasksCount = runningTasksCount; - this.TotalTasksSucceeded = totalTasksSucceeded; - this.RecentTasks = recentTasks; - this.StartTask = startTask; - this.StartTaskInfo = startTaskInfo; - this.CertificateReferences = certificateReferences; - this.Errors = errors; - this.IsDedicated = isDedicated; - this.EndpointConfiguration = endpointConfiguration; + Id = id; + Url = url; + State = state; + SchedulingState = schedulingState; + StateTransitionTime = stateTransitionTime; + LastBootTime = lastBootTime; + AllocationTime = allocationTime; + IpAddress = ipAddress; + AffinityId = affinityId; + VmSize = vmSize; + TotalTasksRun = totalTasksRun; + RunningTasksCount = runningTasksCount; + TotalTasksSucceeded = totalTasksSucceeded; + RecentTasks = recentTasks; + StartTask = startTask; + StartTaskInfo = startTaskInfo; + CertificateReferences = certificateReferences; + Errors = errors; + IsDedicated = isDedicated; + EndpointConfiguration = endpointConfiguration; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the ID of the compute node. /// @@ -98,25 +113,54 @@ public ComputeNode() { } /// Whenever a node is removed from a pool, all of its local files are /// deleted, and the ID is reclaimed and could be reused for new nodes. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + [JsonProperty(PropertyName = "id")] public string Id { get; set; } /// /// Gets or sets the URL of the compute node. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "url")] + [JsonProperty(PropertyName = "url")] public string Url { get; set; } /// /// Gets or sets the current state of the compute node. /// /// - /// Possible values include: 'idle', 'rebooting', 'reimaging', - /// 'running', 'unusable', 'creating', 'starting', - /// 'waitingForStartTask', 'startTaskFailed', 'unknown', 'leavingPool', - /// 'offline', 'preempted' + /// Values are: + /// + /// idle - The node is not currently running a task. + /// rebooting - The node is rebooting. + /// reimaging - The node is reimaging. + /// running - The node is running one or more tasks (other than a start + /// task). + /// unusable - The node cannot be used for task execution due to + /// errors. + /// creating - The Batch service has obtained the underlying virtual + /// machine from Azure Compute, but it has not yet started to join the + /// pool. + /// starting - the Batch service is starting on the underlying virtual + /// machine. + /// waitingforstarttask - The start task has started running on the + /// compute node, but waitForSuccess is set and the start task has not + /// yet completed. + /// starttaskfailed - The start task has failed on the compute node + /// (and exhausted all retries), and waitForSuccess is set. The node is + /// not usable for running tasks. + /// unknown - The Batch service has lost contact with the node, and + /// does not know its true state. + /// leavingpool - The node is leaving the pool, either because the user + /// explicitly removed it or because the pool is resizing or + /// autoscaling down. + /// offline - The node is not currently running a task, and scheduling + /// of new tasks to the node is disabled. + /// preempted - The low-priority node has been preempted. Tasks which + /// were running on the node when it was pre-empted will be rescheduled + /// when another node becomes available. Possible values include: + /// 'idle', 'rebooting', 'reimaging', 'running', 'unusable', + /// 'creating', 'starting', 'waitingForStartTask', 'startTaskFailed', + /// 'unknown', 'leavingPool', 'offline', 'preempted' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "state")] + [JsonProperty(PropertyName = "state")] public ComputeNodeState? State { get; set; } /// @@ -124,19 +168,22 @@ public ComputeNode() { } /// scheduling. /// /// - /// enabled - Tasks can be scheduled on the node. disabled - No new - /// tasks will be scheduled on the node. Tasks already running on the - /// node may still run to completion. All nodes start with scheduling - /// enabled. Possible values include: 'enabled', 'disabled' + /// Values are: + /// + /// enabled - Tasks can be scheduled on the node. + /// disabled - No new tasks will be scheduled on the node. Tasks + /// already running on the node may still run to completion. All nodes + /// start with scheduling enabled. Possible values include: 'enabled', + /// 'disabled' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "schedulingState")] + [JsonProperty(PropertyName = "schedulingState")] public SchedulingState? SchedulingState { get; set; } /// /// Gets or sets the time at which the compute node entered its current /// state. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "stateTransitionTime")] + [JsonProperty(PropertyName = "stateTransitionTime")] public System.DateTime? StateTransitionTime { get; set; } /// @@ -145,14 +192,14 @@ public ComputeNode() { } /// /// This property may not be present if the node state is unusable. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "lastBootTime")] + [JsonProperty(PropertyName = "lastBootTime")] public System.DateTime? LastBootTime { get; set; } /// /// Gets or sets the time at which this compute node was allocated to /// the pool. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "allocationTime")] + [JsonProperty(PropertyName = "allocationTime")] public System.DateTime? AllocationTime { get; set; } /// @@ -165,14 +212,19 @@ public ComputeNode() { } /// deleted, and the IP address is reclaimed and could be reused for /// new nodes. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "ipAddress")] + [JsonProperty(PropertyName = "ipAddress")] public string IpAddress { get; set; } /// /// Gets or sets an identifier which can be passed when adding a task - /// to request that the task be scheduled close to this compute node. + /// to request that the task be scheduled on this node. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "affinityId")] + /// + /// Note that this is just a soft affinity. If the target node is busy + /// or unavailable at the time the task is scheduled, then the task + /// will be scheduled elsewhere. + /// + [JsonProperty(PropertyName = "affinityId")] public string AffinityId { get; set; } /// @@ -195,7 +247,7 @@ public ComputeNode() { } /// premium storage (STANDARD_GS, STANDARD_DS, and STANDARD_DSV2 /// series). /// - [Newtonsoft.Json.JsonProperty(PropertyName = "vmSize")] + [JsonProperty(PropertyName = "vmSize")] public string VmSize { get; set; } /// @@ -203,7 +255,7 @@ public ComputeNode() { } /// node. This includes Job Preparation, Job Release and Job Manager /// tasks, but not the pool start task. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "totalTasksRun")] + [JsonProperty(PropertyName = "totalTasksRun")] public int? TotalTasksRun { get; set; } /// @@ -211,7 +263,7 @@ public ComputeNode() { } /// compute node. This includes Job Preparation, Job Release, and Job /// Manager tasks, but not the pool start task. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "runningTasksCount")] + [JsonProperty(PropertyName = "runningTasksCount")] public int? RunningTasksCount { get; set; } /// @@ -220,28 +272,31 @@ public ComputeNode() { } /// Job Preparation, Job Release, and Job Manager tasks, but not the /// pool start task. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "totalTasksSucceeded")] + [JsonProperty(PropertyName = "totalTasksSucceeded")] public int? TotalTasksSucceeded { get; set; } /// - /// Gets or sets the list of tasks that are currently running on the - /// compute node. + /// Gets or sets a list of tasks whose state has recently changed. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "recentTasks")] - public System.Collections.Generic.IList RecentTasks { get; set; } + /// + /// This property is present only if at least one task has run on this + /// node since it was assigned to the pool. + /// + [JsonProperty(PropertyName = "recentTasks")] + public IList RecentTasks { get; set; } /// /// Gets or sets the task specified to run on the compute node as it /// joins the pool. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "startTask")] + [JsonProperty(PropertyName = "startTask")] public StartTask StartTask { get; set; } /// /// Gets or sets runtime information about the execution of the start /// task on the compute node. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "startTaskInfo")] + [JsonProperty(PropertyName = "startTaskInfo")] public StartTaskInformation StartTaskInfo { get; set; } /// @@ -259,40 +314,40 @@ public ComputeNode() { } /// /home/{user-name}/certs) and certificates are placed in that /// directory. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "certificateReferences")] - public System.Collections.Generic.IList CertificateReferences { get; set; } + [JsonProperty(PropertyName = "certificateReferences")] + public IList CertificateReferences { get; set; } /// /// Gets or sets the list of errors that are currently being /// encountered by the compute node. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "errors")] - public System.Collections.Generic.IList Errors { get; set; } + [JsonProperty(PropertyName = "errors")] + public IList Errors { get; set; } /// /// Gets or sets whether this compute node is a dedicated node. If /// false, the node is a low-priority node. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "isDedicated")] + [JsonProperty(PropertyName = "isDedicated")] public bool? IsDedicated { get; set; } /// /// Gets or sets the endpoint configuration for the compute node. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "endpointConfiguration")] + [JsonProperty(PropertyName = "endpointConfiguration")] public ComputeNodeEndpointConfiguration EndpointConfiguration { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (this.RecentTasks != null) + if (RecentTasks != null) { - foreach (var element in this.RecentTasks) + foreach (var element in RecentTasks) { if (element != null) { @@ -300,17 +355,17 @@ public virtual void Validate() } } } - if (this.StartTask != null) + if (StartTask != null) { - this.StartTask.Validate(); + StartTask.Validate(); } - if (this.StartTaskInfo != null) + if (StartTaskInfo != null) { - this.StartTaskInfo.Validate(); + StartTaskInfo.Validate(); } - if (this.CertificateReferences != null) + if (CertificateReferences != null) { - foreach (var element1 in this.CertificateReferences) + foreach (var element1 in CertificateReferences) { if (element1 != null) { @@ -318,9 +373,9 @@ public virtual void Validate() } } } - if (this.EndpointConfiguration != null) + if (EndpointConfiguration != null) { - this.EndpointConfiguration.Validate(); + EndpointConfiguration.Validate(); } } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeAddUserHeaders.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeAddUserHeaders.cs index 3cff26b2fab2..59290d4d81d5 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeAddUserHeaders.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeAddUserHeaders.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class ComputeNodeAddUserHeaders /// /// Initializes a new instance of the ComputeNodeAddUserHeaders class. /// - public ComputeNodeAddUserHeaders() { } + public ComputeNodeAddUserHeaders() + { + CustomInit(); + } /// /// Initializes a new instance of the ComputeNodeAddUserHeaders class. @@ -44,19 +53,25 @@ public ComputeNodeAddUserHeaders() { } /// the request applied. public ComputeNodeAddUserHeaders(System.Guid? clientRequestId = default(System.Guid?), System.Guid? requestId = default(System.Guid?), string eTag = default(string), System.DateTime? lastModified = default(System.DateTime?), string dataServiceId = default(string)) { - this.ClientRequestId = clientRequestId; - this.RequestId = requestId; - this.ETag = eTag; - this.LastModified = lastModified; - this.DataServiceId = dataServiceId; + ClientRequestId = clientRequestId; + RequestId = requestId; + ETag = eTag; + LastModified = lastModified; + DataServiceId = dataServiceId; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the client-request-id provided by the client during /// the request. This will be returned only if the /// return-client-request-id parameter was set to true. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "client-request-id")] + [JsonProperty(PropertyName = "client-request-id")] public System.Guid? ClientRequestId { get; set; } /// @@ -68,7 +83,7 @@ public ComputeNodeAddUserHeaders() { } /// request was made, the Batch account against which the request was /// made, and the region that account resides in. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "request-id")] + [JsonProperty(PropertyName = "request-id")] public System.Guid? RequestId { get; set; } /// @@ -78,21 +93,21 @@ public ComputeNodeAddUserHeaders() { } /// the If-Modified-Since, If-Unmodified-Since, If-Match or /// If-None-Match headers. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "ETag")] + [JsonProperty(PropertyName = "ETag")] public string ETag { get; set; } /// /// Gets or sets the time at which the resource was last modified. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "Last-Modified")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "Last-Modified")] public System.DateTime? LastModified { get; set; } /// /// Gets or sets the OData ID of the resource to which the request /// applied. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "DataServiceId")] + [JsonProperty(PropertyName = "DataServiceId")] public string DataServiceId { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeAddUserOptions.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeAddUserOptions.cs index 6a5f7a768286..65363bb96d85 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeAddUserOptions.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeAddUserOptions.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class ComputeNodeAddUserOptions /// /// Initializes a new instance of the ComputeNodeAddUserOptions class. /// - public ComputeNodeAddUserOptions() { } + public ComputeNodeAddUserOptions() + { + CustomInit(); + } /// /// Initializes a new instance of the ComputeNodeAddUserOptions class. @@ -36,17 +45,23 @@ public ComputeNodeAddUserOptions() { } /// it explicitly if you are calling the REST API directly. public ComputeNodeAddUserOptions(int? timeout = default(int?), System.Guid? clientRequestId = default(System.Guid?), bool? returnClientRequestId = default(bool?), System.DateTime? ocpDate = default(System.DateTime?)) { - this.Timeout = timeout; - this.ClientRequestId = clientRequestId; - this.ReturnClientRequestId = returnClientRequestId; - this.OcpDate = ocpDate; + Timeout = timeout; + ClientRequestId = clientRequestId; + ReturnClientRequestId = returnClientRequestId; + OcpDate = ocpDate; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the maximum time that the server can spend processing /// the request, in seconds. The default is 30 seconds. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public int? Timeout { get; set; } /// @@ -54,14 +69,14 @@ public ComputeNodeAddUserOptions() { } /// a GUID with no decoration such as curly braces, e.g. /// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public System.Guid? ClientRequestId { get; set; } /// /// Gets or sets whether the server should return the client-request-id /// in the response. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public bool? ReturnClientRequestId { get; set; } /// @@ -69,8 +84,8 @@ public ComputeNodeAddUserOptions() { } /// typically set this to the current system clock time; set it /// explicitly if you are calling the REST API directly. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? OcpDate { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeDeallocationOption.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeDeallocationOption.cs index 24905a0b3ec5..0e81728ca544 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeDeallocationOption.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeDeallocationOption.cs @@ -8,20 +8,64 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; /// /// Defines values for ComputeNodeDeallocationOption. /// - [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + [JsonConverter(typeof(StringEnumConverter))] public enum ComputeNodeDeallocationOption { - [System.Runtime.Serialization.EnumMember(Value = "requeue")] + [EnumMember(Value = "requeue")] Requeue, - [System.Runtime.Serialization.EnumMember(Value = "terminate")] + [EnumMember(Value = "terminate")] Terminate, - [System.Runtime.Serialization.EnumMember(Value = "taskCompletion")] + [EnumMember(Value = "taskCompletion")] TaskCompletion, - [System.Runtime.Serialization.EnumMember(Value = "retainedData")] + [EnumMember(Value = "retainedData")] RetainedData } + internal static class ComputeNodeDeallocationOptionEnumExtension + { + internal static string ToSerializedValue(this ComputeNodeDeallocationOption? value) => + value == null ? null : ((ComputeNodeDeallocationOption)value).ToSerializedValue(); + + internal static string ToSerializedValue(this ComputeNodeDeallocationOption value) + { + switch( value ) + { + case ComputeNodeDeallocationOption.Requeue: + return "requeue"; + case ComputeNodeDeallocationOption.Terminate: + return "terminate"; + case ComputeNodeDeallocationOption.TaskCompletion: + return "taskCompletion"; + case ComputeNodeDeallocationOption.RetainedData: + return "retainedData"; + } + return null; + } + + internal static ComputeNodeDeallocationOption? ParseComputeNodeDeallocationOption(this string value) + { + switch( value ) + { + case "requeue": + return ComputeNodeDeallocationOption.Requeue; + case "terminate": + return ComputeNodeDeallocationOption.Terminate; + case "taskCompletion": + return ComputeNodeDeallocationOption.TaskCompletion; + case "retainedData": + return ComputeNodeDeallocationOption.RetainedData; + } + return null; + } + } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeDeleteUserHeaders.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeDeleteUserHeaders.cs index e3a3abb8aa8b..3533706524c9 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeDeleteUserHeaders.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeDeleteUserHeaders.cs @@ -8,6 +8,10 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; using System.Linq; /// @@ -19,7 +23,10 @@ public partial class ComputeNodeDeleteUserHeaders /// Initializes a new instance of the ComputeNodeDeleteUserHeaders /// class. /// - public ComputeNodeDeleteUserHeaders() { } + public ComputeNodeDeleteUserHeaders() + { + CustomInit(); + } /// /// Initializes a new instance of the ComputeNodeDeleteUserHeaders @@ -37,16 +44,22 @@ public ComputeNodeDeleteUserHeaders() { } /// request was made, and the region that account resides in. public ComputeNodeDeleteUserHeaders(string clientRequestId = default(string), string requestId = default(string)) { - this.ClientRequestId = clientRequestId; - this.RequestId = requestId; + ClientRequestId = clientRequestId; + RequestId = requestId; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the client-request-id provided by the client during /// the request. This will be returned only if the /// return-client-request-id parameter was set to true. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "client-request-id")] + [JsonProperty(PropertyName = "client-request-id")] public string ClientRequestId { get; set; } /// @@ -58,7 +71,7 @@ public ComputeNodeDeleteUserHeaders() { } /// request was made, the Batch account against which the request was /// made, and the region that account resides in. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "request-id")] + [JsonProperty(PropertyName = "request-id")] public string RequestId { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeDeleteUserOptions.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeDeleteUserOptions.cs index 18443d678aad..6328d331c502 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeDeleteUserOptions.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeDeleteUserOptions.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -19,7 +25,10 @@ public partial class ComputeNodeDeleteUserOptions /// Initializes a new instance of the ComputeNodeDeleteUserOptions /// class. /// - public ComputeNodeDeleteUserOptions() { } + public ComputeNodeDeleteUserOptions() + { + CustomInit(); + } /// /// Initializes a new instance of the ComputeNodeDeleteUserOptions @@ -38,17 +47,23 @@ public ComputeNodeDeleteUserOptions() { } /// it explicitly if you are calling the REST API directly. public ComputeNodeDeleteUserOptions(int? timeout = default(int?), System.Guid? clientRequestId = default(System.Guid?), bool? returnClientRequestId = default(bool?), System.DateTime? ocpDate = default(System.DateTime?)) { - this.Timeout = timeout; - this.ClientRequestId = clientRequestId; - this.ReturnClientRequestId = returnClientRequestId; - this.OcpDate = ocpDate; + Timeout = timeout; + ClientRequestId = clientRequestId; + ReturnClientRequestId = returnClientRequestId; + OcpDate = ocpDate; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the maximum time that the server can spend processing /// the request, in seconds. The default is 30 seconds. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public int? Timeout { get; set; } /// @@ -56,14 +71,14 @@ public ComputeNodeDeleteUserOptions() { } /// a GUID with no decoration such as curly braces, e.g. /// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public System.Guid? ClientRequestId { get; set; } /// /// Gets or sets whether the server should return the client-request-id /// in the response. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public bool? ReturnClientRequestId { get; set; } /// @@ -71,8 +86,8 @@ public ComputeNodeDeleteUserOptions() { } /// typically set this to the current system clock time; set it /// explicitly if you are calling the REST API directly. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? OcpDate { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeDisableSchedulingHeaders.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeDisableSchedulingHeaders.cs index 9ae9002be94a..8d5f5437b54b 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeDisableSchedulingHeaders.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeDisableSchedulingHeaders.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -19,7 +25,10 @@ public partial class ComputeNodeDisableSchedulingHeaders /// Initializes a new instance of the /// ComputeNodeDisableSchedulingHeaders class. /// - public ComputeNodeDisableSchedulingHeaders() { } + public ComputeNodeDisableSchedulingHeaders() + { + CustomInit(); + } /// /// Initializes a new instance of the @@ -46,19 +55,25 @@ public ComputeNodeDisableSchedulingHeaders() { } /// the request applied. public ComputeNodeDisableSchedulingHeaders(System.Guid? clientRequestId = default(System.Guid?), System.Guid? requestId = default(System.Guid?), string eTag = default(string), System.DateTime? lastModified = default(System.DateTime?), string dataServiceId = default(string)) { - this.ClientRequestId = clientRequestId; - this.RequestId = requestId; - this.ETag = eTag; - this.LastModified = lastModified; - this.DataServiceId = dataServiceId; + ClientRequestId = clientRequestId; + RequestId = requestId; + ETag = eTag; + LastModified = lastModified; + DataServiceId = dataServiceId; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the client-request-id provided by the client during /// the request. This will be returned only if the /// return-client-request-id parameter was set to true. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "client-request-id")] + [JsonProperty(PropertyName = "client-request-id")] public System.Guid? ClientRequestId { get; set; } /// @@ -70,7 +85,7 @@ public ComputeNodeDisableSchedulingHeaders() { } /// request was made, the Batch account against which the request was /// made, and the region that account resides in. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "request-id")] + [JsonProperty(PropertyName = "request-id")] public System.Guid? RequestId { get; set; } /// @@ -80,21 +95,21 @@ public ComputeNodeDisableSchedulingHeaders() { } /// the If-Modified-Since, If-Unmodified-Since, If-Match or /// If-None-Match headers. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "ETag")] + [JsonProperty(PropertyName = "ETag")] public string ETag { get; set; } /// /// Gets or sets the time at which the resource was last modified. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "Last-Modified")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "Last-Modified")] public System.DateTime? LastModified { get; set; } /// /// Gets or sets the OData ID of the resource to which the request /// applied. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "DataServiceId")] + [JsonProperty(PropertyName = "DataServiceId")] public string DataServiceId { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeDisableSchedulingOptions.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeDisableSchedulingOptions.cs index 21fb1423badc..52a98ed8c3ee 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeDisableSchedulingOptions.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeDisableSchedulingOptions.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -19,7 +25,10 @@ public partial class ComputeNodeDisableSchedulingOptions /// Initializes a new instance of the /// ComputeNodeDisableSchedulingOptions class. /// - public ComputeNodeDisableSchedulingOptions() { } + public ComputeNodeDisableSchedulingOptions() + { + CustomInit(); + } /// /// Initializes a new instance of the @@ -38,17 +47,23 @@ public ComputeNodeDisableSchedulingOptions() { } /// it explicitly if you are calling the REST API directly. public ComputeNodeDisableSchedulingOptions(int? timeout = default(int?), System.Guid? clientRequestId = default(System.Guid?), bool? returnClientRequestId = default(bool?), System.DateTime? ocpDate = default(System.DateTime?)) { - this.Timeout = timeout; - this.ClientRequestId = clientRequestId; - this.ReturnClientRequestId = returnClientRequestId; - this.OcpDate = ocpDate; + Timeout = timeout; + ClientRequestId = clientRequestId; + ReturnClientRequestId = returnClientRequestId; + OcpDate = ocpDate; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the maximum time that the server can spend processing /// the request, in seconds. The default is 30 seconds. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public int? Timeout { get; set; } /// @@ -56,14 +71,14 @@ public ComputeNodeDisableSchedulingOptions() { } /// a GUID with no decoration such as curly braces, e.g. /// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public System.Guid? ClientRequestId { get; set; } /// /// Gets or sets whether the server should return the client-request-id /// in the response. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public bool? ReturnClientRequestId { get; set; } /// @@ -71,8 +86,8 @@ public ComputeNodeDisableSchedulingOptions() { } /// typically set this to the current system clock time; set it /// explicitly if you are calling the REST API directly. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? OcpDate { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeEnableSchedulingHeaders.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeEnableSchedulingHeaders.cs index 570b1124a1be..a9a4bd2b8f01 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeEnableSchedulingHeaders.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeEnableSchedulingHeaders.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -19,7 +25,10 @@ public partial class ComputeNodeEnableSchedulingHeaders /// Initializes a new instance of the /// ComputeNodeEnableSchedulingHeaders class. /// - public ComputeNodeEnableSchedulingHeaders() { } + public ComputeNodeEnableSchedulingHeaders() + { + CustomInit(); + } /// /// Initializes a new instance of the @@ -46,19 +55,25 @@ public ComputeNodeEnableSchedulingHeaders() { } /// the request applied. public ComputeNodeEnableSchedulingHeaders(System.Guid? clientRequestId = default(System.Guid?), System.Guid? requestId = default(System.Guid?), string eTag = default(string), System.DateTime? lastModified = default(System.DateTime?), string dataServiceId = default(string)) { - this.ClientRequestId = clientRequestId; - this.RequestId = requestId; - this.ETag = eTag; - this.LastModified = lastModified; - this.DataServiceId = dataServiceId; + ClientRequestId = clientRequestId; + RequestId = requestId; + ETag = eTag; + LastModified = lastModified; + DataServiceId = dataServiceId; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the client-request-id provided by the client during /// the request. This will be returned only if the /// return-client-request-id parameter was set to true. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "client-request-id")] + [JsonProperty(PropertyName = "client-request-id")] public System.Guid? ClientRequestId { get; set; } /// @@ -70,7 +85,7 @@ public ComputeNodeEnableSchedulingHeaders() { } /// request was made, the Batch account against which the request was /// made, and the region that account resides in. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "request-id")] + [JsonProperty(PropertyName = "request-id")] public System.Guid? RequestId { get; set; } /// @@ -80,21 +95,21 @@ public ComputeNodeEnableSchedulingHeaders() { } /// the If-Modified-Since, If-Unmodified-Since, If-Match or /// If-None-Match headers. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "ETag")] + [JsonProperty(PropertyName = "ETag")] public string ETag { get; set; } /// /// Gets or sets the time at which the resource was last modified. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "Last-Modified")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "Last-Modified")] public System.DateTime? LastModified { get; set; } /// /// Gets or sets the OData ID of the resource to which the request /// applied. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "DataServiceId")] + [JsonProperty(PropertyName = "DataServiceId")] public string DataServiceId { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeEnableSchedulingOptions.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeEnableSchedulingOptions.cs index 76a9cf459036..8d195f1e2fa1 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeEnableSchedulingOptions.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeEnableSchedulingOptions.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -19,7 +25,10 @@ public partial class ComputeNodeEnableSchedulingOptions /// Initializes a new instance of the /// ComputeNodeEnableSchedulingOptions class. /// - public ComputeNodeEnableSchedulingOptions() { } + public ComputeNodeEnableSchedulingOptions() + { + CustomInit(); + } /// /// Initializes a new instance of the @@ -38,17 +47,23 @@ public ComputeNodeEnableSchedulingOptions() { } /// it explicitly if you are calling the REST API directly. public ComputeNodeEnableSchedulingOptions(int? timeout = default(int?), System.Guid? clientRequestId = default(System.Guid?), bool? returnClientRequestId = default(bool?), System.DateTime? ocpDate = default(System.DateTime?)) { - this.Timeout = timeout; - this.ClientRequestId = clientRequestId; - this.ReturnClientRequestId = returnClientRequestId; - this.OcpDate = ocpDate; + Timeout = timeout; + ClientRequestId = clientRequestId; + ReturnClientRequestId = returnClientRequestId; + OcpDate = ocpDate; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the maximum time that the server can spend processing /// the request, in seconds. The default is 30 seconds. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public int? Timeout { get; set; } /// @@ -56,14 +71,14 @@ public ComputeNodeEnableSchedulingOptions() { } /// a GUID with no decoration such as curly braces, e.g. /// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public System.Guid? ClientRequestId { get; set; } /// /// Gets or sets whether the server should return the client-request-id /// in the response. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public bool? ReturnClientRequestId { get; set; } /// @@ -71,8 +86,8 @@ public ComputeNodeEnableSchedulingOptions() { } /// typically set this to the current system clock time; set it /// explicitly if you are calling the REST API directly. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? OcpDate { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeEndpointConfiguration.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeEndpointConfiguration.cs index 07eea4baaa68..68c5347a3a58 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeEndpointConfiguration.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeEndpointConfiguration.cs @@ -8,6 +8,13 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// @@ -19,7 +26,10 @@ public partial class ComputeNodeEndpointConfiguration /// Initializes a new instance of the ComputeNodeEndpointConfiguration /// class. /// - public ComputeNodeEndpointConfiguration() { } + public ComputeNodeEndpointConfiguration() + { + CustomInit(); + } /// /// Initializes a new instance of the ComputeNodeEndpointConfiguration @@ -27,33 +37,39 @@ public ComputeNodeEndpointConfiguration() { } /// /// The list of inbound endpoints that /// are accessible on the compute node. - public ComputeNodeEndpointConfiguration(System.Collections.Generic.IList inboundEndpoints) + public ComputeNodeEndpointConfiguration(IList inboundEndpoints) { - this.InboundEndpoints = inboundEndpoints; + InboundEndpoints = inboundEndpoints; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the list of inbound endpoints that are accessible on /// the compute node. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "inboundEndpoints")] - public System.Collections.Generic.IList InboundEndpoints { get; set; } + [JsonProperty(PropertyName = "inboundEndpoints")] + public IList InboundEndpoints { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (this.InboundEndpoints == null) + if (InboundEndpoints == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "InboundEndpoints"); + throw new ValidationException(ValidationRules.CannotBeNull, "InboundEndpoints"); } - if (this.InboundEndpoints != null) + if (InboundEndpoints != null) { - foreach (var element in this.InboundEndpoints) + foreach (var element in InboundEndpoints) { if (element != null) { diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeError.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeError.cs index 8a14babcdf06..2be9f64a4045 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeError.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeError.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class ComputeNodeError /// /// Initializes a new instance of the ComputeNodeError class. /// - public ComputeNodeError() { } + public ComputeNodeError() + { + CustomInit(); + } /// /// Initializes a new instance of the ComputeNodeError class. @@ -30,33 +39,39 @@ public ComputeNodeError() { } /// intended to be suitable for display in a user interface. /// The list of additional error details /// related to the compute node error. - public ComputeNodeError(string code = default(string), string message = default(string), System.Collections.Generic.IList errorDetails = default(System.Collections.Generic.IList)) + public ComputeNodeError(string code = default(string), string message = default(string), IList errorDetails = default(IList)) { - this.Code = code; - this.Message = message; - this.ErrorDetails = errorDetails; + Code = code; + Message = message; + ErrorDetails = errorDetails; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets an identifier for the compute node error. Codes are /// invariant and are intended to be consumed programmatically. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "code")] + [JsonProperty(PropertyName = "code")] public string Code { get; set; } /// /// Gets or sets a message describing the compute node error, intended /// to be suitable for display in a user interface. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "message")] + [JsonProperty(PropertyName = "message")] public string Message { get; set; } /// /// Gets or sets the list of additional error details related to the /// compute node error. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "errorDetails")] - public System.Collections.Generic.IList ErrorDetails { get; set; } + [JsonProperty(PropertyName = "errorDetails")] + public IList ErrorDetails { get; set; } } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeFillType.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeFillType.cs index 99de956a634c..ddd9cf081a34 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeFillType.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeFillType.cs @@ -8,16 +8,52 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; /// /// Defines values for ComputeNodeFillType. /// - [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + [JsonConverter(typeof(StringEnumConverter))] public enum ComputeNodeFillType { - [System.Runtime.Serialization.EnumMember(Value = "spread")] + [EnumMember(Value = "spread")] Spread, - [System.Runtime.Serialization.EnumMember(Value = "pack")] + [EnumMember(Value = "pack")] Pack } + internal static class ComputeNodeFillTypeEnumExtension + { + internal static string ToSerializedValue(this ComputeNodeFillType? value) => + value == null ? null : ((ComputeNodeFillType)value).ToSerializedValue(); + + internal static string ToSerializedValue(this ComputeNodeFillType value) + { + switch( value ) + { + case ComputeNodeFillType.Spread: + return "spread"; + case ComputeNodeFillType.Pack: + return "pack"; + } + return null; + } + + internal static ComputeNodeFillType? ParseComputeNodeFillType(this string value) + { + switch( value ) + { + case "spread": + return ComputeNodeFillType.Spread; + case "pack": + return ComputeNodeFillType.Pack; + } + return null; + } + } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeGetHeaders.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeGetHeaders.cs index 4d16c132b928..8f071d6860d8 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeGetHeaders.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeGetHeaders.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class ComputeNodeGetHeaders /// /// Initializes a new instance of the ComputeNodeGetHeaders class. /// - public ComputeNodeGetHeaders() { } + public ComputeNodeGetHeaders() + { + CustomInit(); + } /// /// Initializes a new instance of the ComputeNodeGetHeaders class. @@ -42,18 +51,24 @@ public ComputeNodeGetHeaders() { } /// modified. public ComputeNodeGetHeaders(System.Guid? clientRequestId = default(System.Guid?), System.Guid? requestId = default(System.Guid?), string eTag = default(string), System.DateTime? lastModified = default(System.DateTime?)) { - this.ClientRequestId = clientRequestId; - this.RequestId = requestId; - this.ETag = eTag; - this.LastModified = lastModified; + ClientRequestId = clientRequestId; + RequestId = requestId; + ETag = eTag; + LastModified = lastModified; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the client-request-id provided by the client during /// the request. This will be returned only if the /// return-client-request-id parameter was set to true. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "client-request-id")] + [JsonProperty(PropertyName = "client-request-id")] public System.Guid? ClientRequestId { get; set; } /// @@ -65,7 +80,7 @@ public ComputeNodeGetHeaders() { } /// request was made, the Batch account against which the request was /// made, and the region that account resides in. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "request-id")] + [JsonProperty(PropertyName = "request-id")] public System.Guid? RequestId { get; set; } /// @@ -75,14 +90,14 @@ public ComputeNodeGetHeaders() { } /// the If-Modified-Since, If-Unmodified-Since, If-Match or /// If-None-Match headers. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "ETag")] + [JsonProperty(PropertyName = "ETag")] public string ETag { get; set; } /// /// Gets or sets the time at which the resource was last modified. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "Last-Modified")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "Last-Modified")] public System.DateTime? LastModified { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeGetOptions.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeGetOptions.cs index 646f79ed21f9..64cf84c7ba52 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeGetOptions.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeGetOptions.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class ComputeNodeGetOptions /// /// Initializes a new instance of the ComputeNodeGetOptions class. /// - public ComputeNodeGetOptions() { } + public ComputeNodeGetOptions() + { + CustomInit(); + } /// /// Initializes a new instance of the ComputeNodeGetOptions class. @@ -37,24 +46,30 @@ public ComputeNodeGetOptions() { } /// it explicitly if you are calling the REST API directly. public ComputeNodeGetOptions(string select = default(string), int? timeout = default(int?), System.Guid? clientRequestId = default(System.Guid?), bool? returnClientRequestId = default(bool?), System.DateTime? ocpDate = default(System.DateTime?)) { - this.Select = select; - this.Timeout = timeout; - this.ClientRequestId = clientRequestId; - this.ReturnClientRequestId = returnClientRequestId; - this.OcpDate = ocpDate; + Select = select; + Timeout = timeout; + ClientRequestId = clientRequestId; + ReturnClientRequestId = returnClientRequestId; + OcpDate = ocpDate; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets an OData $select clause. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public string Select { get; set; } /// /// Gets or sets the maximum time that the server can spend processing /// the request, in seconds. The default is 30 seconds. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public int? Timeout { get; set; } /// @@ -62,14 +77,14 @@ public ComputeNodeGetOptions() { } /// a GUID with no decoration such as curly braces, e.g. /// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public System.Guid? ClientRequestId { get; set; } /// /// Gets or sets whether the server should return the client-request-id /// in the response. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public bool? ReturnClientRequestId { get; set; } /// @@ -77,8 +92,8 @@ public ComputeNodeGetOptions() { } /// typically set this to the current system clock time; set it /// explicitly if you are calling the REST API directly. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? OcpDate { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeGetRemoteDesktopHeaders.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeGetRemoteDesktopHeaders.cs index edf009a40020..de02c468db59 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeGetRemoteDesktopHeaders.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeGetRemoteDesktopHeaders.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -19,7 +25,10 @@ public partial class ComputeNodeGetRemoteDesktopHeaders /// Initializes a new instance of the /// ComputeNodeGetRemoteDesktopHeaders class. /// - public ComputeNodeGetRemoteDesktopHeaders() { } + public ComputeNodeGetRemoteDesktopHeaders() + { + CustomInit(); + } /// /// Initializes a new instance of the @@ -44,18 +53,24 @@ public ComputeNodeGetRemoteDesktopHeaders() { } /// modified. public ComputeNodeGetRemoteDesktopHeaders(System.Guid? clientRequestId = default(System.Guid?), System.Guid? requestId = default(System.Guid?), string eTag = default(string), System.DateTime? lastModified = default(System.DateTime?)) { - this.ClientRequestId = clientRequestId; - this.RequestId = requestId; - this.ETag = eTag; - this.LastModified = lastModified; + ClientRequestId = clientRequestId; + RequestId = requestId; + ETag = eTag; + LastModified = lastModified; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the client-request-id provided by the client during /// the request. This will be returned only if the /// return-client-request-id parameter was set to true. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "client-request-id")] + [JsonProperty(PropertyName = "client-request-id")] public System.Guid? ClientRequestId { get; set; } /// @@ -67,7 +82,7 @@ public ComputeNodeGetRemoteDesktopHeaders() { } /// request was made, the Batch account against which the request was /// made, and the region that account resides in. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "request-id")] + [JsonProperty(PropertyName = "request-id")] public System.Guid? RequestId { get; set; } /// @@ -77,14 +92,14 @@ public ComputeNodeGetRemoteDesktopHeaders() { } /// the If-Modified-Since, If-Unmodified-Since, If-Match or /// If-None-Match headers. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "ETag")] + [JsonProperty(PropertyName = "ETag")] public string ETag { get; set; } /// /// Gets or sets the time at which the resource was last modified. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "Last-Modified")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "Last-Modified")] public System.DateTime? LastModified { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeGetRemoteDesktopOptions.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeGetRemoteDesktopOptions.cs index dd1407a53671..00ed308c6a89 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeGetRemoteDesktopOptions.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeGetRemoteDesktopOptions.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -19,7 +25,10 @@ public partial class ComputeNodeGetRemoteDesktopOptions /// Initializes a new instance of the /// ComputeNodeGetRemoteDesktopOptions class. /// - public ComputeNodeGetRemoteDesktopOptions() { } + public ComputeNodeGetRemoteDesktopOptions() + { + CustomInit(); + } /// /// Initializes a new instance of the @@ -38,17 +47,23 @@ public ComputeNodeGetRemoteDesktopOptions() { } /// it explicitly if you are calling the REST API directly. public ComputeNodeGetRemoteDesktopOptions(int? timeout = default(int?), System.Guid? clientRequestId = default(System.Guid?), bool? returnClientRequestId = default(bool?), System.DateTime? ocpDate = default(System.DateTime?)) { - this.Timeout = timeout; - this.ClientRequestId = clientRequestId; - this.ReturnClientRequestId = returnClientRequestId; - this.OcpDate = ocpDate; + Timeout = timeout; + ClientRequestId = clientRequestId; + ReturnClientRequestId = returnClientRequestId; + OcpDate = ocpDate; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the maximum time that the server can spend processing /// the request, in seconds. The default is 30 seconds. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public int? Timeout { get; set; } /// @@ -56,14 +71,14 @@ public ComputeNodeGetRemoteDesktopOptions() { } /// a GUID with no decoration such as curly braces, e.g. /// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public System.Guid? ClientRequestId { get; set; } /// /// Gets or sets whether the server should return the client-request-id /// in the response. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public bool? ReturnClientRequestId { get; set; } /// @@ -71,8 +86,8 @@ public ComputeNodeGetRemoteDesktopOptions() { } /// typically set this to the current system clock time; set it /// explicitly if you are calling the REST API directly. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? OcpDate { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeGetRemoteLoginSettingsHeaders.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeGetRemoteLoginSettingsHeaders.cs index aed5b6a566af..15dce6c11737 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeGetRemoteLoginSettingsHeaders.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeGetRemoteLoginSettingsHeaders.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -19,7 +25,10 @@ public partial class ComputeNodeGetRemoteLoginSettingsHeaders /// Initializes a new instance of the /// ComputeNodeGetRemoteLoginSettingsHeaders class. /// - public ComputeNodeGetRemoteLoginSettingsHeaders() { } + public ComputeNodeGetRemoteLoginSettingsHeaders() + { + CustomInit(); + } /// /// Initializes a new instance of the @@ -44,18 +53,24 @@ public ComputeNodeGetRemoteLoginSettingsHeaders() { } /// modified. public ComputeNodeGetRemoteLoginSettingsHeaders(System.Guid? clientRequestId = default(System.Guid?), System.Guid? requestId = default(System.Guid?), string eTag = default(string), System.DateTime? lastModified = default(System.DateTime?)) { - this.ClientRequestId = clientRequestId; - this.RequestId = requestId; - this.ETag = eTag; - this.LastModified = lastModified; + ClientRequestId = clientRequestId; + RequestId = requestId; + ETag = eTag; + LastModified = lastModified; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the client-request-id provided by the client during /// the request. This will be returned only if the /// return-client-request-id parameter was set to true. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "client-request-id")] + [JsonProperty(PropertyName = "client-request-id")] public System.Guid? ClientRequestId { get; set; } /// @@ -67,7 +82,7 @@ public ComputeNodeGetRemoteLoginSettingsHeaders() { } /// request was made, the Batch account against which the request was /// made, and the region that account resides in. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "request-id")] + [JsonProperty(PropertyName = "request-id")] public System.Guid? RequestId { get; set; } /// @@ -77,14 +92,14 @@ public ComputeNodeGetRemoteLoginSettingsHeaders() { } /// the If-Modified-Since, If-Unmodified-Since, If-Match or /// If-None-Match headers. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "ETag")] + [JsonProperty(PropertyName = "ETag")] public string ETag { get; set; } /// /// Gets or sets the time at which the resource was last modified. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "Last-Modified")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "Last-Modified")] public System.DateTime? LastModified { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeGetRemoteLoginSettingsOptions.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeGetRemoteLoginSettingsOptions.cs index 35a90c610b79..8cb1e63b3a86 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeGetRemoteLoginSettingsOptions.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeGetRemoteLoginSettingsOptions.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -20,7 +26,10 @@ public partial class ComputeNodeGetRemoteLoginSettingsOptions /// Initializes a new instance of the /// ComputeNodeGetRemoteLoginSettingsOptions class. /// - public ComputeNodeGetRemoteLoginSettingsOptions() { } + public ComputeNodeGetRemoteLoginSettingsOptions() + { + CustomInit(); + } /// /// Initializes a new instance of the @@ -39,17 +48,23 @@ public ComputeNodeGetRemoteLoginSettingsOptions() { } /// it explicitly if you are calling the REST API directly. public ComputeNodeGetRemoteLoginSettingsOptions(int? timeout = default(int?), System.Guid? clientRequestId = default(System.Guid?), bool? returnClientRequestId = default(bool?), System.DateTime? ocpDate = default(System.DateTime?)) { - this.Timeout = timeout; - this.ClientRequestId = clientRequestId; - this.ReturnClientRequestId = returnClientRequestId; - this.OcpDate = ocpDate; + Timeout = timeout; + ClientRequestId = clientRequestId; + ReturnClientRequestId = returnClientRequestId; + OcpDate = ocpDate; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the maximum time that the server can spend processing /// the request, in seconds. The default is 30 seconds. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public int? Timeout { get; set; } /// @@ -57,14 +72,14 @@ public ComputeNodeGetRemoteLoginSettingsOptions() { } /// a GUID with no decoration such as curly braces, e.g. /// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public System.Guid? ClientRequestId { get; set; } /// /// Gets or sets whether the server should return the client-request-id /// in the response. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public bool? ReturnClientRequestId { get; set; } /// @@ -72,8 +87,8 @@ public ComputeNodeGetRemoteLoginSettingsOptions() { } /// typically set this to the current system clock time; set it /// explicitly if you are calling the REST API directly. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? OcpDate { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeGetRemoteLoginSettingsResult.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeGetRemoteLoginSettingsResult.cs index a86e16e67e33..8040a710cf19 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeGetRemoteLoginSettingsResult.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeGetRemoteLoginSettingsResult.cs @@ -8,6 +8,11 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Newtonsoft.Json; using System.Linq; /// @@ -19,7 +24,10 @@ public partial class ComputeNodeGetRemoteLoginSettingsResult /// Initializes a new instance of the /// ComputeNodeGetRemoteLoginSettingsResult class. /// - public ComputeNodeGetRemoteLoginSettingsResult() { } + public ComputeNodeGetRemoteLoginSettingsResult() + { + CustomInit(); + } /// /// Initializes a new instance of the @@ -31,34 +39,40 @@ public ComputeNodeGetRemoteLoginSettingsResult() { } /// compute node. public ComputeNodeGetRemoteLoginSettingsResult(string remoteLoginIPAddress, int remoteLoginPort) { - this.RemoteLoginIPAddress = remoteLoginIPAddress; - this.RemoteLoginPort = remoteLoginPort; + RemoteLoginIPAddress = remoteLoginIPAddress; + RemoteLoginPort = remoteLoginPort; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the IP address used for remote login to the compute /// node. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "remoteLoginIPAddress")] + [JsonProperty(PropertyName = "remoteLoginIPAddress")] public string RemoteLoginIPAddress { get; set; } /// /// Gets or sets the port used for remote login to the compute node. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "remoteLoginPort")] + [JsonProperty(PropertyName = "remoteLoginPort")] public int RemoteLoginPort { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (this.RemoteLoginIPAddress == null) + if (RemoteLoginIPAddress == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "RemoteLoginIPAddress"); + throw new ValidationException(ValidationRules.CannotBeNull, "RemoteLoginIPAddress"); } } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeInformation.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeInformation.cs index 380ac113323b..7c90b50c1974 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeInformation.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeInformation.cs @@ -8,6 +8,10 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; using System.Linq; /// @@ -18,15 +22,17 @@ public partial class ComputeNodeInformation /// /// Initializes a new instance of the ComputeNodeInformation class. /// - public ComputeNodeInformation() { } + public ComputeNodeInformation() + { + CustomInit(); + } /// /// Initializes a new instance of the ComputeNodeInformation class. /// /// An identifier for the compute node on /// which the task ran, which can be passed when adding a task to - /// request that the task be scheduled close to this compute - /// node. + /// request that the task be scheduled on this compute node. /// The URL of the node on which the task ran. /// /// The ID of the pool on which the task @@ -39,51 +45,57 @@ public ComputeNodeInformation() { } /// the task on the compute node. public ComputeNodeInformation(string affinityId = default(string), string nodeUrl = default(string), string poolId = default(string), string nodeId = default(string), string taskRootDirectory = default(string), string taskRootDirectoryUrl = default(string)) { - this.AffinityId = affinityId; - this.NodeUrl = nodeUrl; - this.PoolId = poolId; - this.NodeId = nodeId; - this.TaskRootDirectory = taskRootDirectory; - this.TaskRootDirectoryUrl = taskRootDirectoryUrl; + AffinityId = affinityId; + NodeUrl = nodeUrl; + PoolId = poolId; + NodeId = nodeId; + TaskRootDirectory = taskRootDirectory; + TaskRootDirectoryUrl = taskRootDirectoryUrl; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets an identifier for the compute node on which the task /// ran, which can be passed when adding a task to request that the - /// task be scheduled close to this compute node. + /// task be scheduled on this compute node. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "affinityId")] + [JsonProperty(PropertyName = "affinityId")] public string AffinityId { get; set; } /// /// Gets or sets the URL of the node on which the task ran. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "nodeUrl")] + [JsonProperty(PropertyName = "nodeUrl")] public string NodeUrl { get; set; } /// /// Gets or sets the ID of the pool on which the task ran. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "poolId")] + [JsonProperty(PropertyName = "poolId")] public string PoolId { get; set; } /// /// Gets or sets the ID of the node on which the task ran. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "nodeId")] + [JsonProperty(PropertyName = "nodeId")] public string NodeId { get; set; } /// /// Gets or sets the root directory of the task on the compute node. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "taskRootDirectory")] + [JsonProperty(PropertyName = "taskRootDirectory")] public string TaskRootDirectory { get; set; } /// /// Gets or sets the URL to the root directory of the task on the /// compute node. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "taskRootDirectoryUrl")] + [JsonProperty(PropertyName = "taskRootDirectoryUrl")] public string TaskRootDirectoryUrl { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeListHeaders.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeListHeaders.cs index d83ee41a4798..cd026ef4a237 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeListHeaders.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeListHeaders.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class ComputeNodeListHeaders /// /// Initializes a new instance of the ComputeNodeListHeaders class. /// - public ComputeNodeListHeaders() { } + public ComputeNodeListHeaders() + { + CustomInit(); + } /// /// Initializes a new instance of the ComputeNodeListHeaders class. @@ -42,18 +51,24 @@ public ComputeNodeListHeaders() { } /// modified. public ComputeNodeListHeaders(System.Guid? clientRequestId = default(System.Guid?), System.Guid? requestId = default(System.Guid?), string eTag = default(string), System.DateTime? lastModified = default(System.DateTime?)) { - this.ClientRequestId = clientRequestId; - this.RequestId = requestId; - this.ETag = eTag; - this.LastModified = lastModified; + ClientRequestId = clientRequestId; + RequestId = requestId; + ETag = eTag; + LastModified = lastModified; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the client-request-id provided by the client during /// the request. This will be returned only if the /// return-client-request-id parameter was set to true. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "client-request-id")] + [JsonProperty(PropertyName = "client-request-id")] public System.Guid? ClientRequestId { get; set; } /// @@ -65,7 +80,7 @@ public ComputeNodeListHeaders() { } /// request was made, the Batch account against which the request was /// made, and the region that account resides in. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "request-id")] + [JsonProperty(PropertyName = "request-id")] public System.Guid? RequestId { get; set; } /// @@ -75,14 +90,14 @@ public ComputeNodeListHeaders() { } /// the If-Modified-Since, If-Unmodified-Since, If-Match or /// If-None-Match headers. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "ETag")] + [JsonProperty(PropertyName = "ETag")] public string ETag { get; set; } /// /// Gets or sets the time at which the resource was last modified. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "Last-Modified")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "Last-Modified")] public System.DateTime? LastModified { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeListNextOptions.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeListNextOptions.cs index 660bd1c920c7..4dd7e79601f9 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeListNextOptions.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeListNextOptions.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class ComputeNodeListNextOptions /// /// Initializes a new instance of the ComputeNodeListNextOptions class. /// - public ComputeNodeListNextOptions() { } + public ComputeNodeListNextOptions() + { + CustomInit(); + } /// /// Initializes a new instance of the ComputeNodeListNextOptions class. @@ -33,24 +42,30 @@ public ComputeNodeListNextOptions() { } /// it explicitly if you are calling the REST API directly. public ComputeNodeListNextOptions(System.Guid? clientRequestId = default(System.Guid?), bool? returnClientRequestId = default(bool?), System.DateTime? ocpDate = default(System.DateTime?)) { - this.ClientRequestId = clientRequestId; - this.ReturnClientRequestId = returnClientRequestId; - this.OcpDate = ocpDate; + ClientRequestId = clientRequestId; + ReturnClientRequestId = returnClientRequestId; + OcpDate = ocpDate; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the caller-generated request identity, in the form of /// a GUID with no decoration such as curly braces, e.g. /// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public System.Guid? ClientRequestId { get; set; } /// /// Gets or sets whether the server should return the client-request-id /// in the response. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public bool? ReturnClientRequestId { get; set; } /// @@ -58,8 +73,8 @@ public ComputeNodeListNextOptions() { } /// typically set this to the current system clock time; set it /// explicitly if you are calling the REST API directly. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? OcpDate { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeListOptions.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeListOptions.cs index fd52c7459db3..74d33d08860a 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeListOptions.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeListOptions.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class ComputeNodeListOptions /// /// Initializes a new instance of the ComputeNodeListOptions class. /// - public ComputeNodeListOptions() { } + public ComputeNodeListOptions() + { + CustomInit(); + } /// /// Initializes a new instance of the ComputeNodeListOptions class. @@ -40,39 +49,45 @@ public ComputeNodeListOptions() { } /// it explicitly if you are calling the REST API directly. public ComputeNodeListOptions(string filter = default(string), string select = default(string), int? maxResults = default(int?), int? timeout = default(int?), System.Guid? clientRequestId = default(System.Guid?), bool? returnClientRequestId = default(bool?), System.DateTime? ocpDate = default(System.DateTime?)) { - this.Filter = filter; - this.Select = select; - this.MaxResults = maxResults; - this.Timeout = timeout; - this.ClientRequestId = clientRequestId; - this.ReturnClientRequestId = returnClientRequestId; - this.OcpDate = ocpDate; + Filter = filter; + Select = select; + MaxResults = maxResults; + Timeout = timeout; + ClientRequestId = clientRequestId; + ReturnClientRequestId = returnClientRequestId; + OcpDate = ocpDate; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets an OData $filter clause.. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public string Filter { get; set; } /// /// Gets or sets an OData $select clause. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public string Select { get; set; } /// /// Gets or sets the maximum number of items to return in the response. /// A maximum of 1000 nodes can be returned. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public int? MaxResults { get; set; } /// /// Gets or sets the maximum time that the server can spend processing /// the request, in seconds. The default is 30 seconds. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public int? Timeout { get; set; } /// @@ -80,14 +95,14 @@ public ComputeNodeListOptions() { } /// a GUID with no decoration such as curly braces, e.g. /// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public System.Guid? ClientRequestId { get; set; } /// /// Gets or sets whether the server should return the client-request-id /// in the response. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public bool? ReturnClientRequestId { get; set; } /// @@ -95,8 +110,8 @@ public ComputeNodeListOptions() { } /// typically set this to the current system clock time; set it /// explicitly if you are calling the REST API directly. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? OcpDate { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeRebootHeaders.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeRebootHeaders.cs index 876651184ffc..c2f8d04ce840 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeRebootHeaders.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeRebootHeaders.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class ComputeNodeRebootHeaders /// /// Initializes a new instance of the ComputeNodeRebootHeaders class. /// - public ComputeNodeRebootHeaders() { } + public ComputeNodeRebootHeaders() + { + CustomInit(); + } /// /// Initializes a new instance of the ComputeNodeRebootHeaders class. @@ -44,19 +53,25 @@ public ComputeNodeRebootHeaders() { } /// the request applied. public ComputeNodeRebootHeaders(System.Guid? clientRequestId = default(System.Guid?), System.Guid? requestId = default(System.Guid?), string eTag = default(string), System.DateTime? lastModified = default(System.DateTime?), string dataServiceId = default(string)) { - this.ClientRequestId = clientRequestId; - this.RequestId = requestId; - this.ETag = eTag; - this.LastModified = lastModified; - this.DataServiceId = dataServiceId; + ClientRequestId = clientRequestId; + RequestId = requestId; + ETag = eTag; + LastModified = lastModified; + DataServiceId = dataServiceId; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the client-request-id provided by the client during /// the request. This will be returned only if the /// return-client-request-id parameter was set to true. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "client-request-id")] + [JsonProperty(PropertyName = "client-request-id")] public System.Guid? ClientRequestId { get; set; } /// @@ -68,7 +83,7 @@ public ComputeNodeRebootHeaders() { } /// request was made, the Batch account against which the request was /// made, and the region that account resides in. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "request-id")] + [JsonProperty(PropertyName = "request-id")] public System.Guid? RequestId { get; set; } /// @@ -78,21 +93,21 @@ public ComputeNodeRebootHeaders() { } /// the If-Modified-Since, If-Unmodified-Since, If-Match or /// If-None-Match headers. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "ETag")] + [JsonProperty(PropertyName = "ETag")] public string ETag { get; set; } /// /// Gets or sets the time at which the resource was last modified. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "Last-Modified")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "Last-Modified")] public System.DateTime? LastModified { get; set; } /// /// Gets or sets the OData ID of the resource to which the request /// applied. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "DataServiceId")] + [JsonProperty(PropertyName = "DataServiceId")] public string DataServiceId { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeRebootOption.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeRebootOption.cs index 68a6d6729a19..cee0a8d8dabb 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeRebootOption.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeRebootOption.cs @@ -8,20 +8,64 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; /// /// Defines values for ComputeNodeRebootOption. /// - [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + [JsonConverter(typeof(StringEnumConverter))] public enum ComputeNodeRebootOption { - [System.Runtime.Serialization.EnumMember(Value = "requeue")] + [EnumMember(Value = "requeue")] Requeue, - [System.Runtime.Serialization.EnumMember(Value = "terminate")] + [EnumMember(Value = "terminate")] Terminate, - [System.Runtime.Serialization.EnumMember(Value = "taskCompletion")] + [EnumMember(Value = "taskCompletion")] TaskCompletion, - [System.Runtime.Serialization.EnumMember(Value = "retainedData")] + [EnumMember(Value = "retainedData")] RetainedData } + internal static class ComputeNodeRebootOptionEnumExtension + { + internal static string ToSerializedValue(this ComputeNodeRebootOption? value) => + value == null ? null : ((ComputeNodeRebootOption)value).ToSerializedValue(); + + internal static string ToSerializedValue(this ComputeNodeRebootOption value) + { + switch( value ) + { + case ComputeNodeRebootOption.Requeue: + return "requeue"; + case ComputeNodeRebootOption.Terminate: + return "terminate"; + case ComputeNodeRebootOption.TaskCompletion: + return "taskCompletion"; + case ComputeNodeRebootOption.RetainedData: + return "retainedData"; + } + return null; + } + + internal static ComputeNodeRebootOption? ParseComputeNodeRebootOption(this string value) + { + switch( value ) + { + case "requeue": + return ComputeNodeRebootOption.Requeue; + case "terminate": + return ComputeNodeRebootOption.Terminate; + case "taskCompletion": + return ComputeNodeRebootOption.TaskCompletion; + case "retainedData": + return ComputeNodeRebootOption.RetainedData; + } + return null; + } + } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeRebootOptions.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeRebootOptions.cs index 3aa3f6f57f6f..e4ff1169f807 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeRebootOptions.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeRebootOptions.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class ComputeNodeRebootOptions /// /// Initializes a new instance of the ComputeNodeRebootOptions class. /// - public ComputeNodeRebootOptions() { } + public ComputeNodeRebootOptions() + { + CustomInit(); + } /// /// Initializes a new instance of the ComputeNodeRebootOptions class. @@ -36,17 +45,23 @@ public ComputeNodeRebootOptions() { } /// it explicitly if you are calling the REST API directly. public ComputeNodeRebootOptions(int? timeout = default(int?), System.Guid? clientRequestId = default(System.Guid?), bool? returnClientRequestId = default(bool?), System.DateTime? ocpDate = default(System.DateTime?)) { - this.Timeout = timeout; - this.ClientRequestId = clientRequestId; - this.ReturnClientRequestId = returnClientRequestId; - this.OcpDate = ocpDate; + Timeout = timeout; + ClientRequestId = clientRequestId; + ReturnClientRequestId = returnClientRequestId; + OcpDate = ocpDate; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the maximum time that the server can spend processing /// the request, in seconds. The default is 30 seconds. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public int? Timeout { get; set; } /// @@ -54,14 +69,14 @@ public ComputeNodeRebootOptions() { } /// a GUID with no decoration such as curly braces, e.g. /// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public System.Guid? ClientRequestId { get; set; } /// /// Gets or sets whether the server should return the client-request-id /// in the response. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public bool? ReturnClientRequestId { get; set; } /// @@ -69,8 +84,8 @@ public ComputeNodeRebootOptions() { } /// typically set this to the current system clock time; set it /// explicitly if you are calling the REST API directly. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? OcpDate { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeReimageHeaders.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeReimageHeaders.cs index cf5aef531c4e..055b03728f71 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeReimageHeaders.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeReimageHeaders.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class ComputeNodeReimageHeaders /// /// Initializes a new instance of the ComputeNodeReimageHeaders class. /// - public ComputeNodeReimageHeaders() { } + public ComputeNodeReimageHeaders() + { + CustomInit(); + } /// /// Initializes a new instance of the ComputeNodeReimageHeaders class. @@ -44,19 +53,25 @@ public ComputeNodeReimageHeaders() { } /// the request applied. public ComputeNodeReimageHeaders(System.Guid? clientRequestId = default(System.Guid?), System.Guid? requestId = default(System.Guid?), string eTag = default(string), System.DateTime? lastModified = default(System.DateTime?), string dataServiceId = default(string)) { - this.ClientRequestId = clientRequestId; - this.RequestId = requestId; - this.ETag = eTag; - this.LastModified = lastModified; - this.DataServiceId = dataServiceId; + ClientRequestId = clientRequestId; + RequestId = requestId; + ETag = eTag; + LastModified = lastModified; + DataServiceId = dataServiceId; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the client-request-id provided by the client during /// the request. This will be returned only if the /// return-client-request-id parameter was set to true. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "client-request-id")] + [JsonProperty(PropertyName = "client-request-id")] public System.Guid? ClientRequestId { get; set; } /// @@ -68,7 +83,7 @@ public ComputeNodeReimageHeaders() { } /// request was made, the Batch account against which the request was /// made, and the region that account resides in. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "request-id")] + [JsonProperty(PropertyName = "request-id")] public System.Guid? RequestId { get; set; } /// @@ -78,21 +93,21 @@ public ComputeNodeReimageHeaders() { } /// the If-Modified-Since, If-Unmodified-Since, If-Match or /// If-None-Match headers. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "ETag")] + [JsonProperty(PropertyName = "ETag")] public string ETag { get; set; } /// /// Gets or sets the time at which the resource was last modified. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "Last-Modified")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "Last-Modified")] public System.DateTime? LastModified { get; set; } /// /// Gets or sets the OData ID of the resource to which the request /// applied. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "DataServiceId")] + [JsonProperty(PropertyName = "DataServiceId")] public string DataServiceId { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeReimageOption.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeReimageOption.cs index 375e287e0533..f0218a8bb94b 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeReimageOption.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeReimageOption.cs @@ -8,20 +8,64 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; /// /// Defines values for ComputeNodeReimageOption. /// - [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + [JsonConverter(typeof(StringEnumConverter))] public enum ComputeNodeReimageOption { - [System.Runtime.Serialization.EnumMember(Value = "requeue")] + [EnumMember(Value = "requeue")] Requeue, - [System.Runtime.Serialization.EnumMember(Value = "terminate")] + [EnumMember(Value = "terminate")] Terminate, - [System.Runtime.Serialization.EnumMember(Value = "taskCompletion")] + [EnumMember(Value = "taskCompletion")] TaskCompletion, - [System.Runtime.Serialization.EnumMember(Value = "retainedData")] + [EnumMember(Value = "retainedData")] RetainedData } + internal static class ComputeNodeReimageOptionEnumExtension + { + internal static string ToSerializedValue(this ComputeNodeReimageOption? value) => + value == null ? null : ((ComputeNodeReimageOption)value).ToSerializedValue(); + + internal static string ToSerializedValue(this ComputeNodeReimageOption value) + { + switch( value ) + { + case ComputeNodeReimageOption.Requeue: + return "requeue"; + case ComputeNodeReimageOption.Terminate: + return "terminate"; + case ComputeNodeReimageOption.TaskCompletion: + return "taskCompletion"; + case ComputeNodeReimageOption.RetainedData: + return "retainedData"; + } + return null; + } + + internal static ComputeNodeReimageOption? ParseComputeNodeReimageOption(this string value) + { + switch( value ) + { + case "requeue": + return ComputeNodeReimageOption.Requeue; + case "terminate": + return ComputeNodeReimageOption.Terminate; + case "taskCompletion": + return ComputeNodeReimageOption.TaskCompletion; + case "retainedData": + return ComputeNodeReimageOption.RetainedData; + } + return null; + } + } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeReimageOptions.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeReimageOptions.cs index 669d0b098cf1..adf28408cb93 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeReimageOptions.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeReimageOptions.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class ComputeNodeReimageOptions /// /// Initializes a new instance of the ComputeNodeReimageOptions class. /// - public ComputeNodeReimageOptions() { } + public ComputeNodeReimageOptions() + { + CustomInit(); + } /// /// Initializes a new instance of the ComputeNodeReimageOptions class. @@ -36,17 +45,23 @@ public ComputeNodeReimageOptions() { } /// it explicitly if you are calling the REST API directly. public ComputeNodeReimageOptions(int? timeout = default(int?), System.Guid? clientRequestId = default(System.Guid?), bool? returnClientRequestId = default(bool?), System.DateTime? ocpDate = default(System.DateTime?)) { - this.Timeout = timeout; - this.ClientRequestId = clientRequestId; - this.ReturnClientRequestId = returnClientRequestId; - this.OcpDate = ocpDate; + Timeout = timeout; + ClientRequestId = clientRequestId; + ReturnClientRequestId = returnClientRequestId; + OcpDate = ocpDate; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the maximum time that the server can spend processing /// the request, in seconds. The default is 30 seconds. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public int? Timeout { get; set; } /// @@ -54,14 +69,14 @@ public ComputeNodeReimageOptions() { } /// a GUID with no decoration such as curly braces, e.g. /// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public System.Guid? ClientRequestId { get; set; } /// /// Gets or sets whether the server should return the client-request-id /// in the response. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public bool? ReturnClientRequestId { get; set; } /// @@ -69,8 +84,8 @@ public ComputeNodeReimageOptions() { } /// typically set this to the current system clock time; set it /// explicitly if you are calling the REST API directly. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? OcpDate { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeState.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeState.cs index 235d17a916e3..13a34dac44f5 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeState.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeState.cs @@ -8,38 +8,118 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; /// /// Defines values for ComputeNodeState. /// - [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + [JsonConverter(typeof(StringEnumConverter))] public enum ComputeNodeState { - [System.Runtime.Serialization.EnumMember(Value = "idle")] + [EnumMember(Value = "idle")] Idle, - [System.Runtime.Serialization.EnumMember(Value = "rebooting")] + [EnumMember(Value = "rebooting")] Rebooting, - [System.Runtime.Serialization.EnumMember(Value = "reimaging")] + [EnumMember(Value = "reimaging")] Reimaging, - [System.Runtime.Serialization.EnumMember(Value = "running")] + [EnumMember(Value = "running")] Running, - [System.Runtime.Serialization.EnumMember(Value = "unusable")] + [EnumMember(Value = "unusable")] Unusable, - [System.Runtime.Serialization.EnumMember(Value = "creating")] + [EnumMember(Value = "creating")] Creating, - [System.Runtime.Serialization.EnumMember(Value = "starting")] + [EnumMember(Value = "starting")] Starting, - [System.Runtime.Serialization.EnumMember(Value = "waitingForStartTask")] + [EnumMember(Value = "waitingForStartTask")] WaitingForStartTask, - [System.Runtime.Serialization.EnumMember(Value = "startTaskFailed")] + [EnumMember(Value = "startTaskFailed")] StartTaskFailed, - [System.Runtime.Serialization.EnumMember(Value = "unknown")] + [EnumMember(Value = "unknown")] Unknown, - [System.Runtime.Serialization.EnumMember(Value = "leavingPool")] + [EnumMember(Value = "leavingPool")] LeavingPool, - [System.Runtime.Serialization.EnumMember(Value = "offline")] + [EnumMember(Value = "offline")] Offline, - [System.Runtime.Serialization.EnumMember(Value = "preempted")] + [EnumMember(Value = "preempted")] Preempted } + internal static class ComputeNodeStateEnumExtension + { + internal static string ToSerializedValue(this ComputeNodeState? value) => + value == null ? null : ((ComputeNodeState)value).ToSerializedValue(); + + internal static string ToSerializedValue(this ComputeNodeState value) + { + switch( value ) + { + case ComputeNodeState.Idle: + return "idle"; + case ComputeNodeState.Rebooting: + return "rebooting"; + case ComputeNodeState.Reimaging: + return "reimaging"; + case ComputeNodeState.Running: + return "running"; + case ComputeNodeState.Unusable: + return "unusable"; + case ComputeNodeState.Creating: + return "creating"; + case ComputeNodeState.Starting: + return "starting"; + case ComputeNodeState.WaitingForStartTask: + return "waitingForStartTask"; + case ComputeNodeState.StartTaskFailed: + return "startTaskFailed"; + case ComputeNodeState.Unknown: + return "unknown"; + case ComputeNodeState.LeavingPool: + return "leavingPool"; + case ComputeNodeState.Offline: + return "offline"; + case ComputeNodeState.Preempted: + return "preempted"; + } + return null; + } + + internal static ComputeNodeState? ParseComputeNodeState(this string value) + { + switch( value ) + { + case "idle": + return ComputeNodeState.Idle; + case "rebooting": + return ComputeNodeState.Rebooting; + case "reimaging": + return ComputeNodeState.Reimaging; + case "running": + return ComputeNodeState.Running; + case "unusable": + return ComputeNodeState.Unusable; + case "creating": + return ComputeNodeState.Creating; + case "starting": + return ComputeNodeState.Starting; + case "waitingForStartTask": + return ComputeNodeState.WaitingForStartTask; + case "startTaskFailed": + return ComputeNodeState.StartTaskFailed; + case "unknown": + return ComputeNodeState.Unknown; + case "leavingPool": + return ComputeNodeState.LeavingPool; + case "offline": + return ComputeNodeState.Offline; + case "preempted": + return ComputeNodeState.Preempted; + } + return null; + } + } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeUpdateUserHeaders.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeUpdateUserHeaders.cs index 480521cd0de8..57026926c7d0 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeUpdateUserHeaders.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeUpdateUserHeaders.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -19,7 +25,10 @@ public partial class ComputeNodeUpdateUserHeaders /// Initializes a new instance of the ComputeNodeUpdateUserHeaders /// class. /// - public ComputeNodeUpdateUserHeaders() { } + public ComputeNodeUpdateUserHeaders() + { + CustomInit(); + } /// /// Initializes a new instance of the ComputeNodeUpdateUserHeaders @@ -46,19 +55,25 @@ public ComputeNodeUpdateUserHeaders() { } /// the request applied. public ComputeNodeUpdateUserHeaders(System.Guid? clientRequestId = default(System.Guid?), System.Guid? requestId = default(System.Guid?), string eTag = default(string), System.DateTime? lastModified = default(System.DateTime?), string dataServiceId = default(string)) { - this.ClientRequestId = clientRequestId; - this.RequestId = requestId; - this.ETag = eTag; - this.LastModified = lastModified; - this.DataServiceId = dataServiceId; + ClientRequestId = clientRequestId; + RequestId = requestId; + ETag = eTag; + LastModified = lastModified; + DataServiceId = dataServiceId; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the client-request-id provided by the client during /// the request. This will be returned only if the /// return-client-request-id parameter was set to true. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "client-request-id")] + [JsonProperty(PropertyName = "client-request-id")] public System.Guid? ClientRequestId { get; set; } /// @@ -70,7 +85,7 @@ public ComputeNodeUpdateUserHeaders() { } /// request was made, the Batch account against which the request was /// made, and the region that account resides in. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "request-id")] + [JsonProperty(PropertyName = "request-id")] public System.Guid? RequestId { get; set; } /// @@ -80,21 +95,21 @@ public ComputeNodeUpdateUserHeaders() { } /// the If-Modified-Since, If-Unmodified-Since, If-Match or /// If-None-Match headers. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "ETag")] + [JsonProperty(PropertyName = "ETag")] public string ETag { get; set; } /// /// Gets or sets the time at which the resource was last modified. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "Last-Modified")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "Last-Modified")] public System.DateTime? LastModified { get; set; } /// /// Gets or sets the OData ID of the resource to which the request /// applied. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "DataServiceId")] + [JsonProperty(PropertyName = "DataServiceId")] public string DataServiceId { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeUpdateUserOptions.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeUpdateUserOptions.cs index a0f92eda40a7..3a5fbc5cc6ed 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeUpdateUserOptions.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeUpdateUserOptions.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -19,7 +25,10 @@ public partial class ComputeNodeUpdateUserOptions /// Initializes a new instance of the ComputeNodeUpdateUserOptions /// class. /// - public ComputeNodeUpdateUserOptions() { } + public ComputeNodeUpdateUserOptions() + { + CustomInit(); + } /// /// Initializes a new instance of the ComputeNodeUpdateUserOptions @@ -38,17 +47,23 @@ public ComputeNodeUpdateUserOptions() { } /// it explicitly if you are calling the REST API directly. public ComputeNodeUpdateUserOptions(int? timeout = default(int?), System.Guid? clientRequestId = default(System.Guid?), bool? returnClientRequestId = default(bool?), System.DateTime? ocpDate = default(System.DateTime?)) { - this.Timeout = timeout; - this.ClientRequestId = clientRequestId; - this.ReturnClientRequestId = returnClientRequestId; - this.OcpDate = ocpDate; + Timeout = timeout; + ClientRequestId = clientRequestId; + ReturnClientRequestId = returnClientRequestId; + OcpDate = ocpDate; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the maximum time that the server can spend processing /// the request, in seconds. The default is 30 seconds. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public int? Timeout { get; set; } /// @@ -56,14 +71,14 @@ public ComputeNodeUpdateUserOptions() { } /// a GUID with no decoration such as curly braces, e.g. /// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public System.Guid? ClientRequestId { get; set; } /// /// Gets or sets whether the server should return the client-request-id /// in the response. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public bool? ReturnClientRequestId { get; set; } /// @@ -71,8 +86,8 @@ public ComputeNodeUpdateUserOptions() { } /// typically set this to the current system clock time; set it /// explicitly if you are calling the REST API directly. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? OcpDate { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeUser.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeUser.cs index 823ed9aeb405..615a3e1ed5fa 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeUser.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ComputeNodeUser.cs @@ -8,6 +8,11 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +23,10 @@ public partial class ComputeNodeUser /// /// Initializes a new instance of the ComputeNodeUser class. /// - public ComputeNodeUser() { } + public ComputeNodeUser() + { + CustomInit(); + } /// /// Initializes a new instance of the ComputeNodeUser class. @@ -33,17 +41,23 @@ public ComputeNodeUser() { } /// remote login to the compute node. public ComputeNodeUser(string name, bool? isAdmin = default(bool?), System.DateTime? expiryTime = default(System.DateTime?), string password = default(string), string sshPublicKey = default(string)) { - this.Name = name; - this.IsAdmin = isAdmin; - this.ExpiryTime = expiryTime; - this.Password = password; - this.SshPublicKey = sshPublicKey; + Name = name; + IsAdmin = isAdmin; + ExpiryTime = expiryTime; + Password = password; + SshPublicKey = sshPublicKey; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the user name of the account. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// @@ -53,7 +67,7 @@ public ComputeNodeUser() { } /// /// The default value is false. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "isAdmin")] + [JsonProperty(PropertyName = "isAdmin")] public bool? IsAdmin { get; set; } /// @@ -63,7 +77,7 @@ public ComputeNodeUser() { } /// If omitted, the default is 1 day from the current time. For Linux /// compute nodes, the expiryTime has a precision up to a day. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "expiryTime")] + [JsonProperty(PropertyName = "expiryTime")] public System.DateTime? ExpiryTime { get; set; } /// @@ -76,7 +90,7 @@ public ComputeNodeUser() { } /// Linux compute nodes, the password can optionally be specified along /// with the sshPublicKey property. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "password")] + [JsonProperty(PropertyName = "password")] public string Password { get; set; } /// @@ -90,20 +104,20 @@ public ComputeNodeUser() { } /// Batch service rejects the request; if you are calling the REST API /// directly, the HTTP status code is 400 (Bad Request). /// - [Newtonsoft.Json.JsonProperty(PropertyName = "sshPublicKey")] + [JsonProperty(PropertyName = "sshPublicKey")] public string SshPublicKey { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (this.Name == null) + if (Name == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Name"); + throw new ValidationException(ValidationRules.CannotBeNull, "Name"); } } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/DeleteCertificateError.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/DeleteCertificateError.cs index 71c06b09c927..3c067752c020 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/DeleteCertificateError.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/DeleteCertificateError.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class DeleteCertificateError /// /// Initializes a new instance of the DeleteCertificateError class. /// - public DeleteCertificateError() { } + public DeleteCertificateError() + { + CustomInit(); + } /// /// Initializes a new instance of the DeleteCertificateError class. @@ -31,26 +40,32 @@ public DeleteCertificateError() { } /// interface. /// A list of additional error details related to /// the certificate deletion error. - public DeleteCertificateError(string code = default(string), string message = default(string), System.Collections.Generic.IList values = default(System.Collections.Generic.IList)) + public DeleteCertificateError(string code = default(string), string message = default(string), IList values = default(IList)) { - this.Code = code; - this.Message = message; - this.Values = values; + Code = code; + Message = message; + Values = values; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets an identifier for the certificate deletion error. /// Codes are invariant and are intended to be consumed /// programmatically. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "code")] + [JsonProperty(PropertyName = "code")] public string Code { get; set; } /// /// Gets or sets a message describing the certificate deletion error, /// intended to be suitable for display in a user interface. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "message")] + [JsonProperty(PropertyName = "message")] public string Message { get; set; } /// @@ -63,8 +78,8 @@ public DeleteCertificateError() { } /// resources reference the certificate, the list contains only about /// the first hundred. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "values")] - public System.Collections.Generic.IList Values { get; set; } + [JsonProperty(PropertyName = "values")] + public IList Values { get; set; } } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/DependencyAction.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/DependencyAction.cs index eaed9ab860e1..0784df013196 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/DependencyAction.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/DependencyAction.cs @@ -8,16 +8,52 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; /// /// Defines values for DependencyAction. /// - [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + [JsonConverter(typeof(StringEnumConverter))] public enum DependencyAction { - [System.Runtime.Serialization.EnumMember(Value = "satisfy")] + [EnumMember(Value = "satisfy")] Satisfy, - [System.Runtime.Serialization.EnumMember(Value = "block")] + [EnumMember(Value = "block")] Block } + internal static class DependencyActionEnumExtension + { + internal static string ToSerializedValue(this DependencyAction? value) => + value == null ? null : ((DependencyAction)value).ToSerializedValue(); + + internal static string ToSerializedValue(this DependencyAction value) + { + switch( value ) + { + case DependencyAction.Satisfy: + return "satisfy"; + case DependencyAction.Block: + return "block"; + } + return null; + } + + internal static DependencyAction? ParseDependencyAction(this string value) + { + switch( value ) + { + case "satisfy": + return DependencyAction.Satisfy; + case "block": + return DependencyAction.Block; + } + return null; + } + } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/DisableComputeNodeSchedulingOption.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/DisableComputeNodeSchedulingOption.cs index 7ab53dbb0b4f..996e76ed423f 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/DisableComputeNodeSchedulingOption.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/DisableComputeNodeSchedulingOption.cs @@ -8,18 +8,58 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; /// /// Defines values for DisableComputeNodeSchedulingOption. /// - [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + [JsonConverter(typeof(StringEnumConverter))] public enum DisableComputeNodeSchedulingOption { - [System.Runtime.Serialization.EnumMember(Value = "requeue")] + [EnumMember(Value = "requeue")] Requeue, - [System.Runtime.Serialization.EnumMember(Value = "terminate")] + [EnumMember(Value = "terminate")] Terminate, - [System.Runtime.Serialization.EnumMember(Value = "taskCompletion")] + [EnumMember(Value = "taskCompletion")] TaskCompletion } + internal static class DisableComputeNodeSchedulingOptionEnumExtension + { + internal static string ToSerializedValue(this DisableComputeNodeSchedulingOption? value) => + value == null ? null : ((DisableComputeNodeSchedulingOption)value).ToSerializedValue(); + + internal static string ToSerializedValue(this DisableComputeNodeSchedulingOption value) + { + switch( value ) + { + case DisableComputeNodeSchedulingOption.Requeue: + return "requeue"; + case DisableComputeNodeSchedulingOption.Terminate: + return "terminate"; + case DisableComputeNodeSchedulingOption.TaskCompletion: + return "taskCompletion"; + } + return null; + } + + internal static DisableComputeNodeSchedulingOption? ParseDisableComputeNodeSchedulingOption(this string value) + { + switch( value ) + { + case "requeue": + return DisableComputeNodeSchedulingOption.Requeue; + case "terminate": + return DisableComputeNodeSchedulingOption.Terminate; + case "taskCompletion": + return DisableComputeNodeSchedulingOption.TaskCompletion; + } + return null; + } + } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/DisableJobOption.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/DisableJobOption.cs index b51a7f28e0de..68785a39ff5d 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/DisableJobOption.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/DisableJobOption.cs @@ -8,18 +8,58 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; /// /// Defines values for DisableJobOption. /// - [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + [JsonConverter(typeof(StringEnumConverter))] public enum DisableJobOption { - [System.Runtime.Serialization.EnumMember(Value = "requeue")] + [EnumMember(Value = "requeue")] Requeue, - [System.Runtime.Serialization.EnumMember(Value = "terminate")] + [EnumMember(Value = "terminate")] Terminate, - [System.Runtime.Serialization.EnumMember(Value = "wait")] + [EnumMember(Value = "wait")] Wait } + internal static class DisableJobOptionEnumExtension + { + internal static string ToSerializedValue(this DisableJobOption? value) => + value == null ? null : ((DisableJobOption)value).ToSerializedValue(); + + internal static string ToSerializedValue(this DisableJobOption value) + { + switch( value ) + { + case DisableJobOption.Requeue: + return "requeue"; + case DisableJobOption.Terminate: + return "terminate"; + case DisableJobOption.Wait: + return "wait"; + } + return null; + } + + internal static DisableJobOption? ParseDisableJobOption(this string value) + { + switch( value ) + { + case "requeue": + return DisableJobOption.Requeue; + case "terminate": + return DisableJobOption.Terminate; + case "wait": + return DisableJobOption.Wait; + } + return null; + } + } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ElevationLevel.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ElevationLevel.cs index 9e8f0249fa38..6138a2bd8d71 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ElevationLevel.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ElevationLevel.cs @@ -8,16 +8,52 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; /// /// Defines values for ElevationLevel. /// - [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + [JsonConverter(typeof(StringEnumConverter))] public enum ElevationLevel { - [System.Runtime.Serialization.EnumMember(Value = "nonAdmin")] + [EnumMember(Value = "nonAdmin")] NonAdmin, - [System.Runtime.Serialization.EnumMember(Value = "admin")] + [EnumMember(Value = "admin")] Admin } + internal static class ElevationLevelEnumExtension + { + internal static string ToSerializedValue(this ElevationLevel? value) => + value == null ? null : ((ElevationLevel)value).ToSerializedValue(); + + internal static string ToSerializedValue(this ElevationLevel value) + { + switch( value ) + { + case ElevationLevel.NonAdmin: + return "nonAdmin"; + case ElevationLevel.Admin: + return "admin"; + } + return null; + } + + internal static ElevationLevel? ParseElevationLevel(this string value) + { + switch( value ) + { + case "nonAdmin": + return ElevationLevel.NonAdmin; + case "admin": + return ElevationLevel.Admin; + } + return null; + } + } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/EnvironmentSetting.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/EnvironmentSetting.cs index e76880e0a4bb..4446ded16eb6 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/EnvironmentSetting.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/EnvironmentSetting.cs @@ -8,6 +8,11 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +23,10 @@ public partial class EnvironmentSetting /// /// Initializes a new instance of the EnvironmentSetting class. /// - public EnvironmentSetting() { } + public EnvironmentSetting() + { + CustomInit(); + } /// /// Initializes a new instance of the EnvironmentSetting class. @@ -27,33 +35,39 @@ public EnvironmentSetting() { } /// The value of the environment variable. public EnvironmentSetting(string name, string value = default(string)) { - this.Name = name; - this.Value = value; + Name = name; + Value = value; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the name of the environment variable. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// /// Gets or sets the value of the environment variable. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "value")] + [JsonProperty(PropertyName = "value")] public string Value { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (this.Name == null) + if (Name == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Name"); + throw new ValidationException(ValidationRules.CannotBeNull, "Name"); } } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ErrorCategory.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ErrorCategory.cs index 1b7464893697..697e56e5edda 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ErrorCategory.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ErrorCategory.cs @@ -8,16 +8,52 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; /// /// Defines values for ErrorCategory. /// - [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + [JsonConverter(typeof(StringEnumConverter))] public enum ErrorCategory { - [System.Runtime.Serialization.EnumMember(Value = "userError")] + [EnumMember(Value = "userError")] UserError, - [System.Runtime.Serialization.EnumMember(Value = "serverError")] + [EnumMember(Value = "serverError")] ServerError } + internal static class ErrorCategoryEnumExtension + { + internal static string ToSerializedValue(this ErrorCategory? value) => + value == null ? null : ((ErrorCategory)value).ToSerializedValue(); + + internal static string ToSerializedValue(this ErrorCategory value) + { + switch( value ) + { + case ErrorCategory.UserError: + return "userError"; + case ErrorCategory.ServerError: + return "serverError"; + } + return null; + } + + internal static ErrorCategory? ParseErrorCategory(this string value) + { + switch( value ) + { + case "userError": + return ErrorCategory.UserError; + case "serverError": + return ErrorCategory.ServerError; + } + return null; + } + } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ErrorMessage.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ErrorMessage.cs index 96b07bf3bc2c..7c0717ef2404 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ErrorMessage.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ErrorMessage.cs @@ -8,6 +8,10 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +22,10 @@ public partial class ErrorMessage /// /// Initializes a new instance of the ErrorMessage class. /// - public ErrorMessage() { } + public ErrorMessage() + { + CustomInit(); + } /// /// Initializes a new instance of the ErrorMessage class. @@ -27,20 +34,26 @@ public ErrorMessage() { } /// The text of the message. public ErrorMessage(string lang = default(string), string value = default(string)) { - this.Lang = lang; - this.Value = value; + Lang = lang; + Value = value; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the language code of the error message /// - [Newtonsoft.Json.JsonProperty(PropertyName = "lang")] + [JsonProperty(PropertyName = "lang")] public string Lang { get; set; } /// /// Gets or sets the text of the message. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "value")] + [JsonProperty(PropertyName = "value")] public string Value { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ExitCodeMapping.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ExitCodeMapping.cs index 428721ec6587..970843015a35 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ExitCodeMapping.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ExitCodeMapping.cs @@ -8,6 +8,11 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Newtonsoft.Json; using System.Linq; /// @@ -19,7 +24,10 @@ public partial class ExitCodeMapping /// /// Initializes a new instance of the ExitCodeMapping class. /// - public ExitCodeMapping() { } + public ExitCodeMapping() + { + CustomInit(); + } /// /// Initializes a new instance of the ExitCodeMapping class. @@ -29,34 +37,40 @@ public ExitCodeMapping() { } /// the task exits with this exit code. public ExitCodeMapping(int code, ExitOptions exitOptions) { - this.Code = code; - this.ExitOptions = exitOptions; + Code = code; + ExitOptions = exitOptions; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets a process exit code. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "code")] + [JsonProperty(PropertyName = "code")] public int Code { get; set; } /// /// Gets or sets how the Batch service should respond if the task exits /// with this exit code. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "exitOptions")] + [JsonProperty(PropertyName = "exitOptions")] public ExitOptions ExitOptions { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (this.ExitOptions == null) + if (ExitOptions == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "ExitOptions"); + throw new ValidationException(ValidationRules.CannotBeNull, "ExitOptions"); } } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ExitCodeRangeMapping.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ExitCodeRangeMapping.cs index 15190e34109d..49680d910624 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ExitCodeRangeMapping.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ExitCodeRangeMapping.cs @@ -8,6 +8,11 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Newtonsoft.Json; using System.Linq; /// @@ -19,7 +24,10 @@ public partial class ExitCodeRangeMapping /// /// Initializes a new instance of the ExitCodeRangeMapping class. /// - public ExitCodeRangeMapping() { } + public ExitCodeRangeMapping() + { + CustomInit(); + } /// /// Initializes a new instance of the ExitCodeRangeMapping class. @@ -31,41 +39,47 @@ public ExitCodeRangeMapping() { } /// (inclusive). public ExitCodeRangeMapping(int start, int end, ExitOptions exitOptions) { - this.Start = start; - this.End = end; - this.ExitOptions = exitOptions; + Start = start; + End = end; + ExitOptions = exitOptions; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the first exit code in the range. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "start")] + [JsonProperty(PropertyName = "start")] public int Start { get; set; } /// /// Gets or sets the last exit code in the range. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "end")] + [JsonProperty(PropertyName = "end")] public int End { get; set; } /// /// Gets or sets how the Batch service should respond if the task exits /// with an exit code in the range start to end (inclusive). /// - [Newtonsoft.Json.JsonProperty(PropertyName = "exitOptions")] + [JsonProperty(PropertyName = "exitOptions")] public ExitOptions ExitOptions { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (this.ExitOptions == null) + if (ExitOptions == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "ExitOptions"); + throw new ValidationException(ValidationRules.CannotBeNull, "ExitOptions"); } } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ExitConditions.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ExitConditions.cs index 7f605cc5d2ee..717f47eb83bf 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ExitConditions.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ExitConditions.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class ExitConditions /// /// Initializes a new instance of the ExitConditions class. /// - public ExitConditions() { } + public ExitConditions() + { + CustomInit(); + } /// /// Initializes a new instance of the ExitConditions class. @@ -34,34 +43,40 @@ public ExitConditions() { } /// How the Batch service should respond /// if the task fails with an exit condition not covered by any of the /// other properties. - public ExitConditions(System.Collections.Generic.IList exitCodes = default(System.Collections.Generic.IList), System.Collections.Generic.IList exitCodeRanges = default(System.Collections.Generic.IList), ExitOptions preProcessingError = default(ExitOptions), ExitOptions fileUploadError = default(ExitOptions), ExitOptions defaultProperty = default(ExitOptions)) + public ExitConditions(IList exitCodes = default(IList), IList exitCodeRanges = default(IList), ExitOptions preProcessingError = default(ExitOptions), ExitOptions fileUploadError = default(ExitOptions), ExitOptions defaultProperty = default(ExitOptions)) { - this.ExitCodes = exitCodes; - this.ExitCodeRanges = exitCodeRanges; - this.PreProcessingError = preProcessingError; - this.FileUploadError = fileUploadError; - this.DefaultProperty = defaultProperty; + ExitCodes = exitCodes; + ExitCodeRanges = exitCodeRanges; + PreProcessingError = preProcessingError; + FileUploadError = fileUploadError; + DefaultProperty = defaultProperty; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets a list of individual task exit codes and how the Batch /// service should respond to them. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "exitCodes")] - public System.Collections.Generic.IList ExitCodes { get; set; } + [JsonProperty(PropertyName = "exitCodes")] + public IList ExitCodes { get; set; } /// /// Gets or sets a list of task exit code ranges and how the Batch /// service should respond to them. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "exitCodeRanges")] - public System.Collections.Generic.IList ExitCodeRanges { get; set; } + [JsonProperty(PropertyName = "exitCodeRanges")] + public IList ExitCodeRanges { get; set; } /// /// Gets or sets how the Batch service should respond if the task fails /// to start due to an error. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "preProcessingError")] + [JsonProperty(PropertyName = "preProcessingError")] public ExitOptions PreProcessingError { get; set; } /// @@ -73,7 +88,7 @@ public ExitConditions() { } /// exitCodes or exitCodeRanges, and then encountered a file upload /// error, then the action specified by the exit code takes precedence. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "fileUploadError")] + [JsonProperty(PropertyName = "fileUploadError")] public ExitOptions FileUploadError { get; set; } /// @@ -89,7 +104,7 @@ public ExitConditions() { } /// code 0, you must list it explicitly using the exitCodes or /// exitCodeRanges collection. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "default")] + [JsonProperty(PropertyName = "default")] public ExitOptions DefaultProperty { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ExitOptions.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ExitOptions.cs index b7675072e6b0..db8a5c04f307 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ExitOptions.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ExitOptions.cs @@ -8,6 +8,10 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; using System.Linq; /// @@ -19,7 +23,10 @@ public partial class ExitOptions /// /// Initializes a new instance of the ExitOptions class. /// - public ExitOptions() { } + public ExitOptions() + { + CustomInit(); + } /// /// Initializes a new instance of the ExitOptions class. @@ -32,24 +39,38 @@ public ExitOptions() { } /// performs on tasks that depend on this task. public ExitOptions(JobAction? jobAction = default(JobAction?), DependencyAction? dependencyAction = default(DependencyAction?)) { - this.JobAction = jobAction; - this.DependencyAction = dependencyAction; + JobAction = jobAction; + DependencyAction = dependencyAction; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets an action to take on the job containing the task, if /// the task completes with the given exit condition and the job's /// onTaskFailed property is 'performExitOptionsJobAction'. /// /// - /// The default is none for exit code 0 and terminate for all other - /// exit conditions. If the job's onTaskFailed property is noAction, - /// then specify this property returns an error. The add task request - /// fails with an invalid property value error;; if you are calling the - /// REST API directly, the HTTP status code is 400 (Bad Request). - /// Possible values include: 'none', 'disable', 'terminate' + /// Values are: + /// + /// none - Take no action. + /// disable - Disable the job. This is equivalent to calling the + /// disable job API, with a disableTasks value of requeue. + /// terminate - Terminate the job. The terminateReason in the job's + /// executionInfo is set to "TaskFailed". The default is none for exit + /// code 0 and terminate for all other exit conditions. + /// + /// If the job's onTaskFailed property is noAction, then specifying + /// this property returns an error and the add task request fails with + /// an invalid property value error; if you are calling the REST API + /// directly, the HTTP status code is 400 (Bad Request). Possible + /// values include: 'none', 'disable', 'terminate' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "jobAction")] + [JsonProperty(PropertyName = "jobAction")] public JobAction? JobAction { get; set; } /// @@ -57,15 +78,20 @@ public ExitOptions() { } /// that depend on this task. /// /// + /// Values are: + /// + /// satisfy - Satisfy the task's dependencies. + /// block - Block the task's dependencies. + /// /// The default is 'satisfy' for exit code 0, and 'block' for all other /// exit conditions. If the job's usesTaskDependencies property is set /// to false, then specifying the dependencyAction property returns an - /// error. The add task request fails with an invalid property value + /// erro and the add task request fails with an invalid property value /// error; if you are calling the REST API directly, the HTTP status /// code is 400 (Bad Request). Possible values include: 'satisfy', /// 'block' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "dependencyAction")] + [JsonProperty(PropertyName = "dependencyAction")] public DependencyAction? DependencyAction { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/FileDeleteFromComputeNodeHeaders.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/FileDeleteFromComputeNodeHeaders.cs index 1f4325aa704f..692da1f61315 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/FileDeleteFromComputeNodeHeaders.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/FileDeleteFromComputeNodeHeaders.cs @@ -8,6 +8,10 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; using System.Linq; /// @@ -19,7 +23,10 @@ public partial class FileDeleteFromComputeNodeHeaders /// Initializes a new instance of the FileDeleteFromComputeNodeHeaders /// class. /// - public FileDeleteFromComputeNodeHeaders() { } + public FileDeleteFromComputeNodeHeaders() + { + CustomInit(); + } /// /// Initializes a new instance of the FileDeleteFromComputeNodeHeaders @@ -37,16 +44,22 @@ public FileDeleteFromComputeNodeHeaders() { } /// request was made, and the region that account resides in. public FileDeleteFromComputeNodeHeaders(string clientRequestId = default(string), string requestId = default(string)) { - this.ClientRequestId = clientRequestId; - this.RequestId = requestId; + ClientRequestId = clientRequestId; + RequestId = requestId; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the client-request-id provided by the client during /// the request. This will be returned only if the /// return-client-request-id parameter was set to true. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "client-request-id")] + [JsonProperty(PropertyName = "client-request-id")] public string ClientRequestId { get; set; } /// @@ -58,7 +71,7 @@ public FileDeleteFromComputeNodeHeaders() { } /// request was made, the Batch account against which the request was /// made, and the region that account resides in. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "request-id")] + [JsonProperty(PropertyName = "request-id")] public string RequestId { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/FileDeleteFromComputeNodeOptions.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/FileDeleteFromComputeNodeOptions.cs index 1401a6ecd39b..101d2399a84a 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/FileDeleteFromComputeNodeOptions.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/FileDeleteFromComputeNodeOptions.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -19,7 +25,10 @@ public partial class FileDeleteFromComputeNodeOptions /// Initializes a new instance of the FileDeleteFromComputeNodeOptions /// class. /// - public FileDeleteFromComputeNodeOptions() { } + public FileDeleteFromComputeNodeOptions() + { + CustomInit(); + } /// /// Initializes a new instance of the FileDeleteFromComputeNodeOptions @@ -38,17 +47,23 @@ public FileDeleteFromComputeNodeOptions() { } /// it explicitly if you are calling the REST API directly. public FileDeleteFromComputeNodeOptions(int? timeout = default(int?), System.Guid? clientRequestId = default(System.Guid?), bool? returnClientRequestId = default(bool?), System.DateTime? ocpDate = default(System.DateTime?)) { - this.Timeout = timeout; - this.ClientRequestId = clientRequestId; - this.ReturnClientRequestId = returnClientRequestId; - this.OcpDate = ocpDate; + Timeout = timeout; + ClientRequestId = clientRequestId; + ReturnClientRequestId = returnClientRequestId; + OcpDate = ocpDate; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the maximum time that the server can spend processing /// the request, in seconds. The default is 30 seconds. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public int? Timeout { get; set; } /// @@ -56,14 +71,14 @@ public FileDeleteFromComputeNodeOptions() { } /// a GUID with no decoration such as curly braces, e.g. /// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public System.Guid? ClientRequestId { get; set; } /// /// Gets or sets whether the server should return the client-request-id /// in the response. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public bool? ReturnClientRequestId { get; set; } /// @@ -71,8 +86,8 @@ public FileDeleteFromComputeNodeOptions() { } /// typically set this to the current system clock time; set it /// explicitly if you are calling the REST API directly. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? OcpDate { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/FileDeleteFromTaskHeaders.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/FileDeleteFromTaskHeaders.cs index bfea2c4cf4b9..420bb08db012 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/FileDeleteFromTaskHeaders.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/FileDeleteFromTaskHeaders.cs @@ -8,6 +8,10 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +22,10 @@ public partial class FileDeleteFromTaskHeaders /// /// Initializes a new instance of the FileDeleteFromTaskHeaders class. /// - public FileDeleteFromTaskHeaders() { } + public FileDeleteFromTaskHeaders() + { + CustomInit(); + } /// /// Initializes a new instance of the FileDeleteFromTaskHeaders class. @@ -35,16 +42,22 @@ public FileDeleteFromTaskHeaders() { } /// request was made, and the region that account resides in. public FileDeleteFromTaskHeaders(string clientRequestId = default(string), string requestId = default(string)) { - this.ClientRequestId = clientRequestId; - this.RequestId = requestId; + ClientRequestId = clientRequestId; + RequestId = requestId; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the client-request-id provided by the client during /// the request. This will be returned only if the /// return-client-request-id parameter was set to true. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "client-request-id")] + [JsonProperty(PropertyName = "client-request-id")] public string ClientRequestId { get; set; } /// @@ -56,7 +69,7 @@ public FileDeleteFromTaskHeaders() { } /// request was made, the Batch account against which the request was /// made, and the region that account resides in. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "request-id")] + [JsonProperty(PropertyName = "request-id")] public string RequestId { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/FileDeleteFromTaskOptions.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/FileDeleteFromTaskOptions.cs index f384515f49f8..8f6894570ed1 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/FileDeleteFromTaskOptions.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/FileDeleteFromTaskOptions.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class FileDeleteFromTaskOptions /// /// Initializes a new instance of the FileDeleteFromTaskOptions class. /// - public FileDeleteFromTaskOptions() { } + public FileDeleteFromTaskOptions() + { + CustomInit(); + } /// /// Initializes a new instance of the FileDeleteFromTaskOptions class. @@ -36,17 +45,23 @@ public FileDeleteFromTaskOptions() { } /// it explicitly if you are calling the REST API directly. public FileDeleteFromTaskOptions(int? timeout = default(int?), System.Guid? clientRequestId = default(System.Guid?), bool? returnClientRequestId = default(bool?), System.DateTime? ocpDate = default(System.DateTime?)) { - this.Timeout = timeout; - this.ClientRequestId = clientRequestId; - this.ReturnClientRequestId = returnClientRequestId; - this.OcpDate = ocpDate; + Timeout = timeout; + ClientRequestId = clientRequestId; + ReturnClientRequestId = returnClientRequestId; + OcpDate = ocpDate; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the maximum time that the server can spend processing /// the request, in seconds. The default is 30 seconds. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public int? Timeout { get; set; } /// @@ -54,14 +69,14 @@ public FileDeleteFromTaskOptions() { } /// a GUID with no decoration such as curly braces, e.g. /// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public System.Guid? ClientRequestId { get; set; } /// /// Gets or sets whether the server should return the client-request-id /// in the response. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public bool? ReturnClientRequestId { get; set; } /// @@ -69,8 +84,8 @@ public FileDeleteFromTaskOptions() { } /// typically set this to the current system clock time; set it /// explicitly if you are calling the REST API directly. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? OcpDate { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/FileGetFromComputeNodeHeaders.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/FileGetFromComputeNodeHeaders.cs index a8f1934db86f..4b2455fcaeed 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/FileGetFromComputeNodeHeaders.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/FileGetFromComputeNodeHeaders.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -19,7 +25,10 @@ public partial class FileGetFromComputeNodeHeaders /// Initializes a new instance of the FileGetFromComputeNodeHeaders /// class. /// - public FileGetFromComputeNodeHeaders() { } + public FileGetFromComputeNodeHeaders() + { + CustomInit(); + } /// /// Initializes a new instance of the FileGetFromComputeNodeHeaders @@ -52,24 +61,30 @@ public FileGetFromComputeNodeHeaders() { } /// The length of the file. public FileGetFromComputeNodeHeaders(System.Guid? clientRequestId = default(System.Guid?), System.Guid? requestId = default(System.Guid?), string eTag = default(string), System.DateTime? lastModified = default(System.DateTime?), System.DateTime? ocpCreationTime = default(System.DateTime?), bool? ocpBatchFileIsdirectory = default(bool?), string ocpBatchFileUrl = default(string), string ocpBatchFileMode = default(string), string contentType = default(string), long? contentLength = default(long?)) { - this.ClientRequestId = clientRequestId; - this.RequestId = requestId; - this.ETag = eTag; - this.LastModified = lastModified; - this.OcpCreationTime = ocpCreationTime; - this.OcpBatchFileIsdirectory = ocpBatchFileIsdirectory; - this.OcpBatchFileUrl = ocpBatchFileUrl; - this.OcpBatchFileMode = ocpBatchFileMode; - this.ContentType = contentType; - this.ContentLength = contentLength; + ClientRequestId = clientRequestId; + RequestId = requestId; + ETag = eTag; + LastModified = lastModified; + OcpCreationTime = ocpCreationTime; + OcpBatchFileIsdirectory = ocpBatchFileIsdirectory; + OcpBatchFileUrl = ocpBatchFileUrl; + OcpBatchFileMode = ocpBatchFileMode; + ContentType = contentType; + ContentLength = contentLength; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the client-request-id provided by the client during /// the request. This will be returned only if the /// return-client-request-id parameter was set to true. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "client-request-id")] + [JsonProperty(PropertyName = "client-request-id")] public System.Guid? ClientRequestId { get; set; } /// @@ -81,7 +96,7 @@ public FileGetFromComputeNodeHeaders() { } /// request was made, the Batch account against which the request was /// made, and the region that account resides in. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "request-id")] + [JsonProperty(PropertyName = "request-id")] public System.Guid? RequestId { get; set; } /// @@ -91,51 +106,51 @@ public FileGetFromComputeNodeHeaders() { } /// the If-Modified-Since, If-Unmodified-Since, If-Match or /// If-None-Match headers. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "ETag")] + [JsonProperty(PropertyName = "ETag")] public string ETag { get; set; } /// /// Gets or sets the time at which the resource was last modified. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "Last-Modified")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "Last-Modified")] public System.DateTime? LastModified { get; set; } /// /// Gets or sets the file creation time. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "ocp-creation-time")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "ocp-creation-time")] public System.DateTime? OcpCreationTime { get; set; } /// /// Gets or sets whether the object represents a directory. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "ocp-batch-file-isdirectory")] + [JsonProperty(PropertyName = "ocp-batch-file-isdirectory")] public bool? OcpBatchFileIsdirectory { get; set; } /// /// Gets or sets the URL of the file. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "ocp-batch-file-url")] + [JsonProperty(PropertyName = "ocp-batch-file-url")] public string OcpBatchFileUrl { get; set; } /// /// Gets or sets the file mode attribute in octal format. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "ocp-batch-file-mode")] + [JsonProperty(PropertyName = "ocp-batch-file-mode")] public string OcpBatchFileMode { get; set; } /// /// Gets or sets the content type of the file. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "Content-Type")] + [JsonProperty(PropertyName = "Content-Type")] public string ContentType { get; set; } /// /// Gets or sets the length of the file. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "Content-Length")] + [JsonProperty(PropertyName = "Content-Length")] public long? ContentLength { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/FileGetFromComputeNodeOptions.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/FileGetFromComputeNodeOptions.cs index c0b1f1af2beb..5a59be23185d 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/FileGetFromComputeNodeOptions.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/FileGetFromComputeNodeOptions.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -19,7 +25,10 @@ public partial class FileGetFromComputeNodeOptions /// Initializes a new instance of the FileGetFromComputeNodeOptions /// class. /// - public FileGetFromComputeNodeOptions() { } + public FileGetFromComputeNodeOptions() + { + CustomInit(); + } /// /// Initializes a new instance of the FileGetFromComputeNodeOptions @@ -49,20 +58,26 @@ public FileGetFromComputeNodeOptions() { } /// modified since the specified time. public FileGetFromComputeNodeOptions(int? timeout = default(int?), System.Guid? clientRequestId = default(System.Guid?), bool? returnClientRequestId = default(bool?), System.DateTime? ocpDate = default(System.DateTime?), string ocpRange = default(string), System.DateTime? ifModifiedSince = default(System.DateTime?), System.DateTime? ifUnmodifiedSince = default(System.DateTime?)) { - this.Timeout = timeout; - this.ClientRequestId = clientRequestId; - this.ReturnClientRequestId = returnClientRequestId; - this.OcpDate = ocpDate; - this.OcpRange = ocpRange; - this.IfModifiedSince = ifModifiedSince; - this.IfUnmodifiedSince = ifUnmodifiedSince; + Timeout = timeout; + ClientRequestId = clientRequestId; + ReturnClientRequestId = returnClientRequestId; + OcpDate = ocpDate; + OcpRange = ocpRange; + IfModifiedSince = ifModifiedSince; + IfUnmodifiedSince = ifUnmodifiedSince; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the maximum time that the server can spend processing /// the request, in seconds. The default is 30 seconds. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public int? Timeout { get; set; } /// @@ -70,14 +85,14 @@ public FileGetFromComputeNodeOptions() { } /// a GUID with no decoration such as curly braces, e.g. /// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public System.Guid? ClientRequestId { get; set; } /// /// Gets or sets whether the server should return the client-request-id /// in the response. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public bool? ReturnClientRequestId { get; set; } /// @@ -85,15 +100,15 @@ public FileGetFromComputeNodeOptions() { } /// typically set this to the current system clock time; set it /// explicitly if you are calling the REST API directly. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? OcpDate { get; set; } /// /// Gets or sets the byte range to be retrieved. The default is to /// retrieve the entire file. The format is bytes=startRange-endRange. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public string OcpRange { get; set; } /// @@ -102,8 +117,8 @@ public FileGetFromComputeNodeOptions() { } /// if the resource on the service has been modified since the /// specified time. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? IfModifiedSince { get; set; } /// @@ -112,8 +127,8 @@ public FileGetFromComputeNodeOptions() { } /// if the resource on the service has not been modified since the /// specified time. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? IfUnmodifiedSince { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/FileGetFromTaskHeaders.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/FileGetFromTaskHeaders.cs index ebd03e88f37c..4bf795a8e9d8 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/FileGetFromTaskHeaders.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/FileGetFromTaskHeaders.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class FileGetFromTaskHeaders /// /// Initializes a new instance of the FileGetFromTaskHeaders class. /// - public FileGetFromTaskHeaders() { } + public FileGetFromTaskHeaders() + { + CustomInit(); + } /// /// Initializes a new instance of the FileGetFromTaskHeaders class. @@ -50,24 +59,30 @@ public FileGetFromTaskHeaders() { } /// The length of the file. public FileGetFromTaskHeaders(System.Guid? clientRequestId = default(System.Guid?), System.Guid? requestId = default(System.Guid?), string eTag = default(string), System.DateTime? lastModified = default(System.DateTime?), System.DateTime? ocpCreationTime = default(System.DateTime?), bool? ocpBatchFileIsdirectory = default(bool?), string ocpBatchFileUrl = default(string), string ocpBatchFileMode = default(string), string contentType = default(string), long? contentLength = default(long?)) { - this.ClientRequestId = clientRequestId; - this.RequestId = requestId; - this.ETag = eTag; - this.LastModified = lastModified; - this.OcpCreationTime = ocpCreationTime; - this.OcpBatchFileIsdirectory = ocpBatchFileIsdirectory; - this.OcpBatchFileUrl = ocpBatchFileUrl; - this.OcpBatchFileMode = ocpBatchFileMode; - this.ContentType = contentType; - this.ContentLength = contentLength; + ClientRequestId = clientRequestId; + RequestId = requestId; + ETag = eTag; + LastModified = lastModified; + OcpCreationTime = ocpCreationTime; + OcpBatchFileIsdirectory = ocpBatchFileIsdirectory; + OcpBatchFileUrl = ocpBatchFileUrl; + OcpBatchFileMode = ocpBatchFileMode; + ContentType = contentType; + ContentLength = contentLength; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the client-request-id provided by the client during /// the request. This will be returned only if the /// return-client-request-id parameter was set to true. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "client-request-id")] + [JsonProperty(PropertyName = "client-request-id")] public System.Guid? ClientRequestId { get; set; } /// @@ -79,7 +94,7 @@ public FileGetFromTaskHeaders() { } /// request was made, the Batch account against which the request was /// made, and the region that account resides in. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "request-id")] + [JsonProperty(PropertyName = "request-id")] public System.Guid? RequestId { get; set; } /// @@ -89,51 +104,51 @@ public FileGetFromTaskHeaders() { } /// the If-Modified-Since, If-Unmodified-Since, If-Match or /// If-None-Match headers. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "ETag")] + [JsonProperty(PropertyName = "ETag")] public string ETag { get; set; } /// /// Gets or sets the time at which the resource was last modified. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "Last-Modified")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "Last-Modified")] public System.DateTime? LastModified { get; set; } /// /// Gets or sets the file creation time. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "ocp-creation-time")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "ocp-creation-time")] public System.DateTime? OcpCreationTime { get; set; } /// /// Gets or sets whether the object represents a directory. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "ocp-batch-file-isdirectory")] + [JsonProperty(PropertyName = "ocp-batch-file-isdirectory")] public bool? OcpBatchFileIsdirectory { get; set; } /// /// Gets or sets the URL of the file. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "ocp-batch-file-url")] + [JsonProperty(PropertyName = "ocp-batch-file-url")] public string OcpBatchFileUrl { get; set; } /// /// Gets or sets the file mode attribute in octal format. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "ocp-batch-file-mode")] + [JsonProperty(PropertyName = "ocp-batch-file-mode")] public string OcpBatchFileMode { get; set; } /// /// Gets or sets the content type of the file. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "Content-Type")] + [JsonProperty(PropertyName = "Content-Type")] public string ContentType { get; set; } /// /// Gets or sets the length of the file. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "Content-Length")] + [JsonProperty(PropertyName = "Content-Length")] public long? ContentLength { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/FileGetFromTaskOptions.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/FileGetFromTaskOptions.cs index 2c7e6aca5ef7..457d8fd78514 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/FileGetFromTaskOptions.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/FileGetFromTaskOptions.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class FileGetFromTaskOptions /// /// Initializes a new instance of the FileGetFromTaskOptions class. /// - public FileGetFromTaskOptions() { } + public FileGetFromTaskOptions() + { + CustomInit(); + } /// /// Initializes a new instance of the FileGetFromTaskOptions class. @@ -47,20 +56,26 @@ public FileGetFromTaskOptions() { } /// modified since the specified time. public FileGetFromTaskOptions(int? timeout = default(int?), System.Guid? clientRequestId = default(System.Guid?), bool? returnClientRequestId = default(bool?), System.DateTime? ocpDate = default(System.DateTime?), string ocpRange = default(string), System.DateTime? ifModifiedSince = default(System.DateTime?), System.DateTime? ifUnmodifiedSince = default(System.DateTime?)) { - this.Timeout = timeout; - this.ClientRequestId = clientRequestId; - this.ReturnClientRequestId = returnClientRequestId; - this.OcpDate = ocpDate; - this.OcpRange = ocpRange; - this.IfModifiedSince = ifModifiedSince; - this.IfUnmodifiedSince = ifUnmodifiedSince; + Timeout = timeout; + ClientRequestId = clientRequestId; + ReturnClientRequestId = returnClientRequestId; + OcpDate = ocpDate; + OcpRange = ocpRange; + IfModifiedSince = ifModifiedSince; + IfUnmodifiedSince = ifUnmodifiedSince; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the maximum time that the server can spend processing /// the request, in seconds. The default is 30 seconds. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public int? Timeout { get; set; } /// @@ -68,14 +83,14 @@ public FileGetFromTaskOptions() { } /// a GUID with no decoration such as curly braces, e.g. /// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public System.Guid? ClientRequestId { get; set; } /// /// Gets or sets whether the server should return the client-request-id /// in the response. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public bool? ReturnClientRequestId { get; set; } /// @@ -83,15 +98,15 @@ public FileGetFromTaskOptions() { } /// typically set this to the current system clock time; set it /// explicitly if you are calling the REST API directly. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? OcpDate { get; set; } /// /// Gets or sets the byte range to be retrieved. The default is to /// retrieve the entire file. The format is bytes=startRange-endRange. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public string OcpRange { get; set; } /// @@ -100,8 +115,8 @@ public FileGetFromTaskOptions() { } /// if the resource on the service has been modified since the /// specified time. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? IfModifiedSince { get; set; } /// @@ -110,8 +125,8 @@ public FileGetFromTaskOptions() { } /// if the resource on the service has not been modified since the /// specified time. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? IfUnmodifiedSince { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/FileGetPropertiesFromComputeNodeHeaders.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/FileGetPropertiesFromComputeNodeHeaders.cs index 402f42115085..6e34b7a2ebaa 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/FileGetPropertiesFromComputeNodeHeaders.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/FileGetPropertiesFromComputeNodeHeaders.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -19,7 +25,10 @@ public partial class FileGetPropertiesFromComputeNodeHeaders /// Initializes a new instance of the /// FileGetPropertiesFromComputeNodeHeaders class. /// - public FileGetPropertiesFromComputeNodeHeaders() { } + public FileGetPropertiesFromComputeNodeHeaders() + { + CustomInit(); + } /// /// Initializes a new instance of the @@ -52,24 +61,30 @@ public FileGetPropertiesFromComputeNodeHeaders() { } /// The length of the file. public FileGetPropertiesFromComputeNodeHeaders(System.Guid? clientRequestId = default(System.Guid?), System.Guid? requestId = default(System.Guid?), string eTag = default(string), System.DateTime? lastModified = default(System.DateTime?), System.DateTime? ocpCreationTime = default(System.DateTime?), bool? ocpBatchFileIsdirectory = default(bool?), string ocpBatchFileUrl = default(string), string ocpBatchFileMode = default(string), string contentType = default(string), long? contentLength = default(long?)) { - this.ClientRequestId = clientRequestId; - this.RequestId = requestId; - this.ETag = eTag; - this.LastModified = lastModified; - this.OcpCreationTime = ocpCreationTime; - this.OcpBatchFileIsdirectory = ocpBatchFileIsdirectory; - this.OcpBatchFileUrl = ocpBatchFileUrl; - this.OcpBatchFileMode = ocpBatchFileMode; - this.ContentType = contentType; - this.ContentLength = contentLength; + ClientRequestId = clientRequestId; + RequestId = requestId; + ETag = eTag; + LastModified = lastModified; + OcpCreationTime = ocpCreationTime; + OcpBatchFileIsdirectory = ocpBatchFileIsdirectory; + OcpBatchFileUrl = ocpBatchFileUrl; + OcpBatchFileMode = ocpBatchFileMode; + ContentType = contentType; + ContentLength = contentLength; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the client-request-id provided by the client during /// the request. This will be returned only if the /// return-client-request-id parameter was set to true. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "client-request-id")] + [JsonProperty(PropertyName = "client-request-id")] public System.Guid? ClientRequestId { get; set; } /// @@ -81,7 +96,7 @@ public FileGetPropertiesFromComputeNodeHeaders() { } /// request was made, the Batch account against which the request was /// made, and the region that account resides in. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "request-id")] + [JsonProperty(PropertyName = "request-id")] public System.Guid? RequestId { get; set; } /// @@ -91,51 +106,51 @@ public FileGetPropertiesFromComputeNodeHeaders() { } /// the If-Modified-Since, If-Unmodified-Since, If-Match or /// If-None-Match headers. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "ETag")] + [JsonProperty(PropertyName = "ETag")] public string ETag { get; set; } /// /// Gets or sets the time at which the resource was last modified. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "Last-Modified")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "Last-Modified")] public System.DateTime? LastModified { get; set; } /// /// Gets or sets the file creation time. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "ocp-creation-time")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "ocp-creation-time")] public System.DateTime? OcpCreationTime { get; set; } /// /// Gets or sets whether the object represents a directory. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "ocp-batch-file-isdirectory")] + [JsonProperty(PropertyName = "ocp-batch-file-isdirectory")] public bool? OcpBatchFileIsdirectory { get; set; } /// /// Gets or sets the URL of the file. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "ocp-batch-file-url")] + [JsonProperty(PropertyName = "ocp-batch-file-url")] public string OcpBatchFileUrl { get; set; } /// /// Gets or sets the file mode attribute in octal format. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "ocp-batch-file-mode")] + [JsonProperty(PropertyName = "ocp-batch-file-mode")] public string OcpBatchFileMode { get; set; } /// /// Gets or sets the content type of the file. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "Content-Type")] + [JsonProperty(PropertyName = "Content-Type")] public string ContentType { get; set; } /// /// Gets or sets the length of the file. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "Content-Length")] + [JsonProperty(PropertyName = "Content-Length")] public long? ContentLength { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/FileGetPropertiesFromComputeNodeOptions.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/FileGetPropertiesFromComputeNodeOptions.cs index d7da49f8f23d..01770cb3f77d 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/FileGetPropertiesFromComputeNodeOptions.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/FileGetPropertiesFromComputeNodeOptions.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -20,7 +26,10 @@ public partial class FileGetPropertiesFromComputeNodeOptions /// Initializes a new instance of the /// FileGetPropertiesFromComputeNodeOptions class. /// - public FileGetPropertiesFromComputeNodeOptions() { } + public FileGetPropertiesFromComputeNodeOptions() + { + CustomInit(); + } /// /// Initializes a new instance of the @@ -47,19 +56,25 @@ public FileGetPropertiesFromComputeNodeOptions() { } /// modified since the specified time. public FileGetPropertiesFromComputeNodeOptions(int? timeout = default(int?), System.Guid? clientRequestId = default(System.Guid?), bool? returnClientRequestId = default(bool?), System.DateTime? ocpDate = default(System.DateTime?), System.DateTime? ifModifiedSince = default(System.DateTime?), System.DateTime? ifUnmodifiedSince = default(System.DateTime?)) { - this.Timeout = timeout; - this.ClientRequestId = clientRequestId; - this.ReturnClientRequestId = returnClientRequestId; - this.OcpDate = ocpDate; - this.IfModifiedSince = ifModifiedSince; - this.IfUnmodifiedSince = ifUnmodifiedSince; + Timeout = timeout; + ClientRequestId = clientRequestId; + ReturnClientRequestId = returnClientRequestId; + OcpDate = ocpDate; + IfModifiedSince = ifModifiedSince; + IfUnmodifiedSince = ifUnmodifiedSince; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the maximum time that the server can spend processing /// the request, in seconds. The default is 30 seconds. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public int? Timeout { get; set; } /// @@ -67,14 +82,14 @@ public FileGetPropertiesFromComputeNodeOptions() { } /// a GUID with no decoration such as curly braces, e.g. /// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public System.Guid? ClientRequestId { get; set; } /// /// Gets or sets whether the server should return the client-request-id /// in the response. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public bool? ReturnClientRequestId { get; set; } /// @@ -82,8 +97,8 @@ public FileGetPropertiesFromComputeNodeOptions() { } /// typically set this to the current system clock time; set it /// explicitly if you are calling the REST API directly. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? OcpDate { get; set; } /// @@ -92,8 +107,8 @@ public FileGetPropertiesFromComputeNodeOptions() { } /// if the resource on the service has been modified since the /// specified time. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? IfModifiedSince { get; set; } /// @@ -102,8 +117,8 @@ public FileGetPropertiesFromComputeNodeOptions() { } /// if the resource on the service has not been modified since the /// specified time. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? IfUnmodifiedSince { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/FileGetPropertiesFromTaskHeaders.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/FileGetPropertiesFromTaskHeaders.cs index 821f9f9696d2..9f852f25c997 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/FileGetPropertiesFromTaskHeaders.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/FileGetPropertiesFromTaskHeaders.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -19,7 +25,10 @@ public partial class FileGetPropertiesFromTaskHeaders /// Initializes a new instance of the FileGetPropertiesFromTaskHeaders /// class. /// - public FileGetPropertiesFromTaskHeaders() { } + public FileGetPropertiesFromTaskHeaders() + { + CustomInit(); + } /// /// Initializes a new instance of the FileGetPropertiesFromTaskHeaders @@ -52,24 +61,30 @@ public FileGetPropertiesFromTaskHeaders() { } /// The length of the file. public FileGetPropertiesFromTaskHeaders(System.Guid? clientRequestId = default(System.Guid?), System.Guid? requestId = default(System.Guid?), string eTag = default(string), System.DateTime? lastModified = default(System.DateTime?), System.DateTime? ocpCreationTime = default(System.DateTime?), bool? ocpBatchFileIsdirectory = default(bool?), string ocpBatchFileUrl = default(string), string ocpBatchFileMode = default(string), string contentType = default(string), long? contentLength = default(long?)) { - this.ClientRequestId = clientRequestId; - this.RequestId = requestId; - this.ETag = eTag; - this.LastModified = lastModified; - this.OcpCreationTime = ocpCreationTime; - this.OcpBatchFileIsdirectory = ocpBatchFileIsdirectory; - this.OcpBatchFileUrl = ocpBatchFileUrl; - this.OcpBatchFileMode = ocpBatchFileMode; - this.ContentType = contentType; - this.ContentLength = contentLength; + ClientRequestId = clientRequestId; + RequestId = requestId; + ETag = eTag; + LastModified = lastModified; + OcpCreationTime = ocpCreationTime; + OcpBatchFileIsdirectory = ocpBatchFileIsdirectory; + OcpBatchFileUrl = ocpBatchFileUrl; + OcpBatchFileMode = ocpBatchFileMode; + ContentType = contentType; + ContentLength = contentLength; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the client-request-id provided by the client during /// the request. This will be returned only if the /// return-client-request-id parameter was set to true. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "client-request-id")] + [JsonProperty(PropertyName = "client-request-id")] public System.Guid? ClientRequestId { get; set; } /// @@ -81,7 +96,7 @@ public FileGetPropertiesFromTaskHeaders() { } /// request was made, the Batch account against which the request was /// made, and the region that account resides in. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "request-id")] + [JsonProperty(PropertyName = "request-id")] public System.Guid? RequestId { get; set; } /// @@ -91,51 +106,51 @@ public FileGetPropertiesFromTaskHeaders() { } /// the If-Modified-Since, If-Unmodified-Since, If-Match or /// If-None-Match headers. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "ETag")] + [JsonProperty(PropertyName = "ETag")] public string ETag { get; set; } /// /// Gets or sets the time at which the resource was last modified. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "Last-Modified")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "Last-Modified")] public System.DateTime? LastModified { get; set; } /// /// Gets or sets the file creation time. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "ocp-creation-time")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "ocp-creation-time")] public System.DateTime? OcpCreationTime { get; set; } /// /// Gets or sets whether the object represents a directory. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "ocp-batch-file-isdirectory")] + [JsonProperty(PropertyName = "ocp-batch-file-isdirectory")] public bool? OcpBatchFileIsdirectory { get; set; } /// /// Gets or sets the URL of the file. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "ocp-batch-file-url")] + [JsonProperty(PropertyName = "ocp-batch-file-url")] public string OcpBatchFileUrl { get; set; } /// /// Gets or sets the file mode attribute in octal format. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "ocp-batch-file-mode")] + [JsonProperty(PropertyName = "ocp-batch-file-mode")] public string OcpBatchFileMode { get; set; } /// /// Gets or sets the content type of the file. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "Content-Type")] + [JsonProperty(PropertyName = "Content-Type")] public string ContentType { get; set; } /// /// Gets or sets the length of the file. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "Content-Length")] + [JsonProperty(PropertyName = "Content-Length")] public long? ContentLength { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/FileGetPropertiesFromTaskOptions.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/FileGetPropertiesFromTaskOptions.cs index c94a98025b8c..86d5aeeddc71 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/FileGetPropertiesFromTaskOptions.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/FileGetPropertiesFromTaskOptions.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -19,7 +25,10 @@ public partial class FileGetPropertiesFromTaskOptions /// Initializes a new instance of the FileGetPropertiesFromTaskOptions /// class. /// - public FileGetPropertiesFromTaskOptions() { } + public FileGetPropertiesFromTaskOptions() + { + CustomInit(); + } /// /// Initializes a new instance of the FileGetPropertiesFromTaskOptions @@ -46,19 +55,25 @@ public FileGetPropertiesFromTaskOptions() { } /// modified since the specified time. public FileGetPropertiesFromTaskOptions(int? timeout = default(int?), System.Guid? clientRequestId = default(System.Guid?), bool? returnClientRequestId = default(bool?), System.DateTime? ocpDate = default(System.DateTime?), System.DateTime? ifModifiedSince = default(System.DateTime?), System.DateTime? ifUnmodifiedSince = default(System.DateTime?)) { - this.Timeout = timeout; - this.ClientRequestId = clientRequestId; - this.ReturnClientRequestId = returnClientRequestId; - this.OcpDate = ocpDate; - this.IfModifiedSince = ifModifiedSince; - this.IfUnmodifiedSince = ifUnmodifiedSince; + Timeout = timeout; + ClientRequestId = clientRequestId; + ReturnClientRequestId = returnClientRequestId; + OcpDate = ocpDate; + IfModifiedSince = ifModifiedSince; + IfUnmodifiedSince = ifUnmodifiedSince; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the maximum time that the server can spend processing /// the request, in seconds. The default is 30 seconds. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public int? Timeout { get; set; } /// @@ -66,14 +81,14 @@ public FileGetPropertiesFromTaskOptions() { } /// a GUID with no decoration such as curly braces, e.g. /// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public System.Guid? ClientRequestId { get; set; } /// /// Gets or sets whether the server should return the client-request-id /// in the response. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public bool? ReturnClientRequestId { get; set; } /// @@ -81,8 +96,8 @@ public FileGetPropertiesFromTaskOptions() { } /// typically set this to the current system clock time; set it /// explicitly if you are calling the REST API directly. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? OcpDate { get; set; } /// @@ -91,8 +106,8 @@ public FileGetPropertiesFromTaskOptions() { } /// if the resource on the service has been modified since the /// specified time. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? IfModifiedSince { get; set; } /// @@ -101,8 +116,8 @@ public FileGetPropertiesFromTaskOptions() { } /// if the resource on the service has not been modified since the /// specified time. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? IfUnmodifiedSince { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/FileListFromComputeNodeHeaders.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/FileListFromComputeNodeHeaders.cs index bdeaedac2233..f22afc7f335d 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/FileListFromComputeNodeHeaders.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/FileListFromComputeNodeHeaders.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -19,7 +25,10 @@ public partial class FileListFromComputeNodeHeaders /// Initializes a new instance of the FileListFromComputeNodeHeaders /// class. /// - public FileListFromComputeNodeHeaders() { } + public FileListFromComputeNodeHeaders() + { + CustomInit(); + } /// /// Initializes a new instance of the FileListFromComputeNodeHeaders @@ -44,18 +53,24 @@ public FileListFromComputeNodeHeaders() { } /// modified. public FileListFromComputeNodeHeaders(System.Guid? clientRequestId = default(System.Guid?), System.Guid? requestId = default(System.Guid?), string eTag = default(string), System.DateTime? lastModified = default(System.DateTime?)) { - this.ClientRequestId = clientRequestId; - this.RequestId = requestId; - this.ETag = eTag; - this.LastModified = lastModified; + ClientRequestId = clientRequestId; + RequestId = requestId; + ETag = eTag; + LastModified = lastModified; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the client-request-id provided by the client during /// the request. This will be returned only if the /// return-client-request-id parameter was set to true. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "client-request-id")] + [JsonProperty(PropertyName = "client-request-id")] public System.Guid? ClientRequestId { get; set; } /// @@ -67,7 +82,7 @@ public FileListFromComputeNodeHeaders() { } /// request was made, the Batch account against which the request was /// made, and the region that account resides in. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "request-id")] + [JsonProperty(PropertyName = "request-id")] public System.Guid? RequestId { get; set; } /// @@ -77,14 +92,14 @@ public FileListFromComputeNodeHeaders() { } /// the If-Modified-Since, If-Unmodified-Since, If-Match or /// If-None-Match headers. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "ETag")] + [JsonProperty(PropertyName = "ETag")] public string ETag { get; set; } /// /// Gets or sets the time at which the resource was last modified. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "Last-Modified")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "Last-Modified")] public System.DateTime? LastModified { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/FileListFromComputeNodeNextOptions.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/FileListFromComputeNodeNextOptions.cs index 27c89890dfe1..6e95bced4f7e 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/FileListFromComputeNodeNextOptions.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/FileListFromComputeNodeNextOptions.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -19,7 +25,10 @@ public partial class FileListFromComputeNodeNextOptions /// Initializes a new instance of the /// FileListFromComputeNodeNextOptions class. /// - public FileListFromComputeNodeNextOptions() { } + public FileListFromComputeNodeNextOptions() + { + CustomInit(); + } /// /// Initializes a new instance of the @@ -35,24 +44,30 @@ public FileListFromComputeNodeNextOptions() { } /// it explicitly if you are calling the REST API directly. public FileListFromComputeNodeNextOptions(System.Guid? clientRequestId = default(System.Guid?), bool? returnClientRequestId = default(bool?), System.DateTime? ocpDate = default(System.DateTime?)) { - this.ClientRequestId = clientRequestId; - this.ReturnClientRequestId = returnClientRequestId; - this.OcpDate = ocpDate; + ClientRequestId = clientRequestId; + ReturnClientRequestId = returnClientRequestId; + OcpDate = ocpDate; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the caller-generated request identity, in the form of /// a GUID with no decoration such as curly braces, e.g. /// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public System.Guid? ClientRequestId { get; set; } /// /// Gets or sets whether the server should return the client-request-id /// in the response. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public bool? ReturnClientRequestId { get; set; } /// @@ -60,8 +75,8 @@ public FileListFromComputeNodeNextOptions() { } /// typically set this to the current system clock time; set it /// explicitly if you are calling the REST API directly. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? OcpDate { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/FileListFromComputeNodeOptions.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/FileListFromComputeNodeOptions.cs index 9c77426b8e38..13eec888a317 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/FileListFromComputeNodeOptions.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/FileListFromComputeNodeOptions.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -19,7 +25,10 @@ public partial class FileListFromComputeNodeOptions /// Initializes a new instance of the FileListFromComputeNodeOptions /// class. /// - public FileListFromComputeNodeOptions() { } + public FileListFromComputeNodeOptions() + { + CustomInit(); + } /// /// Initializes a new instance of the FileListFromComputeNodeOptions @@ -41,32 +50,38 @@ public FileListFromComputeNodeOptions() { } /// it explicitly if you are calling the REST API directly. public FileListFromComputeNodeOptions(string filter = default(string), int? maxResults = default(int?), int? timeout = default(int?), System.Guid? clientRequestId = default(System.Guid?), bool? returnClientRequestId = default(bool?), System.DateTime? ocpDate = default(System.DateTime?)) { - this.Filter = filter; - this.MaxResults = maxResults; - this.Timeout = timeout; - this.ClientRequestId = clientRequestId; - this.ReturnClientRequestId = returnClientRequestId; - this.OcpDate = ocpDate; + Filter = filter; + MaxResults = maxResults; + Timeout = timeout; + ClientRequestId = clientRequestId; + ReturnClientRequestId = returnClientRequestId; + OcpDate = ocpDate; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets an OData $filter clause. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public string Filter { get; set; } /// /// Gets or sets the maximum number of items to return in the response. /// A maximum of 1000 files can be returned. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public int? MaxResults { get; set; } /// /// Gets or sets the maximum time that the server can spend processing /// the request, in seconds. The default is 30 seconds. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public int? Timeout { get; set; } /// @@ -74,14 +89,14 @@ public FileListFromComputeNodeOptions() { } /// a GUID with no decoration such as curly braces, e.g. /// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public System.Guid? ClientRequestId { get; set; } /// /// Gets or sets whether the server should return the client-request-id /// in the response. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public bool? ReturnClientRequestId { get; set; } /// @@ -89,8 +104,8 @@ public FileListFromComputeNodeOptions() { } /// typically set this to the current system clock time; set it /// explicitly if you are calling the REST API directly. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? OcpDate { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/FileListFromTaskHeaders.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/FileListFromTaskHeaders.cs index 469381b104f0..7262ee62536d 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/FileListFromTaskHeaders.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/FileListFromTaskHeaders.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class FileListFromTaskHeaders /// /// Initializes a new instance of the FileListFromTaskHeaders class. /// - public FileListFromTaskHeaders() { } + public FileListFromTaskHeaders() + { + CustomInit(); + } /// /// Initializes a new instance of the FileListFromTaskHeaders class. @@ -42,18 +51,24 @@ public FileListFromTaskHeaders() { } /// modified. public FileListFromTaskHeaders(System.Guid? clientRequestId = default(System.Guid?), System.Guid? requestId = default(System.Guid?), string eTag = default(string), System.DateTime? lastModified = default(System.DateTime?)) { - this.ClientRequestId = clientRequestId; - this.RequestId = requestId; - this.ETag = eTag; - this.LastModified = lastModified; + ClientRequestId = clientRequestId; + RequestId = requestId; + ETag = eTag; + LastModified = lastModified; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the client-request-id provided by the client during /// the request. This will be returned only if the /// return-client-request-id parameter was set to true. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "client-request-id")] + [JsonProperty(PropertyName = "client-request-id")] public System.Guid? ClientRequestId { get; set; } /// @@ -65,7 +80,7 @@ public FileListFromTaskHeaders() { } /// request was made, the Batch account against which the request was /// made, and the region that account resides in. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "request-id")] + [JsonProperty(PropertyName = "request-id")] public System.Guid? RequestId { get; set; } /// @@ -75,14 +90,14 @@ public FileListFromTaskHeaders() { } /// the If-Modified-Since, If-Unmodified-Since, If-Match or /// If-None-Match headers. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "ETag")] + [JsonProperty(PropertyName = "ETag")] public string ETag { get; set; } /// /// Gets or sets the time at which the resource was last modified. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "Last-Modified")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "Last-Modified")] public System.DateTime? LastModified { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/FileListFromTaskNextOptions.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/FileListFromTaskNextOptions.cs index d142bbf7079e..7a6379be264d 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/FileListFromTaskNextOptions.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/FileListFromTaskNextOptions.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -19,7 +25,10 @@ public partial class FileListFromTaskNextOptions /// Initializes a new instance of the FileListFromTaskNextOptions /// class. /// - public FileListFromTaskNextOptions() { } + public FileListFromTaskNextOptions() + { + CustomInit(); + } /// /// Initializes a new instance of the FileListFromTaskNextOptions @@ -35,24 +44,30 @@ public FileListFromTaskNextOptions() { } /// it explicitly if you are calling the REST API directly. public FileListFromTaskNextOptions(System.Guid? clientRequestId = default(System.Guid?), bool? returnClientRequestId = default(bool?), System.DateTime? ocpDate = default(System.DateTime?)) { - this.ClientRequestId = clientRequestId; - this.ReturnClientRequestId = returnClientRequestId; - this.OcpDate = ocpDate; + ClientRequestId = clientRequestId; + ReturnClientRequestId = returnClientRequestId; + OcpDate = ocpDate; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the caller-generated request identity, in the form of /// a GUID with no decoration such as curly braces, e.g. /// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public System.Guid? ClientRequestId { get; set; } /// /// Gets or sets whether the server should return the client-request-id /// in the response. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public bool? ReturnClientRequestId { get; set; } /// @@ -60,8 +75,8 @@ public FileListFromTaskNextOptions() { } /// typically set this to the current system clock time; set it /// explicitly if you are calling the REST API directly. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? OcpDate { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/FileListFromTaskOptions.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/FileListFromTaskOptions.cs index 253d19e4e3dd..b0b29922c2bd 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/FileListFromTaskOptions.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/FileListFromTaskOptions.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class FileListFromTaskOptions /// /// Initializes a new instance of the FileListFromTaskOptions class. /// - public FileListFromTaskOptions() { } + public FileListFromTaskOptions() + { + CustomInit(); + } /// /// Initializes a new instance of the FileListFromTaskOptions class. @@ -39,32 +48,38 @@ public FileListFromTaskOptions() { } /// it explicitly if you are calling the REST API directly. public FileListFromTaskOptions(string filter = default(string), int? maxResults = default(int?), int? timeout = default(int?), System.Guid? clientRequestId = default(System.Guid?), bool? returnClientRequestId = default(bool?), System.DateTime? ocpDate = default(System.DateTime?)) { - this.Filter = filter; - this.MaxResults = maxResults; - this.Timeout = timeout; - this.ClientRequestId = clientRequestId; - this.ReturnClientRequestId = returnClientRequestId; - this.OcpDate = ocpDate; + Filter = filter; + MaxResults = maxResults; + Timeout = timeout; + ClientRequestId = clientRequestId; + ReturnClientRequestId = returnClientRequestId; + OcpDate = ocpDate; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets an OData $filter clause. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public string Filter { get; set; } /// /// Gets or sets the maximum number of items to return in the response. /// A maximum of 1000 files can be returned. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public int? MaxResults { get; set; } /// /// Gets or sets the maximum time that the server can spend processing /// the request, in seconds. The default is 30 seconds. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public int? Timeout { get; set; } /// @@ -72,14 +87,14 @@ public FileListFromTaskOptions() { } /// a GUID with no decoration such as curly braces, e.g. /// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public System.Guid? ClientRequestId { get; set; } /// /// Gets or sets whether the server should return the client-request-id /// in the response. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public bool? ReturnClientRequestId { get; set; } /// @@ -87,8 +102,8 @@ public FileListFromTaskOptions() { } /// typically set this to the current system clock time; set it /// explicitly if you are calling the REST API directly. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? OcpDate { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/FileProperties.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/FileProperties.cs index d5a57a5a24a1..75f94644fa4c 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/FileProperties.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/FileProperties.cs @@ -8,6 +8,10 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +22,10 @@ public partial class FileProperties /// /// Initializes a new instance of the FileProperties class. /// - public FileProperties() { } + public FileProperties() + { + CustomInit(); + } /// /// Initializes a new instance of the FileProperties class. @@ -32,38 +39,44 @@ public FileProperties() { } /// format. public FileProperties(System.DateTime lastModified, long contentLength, System.DateTime? creationTime = default(System.DateTime?), string contentType = default(string), string fileMode = default(string)) { - this.CreationTime = creationTime; - this.LastModified = lastModified; - this.ContentLength = contentLength; - this.ContentType = contentType; - this.FileMode = fileMode; + CreationTime = creationTime; + LastModified = lastModified; + ContentLength = contentLength; + ContentType = contentType; + FileMode = fileMode; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the file creation time. /// /// /// The creation time is not returned for files on Linux compute nodes. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "creationTime")] + [JsonProperty(PropertyName = "creationTime")] public System.DateTime? CreationTime { get; set; } /// /// Gets or sets the time at which the file was last modified. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "lastModified")] + [JsonProperty(PropertyName = "lastModified")] public System.DateTime LastModified { get; set; } /// /// Gets or sets the length of the file. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "contentLength")] + [JsonProperty(PropertyName = "contentLength")] public long ContentLength { get; set; } /// /// Gets or sets the content type of the file. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "contentType")] + [JsonProperty(PropertyName = "contentType")] public string ContentType { get; set; } /// @@ -72,13 +85,13 @@ public FileProperties() { } /// /// The file mode is returned only for files on Linux compute nodes. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "fileMode")] + [JsonProperty(PropertyName = "fileMode")] public string FileMode { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ImageReference.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ImageReference.cs index b93fef52820d..844ad92fb1a7 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ImageReference.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ImageReference.cs @@ -8,6 +8,11 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Newtonsoft.Json; using System.Linq; /// @@ -20,7 +25,10 @@ public partial class ImageReference /// /// Initializes a new instance of the ImageReference class. /// - public ImageReference() { } + public ImageReference() + { + CustomInit(); + } /// /// Initializes a new instance of the ImageReference class. @@ -35,12 +43,18 @@ public ImageReference() { } /// Marketplace image. public ImageReference(string publisher, string offer, string sku, string version = default(string)) { - this.Publisher = publisher; - this.Offer = offer; - this.Sku = sku; - this.Version = version; + Publisher = publisher; + Offer = offer; + Sku = sku; + Version = version; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the publisher of the Azure Virtual Machines /// Marketplace image. @@ -48,7 +62,7 @@ public ImageReference() { } /// /// For example, Canonical or MicrosoftWindowsServer. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "publisher")] + [JsonProperty(PropertyName = "publisher")] public string Publisher { get; set; } /// @@ -58,7 +72,7 @@ public ImageReference() { } /// /// For example, UbuntuServer or WindowsServer. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "offer")] + [JsonProperty(PropertyName = "offer")] public string Offer { get; set; } /// @@ -68,7 +82,7 @@ public ImageReference() { } /// /// For example, 14.04.0-LTS or 2012-R2-Datacenter. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "sku")] + [JsonProperty(PropertyName = "sku")] public string Sku { get; set; } /// @@ -79,28 +93,28 @@ public ImageReference() { } /// A value of 'latest' can be specified to select the latest version /// of an image. If omitted, the default is 'latest'. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "version")] + [JsonProperty(PropertyName = "version")] public string Version { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (this.Publisher == null) + if (Publisher == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Publisher"); + throw new ValidationException(ValidationRules.CannotBeNull, "Publisher"); } - if (this.Offer == null) + if (Offer == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Offer"); + throw new ValidationException(ValidationRules.CannotBeNull, "Offer"); } - if (this.Sku == null) + if (Sku == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Sku"); + throw new ValidationException(ValidationRules.CannotBeNull, "Sku"); } } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/InboundEndpoint.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/InboundEndpoint.cs index 792652d46831..aae9b1ef1bf1 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/InboundEndpoint.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/InboundEndpoint.cs @@ -8,6 +8,11 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +23,10 @@ public partial class InboundEndpoint /// /// Initializes a new instance of the InboundEndpoint class. /// - public InboundEndpoint() { } + public InboundEndpoint() + { + CustomInit(); + } /// /// Initializes a new instance of the InboundEndpoint class. @@ -35,18 +43,24 @@ public InboundEndpoint() { } /// endpoint. public InboundEndpoint(string name, InboundEndpointProtocol protocol, string publicIPAddress, string publicFQDN, int frontendPort, int backendPort) { - this.Name = name; - this.Protocol = protocol; - this.PublicIPAddress = publicIPAddress; - this.PublicFQDN = publicFQDN; - this.FrontendPort = frontendPort; - this.BackendPort = backendPort; + Name = name; + Protocol = protocol; + PublicIPAddress = publicIPAddress; + PublicFQDN = publicFQDN; + FrontendPort = frontendPort; + BackendPort = backendPort; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the name of the endpoint. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// @@ -55,53 +69,53 @@ public InboundEndpoint(string name, InboundEndpointProtocol protocol, string pub /// /// Possible values include: 'tcp', 'udp' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "protocol")] + [JsonProperty(PropertyName = "protocol")] public InboundEndpointProtocol Protocol { get; set; } /// /// Gets or sets the public IP address of the compute node. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "publicIPAddress")] + [JsonProperty(PropertyName = "publicIPAddress")] public string PublicIPAddress { get; set; } /// /// Gets or sets the public fully qualified domain name for the compute /// node. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "publicFQDN")] + [JsonProperty(PropertyName = "publicFQDN")] public string PublicFQDN { get; set; } /// /// Gets or sets the public port number of the endpoint. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "frontendPort")] + [JsonProperty(PropertyName = "frontendPort")] public int FrontendPort { get; set; } /// /// Gets or sets the backend port number of the endpoint. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "backendPort")] + [JsonProperty(PropertyName = "backendPort")] public int BackendPort { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (this.Name == null) + if (Name == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Name"); + throw new ValidationException(ValidationRules.CannotBeNull, "Name"); } - if (this.PublicIPAddress == null) + if (PublicIPAddress == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "PublicIPAddress"); + throw new ValidationException(ValidationRules.CannotBeNull, "PublicIPAddress"); } - if (this.PublicFQDN == null) + if (PublicFQDN == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "PublicFQDN"); + throw new ValidationException(ValidationRules.CannotBeNull, "PublicFQDN"); } } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/InboundEndpointProtocol.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/InboundEndpointProtocol.cs index 78f09b66e890..37c270baf16d 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/InboundEndpointProtocol.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/InboundEndpointProtocol.cs @@ -8,16 +8,52 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; /// /// Defines values for InboundEndpointProtocol. /// - [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + [JsonConverter(typeof(StringEnumConverter))] public enum InboundEndpointProtocol { - [System.Runtime.Serialization.EnumMember(Value = "tcp")] + [EnumMember(Value = "tcp")] Tcp, - [System.Runtime.Serialization.EnumMember(Value = "udp")] + [EnumMember(Value = "udp")] Udp } + internal static class InboundEndpointProtocolEnumExtension + { + internal static string ToSerializedValue(this InboundEndpointProtocol? value) => + value == null ? null : ((InboundEndpointProtocol)value).ToSerializedValue(); + + internal static string ToSerializedValue(this InboundEndpointProtocol value) + { + switch( value ) + { + case InboundEndpointProtocol.Tcp: + return "tcp"; + case InboundEndpointProtocol.Udp: + return "udp"; + } + return null; + } + + internal static InboundEndpointProtocol? ParseInboundEndpointProtocol(this string value) + { + switch( value ) + { + case "tcp": + return InboundEndpointProtocol.Tcp; + case "udp": + return InboundEndpointProtocol.Udp; + } + return null; + } + } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/InboundNatPool.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/InboundNatPool.cs index 9993a13e4156..bdad9db63e38 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/InboundNatPool.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/InboundNatPool.cs @@ -8,6 +8,13 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// @@ -19,7 +26,10 @@ public partial class InboundNATPool /// /// Initializes a new instance of the InboundNATPool class. /// - public InboundNATPool() { } + public InboundNATPool() + { + CustomInit(); + } /// /// Initializes a new instance of the InboundNATPool class. @@ -36,16 +46,22 @@ public InboundNATPool() { } /// to the backendPort on individual compute nodes. /// A list of network security /// group rules that will be applied to the endpoint. - public InboundNATPool(string name, InboundEndpointProtocol protocol, int backendPort, int frontendPortRangeStart, int frontendPortRangeEnd, System.Collections.Generic.IList networkSecurityGroupRules = default(System.Collections.Generic.IList)) + public InboundNATPool(string name, InboundEndpointProtocol protocol, int backendPort, int frontendPortRangeStart, int frontendPortRangeEnd, IList networkSecurityGroupRules = default(IList)) { - this.Name = name; - this.Protocol = protocol; - this.BackendPort = backendPort; - this.FrontendPortRangeStart = frontendPortRangeStart; - this.FrontendPortRangeEnd = frontendPortRangeEnd; - this.NetworkSecurityGroupRules = networkSecurityGroupRules; + Name = name; + Protocol = protocol; + BackendPort = backendPort; + FrontendPortRangeStart = frontendPortRangeStart; + FrontendPortRangeEnd = frontendPortRangeEnd; + NetworkSecurityGroupRules = networkSecurityGroupRules; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the name of the endpoint. /// @@ -56,7 +72,7 @@ public InboundNATPool() { } /// and cannot exceed 77 characters. If any invalid values are /// provided the request fails with HTTP status code 400. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// @@ -65,7 +81,7 @@ public InboundNATPool() { } /// /// Possible values include: 'tcp', 'udp' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "protocol")] + [JsonProperty(PropertyName = "protocol")] public InboundEndpointProtocol Protocol { get; set; } /// @@ -77,7 +93,7 @@ public InboundNATPool() { } /// are reserved. If any reserved values are provided the request fails /// with HTTP status code 400. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "backendPort")] + [JsonProperty(PropertyName = "backendPort")] public int BackendPort { get; set; } /// @@ -91,7 +107,7 @@ public InboundNATPool() { } /// distinct and cannot overlap. If any reserved or overlapping values /// are provided the request fails with HTTP status code 400. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "frontendPortRangeStart")] + [JsonProperty(PropertyName = "frontendPortRangeStart")] public int FrontendPortRangeStart { get; set; } /// @@ -106,7 +122,7 @@ public InboundNATPool() { } /// overlapping values are provided the request fails with HTTP status /// code 400. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "frontendPortRangeEnd")] + [JsonProperty(PropertyName = "frontendPortRangeEnd")] public int FrontendPortRangeEnd { get; set; } /// @@ -121,24 +137,24 @@ public InboundNATPool() { } /// network security group rules is exceeded the request fails with /// HTTP status code 400. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "networkSecurityGroupRules")] - public System.Collections.Generic.IList NetworkSecurityGroupRules { get; set; } + [JsonProperty(PropertyName = "networkSecurityGroupRules")] + public IList NetworkSecurityGroupRules { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (this.Name == null) + if (Name == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Name"); + throw new ValidationException(ValidationRules.CannotBeNull, "Name"); } - if (this.NetworkSecurityGroupRules != null) + if (NetworkSecurityGroupRules != null) { - foreach (var element in this.NetworkSecurityGroupRules) + foreach (var element in NetworkSecurityGroupRules) { if (element != null) { diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobAction.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobAction.cs index 96460ec7ec2a..061e8a71bb79 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobAction.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobAction.cs @@ -8,18 +8,58 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; /// /// Defines values for JobAction. /// - [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + [JsonConverter(typeof(StringEnumConverter))] public enum JobAction { - [System.Runtime.Serialization.EnumMember(Value = "none")] + [EnumMember(Value = "none")] None, - [System.Runtime.Serialization.EnumMember(Value = "disable")] + [EnumMember(Value = "disable")] Disable, - [System.Runtime.Serialization.EnumMember(Value = "terminate")] + [EnumMember(Value = "terminate")] Terminate } + internal static class JobActionEnumExtension + { + internal static string ToSerializedValue(this JobAction? value) => + value == null ? null : ((JobAction)value).ToSerializedValue(); + + internal static string ToSerializedValue(this JobAction value) + { + switch( value ) + { + case JobAction.None: + return "none"; + case JobAction.Disable: + return "disable"; + case JobAction.Terminate: + return "terminate"; + } + return null; + } + + internal static JobAction? ParseJobAction(this string value) + { + switch( value ) + { + case "none": + return JobAction.None; + case "disable": + return JobAction.Disable; + case "terminate": + return JobAction.Terminate; + } + return null; + } + } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobAddHeaders.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobAddHeaders.cs index 08ded3caf1d7..b9c277de7a51 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobAddHeaders.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobAddHeaders.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class JobAddHeaders /// /// Initializes a new instance of the JobAddHeaders class. /// - public JobAddHeaders() { } + public JobAddHeaders() + { + CustomInit(); + } /// /// Initializes a new instance of the JobAddHeaders class. @@ -44,19 +53,25 @@ public JobAddHeaders() { } /// the request applied. public JobAddHeaders(System.Guid? clientRequestId = default(System.Guid?), System.Guid? requestId = default(System.Guid?), string eTag = default(string), System.DateTime? lastModified = default(System.DateTime?), string dataServiceId = default(string)) { - this.ClientRequestId = clientRequestId; - this.RequestId = requestId; - this.ETag = eTag; - this.LastModified = lastModified; - this.DataServiceId = dataServiceId; + ClientRequestId = clientRequestId; + RequestId = requestId; + ETag = eTag; + LastModified = lastModified; + DataServiceId = dataServiceId; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the client-request-id provided by the client during /// the request. This will be returned only if the /// return-client-request-id parameter was set to true. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "client-request-id")] + [JsonProperty(PropertyName = "client-request-id")] public System.Guid? ClientRequestId { get; set; } /// @@ -68,7 +83,7 @@ public JobAddHeaders() { } /// request was made, the Batch account against which the request was /// made, and the region that account resides in. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "request-id")] + [JsonProperty(PropertyName = "request-id")] public System.Guid? RequestId { get; set; } /// @@ -78,21 +93,21 @@ public JobAddHeaders() { } /// the If-Modified-Since, If-Unmodified-Since, If-Match or /// If-None-Match headers. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "ETag")] + [JsonProperty(PropertyName = "ETag")] public string ETag { get; set; } /// /// Gets or sets the time at which the resource was last modified. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "Last-Modified")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "Last-Modified")] public System.DateTime? LastModified { get; set; } /// /// Gets or sets the OData ID of the resource to which the request /// applied. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "DataServiceId")] + [JsonProperty(PropertyName = "DataServiceId")] public string DataServiceId { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobAddOptions.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobAddOptions.cs index f844e5deffc8..e7c0952f85bd 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobAddOptions.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobAddOptions.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class JobAddOptions /// /// Initializes a new instance of the JobAddOptions class. /// - public JobAddOptions() { } + public JobAddOptions() + { + CustomInit(); + } /// /// Initializes a new instance of the JobAddOptions class. @@ -36,17 +45,23 @@ public JobAddOptions() { } /// it explicitly if you are calling the REST API directly. public JobAddOptions(int? timeout = default(int?), System.Guid? clientRequestId = default(System.Guid?), bool? returnClientRequestId = default(bool?), System.DateTime? ocpDate = default(System.DateTime?)) { - this.Timeout = timeout; - this.ClientRequestId = clientRequestId; - this.ReturnClientRequestId = returnClientRequestId; - this.OcpDate = ocpDate; + Timeout = timeout; + ClientRequestId = clientRequestId; + ReturnClientRequestId = returnClientRequestId; + OcpDate = ocpDate; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the maximum time that the server can spend processing /// the request, in seconds. The default is 30 seconds. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public int? Timeout { get; set; } /// @@ -54,14 +69,14 @@ public JobAddOptions() { } /// a GUID with no decoration such as curly braces, e.g. /// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public System.Guid? ClientRequestId { get; set; } /// /// Gets or sets whether the server should return the client-request-id /// in the response. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public bool? ReturnClientRequestId { get; set; } /// @@ -69,8 +84,8 @@ public JobAddOptions() { } /// typically set this to the current system clock time; set it /// explicitly if you are calling the REST API directly. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? OcpDate { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobAddParameter.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobAddParameter.cs index 4a62eb98bdd7..5c3a46aae2ea 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobAddParameter.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobAddParameter.cs @@ -8,6 +8,13 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// @@ -18,7 +25,10 @@ public partial class JobAddParameter /// /// Initializes a new instance of the JobAddParameter class. /// - public JobAddParameter() { } + public JobAddParameter() + { + CustomInit(); + } /// /// Initializes a new instance of the JobAddParameter class. @@ -43,30 +53,34 @@ public JobAddParameter() { } /// should take when all tasks in the job are in the completed /// state. /// The action the Batch service should - /// take when any task in the job fails. A task is considered to have - /// failed if it completes with a non-zero exit code and has exhausted - /// its retry count, or if it had a scheduling error. + /// take when any task in the job fails. /// A list of name-value pairs associated with /// the job as metadata. - /// The flag that determines if this - /// job will use tasks with dependencies. - public JobAddParameter(string id, PoolInformation poolInfo, string displayName = default(string), int? priority = default(int?), JobConstraints constraints = default(JobConstraints), JobManagerTask jobManagerTask = default(JobManagerTask), JobPreparationTask jobPreparationTask = default(JobPreparationTask), JobReleaseTask jobReleaseTask = default(JobReleaseTask), System.Collections.Generic.IList commonEnvironmentSettings = default(System.Collections.Generic.IList), OnAllTasksComplete? onAllTasksComplete = default(OnAllTasksComplete?), OnTaskFailure? onTaskFailure = default(OnTaskFailure?), System.Collections.Generic.IList metadata = default(System.Collections.Generic.IList), bool? usesTaskDependencies = default(bool?)) + /// Whether tasks in the job can + /// define dependencies on each other. The default is false. + public JobAddParameter(string id, PoolInformation poolInfo, string displayName = default(string), int? priority = default(int?), JobConstraints constraints = default(JobConstraints), JobManagerTask jobManagerTask = default(JobManagerTask), JobPreparationTask jobPreparationTask = default(JobPreparationTask), JobReleaseTask jobReleaseTask = default(JobReleaseTask), IList commonEnvironmentSettings = default(IList), OnAllTasksComplete? onAllTasksComplete = default(OnAllTasksComplete?), OnTaskFailure? onTaskFailure = default(OnTaskFailure?), IList metadata = default(IList), bool? usesTaskDependencies = default(bool?)) { - this.Id = id; - this.DisplayName = displayName; - this.Priority = priority; - this.Constraints = constraints; - this.JobManagerTask = jobManagerTask; - this.JobPreparationTask = jobPreparationTask; - this.JobReleaseTask = jobReleaseTask; - this.CommonEnvironmentSettings = commonEnvironmentSettings; - this.PoolInfo = poolInfo; - this.OnAllTasksComplete = onAllTasksComplete; - this.OnTaskFailure = onTaskFailure; - this.Metadata = metadata; - this.UsesTaskDependencies = usesTaskDependencies; + Id = id; + DisplayName = displayName; + Priority = priority; + Constraints = constraints; + JobManagerTask = jobManagerTask; + JobPreparationTask = jobPreparationTask; + JobReleaseTask = jobReleaseTask; + CommonEnvironmentSettings = commonEnvironmentSettings; + PoolInfo = poolInfo; + OnAllTasksComplete = onAllTasksComplete; + OnTaskFailure = onTaskFailure; + Metadata = metadata; + UsesTaskDependencies = usesTaskDependencies; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets a string that uniquely identifies the job within the /// account. @@ -74,9 +88,11 @@ public JobAddParameter() { } /// /// The ID can contain any combination of alphanumeric characters /// including hyphens and underscores, and cannot contain more than 64 - /// characters. It is common to use a GUID for the id. + /// characters. The ID is case-preserving and case-insensitive (that + /// is, you may not have two IDs within an account that differ only by + /// case). /// - [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + [JsonProperty(PropertyName = "id")] public string Id { get; set; } /// @@ -86,7 +102,7 @@ public JobAddParameter() { } /// The display name need not be unique and can contain any Unicode /// characters up to a maximum length of 1024. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "displayName")] + [JsonProperty(PropertyName = "displayName")] public string DisplayName { get; set; } /// @@ -97,13 +113,13 @@ public JobAddParameter() { } /// lowest priority and 1000 being the highest priority. The default /// value is 0. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "priority")] + [JsonProperty(PropertyName = "priority")] public int? Priority { get; set; } /// /// Gets or sets the execution constraints for the job. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "constraints")] + [JsonProperty(PropertyName = "constraints")] public JobConstraints Constraints { get; set; } /// @@ -125,7 +141,7 @@ public JobAddParameter() { } /// parameter, analyze the contents of that file and submit additional /// tasks based on those contents. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "jobManagerTask")] + [JsonProperty(PropertyName = "jobManagerTask")] public JobManagerTask JobManagerTask { get; set; } /// @@ -136,7 +152,7 @@ public JobAddParameter() { } /// Job Preparation task on a compute node before starting any tasks of /// that job on that compute node. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "jobPreparationTask")] + [JsonProperty(PropertyName = "jobPreparationTask")] public JobPreparationTask JobPreparationTask { get; set; } /// @@ -151,7 +167,7 @@ public JobAddParameter() { } /// activities include deleting local files, or shutting down services /// that were started as part of job preparation. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "jobReleaseTask")] + [JsonProperty(PropertyName = "jobReleaseTask")] public JobReleaseTask JobReleaseTask { get; set; } /// @@ -159,14 +175,18 @@ public JobAddParameter() { } /// These environment variables are set for all tasks in the job /// (including the Job Manager, Job Preparation and Job Release tasks). /// - [Newtonsoft.Json.JsonProperty(PropertyName = "commonEnvironmentSettings")] - public System.Collections.Generic.IList CommonEnvironmentSettings { get; set; } + /// + /// Individual tasks can override an environment setting specified here + /// by specifying the same setting name with a different value. + /// + [JsonProperty(PropertyName = "commonEnvironmentSettings")] + public IList CommonEnvironmentSettings { get; set; } /// /// Gets or sets the pool on which the Batch service runs the job's /// tasks. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "poolInfo")] + [JsonProperty(PropertyName = "poolInfo")] public PoolInformation PoolInfo { get; set; } /// @@ -186,16 +206,18 @@ public JobAddParameter() { } /// 'AllTasksComplete'. The default is noAction. Possible values /// include: 'noAction', 'terminateJob' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "onAllTasksComplete")] + [JsonProperty(PropertyName = "onAllTasksComplete")] public OnAllTasksComplete? OnAllTasksComplete { get; set; } /// /// Gets or sets the action the Batch service should take when any task - /// in the job fails. A task is considered to have failed if it - /// completes with a non-zero exit code and has exhausted its retry - /// count, or if it had a scheduling error. + /// in the job fails. /// /// + /// A task is considered to have failed if has a failureInfo. A + /// failureInfo is set if the task completes with a non-zero exit code + /// after exhausting its retry count, or if there was an error starting + /// the task, for example due to a resource file download error. /// noAction - do nothing. performExitOptionsJobAction - take the /// action associated with the task exit condition in the task's /// exitConditions collection. (This may still result in no action @@ -203,7 +225,7 @@ public JobAddParameter() { } /// noAction. Possible values include: 'noAction', /// 'performExitOptionsJobAction' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "onTaskFailure")] + [JsonProperty(PropertyName = "onTaskFailure")] public OnTaskFailure? OnTaskFailure { get; set; } /// @@ -214,47 +236,47 @@ public JobAddParameter() { } /// The Batch service does not assign any meaning to metadata; it is /// solely for the use of user code. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "metadata")] - public System.Collections.Generic.IList Metadata { get; set; } + [JsonProperty(PropertyName = "metadata")] + public IList Metadata { get; set; } /// - /// Gets or sets the flag that determines if this job will use tasks - /// with dependencies. + /// Gets or sets whether tasks in the job can define dependencies on + /// each other. The default is false. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "usesTaskDependencies")] + [JsonProperty(PropertyName = "usesTaskDependencies")] public bool? UsesTaskDependencies { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (this.Id == null) + if (Id == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Id"); + throw new ValidationException(ValidationRules.CannotBeNull, "Id"); } - if (this.PoolInfo == null) + if (PoolInfo == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "PoolInfo"); + throw new ValidationException(ValidationRules.CannotBeNull, "PoolInfo"); } - if (this.JobManagerTask != null) + if (JobManagerTask != null) { - this.JobManagerTask.Validate(); + JobManagerTask.Validate(); } - if (this.JobPreparationTask != null) + if (JobPreparationTask != null) { - this.JobPreparationTask.Validate(); + JobPreparationTask.Validate(); } - if (this.JobReleaseTask != null) + if (JobReleaseTask != null) { - this.JobReleaseTask.Validate(); + JobReleaseTask.Validate(); } - if (this.CommonEnvironmentSettings != null) + if (CommonEnvironmentSettings != null) { - foreach (var element in this.CommonEnvironmentSettings) + foreach (var element in CommonEnvironmentSettings) { if (element != null) { @@ -262,13 +284,13 @@ public virtual void Validate() } } } - if (this.PoolInfo != null) + if (PoolInfo != null) { - this.PoolInfo.Validate(); + PoolInfo.Validate(); } - if (this.Metadata != null) + if (Metadata != null) { - foreach (var element1 in this.Metadata) + foreach (var element1 in Metadata) { if (element1 != null) { diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobConstraints.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobConstraints.cs index cc2816f27a03..c963a2a71a40 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobConstraints.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobConstraints.cs @@ -8,6 +8,10 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +22,10 @@ public partial class JobConstraints /// /// Initializes a new instance of the JobConstraints class. /// - public JobConstraints() { } + public JobConstraints() + { + CustomInit(); + } /// /// Initializes a new instance of the JobConstraints class. @@ -30,10 +37,16 @@ public JobConstraints() { } /// code is nonzero. public JobConstraints(System.TimeSpan? maxWallClockTime = default(System.TimeSpan?), int? maxTaskRetryCount = default(int?)) { - this.MaxWallClockTime = maxWallClockTime; - this.MaxTaskRetryCount = maxTaskRetryCount; + MaxWallClockTime = maxWallClockTime; + MaxTaskRetryCount = maxTaskRetryCount; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the maximum elapsed time that the job may run, /// measured from the time the job is created. @@ -45,7 +58,7 @@ public JobConstraints() { } /// this property is not specified, there is no time limit on how long /// the job may run. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "maxWallClockTime")] + [JsonProperty(PropertyName = "maxWallClockTime")] public System.TimeSpan? MaxWallClockTime { get; set; } /// @@ -61,7 +74,7 @@ public JobConstraints() { } /// If the maximum retry count is -1, the Batch service retries tasks /// without limit. The default value is 0 (no retries). /// - [Newtonsoft.Json.JsonProperty(PropertyName = "maxTaskRetryCount")] + [JsonProperty(PropertyName = "maxTaskRetryCount")] public int? MaxTaskRetryCount { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobDeleteHeaders.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobDeleteHeaders.cs index 6c19d036bf77..af49762653d8 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobDeleteHeaders.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobDeleteHeaders.cs @@ -8,6 +8,10 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +22,10 @@ public partial class JobDeleteHeaders /// /// Initializes a new instance of the JobDeleteHeaders class. /// - public JobDeleteHeaders() { } + public JobDeleteHeaders() + { + CustomInit(); + } /// /// Initializes a new instance of the JobDeleteHeaders class. @@ -35,16 +42,22 @@ public JobDeleteHeaders() { } /// request was made, and the region that account resides in. public JobDeleteHeaders(string clientRequestId = default(string), string requestId = default(string)) { - this.ClientRequestId = clientRequestId; - this.RequestId = requestId; + ClientRequestId = clientRequestId; + RequestId = requestId; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the client-request-id provided by the client during /// the request. This will be returned only if the /// return-client-request-id parameter was set to true. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "client-request-id")] + [JsonProperty(PropertyName = "client-request-id")] public string ClientRequestId { get; set; } /// @@ -56,7 +69,7 @@ public JobDeleteHeaders() { } /// request was made, the Batch account against which the request was /// made, and the region that account resides in. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "request-id")] + [JsonProperty(PropertyName = "request-id")] public string RequestId { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobDeleteOptions.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobDeleteOptions.cs index d2a733911a99..92c40feca7c6 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobDeleteOptions.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobDeleteOptions.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class JobDeleteOptions /// /// Initializes a new instance of the JobDeleteOptions class. /// - public JobDeleteOptions() { } + public JobDeleteOptions() + { + CustomInit(); + } /// /// Initializes a new instance of the JobDeleteOptions class. @@ -52,21 +61,27 @@ public JobDeleteOptions() { } /// modified since the specified time. public JobDeleteOptions(int? timeout = default(int?), System.Guid? clientRequestId = default(System.Guid?), bool? returnClientRequestId = default(bool?), System.DateTime? ocpDate = default(System.DateTime?), string ifMatch = default(string), string ifNoneMatch = default(string), System.DateTime? ifModifiedSince = default(System.DateTime?), System.DateTime? ifUnmodifiedSince = default(System.DateTime?)) { - this.Timeout = timeout; - this.ClientRequestId = clientRequestId; - this.ReturnClientRequestId = returnClientRequestId; - this.OcpDate = ocpDate; - this.IfMatch = ifMatch; - this.IfNoneMatch = ifNoneMatch; - this.IfModifiedSince = ifModifiedSince; - this.IfUnmodifiedSince = ifUnmodifiedSince; + Timeout = timeout; + ClientRequestId = clientRequestId; + ReturnClientRequestId = returnClientRequestId; + OcpDate = ocpDate; + IfMatch = ifMatch; + IfNoneMatch = ifNoneMatch; + IfModifiedSince = ifModifiedSince; + IfUnmodifiedSince = ifUnmodifiedSince; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the maximum time that the server can spend processing /// the request, in seconds. The default is 30 seconds. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public int? Timeout { get; set; } /// @@ -74,14 +89,14 @@ public JobDeleteOptions() { } /// a GUID with no decoration such as curly braces, e.g. /// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public System.Guid? ClientRequestId { get; set; } /// /// Gets or sets whether the server should return the client-request-id /// in the response. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public bool? ReturnClientRequestId { get; set; } /// @@ -89,8 +104,8 @@ public JobDeleteOptions() { } /// typically set this to the current system clock time; set it /// explicitly if you are calling the REST API directly. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? OcpDate { get; set; } /// @@ -99,7 +114,7 @@ public JobDeleteOptions() { } /// if the resource's current ETag on the service exactly matches the /// value specified by the client. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public string IfMatch { get; set; } /// @@ -108,7 +123,7 @@ public JobDeleteOptions() { } /// if the resource's current ETag on the service does not match the /// value specified by the client. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public string IfNoneMatch { get; set; } /// @@ -117,8 +132,8 @@ public JobDeleteOptions() { } /// if the resource on the service has been modified since the /// specified time. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? IfModifiedSince { get; set; } /// @@ -127,8 +142,8 @@ public JobDeleteOptions() { } /// if the resource on the service has not been modified since the /// specified time. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? IfUnmodifiedSince { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobDisableHeaders.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobDisableHeaders.cs index 9eaa6784a25e..561f82e2f0fb 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobDisableHeaders.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobDisableHeaders.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class JobDisableHeaders /// /// Initializes a new instance of the JobDisableHeaders class. /// - public JobDisableHeaders() { } + public JobDisableHeaders() + { + CustomInit(); + } /// /// Initializes a new instance of the JobDisableHeaders class. @@ -44,19 +53,25 @@ public JobDisableHeaders() { } /// the request applied. public JobDisableHeaders(System.Guid? clientRequestId = default(System.Guid?), System.Guid? requestId = default(System.Guid?), string eTag = default(string), System.DateTime? lastModified = default(System.DateTime?), string dataServiceId = default(string)) { - this.ClientRequestId = clientRequestId; - this.RequestId = requestId; - this.ETag = eTag; - this.LastModified = lastModified; - this.DataServiceId = dataServiceId; + ClientRequestId = clientRequestId; + RequestId = requestId; + ETag = eTag; + LastModified = lastModified; + DataServiceId = dataServiceId; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the client-request-id provided by the client during /// the request. This will be returned only if the /// return-client-request-id parameter was set to true. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "client-request-id")] + [JsonProperty(PropertyName = "client-request-id")] public System.Guid? ClientRequestId { get; set; } /// @@ -68,7 +83,7 @@ public JobDisableHeaders() { } /// request was made, the Batch account against which the request was /// made, and the region that account resides in. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "request-id")] + [JsonProperty(PropertyName = "request-id")] public System.Guid? RequestId { get; set; } /// @@ -78,21 +93,21 @@ public JobDisableHeaders() { } /// the If-Modified-Since, If-Unmodified-Since, If-Match or /// If-None-Match headers. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "ETag")] + [JsonProperty(PropertyName = "ETag")] public string ETag { get; set; } /// /// Gets or sets the time at which the resource was last modified. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "Last-Modified")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "Last-Modified")] public System.DateTime? LastModified { get; set; } /// /// Gets or sets the OData ID of the resource to which the request /// applied. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "DataServiceId")] + [JsonProperty(PropertyName = "DataServiceId")] public string DataServiceId { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobDisableOptions.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobDisableOptions.cs index 71b5196b93ab..c6329241e5dd 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobDisableOptions.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobDisableOptions.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class JobDisableOptions /// /// Initializes a new instance of the JobDisableOptions class. /// - public JobDisableOptions() { } + public JobDisableOptions() + { + CustomInit(); + } /// /// Initializes a new instance of the JobDisableOptions class. @@ -52,21 +61,27 @@ public JobDisableOptions() { } /// modified since the specified time. public JobDisableOptions(int? timeout = default(int?), System.Guid? clientRequestId = default(System.Guid?), bool? returnClientRequestId = default(bool?), System.DateTime? ocpDate = default(System.DateTime?), string ifMatch = default(string), string ifNoneMatch = default(string), System.DateTime? ifModifiedSince = default(System.DateTime?), System.DateTime? ifUnmodifiedSince = default(System.DateTime?)) { - this.Timeout = timeout; - this.ClientRequestId = clientRequestId; - this.ReturnClientRequestId = returnClientRequestId; - this.OcpDate = ocpDate; - this.IfMatch = ifMatch; - this.IfNoneMatch = ifNoneMatch; - this.IfModifiedSince = ifModifiedSince; - this.IfUnmodifiedSince = ifUnmodifiedSince; + Timeout = timeout; + ClientRequestId = clientRequestId; + ReturnClientRequestId = returnClientRequestId; + OcpDate = ocpDate; + IfMatch = ifMatch; + IfNoneMatch = ifNoneMatch; + IfModifiedSince = ifModifiedSince; + IfUnmodifiedSince = ifUnmodifiedSince; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the maximum time that the server can spend processing /// the request, in seconds. The default is 30 seconds. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public int? Timeout { get; set; } /// @@ -74,14 +89,14 @@ public JobDisableOptions() { } /// a GUID with no decoration such as curly braces, e.g. /// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public System.Guid? ClientRequestId { get; set; } /// /// Gets or sets whether the server should return the client-request-id /// in the response. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public bool? ReturnClientRequestId { get; set; } /// @@ -89,8 +104,8 @@ public JobDisableOptions() { } /// typically set this to the current system clock time; set it /// explicitly if you are calling the REST API directly. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? OcpDate { get; set; } /// @@ -99,7 +114,7 @@ public JobDisableOptions() { } /// if the resource's current ETag on the service exactly matches the /// value specified by the client. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public string IfMatch { get; set; } /// @@ -108,7 +123,7 @@ public JobDisableOptions() { } /// if the resource's current ETag on the service does not match the /// value specified by the client. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public string IfNoneMatch { get; set; } /// @@ -117,8 +132,8 @@ public JobDisableOptions() { } /// if the resource on the service has been modified since the /// specified time. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? IfModifiedSince { get; set; } /// @@ -127,8 +142,8 @@ public JobDisableOptions() { } /// if the resource on the service has not been modified since the /// specified time. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? IfUnmodifiedSince { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobDisableParameter.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobDisableParameter.cs index 72841ccaf43d..2c4af1c7fc8b 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobDisableParameter.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobDisableParameter.cs @@ -8,6 +8,10 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +22,10 @@ public partial class JobDisableParameter /// /// Initializes a new instance of the JobDisableParameter class. /// - public JobDisableParameter() { } + public JobDisableParameter() + { + CustomInit(); + } /// /// Initializes a new instance of the JobDisableParameter class. @@ -27,26 +34,34 @@ public JobDisableParameter() { } /// with the job. public JobDisableParameter(DisableJobOption disableTasks) { - this.DisableTasks = disableTasks; + DisableTasks = disableTasks; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets what to do with active tasks associated with the job. /// /// + /// Values are: + /// /// requeue - Terminate running tasks and requeue them. The tasks will - /// run again when the job is enabled. terminate - Terminate running - /// tasks. The tasks will not run again. wait - Allow currently running - /// tasks to complete. Possible values include: 'requeue', 'terminate', - /// 'wait' + /// run again when the job is enabled. + /// terminate - Terminate running tasks. The tasks will not run again. + /// wait - Allow currently running tasks to complete. Possible values + /// include: 'requeue', 'terminate', 'wait' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "disableTasks")] + [JsonProperty(PropertyName = "disableTasks")] public DisableJobOption DisableTasks { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobEnableHeaders.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobEnableHeaders.cs index df7d1304906f..a6f2c20a4c9f 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobEnableHeaders.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobEnableHeaders.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class JobEnableHeaders /// /// Initializes a new instance of the JobEnableHeaders class. /// - public JobEnableHeaders() { } + public JobEnableHeaders() + { + CustomInit(); + } /// /// Initializes a new instance of the JobEnableHeaders class. @@ -44,19 +53,25 @@ public JobEnableHeaders() { } /// the request applied. public JobEnableHeaders(System.Guid? clientRequestId = default(System.Guid?), System.Guid? requestId = default(System.Guid?), string eTag = default(string), System.DateTime? lastModified = default(System.DateTime?), string dataServiceId = default(string)) { - this.ClientRequestId = clientRequestId; - this.RequestId = requestId; - this.ETag = eTag; - this.LastModified = lastModified; - this.DataServiceId = dataServiceId; + ClientRequestId = clientRequestId; + RequestId = requestId; + ETag = eTag; + LastModified = lastModified; + DataServiceId = dataServiceId; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the client-request-id provided by the client during /// the request. This will be returned only if the /// return-client-request-id parameter was set to true. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "client-request-id")] + [JsonProperty(PropertyName = "client-request-id")] public System.Guid? ClientRequestId { get; set; } /// @@ -68,7 +83,7 @@ public JobEnableHeaders() { } /// request was made, the Batch account against which the request was /// made, and the region that account resides in. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "request-id")] + [JsonProperty(PropertyName = "request-id")] public System.Guid? RequestId { get; set; } /// @@ -78,21 +93,21 @@ public JobEnableHeaders() { } /// the If-Modified-Since, If-Unmodified-Since, If-Match or /// If-None-Match headers. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "ETag")] + [JsonProperty(PropertyName = "ETag")] public string ETag { get; set; } /// /// Gets or sets the time at which the resource was last modified. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "Last-Modified")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "Last-Modified")] public System.DateTime? LastModified { get; set; } /// /// Gets or sets the OData ID of the resource to which the request /// applied. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "DataServiceId")] + [JsonProperty(PropertyName = "DataServiceId")] public string DataServiceId { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobEnableOptions.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobEnableOptions.cs index a23a46187770..5f46065ffd92 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobEnableOptions.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobEnableOptions.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class JobEnableOptions /// /// Initializes a new instance of the JobEnableOptions class. /// - public JobEnableOptions() { } + public JobEnableOptions() + { + CustomInit(); + } /// /// Initializes a new instance of the JobEnableOptions class. @@ -52,21 +61,27 @@ public JobEnableOptions() { } /// modified since the specified time. public JobEnableOptions(int? timeout = default(int?), System.Guid? clientRequestId = default(System.Guid?), bool? returnClientRequestId = default(bool?), System.DateTime? ocpDate = default(System.DateTime?), string ifMatch = default(string), string ifNoneMatch = default(string), System.DateTime? ifModifiedSince = default(System.DateTime?), System.DateTime? ifUnmodifiedSince = default(System.DateTime?)) { - this.Timeout = timeout; - this.ClientRequestId = clientRequestId; - this.ReturnClientRequestId = returnClientRequestId; - this.OcpDate = ocpDate; - this.IfMatch = ifMatch; - this.IfNoneMatch = ifNoneMatch; - this.IfModifiedSince = ifModifiedSince; - this.IfUnmodifiedSince = ifUnmodifiedSince; + Timeout = timeout; + ClientRequestId = clientRequestId; + ReturnClientRequestId = returnClientRequestId; + OcpDate = ocpDate; + IfMatch = ifMatch; + IfNoneMatch = ifNoneMatch; + IfModifiedSince = ifModifiedSince; + IfUnmodifiedSince = ifUnmodifiedSince; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the maximum time that the server can spend processing /// the request, in seconds. The default is 30 seconds. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public int? Timeout { get; set; } /// @@ -74,14 +89,14 @@ public JobEnableOptions() { } /// a GUID with no decoration such as curly braces, e.g. /// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public System.Guid? ClientRequestId { get; set; } /// /// Gets or sets whether the server should return the client-request-id /// in the response. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public bool? ReturnClientRequestId { get; set; } /// @@ -89,8 +104,8 @@ public JobEnableOptions() { } /// typically set this to the current system clock time; set it /// explicitly if you are calling the REST API directly. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? OcpDate { get; set; } /// @@ -99,7 +114,7 @@ public JobEnableOptions() { } /// if the resource's current ETag on the service exactly matches the /// value specified by the client. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public string IfMatch { get; set; } /// @@ -108,7 +123,7 @@ public JobEnableOptions() { } /// if the resource's current ETag on the service does not match the /// value specified by the client. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public string IfNoneMatch { get; set; } /// @@ -117,8 +132,8 @@ public JobEnableOptions() { } /// if the resource on the service has been modified since the /// specified time. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? IfModifiedSince { get; set; } /// @@ -127,8 +142,8 @@ public JobEnableOptions() { } /// if the resource on the service has not been modified since the /// specified time. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? IfUnmodifiedSince { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobExecutionInformation.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobExecutionInformation.cs index 6dfbce5aaf5a..524ea3d81bfc 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobExecutionInformation.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobExecutionInformation.cs @@ -8,6 +8,10 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; using System.Linq; /// @@ -19,7 +23,10 @@ public partial class JobExecutionInformation /// /// Initializes a new instance of the JobExecutionInformation class. /// - public JobExecutionInformation() { } + public JobExecutionInformation() + { + CustomInit(); + } /// /// Initializes a new instance of the JobExecutionInformation class. @@ -34,20 +41,26 @@ public JobExecutionInformation() { } /// job ended. public JobExecutionInformation(System.DateTime startTime, System.DateTime? endTime = default(System.DateTime?), string poolId = default(string), JobSchedulingError schedulingError = default(JobSchedulingError), string terminateReason = default(string)) { - this.StartTime = startTime; - this.EndTime = endTime; - this.PoolId = poolId; - this.SchedulingError = schedulingError; - this.TerminateReason = terminateReason; + StartTime = startTime; + EndTime = endTime; + PoolId = poolId; + SchedulingError = schedulingError; + TerminateReason = terminateReason; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the start time of the job. /// /// /// This is the time at which the job was created. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "startTime")] + [JsonProperty(PropertyName = "startTime")] public System.DateTime StartTime { get; set; } /// @@ -56,7 +69,7 @@ public JobExecutionInformation() { } /// /// This property is set only if the job is in the completed state. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "endTime")] + [JsonProperty(PropertyName = "endTime")] public System.DateTime? EndTime { get; set; } /// @@ -69,9 +82,9 @@ public JobExecutionInformation() { } /// when the job was added or updated. That poolInfo element may also /// contain a poolId element. If it does, the two IDs are the same. If /// it does not, it means the job ran on an auto pool, and this - /// property contains the id of that auto pool. + /// property contains the ID of that auto pool. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "poolId")] + [JsonProperty(PropertyName = "poolId")] public string PoolId { get; set; } /// @@ -81,7 +94,7 @@ public JobExecutionInformation() { } /// /// This property is not set if there was no error starting the job. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "schedulingError")] + [JsonProperty(PropertyName = "schedulingError")] public JobSchedulingError SchedulingError { get; set; } /// @@ -102,20 +115,20 @@ public JobExecutionInformation() { } /// other string is a user-defined reason specified in a call to the /// 'Terminate a job' operation. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "terminateReason")] + [JsonProperty(PropertyName = "terminateReason")] public string TerminateReason { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (this.SchedulingError != null) + if (SchedulingError != null) { - this.SchedulingError.Validate(); + SchedulingError.Validate(); } } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobGetAllLifetimeStatisticsHeaders.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobGetAllLifetimeStatisticsHeaders.cs index 9453a967607e..01cd95bbfc36 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobGetAllLifetimeStatisticsHeaders.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobGetAllLifetimeStatisticsHeaders.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -19,7 +25,10 @@ public partial class JobGetAllLifetimeStatisticsHeaders /// Initializes a new instance of the /// JobGetAllLifetimeStatisticsHeaders class. /// - public JobGetAllLifetimeStatisticsHeaders() { } + public JobGetAllLifetimeStatisticsHeaders() + { + CustomInit(); + } /// /// Initializes a new instance of the @@ -44,18 +53,24 @@ public JobGetAllLifetimeStatisticsHeaders() { } /// modified. public JobGetAllLifetimeStatisticsHeaders(System.Guid? clientRequestId = default(System.Guid?), System.Guid? requestId = default(System.Guid?), string eTag = default(string), System.DateTime? lastModified = default(System.DateTime?)) { - this.ClientRequestId = clientRequestId; - this.RequestId = requestId; - this.ETag = eTag; - this.LastModified = lastModified; + ClientRequestId = clientRequestId; + RequestId = requestId; + ETag = eTag; + LastModified = lastModified; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the client-request-id provided by the client during /// the request. This will be returned only if the /// return-client-request-id parameter was set to true. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "client-request-id")] + [JsonProperty(PropertyName = "client-request-id")] public System.Guid? ClientRequestId { get; set; } /// @@ -67,7 +82,7 @@ public JobGetAllLifetimeStatisticsHeaders() { } /// request was made, the Batch account against which the request was /// made, and the region that account resides in. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "request-id")] + [JsonProperty(PropertyName = "request-id")] public System.Guid? RequestId { get; set; } /// @@ -77,14 +92,14 @@ public JobGetAllLifetimeStatisticsHeaders() { } /// the If-Modified-Since, If-Unmodified-Since, If-Match or /// If-None-Match headers. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "ETag")] + [JsonProperty(PropertyName = "ETag")] public string ETag { get; set; } /// /// Gets or sets the time at which the resource was last modified. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "Last-Modified")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "Last-Modified")] public System.DateTime? LastModified { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobGetAllLifetimeStatisticsOptions.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobGetAllLifetimeStatisticsOptions.cs index 0166ba7e4826..c23b2cacade4 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobGetAllLifetimeStatisticsOptions.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobGetAllLifetimeStatisticsOptions.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -19,7 +25,10 @@ public partial class JobGetAllLifetimeStatisticsOptions /// Initializes a new instance of the /// JobGetAllLifetimeStatisticsOptions class. /// - public JobGetAllLifetimeStatisticsOptions() { } + public JobGetAllLifetimeStatisticsOptions() + { + CustomInit(); + } /// /// Initializes a new instance of the @@ -38,17 +47,23 @@ public JobGetAllLifetimeStatisticsOptions() { } /// it explicitly if you are calling the REST API directly. public JobGetAllLifetimeStatisticsOptions(int? timeout = default(int?), System.Guid? clientRequestId = default(System.Guid?), bool? returnClientRequestId = default(bool?), System.DateTime? ocpDate = default(System.DateTime?)) { - this.Timeout = timeout; - this.ClientRequestId = clientRequestId; - this.ReturnClientRequestId = returnClientRequestId; - this.OcpDate = ocpDate; + Timeout = timeout; + ClientRequestId = clientRequestId; + ReturnClientRequestId = returnClientRequestId; + OcpDate = ocpDate; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the maximum time that the server can spend processing /// the request, in seconds. The default is 30 seconds. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public int? Timeout { get; set; } /// @@ -56,14 +71,14 @@ public JobGetAllLifetimeStatisticsOptions() { } /// a GUID with no decoration such as curly braces, e.g. /// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public System.Guid? ClientRequestId { get; set; } /// /// Gets or sets whether the server should return the client-request-id /// in the response. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public bool? ReturnClientRequestId { get; set; } /// @@ -71,8 +86,8 @@ public JobGetAllLifetimeStatisticsOptions() { } /// typically set this to the current system clock time; set it /// explicitly if you are calling the REST API directly. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? OcpDate { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobGetHeaders.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobGetHeaders.cs index 35579b44b4f4..e25d0bba8d6f 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobGetHeaders.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobGetHeaders.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class JobGetHeaders /// /// Initializes a new instance of the JobGetHeaders class. /// - public JobGetHeaders() { } + public JobGetHeaders() + { + CustomInit(); + } /// /// Initializes a new instance of the JobGetHeaders class. @@ -42,18 +51,24 @@ public JobGetHeaders() { } /// modified. public JobGetHeaders(System.Guid? clientRequestId = default(System.Guid?), System.Guid? requestId = default(System.Guid?), string eTag = default(string), System.DateTime? lastModified = default(System.DateTime?)) { - this.ClientRequestId = clientRequestId; - this.RequestId = requestId; - this.ETag = eTag; - this.LastModified = lastModified; + ClientRequestId = clientRequestId; + RequestId = requestId; + ETag = eTag; + LastModified = lastModified; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the client-request-id provided by the client during /// the request. This will be returned only if the /// return-client-request-id parameter was set to true. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "client-request-id")] + [JsonProperty(PropertyName = "client-request-id")] public System.Guid? ClientRequestId { get; set; } /// @@ -65,7 +80,7 @@ public JobGetHeaders() { } /// request was made, the Batch account against which the request was /// made, and the region that account resides in. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "request-id")] + [JsonProperty(PropertyName = "request-id")] public System.Guid? RequestId { get; set; } /// @@ -75,14 +90,14 @@ public JobGetHeaders() { } /// the If-Modified-Since, If-Unmodified-Since, If-Match or /// If-None-Match headers. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "ETag")] + [JsonProperty(PropertyName = "ETag")] public string ETag { get; set; } /// /// Gets or sets the time at which the resource was last modified. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "Last-Modified")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "Last-Modified")] public System.DateTime? LastModified { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobGetOptions.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobGetOptions.cs index 1bb81b00c78b..d7b4ac5ab34a 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobGetOptions.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobGetOptions.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class JobGetOptions /// /// Initializes a new instance of the JobGetOptions class. /// - public JobGetOptions() { } + public JobGetOptions() + { + CustomInit(); + } /// /// Initializes a new instance of the JobGetOptions class. @@ -54,35 +63,41 @@ public JobGetOptions() { } /// modified since the specified time. public JobGetOptions(string select = default(string), string expand = default(string), int? timeout = default(int?), System.Guid? clientRequestId = default(System.Guid?), bool? returnClientRequestId = default(bool?), System.DateTime? ocpDate = default(System.DateTime?), string ifMatch = default(string), string ifNoneMatch = default(string), System.DateTime? ifModifiedSince = default(System.DateTime?), System.DateTime? ifUnmodifiedSince = default(System.DateTime?)) { - this.Select = select; - this.Expand = expand; - this.Timeout = timeout; - this.ClientRequestId = clientRequestId; - this.ReturnClientRequestId = returnClientRequestId; - this.OcpDate = ocpDate; - this.IfMatch = ifMatch; - this.IfNoneMatch = ifNoneMatch; - this.IfModifiedSince = ifModifiedSince; - this.IfUnmodifiedSince = ifUnmodifiedSince; + Select = select; + Expand = expand; + Timeout = timeout; + ClientRequestId = clientRequestId; + ReturnClientRequestId = returnClientRequestId; + OcpDate = ocpDate; + IfMatch = ifMatch; + IfNoneMatch = ifNoneMatch; + IfModifiedSince = ifModifiedSince; + IfUnmodifiedSince = ifUnmodifiedSince; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets an OData $select clause. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public string Select { get; set; } /// /// Gets or sets an OData $expand clause. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public string Expand { get; set; } /// /// Gets or sets the maximum time that the server can spend processing /// the request, in seconds. The default is 30 seconds. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public int? Timeout { get; set; } /// @@ -90,14 +105,14 @@ public JobGetOptions() { } /// a GUID with no decoration such as curly braces, e.g. /// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public System.Guid? ClientRequestId { get; set; } /// /// Gets or sets whether the server should return the client-request-id /// in the response. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public bool? ReturnClientRequestId { get; set; } /// @@ -105,8 +120,8 @@ public JobGetOptions() { } /// typically set this to the current system clock time; set it /// explicitly if you are calling the REST API directly. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? OcpDate { get; set; } /// @@ -115,7 +130,7 @@ public JobGetOptions() { } /// if the resource's current ETag on the service exactly matches the /// value specified by the client. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public string IfMatch { get; set; } /// @@ -124,7 +139,7 @@ public JobGetOptions() { } /// if the resource's current ETag on the service does not match the /// value specified by the client. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public string IfNoneMatch { get; set; } /// @@ -133,8 +148,8 @@ public JobGetOptions() { } /// if the resource on the service has been modified since the /// specified time. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? IfModifiedSince { get; set; } /// @@ -143,8 +158,8 @@ public JobGetOptions() { } /// if the resource on the service has not been modified since the /// specified time. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? IfUnmodifiedSince { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobGetTaskCountsHeaders.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobGetTaskCountsHeaders.cs index 4a51f24e253c..675b6c6613ed 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobGetTaskCountsHeaders.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobGetTaskCountsHeaders.cs @@ -8,6 +8,10 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +22,10 @@ public partial class JobGetTaskCountsHeaders /// /// Initializes a new instance of the JobGetTaskCountsHeaders class. /// - public JobGetTaskCountsHeaders() { } + public JobGetTaskCountsHeaders() + { + CustomInit(); + } /// /// Initializes a new instance of the JobGetTaskCountsHeaders class. @@ -35,16 +42,22 @@ public JobGetTaskCountsHeaders() { } /// request was made, and the region that account resides in. public JobGetTaskCountsHeaders(System.Guid? clientRequestId = default(System.Guid?), System.Guid? requestId = default(System.Guid?)) { - this.ClientRequestId = clientRequestId; - this.RequestId = requestId; + ClientRequestId = clientRequestId; + RequestId = requestId; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the client-request-id provided by the client during /// the request. This will be returned only if the /// return-client-request-id parameter was set to true. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "client-request-id")] + [JsonProperty(PropertyName = "client-request-id")] public System.Guid? ClientRequestId { get; set; } /// @@ -56,7 +69,7 @@ public JobGetTaskCountsHeaders() { } /// request was made, the Batch account against which the request was /// made, and the region that account resides in. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "request-id")] + [JsonProperty(PropertyName = "request-id")] public System.Guid? RequestId { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobGetTaskCountsOptions.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobGetTaskCountsOptions.cs index fa94e1d66791..c46f71850207 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobGetTaskCountsOptions.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobGetTaskCountsOptions.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class JobGetTaskCountsOptions /// /// Initializes a new instance of the JobGetTaskCountsOptions class. /// - public JobGetTaskCountsOptions() { } + public JobGetTaskCountsOptions() + { + CustomInit(); + } /// /// Initializes a new instance of the JobGetTaskCountsOptions class. @@ -36,17 +45,23 @@ public JobGetTaskCountsOptions() { } /// it explicitly if you are calling the REST API directly. public JobGetTaskCountsOptions(int? timeout = default(int?), System.Guid? clientRequestId = default(System.Guid?), bool? returnClientRequestId = default(bool?), System.DateTime? ocpDate = default(System.DateTime?)) { - this.Timeout = timeout; - this.ClientRequestId = clientRequestId; - this.ReturnClientRequestId = returnClientRequestId; - this.OcpDate = ocpDate; + Timeout = timeout; + ClientRequestId = clientRequestId; + ReturnClientRequestId = returnClientRequestId; + OcpDate = ocpDate; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the maximum time that the server can spend processing /// the request, in seconds. The default is 30 seconds. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public int? Timeout { get; set; } /// @@ -54,14 +69,14 @@ public JobGetTaskCountsOptions() { } /// a GUID with no decoration such as curly braces, e.g. /// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public System.Guid? ClientRequestId { get; set; } /// /// Gets or sets whether the server should return the client-request-id /// in the response. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public bool? ReturnClientRequestId { get; set; } /// @@ -69,8 +84,8 @@ public JobGetTaskCountsOptions() { } /// typically set this to the current system clock time; set it /// explicitly if you are calling the REST API directly. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? OcpDate { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobListFromJobScheduleHeaders.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobListFromJobScheduleHeaders.cs index 9c18259ec738..338760afb63f 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobListFromJobScheduleHeaders.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobListFromJobScheduleHeaders.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -19,7 +25,10 @@ public partial class JobListFromJobScheduleHeaders /// Initializes a new instance of the JobListFromJobScheduleHeaders /// class. /// - public JobListFromJobScheduleHeaders() { } + public JobListFromJobScheduleHeaders() + { + CustomInit(); + } /// /// Initializes a new instance of the JobListFromJobScheduleHeaders @@ -44,18 +53,24 @@ public JobListFromJobScheduleHeaders() { } /// modified. public JobListFromJobScheduleHeaders(System.Guid? clientRequestId = default(System.Guid?), System.Guid? requestId = default(System.Guid?), string eTag = default(string), System.DateTime? lastModified = default(System.DateTime?)) { - this.ClientRequestId = clientRequestId; - this.RequestId = requestId; - this.ETag = eTag; - this.LastModified = lastModified; + ClientRequestId = clientRequestId; + RequestId = requestId; + ETag = eTag; + LastModified = lastModified; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the client-request-id provided by the client during /// the request. This will be returned only if the /// return-client-request-id parameter was set to true. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "client-request-id")] + [JsonProperty(PropertyName = "client-request-id")] public System.Guid? ClientRequestId { get; set; } /// @@ -67,7 +82,7 @@ public JobListFromJobScheduleHeaders() { } /// request was made, the Batch account against which the request was /// made, and the region that account resides in. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "request-id")] + [JsonProperty(PropertyName = "request-id")] public System.Guid? RequestId { get; set; } /// @@ -77,14 +92,14 @@ public JobListFromJobScheduleHeaders() { } /// the If-Modified-Since, If-Unmodified-Since, If-Match or /// If-None-Match headers. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "ETag")] + [JsonProperty(PropertyName = "ETag")] public string ETag { get; set; } /// /// Gets or sets the time at which the resource was last modified. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "Last-Modified")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "Last-Modified")] public System.DateTime? LastModified { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobListFromJobScheduleNextOptions.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobListFromJobScheduleNextOptions.cs index b47f100bc9b4..2d84dfbc9af8 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobListFromJobScheduleNextOptions.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobListFromJobScheduleNextOptions.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -19,7 +25,10 @@ public partial class JobListFromJobScheduleNextOptions /// Initializes a new instance of the JobListFromJobScheduleNextOptions /// class. /// - public JobListFromJobScheduleNextOptions() { } + public JobListFromJobScheduleNextOptions() + { + CustomInit(); + } /// /// Initializes a new instance of the JobListFromJobScheduleNextOptions @@ -35,24 +44,30 @@ public JobListFromJobScheduleNextOptions() { } /// it explicitly if you are calling the REST API directly. public JobListFromJobScheduleNextOptions(System.Guid? clientRequestId = default(System.Guid?), bool? returnClientRequestId = default(bool?), System.DateTime? ocpDate = default(System.DateTime?)) { - this.ClientRequestId = clientRequestId; - this.ReturnClientRequestId = returnClientRequestId; - this.OcpDate = ocpDate; + ClientRequestId = clientRequestId; + ReturnClientRequestId = returnClientRequestId; + OcpDate = ocpDate; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the caller-generated request identity, in the form of /// a GUID with no decoration such as curly braces, e.g. /// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public System.Guid? ClientRequestId { get; set; } /// /// Gets or sets whether the server should return the client-request-id /// in the response. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public bool? ReturnClientRequestId { get; set; } /// @@ -60,8 +75,8 @@ public JobListFromJobScheduleNextOptions() { } /// typically set this to the current system clock time; set it /// explicitly if you are calling the REST API directly. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? OcpDate { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobListFromJobScheduleOptions.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobListFromJobScheduleOptions.cs index b87474e41df8..e045fa28945b 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobListFromJobScheduleOptions.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobListFromJobScheduleOptions.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -19,7 +25,10 @@ public partial class JobListFromJobScheduleOptions /// Initializes a new instance of the JobListFromJobScheduleOptions /// class. /// - public JobListFromJobScheduleOptions() { } + public JobListFromJobScheduleOptions() + { + CustomInit(); + } /// /// Initializes a new instance of the JobListFromJobScheduleOptions @@ -43,46 +52,52 @@ public JobListFromJobScheduleOptions() { } /// it explicitly if you are calling the REST API directly. public JobListFromJobScheduleOptions(string filter = default(string), string select = default(string), string expand = default(string), int? maxResults = default(int?), int? timeout = default(int?), System.Guid? clientRequestId = default(System.Guid?), bool? returnClientRequestId = default(bool?), System.DateTime? ocpDate = default(System.DateTime?)) { - this.Filter = filter; - this.Select = select; - this.Expand = expand; - this.MaxResults = maxResults; - this.Timeout = timeout; - this.ClientRequestId = clientRequestId; - this.ReturnClientRequestId = returnClientRequestId; - this.OcpDate = ocpDate; + Filter = filter; + Select = select; + Expand = expand; + MaxResults = maxResults; + Timeout = timeout; + ClientRequestId = clientRequestId; + ReturnClientRequestId = returnClientRequestId; + OcpDate = ocpDate; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets an OData $filter clause. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public string Filter { get; set; } /// /// Gets or sets an OData $select clause. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public string Select { get; set; } /// /// Gets or sets an OData $expand clause. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public string Expand { get; set; } /// /// Gets or sets the maximum number of items to return in the response. /// A maximum of 1000 jobs can be returned. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public int? MaxResults { get; set; } /// /// Gets or sets the maximum time that the server can spend processing /// the request, in seconds. The default is 30 seconds. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public int? Timeout { get; set; } /// @@ -90,14 +105,14 @@ public JobListFromJobScheduleOptions() { } /// a GUID with no decoration such as curly braces, e.g. /// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public System.Guid? ClientRequestId { get; set; } /// /// Gets or sets whether the server should return the client-request-id /// in the response. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public bool? ReturnClientRequestId { get; set; } /// @@ -105,8 +120,8 @@ public JobListFromJobScheduleOptions() { } /// typically set this to the current system clock time; set it /// explicitly if you are calling the REST API directly. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? OcpDate { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobListHeaders.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobListHeaders.cs index a2b08941ac2d..b03d08a6c5ea 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobListHeaders.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobListHeaders.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class JobListHeaders /// /// Initializes a new instance of the JobListHeaders class. /// - public JobListHeaders() { } + public JobListHeaders() + { + CustomInit(); + } /// /// Initializes a new instance of the JobListHeaders class. @@ -42,18 +51,24 @@ public JobListHeaders() { } /// modified. public JobListHeaders(System.Guid? clientRequestId = default(System.Guid?), System.Guid? requestId = default(System.Guid?), string eTag = default(string), System.DateTime? lastModified = default(System.DateTime?)) { - this.ClientRequestId = clientRequestId; - this.RequestId = requestId; - this.ETag = eTag; - this.LastModified = lastModified; + ClientRequestId = clientRequestId; + RequestId = requestId; + ETag = eTag; + LastModified = lastModified; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the client-request-id provided by the client during /// the request. This will be returned only if the /// return-client-request-id parameter was set to true. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "client-request-id")] + [JsonProperty(PropertyName = "client-request-id")] public System.Guid? ClientRequestId { get; set; } /// @@ -65,7 +80,7 @@ public JobListHeaders() { } /// request was made, the Batch account against which the request was /// made, and the region that account resides in. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "request-id")] + [JsonProperty(PropertyName = "request-id")] public System.Guid? RequestId { get; set; } /// @@ -75,14 +90,14 @@ public JobListHeaders() { } /// the If-Modified-Since, If-Unmodified-Since, If-Match or /// If-None-Match headers. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "ETag")] + [JsonProperty(PropertyName = "ETag")] public string ETag { get; set; } /// /// Gets or sets the time at which the resource was last modified. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "Last-Modified")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "Last-Modified")] public System.DateTime? LastModified { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobListNextOptions.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobListNextOptions.cs index e5fd8ed4ef63..fd0943b01496 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobListNextOptions.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobListNextOptions.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class JobListNextOptions /// /// Initializes a new instance of the JobListNextOptions class. /// - public JobListNextOptions() { } + public JobListNextOptions() + { + CustomInit(); + } /// /// Initializes a new instance of the JobListNextOptions class. @@ -33,24 +42,30 @@ public JobListNextOptions() { } /// it explicitly if you are calling the REST API directly. public JobListNextOptions(System.Guid? clientRequestId = default(System.Guid?), bool? returnClientRequestId = default(bool?), System.DateTime? ocpDate = default(System.DateTime?)) { - this.ClientRequestId = clientRequestId; - this.ReturnClientRequestId = returnClientRequestId; - this.OcpDate = ocpDate; + ClientRequestId = clientRequestId; + ReturnClientRequestId = returnClientRequestId; + OcpDate = ocpDate; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the caller-generated request identity, in the form of /// a GUID with no decoration such as curly braces, e.g. /// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public System.Guid? ClientRequestId { get; set; } /// /// Gets or sets whether the server should return the client-request-id /// in the response. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public bool? ReturnClientRequestId { get; set; } /// @@ -58,8 +73,8 @@ public JobListNextOptions() { } /// typically set this to the current system clock time; set it /// explicitly if you are calling the REST API directly. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? OcpDate { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobListOptions.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobListOptions.cs index 9205881e10bd..e560836b8bb4 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobListOptions.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobListOptions.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class JobListOptions /// /// Initializes a new instance of the JobListOptions class. /// - public JobListOptions() { } + public JobListOptions() + { + CustomInit(); + } /// /// Initializes a new instance of the JobListOptions class. @@ -41,46 +50,52 @@ public JobListOptions() { } /// it explicitly if you are calling the REST API directly. public JobListOptions(string filter = default(string), string select = default(string), string expand = default(string), int? maxResults = default(int?), int? timeout = default(int?), System.Guid? clientRequestId = default(System.Guid?), bool? returnClientRequestId = default(bool?), System.DateTime? ocpDate = default(System.DateTime?)) { - this.Filter = filter; - this.Select = select; - this.Expand = expand; - this.MaxResults = maxResults; - this.Timeout = timeout; - this.ClientRequestId = clientRequestId; - this.ReturnClientRequestId = returnClientRequestId; - this.OcpDate = ocpDate; + Filter = filter; + Select = select; + Expand = expand; + MaxResults = maxResults; + Timeout = timeout; + ClientRequestId = clientRequestId; + ReturnClientRequestId = returnClientRequestId; + OcpDate = ocpDate; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets an OData $filter clause. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public string Filter { get; set; } /// /// Gets or sets an OData $select clause. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public string Select { get; set; } /// /// Gets or sets an OData $expand clause. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public string Expand { get; set; } /// /// Gets or sets the maximum number of items to return in the response. /// A maximum of 1000 jobs can be returned. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public int? MaxResults { get; set; } /// /// Gets or sets the maximum time that the server can spend processing /// the request, in seconds. The default is 30 seconds. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public int? Timeout { get; set; } /// @@ -88,14 +103,14 @@ public JobListOptions() { } /// a GUID with no decoration such as curly braces, e.g. /// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public System.Guid? ClientRequestId { get; set; } /// /// Gets or sets whether the server should return the client-request-id /// in the response. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public bool? ReturnClientRequestId { get; set; } /// @@ -103,8 +118,8 @@ public JobListOptions() { } /// typically set this to the current system clock time; set it /// explicitly if you are calling the REST API directly. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? OcpDate { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobListPreparationAndReleaseTaskStatusHeaders.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobListPreparationAndReleaseTaskStatusHeaders.cs index 5248270c07a2..b473b04f9073 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobListPreparationAndReleaseTaskStatusHeaders.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobListPreparationAndReleaseTaskStatusHeaders.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -19,7 +25,10 @@ public partial class JobListPreparationAndReleaseTaskStatusHeaders /// Initializes a new instance of the /// JobListPreparationAndReleaseTaskStatusHeaders class. /// - public JobListPreparationAndReleaseTaskStatusHeaders() { } + public JobListPreparationAndReleaseTaskStatusHeaders() + { + CustomInit(); + } /// /// Initializes a new instance of the @@ -44,18 +53,24 @@ public JobListPreparationAndReleaseTaskStatusHeaders() { } /// modified. public JobListPreparationAndReleaseTaskStatusHeaders(System.Guid? clientRequestId = default(System.Guid?), System.Guid? requestId = default(System.Guid?), string eTag = default(string), System.DateTime? lastModified = default(System.DateTime?)) { - this.ClientRequestId = clientRequestId; - this.RequestId = requestId; - this.ETag = eTag; - this.LastModified = lastModified; + ClientRequestId = clientRequestId; + RequestId = requestId; + ETag = eTag; + LastModified = lastModified; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the client-request-id provided by the client during /// the request. This will be returned only if the /// return-client-request-id parameter was set to true. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "client-request-id")] + [JsonProperty(PropertyName = "client-request-id")] public System.Guid? ClientRequestId { get; set; } /// @@ -67,7 +82,7 @@ public JobListPreparationAndReleaseTaskStatusHeaders() { } /// request was made, the Batch account against which the request was /// made, and the region that account resides in. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "request-id")] + [JsonProperty(PropertyName = "request-id")] public System.Guid? RequestId { get; set; } /// @@ -77,14 +92,14 @@ public JobListPreparationAndReleaseTaskStatusHeaders() { } /// the If-Modified-Since, If-Unmodified-Since, If-Match or /// If-None-Match headers. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "ETag")] + [JsonProperty(PropertyName = "ETag")] public string ETag { get; set; } /// /// Gets or sets the time at which the resource was last modified. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "Last-Modified")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "Last-Modified")] public System.DateTime? LastModified { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobListPreparationAndReleaseTaskStatusNextOptions.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobListPreparationAndReleaseTaskStatusNextOptions.cs index b00c52a82e49..057595e6c2f3 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobListPreparationAndReleaseTaskStatusNextOptions.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobListPreparationAndReleaseTaskStatusNextOptions.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -20,7 +26,10 @@ public partial class JobListPreparationAndReleaseTaskStatusNextOptions /// Initializes a new instance of the /// JobListPreparationAndReleaseTaskStatusNextOptions class. /// - public JobListPreparationAndReleaseTaskStatusNextOptions() { } + public JobListPreparationAndReleaseTaskStatusNextOptions() + { + CustomInit(); + } /// /// Initializes a new instance of the @@ -36,24 +45,30 @@ public JobListPreparationAndReleaseTaskStatusNextOptions() { } /// it explicitly if you are calling the REST API directly. public JobListPreparationAndReleaseTaskStatusNextOptions(System.Guid? clientRequestId = default(System.Guid?), bool? returnClientRequestId = default(bool?), System.DateTime? ocpDate = default(System.DateTime?)) { - this.ClientRequestId = clientRequestId; - this.ReturnClientRequestId = returnClientRequestId; - this.OcpDate = ocpDate; + ClientRequestId = clientRequestId; + ReturnClientRequestId = returnClientRequestId; + OcpDate = ocpDate; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the caller-generated request identity, in the form of /// a GUID with no decoration such as curly braces, e.g. /// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public System.Guid? ClientRequestId { get; set; } /// /// Gets or sets whether the server should return the client-request-id /// in the response. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public bool? ReturnClientRequestId { get; set; } /// @@ -61,8 +76,8 @@ public JobListPreparationAndReleaseTaskStatusNextOptions() { } /// typically set this to the current system clock time; set it /// explicitly if you are calling the REST API directly. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? OcpDate { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobListPreparationAndReleaseTaskStatusOptions.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobListPreparationAndReleaseTaskStatusOptions.cs index 0cc48c4ed787..faf8c613eff1 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobListPreparationAndReleaseTaskStatusOptions.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobListPreparationAndReleaseTaskStatusOptions.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -20,13 +26,18 @@ public partial class JobListPreparationAndReleaseTaskStatusOptions /// Initializes a new instance of the /// JobListPreparationAndReleaseTaskStatusOptions class. /// - public JobListPreparationAndReleaseTaskStatusOptions() { } + public JobListPreparationAndReleaseTaskStatusOptions() + { + CustomInit(); + } /// /// Initializes a new instance of the /// JobListPreparationAndReleaseTaskStatusOptions class. /// - /// An OData $filter clause. + /// An OData $filter clause. To get the status of + /// the Job Preparation and Job Release tasks on a specific compute + /// node, use "nodeId eq '{desired-node-id}'" /// An OData $select clause. /// The maximum number of items to return in /// the response. A maximum of 1000 tasks can be returned. @@ -43,39 +54,47 @@ public JobListPreparationAndReleaseTaskStatusOptions() { } /// it explicitly if you are calling the REST API directly. public JobListPreparationAndReleaseTaskStatusOptions(string filter = default(string), string select = default(string), int? maxResults = default(int?), int? timeout = default(int?), System.Guid? clientRequestId = default(System.Guid?), bool? returnClientRequestId = default(bool?), System.DateTime? ocpDate = default(System.DateTime?)) { - this.Filter = filter; - this.Select = select; - this.MaxResults = maxResults; - this.Timeout = timeout; - this.ClientRequestId = clientRequestId; - this.ReturnClientRequestId = returnClientRequestId; - this.OcpDate = ocpDate; + Filter = filter; + Select = select; + MaxResults = maxResults; + Timeout = timeout; + ClientRequestId = clientRequestId; + ReturnClientRequestId = returnClientRequestId; + OcpDate = ocpDate; + CustomInit(); } /// - /// Gets or sets an OData $filter clause. + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets an OData $filter clause. To get the status of the Job + /// Preparation and Job Release tasks on a specific compute node, use + /// "nodeId eq '{desired-node-id}'" /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public string Filter { get; set; } /// /// Gets or sets an OData $select clause. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public string Select { get; set; } /// /// Gets or sets the maximum number of items to return in the response. /// A maximum of 1000 tasks can be returned. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public int? MaxResults { get; set; } /// /// Gets or sets the maximum time that the server can spend processing /// the request, in seconds. The default is 30 seconds. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public int? Timeout { get; set; } /// @@ -83,14 +102,14 @@ public JobListPreparationAndReleaseTaskStatusOptions() { } /// a GUID with no decoration such as curly braces, e.g. /// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public System.Guid? ClientRequestId { get; set; } /// /// Gets or sets whether the server should return the client-request-id /// in the response. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public bool? ReturnClientRequestId { get; set; } /// @@ -98,8 +117,8 @@ public JobListPreparationAndReleaseTaskStatusOptions() { } /// typically set this to the current system clock time; set it /// explicitly if you are calling the REST API directly. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? OcpDate { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobManagerTask.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobManagerTask.cs index 64630a26b808..96eaf8ab56fd 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobManagerTask.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobManagerTask.cs @@ -8,23 +8,49 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// /// Specifies details of a Job Manager task. /// + /// + /// The Job Manager task is automatically started when the job is created. + /// The Batch service tries to schedule the Job Manager task before any + /// other tasks in the job. When shrinking a pool, the Batch service tries + /// to preserve compute nodes where Job Manager tasks are running for as + /// long as possible (that is, nodes running 'normal' tasks are removed + /// before nodes running Job Manager tasks). When a Job Manager task fails + /// and needs to be restarted, the system tries to schedule it at the + /// highest priority. If there are no idle nodes available, the system may + /// terminate one of the running tasks in the pool and return it to the + /// queue in order to make room for the Job Manager task to restart. Note + /// that a Job Manager task in one job does not have priority over tasks in + /// other jobs. Across jobs, only job level priorities are observed. For + /// example, if a Job Manager in a priority 0 job needs to be restarted, it + /// will not displace tasks of a priority 1 job. + /// public partial class JobManagerTask { /// /// Initializes a new instance of the JobManagerTask class. /// - public JobManagerTask() { } + public JobManagerTask() + { + CustomInit(); + } /// /// Initializes a new instance of the JobManagerTask class. /// /// A string that uniquely identifies the Job Manager - /// taskwithin the job. + /// task within the job. /// The command line of the Job Manager /// task. /// The display name of the Job Manager @@ -53,33 +79,39 @@ public JobManagerTask() { } /// operations. /// Whether the Job Manager task may /// run on a low-priority compute node. - public JobManagerTask(string id, string commandLine, string displayName = default(string), System.Collections.Generic.IList resourceFiles = default(System.Collections.Generic.IList), System.Collections.Generic.IList outputFiles = default(System.Collections.Generic.IList), System.Collections.Generic.IList environmentSettings = default(System.Collections.Generic.IList), TaskConstraints constraints = default(TaskConstraints), bool? killJobOnCompletion = default(bool?), UserIdentity userIdentity = default(UserIdentity), bool? runExclusive = default(bool?), System.Collections.Generic.IList applicationPackageReferences = default(System.Collections.Generic.IList), AuthenticationTokenSettings authenticationTokenSettings = default(AuthenticationTokenSettings), bool? allowLowPriorityNode = default(bool?)) + public JobManagerTask(string id, string commandLine, string displayName = default(string), IList resourceFiles = default(IList), IList outputFiles = default(IList), IList environmentSettings = default(IList), TaskConstraints constraints = default(TaskConstraints), bool? killJobOnCompletion = default(bool?), UserIdentity userIdentity = default(UserIdentity), bool? runExclusive = default(bool?), IList applicationPackageReferences = default(IList), AuthenticationTokenSettings authenticationTokenSettings = default(AuthenticationTokenSettings), bool? allowLowPriorityNode = default(bool?)) { - this.Id = id; - this.DisplayName = displayName; - this.CommandLine = commandLine; - this.ResourceFiles = resourceFiles; - this.OutputFiles = outputFiles; - this.EnvironmentSettings = environmentSettings; - this.Constraints = constraints; - this.KillJobOnCompletion = killJobOnCompletion; - this.UserIdentity = userIdentity; - this.RunExclusive = runExclusive; - this.ApplicationPackageReferences = applicationPackageReferences; - this.AuthenticationTokenSettings = authenticationTokenSettings; - this.AllowLowPriorityNode = allowLowPriorityNode; + Id = id; + DisplayName = displayName; + CommandLine = commandLine; + ResourceFiles = resourceFiles; + OutputFiles = outputFiles; + EnvironmentSettings = environmentSettings; + Constraints = constraints; + KillJobOnCompletion = killJobOnCompletion; + UserIdentity = userIdentity; + RunExclusive = runExclusive; + ApplicationPackageReferences = applicationPackageReferences; + AuthenticationTokenSettings = authenticationTokenSettings; + AllowLowPriorityNode = allowLowPriorityNode; + CustomInit(); } /// - /// Gets or sets a string that uniquely identifies the Job Manager - /// taskwithin the job. + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets a string that uniquely identifies the Job Manager task + /// within the job. /// /// - /// The id can contain any combination of alphanumeric characters + /// The ID can contain any combination of alphanumeric characters /// including hyphens and underscores and cannot contain more than 64 /// characters. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + [JsonProperty(PropertyName = "id")] public string Id { get; set; } /// @@ -89,7 +121,7 @@ public JobManagerTask() { } /// It need not be unique and can contain any Unicode characters up to /// a maximum length of 1024. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "displayName")] + [JsonProperty(PropertyName = "displayName")] public string DisplayName { get; set; } /// @@ -102,7 +134,7 @@ public JobManagerTask() { } /// should invoke the shell in the command line, for example using "cmd /// /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "commandLine")] + [JsonProperty(PropertyName = "commandLine")] public string CommandLine { get; set; } /// @@ -113,27 +145,31 @@ public JobManagerTask() { } /// Files listed under this element are located in the task's working /// directory. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "resourceFiles")] - public System.Collections.Generic.IList ResourceFiles { get; set; } + [JsonProperty(PropertyName = "resourceFiles")] + public IList ResourceFiles { get; set; } /// /// Gets or sets a list of files that the Batch service will upload /// from the compute node after running the command line. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "outputFiles")] - public System.Collections.Generic.IList OutputFiles { get; set; } + /// + /// For multi-instance tasks, the files will only be uploaded from the + /// compute node on which the primary task is executed. + /// + [JsonProperty(PropertyName = "outputFiles")] + public IList OutputFiles { get; set; } /// /// Gets or sets a list of environment variable settings for the Job /// Manager task. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "environmentSettings")] - public System.Collections.Generic.IList EnvironmentSettings { get; set; } + [JsonProperty(PropertyName = "environmentSettings")] + public IList EnvironmentSettings { get; set; } /// /// Gets or sets constraints that apply to the Job Manager task. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "constraints")] + [JsonProperty(PropertyName = "constraints")] public TaskConstraints Constraints { get; set; } /// @@ -155,7 +191,7 @@ public JobManagerTask() { } /// for the job (not to monitor progress), then it is important to set /// killJobOnCompletion to false. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "killJobOnCompletion")] + [JsonProperty(PropertyName = "killJobOnCompletion")] public bool? KillJobOnCompletion { get; set; } /// @@ -166,7 +202,7 @@ public JobManagerTask() { } /// If omitted, the task runs as a non-administrative user unique to /// the task. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "userIdentity")] + [JsonProperty(PropertyName = "userIdentity")] public UserIdentity UserIdentity { get; set; } /// @@ -181,7 +217,7 @@ public JobManagerTask() { } /// limit, so this is only relevant if the node allows multiple /// concurrent tasks. The default value is true. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "runExclusive")] + [JsonProperty(PropertyName = "runExclusive")] public bool? RunExclusive { get; set; } /// @@ -190,15 +226,15 @@ public JobManagerTask() { } /// /// /// Application packages are downloaded and deployed to a shared - /// directory, not the task directory. Therefore, if a referenced - /// package is already on the compute node, and is up to date, then it - /// is not re-downloaded; the existing copy on the compute node is - /// used. If a referenced application package cannot be installed, for - /// example because the package has been deleted or because download - /// failed, the task fails with a scheduling error. + /// directory, not the task working directory. Therefore, if a + /// referenced package is already on the compute node, and is up to + /// date, then it is not re-downloaded; the existing copy on the + /// compute node is used. If a referenced application package cannot be + /// installed, for example because the package has been deleted or + /// because download failed, the task fails. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "applicationPackageReferences")] - public System.Collections.Generic.IList ApplicationPackageReferences { get; set; } + [JsonProperty(PropertyName = "applicationPackageReferences")] + public IList ApplicationPackageReferences { get; set; } /// /// Gets or sets the settings for an authentication token that the task @@ -214,7 +250,7 @@ public JobManagerTask() { } /// permissions in order to add other tasks to the job, or check the /// status of the job or of other tasks under the job. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "authenticationTokenSettings")] + [JsonProperty(PropertyName = "authenticationTokenSettings")] public AuthenticationTokenSettings AuthenticationTokenSettings { get; set; } /// @@ -224,28 +260,28 @@ public JobManagerTask() { } /// /// The default value is false. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "allowLowPriorityNode")] + [JsonProperty(PropertyName = "allowLowPriorityNode")] public bool? AllowLowPriorityNode { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (this.Id == null) + if (Id == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Id"); + throw new ValidationException(ValidationRules.CannotBeNull, "Id"); } - if (this.CommandLine == null) + if (CommandLine == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "CommandLine"); + throw new ValidationException(ValidationRules.CannotBeNull, "CommandLine"); } - if (this.ResourceFiles != null) + if (ResourceFiles != null) { - foreach (var element in this.ResourceFiles) + foreach (var element in ResourceFiles) { if (element != null) { @@ -253,9 +289,9 @@ public virtual void Validate() } } } - if (this.OutputFiles != null) + if (OutputFiles != null) { - foreach (var element1 in this.OutputFiles) + foreach (var element1 in OutputFiles) { if (element1 != null) { @@ -263,9 +299,9 @@ public virtual void Validate() } } } - if (this.EnvironmentSettings != null) + if (EnvironmentSettings != null) { - foreach (var element2 in this.EnvironmentSettings) + foreach (var element2 in EnvironmentSettings) { if (element2 != null) { @@ -273,9 +309,9 @@ public virtual void Validate() } } } - if (this.ApplicationPackageReferences != null) + if (ApplicationPackageReferences != null) { - foreach (var element3 in this.ApplicationPackageReferences) + foreach (var element3 in ApplicationPackageReferences) { if (element3 != null) { diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobPatchHeaders.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobPatchHeaders.cs index 81baff8a69f3..af45ac1ab8b9 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobPatchHeaders.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobPatchHeaders.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class JobPatchHeaders /// /// Initializes a new instance of the JobPatchHeaders class. /// - public JobPatchHeaders() { } + public JobPatchHeaders() + { + CustomInit(); + } /// /// Initializes a new instance of the JobPatchHeaders class. @@ -44,19 +53,25 @@ public JobPatchHeaders() { } /// the request applied. public JobPatchHeaders(System.Guid? clientRequestId = default(System.Guid?), System.Guid? requestId = default(System.Guid?), string eTag = default(string), System.DateTime? lastModified = default(System.DateTime?), string dataServiceId = default(string)) { - this.ClientRequestId = clientRequestId; - this.RequestId = requestId; - this.ETag = eTag; - this.LastModified = lastModified; - this.DataServiceId = dataServiceId; + ClientRequestId = clientRequestId; + RequestId = requestId; + ETag = eTag; + LastModified = lastModified; + DataServiceId = dataServiceId; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the client-request-id provided by the client during /// the request. This will be returned only if the /// return-client-request-id parameter was set to true. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "client-request-id")] + [JsonProperty(PropertyName = "client-request-id")] public System.Guid? ClientRequestId { get; set; } /// @@ -68,7 +83,7 @@ public JobPatchHeaders() { } /// request was made, the Batch account against which the request was /// made, and the region that account resides in. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "request-id")] + [JsonProperty(PropertyName = "request-id")] public System.Guid? RequestId { get; set; } /// @@ -78,21 +93,21 @@ public JobPatchHeaders() { } /// the If-Modified-Since, If-Unmodified-Since, If-Match or /// If-None-Match headers. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "ETag")] + [JsonProperty(PropertyName = "ETag")] public string ETag { get; set; } /// /// Gets or sets the time at which the resource was last modified. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "Last-Modified")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "Last-Modified")] public System.DateTime? LastModified { get; set; } /// /// Gets or sets the OData ID of the resource to which the request /// applied. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "DataServiceId")] + [JsonProperty(PropertyName = "DataServiceId")] public string DataServiceId { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobPatchOptions.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobPatchOptions.cs index 39c473000f44..6f03b561a7a6 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobPatchOptions.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobPatchOptions.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class JobPatchOptions /// /// Initializes a new instance of the JobPatchOptions class. /// - public JobPatchOptions() { } + public JobPatchOptions() + { + CustomInit(); + } /// /// Initializes a new instance of the JobPatchOptions class. @@ -52,21 +61,27 @@ public JobPatchOptions() { } /// modified since the specified time. public JobPatchOptions(int? timeout = default(int?), System.Guid? clientRequestId = default(System.Guid?), bool? returnClientRequestId = default(bool?), System.DateTime? ocpDate = default(System.DateTime?), string ifMatch = default(string), string ifNoneMatch = default(string), System.DateTime? ifModifiedSince = default(System.DateTime?), System.DateTime? ifUnmodifiedSince = default(System.DateTime?)) { - this.Timeout = timeout; - this.ClientRequestId = clientRequestId; - this.ReturnClientRequestId = returnClientRequestId; - this.OcpDate = ocpDate; - this.IfMatch = ifMatch; - this.IfNoneMatch = ifNoneMatch; - this.IfModifiedSince = ifModifiedSince; - this.IfUnmodifiedSince = ifUnmodifiedSince; + Timeout = timeout; + ClientRequestId = clientRequestId; + ReturnClientRequestId = returnClientRequestId; + OcpDate = ocpDate; + IfMatch = ifMatch; + IfNoneMatch = ifNoneMatch; + IfModifiedSince = ifModifiedSince; + IfUnmodifiedSince = ifUnmodifiedSince; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the maximum time that the server can spend processing /// the request, in seconds. The default is 30 seconds. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public int? Timeout { get; set; } /// @@ -74,14 +89,14 @@ public JobPatchOptions() { } /// a GUID with no decoration such as curly braces, e.g. /// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public System.Guid? ClientRequestId { get; set; } /// /// Gets or sets whether the server should return the client-request-id /// in the response. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public bool? ReturnClientRequestId { get; set; } /// @@ -89,8 +104,8 @@ public JobPatchOptions() { } /// typically set this to the current system clock time; set it /// explicitly if you are calling the REST API directly. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? OcpDate { get; set; } /// @@ -99,7 +114,7 @@ public JobPatchOptions() { } /// if the resource's current ETag on the service exactly matches the /// value specified by the client. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public string IfMatch { get; set; } /// @@ -108,7 +123,7 @@ public JobPatchOptions() { } /// if the resource's current ETag on the service does not match the /// value specified by the client. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public string IfNoneMatch { get; set; } /// @@ -117,8 +132,8 @@ public JobPatchOptions() { } /// if the resource on the service has been modified since the /// specified time. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? IfModifiedSince { get; set; } /// @@ -127,8 +142,8 @@ public JobPatchOptions() { } /// if the resource on the service has not been modified since the /// specified time. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? IfUnmodifiedSince { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobPatchParameter.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobPatchParameter.cs index 3c27272d4e2c..14f109fb115f 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobPatchParameter.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobPatchParameter.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class JobPatchParameter /// /// Initializes a new instance of the JobPatchParameter class. /// - public JobPatchParameter() { } + public JobPatchParameter() + { + CustomInit(); + } /// /// Initializes a new instance of the JobPatchParameter class. @@ -33,15 +42,21 @@ public JobPatchParameter() { } /// job's tasks. /// A list of name-value pairs associated with /// the job as metadata. - public JobPatchParameter(int? priority = default(int?), OnAllTasksComplete? onAllTasksComplete = default(OnAllTasksComplete?), JobConstraints constraints = default(JobConstraints), PoolInformation poolInfo = default(PoolInformation), System.Collections.Generic.IList metadata = default(System.Collections.Generic.IList)) + public JobPatchParameter(int? priority = default(int?), OnAllTasksComplete? onAllTasksComplete = default(OnAllTasksComplete?), JobConstraints constraints = default(JobConstraints), PoolInformation poolInfo = default(PoolInformation), IList metadata = default(IList)) { - this.Priority = priority; - this.OnAllTasksComplete = onAllTasksComplete; - this.Constraints = constraints; - this.PoolInfo = poolInfo; - this.Metadata = metadata; + Priority = priority; + OnAllTasksComplete = onAllTasksComplete; + Constraints = constraints; + PoolInfo = poolInfo; + Metadata = metadata; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the priority of the job. /// @@ -50,7 +65,7 @@ public JobPatchParameter() { } /// lowest priority and 1000 being the highest priority. If omitted, /// the priority of the job is left unchanged. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "priority")] + [JsonProperty(PropertyName = "priority")] public int? Priority { get; set; } /// @@ -66,7 +81,7 @@ public JobPatchParameter() { } /// directly, the HTTP status code is 400 (Bad Request). Possible /// values include: 'noAction', 'terminateJob' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "onAllTasksComplete")] + [JsonProperty(PropertyName = "onAllTasksComplete")] public OnAllTasksComplete? OnAllTasksComplete { get; set; } /// @@ -75,7 +90,7 @@ public JobPatchParameter() { } /// /// If omitted, the existing execution constraints are left unchanged. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "constraints")] + [JsonProperty(PropertyName = "constraints")] public JobConstraints Constraints { get; set; } /// @@ -91,7 +106,7 @@ public JobPatchParameter() { } /// has a poolLifetimeOption of job. If omitted, the job continues to /// run on its current pool. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "poolInfo")] + [JsonProperty(PropertyName = "poolInfo")] public PoolInformation PoolInfo { get; set; } /// @@ -101,24 +116,24 @@ public JobPatchParameter() { } /// /// If omitted, the existing job metadata is left unchanged. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "metadata")] - public System.Collections.Generic.IList Metadata { get; set; } + [JsonProperty(PropertyName = "metadata")] + public IList Metadata { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (this.PoolInfo != null) + if (PoolInfo != null) { - this.PoolInfo.Validate(); + PoolInfo.Validate(); } - if (this.Metadata != null) + if (Metadata != null) { - foreach (var element in this.Metadata) + foreach (var element in Metadata) { if (element != null) { diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobPreparationAndReleaseTaskExecutionInformation.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobPreparationAndReleaseTaskExecutionInformation.cs index a695dcaec008..7f3db9b8fcad 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobPreparationAndReleaseTaskExecutionInformation.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobPreparationAndReleaseTaskExecutionInformation.cs @@ -8,6 +8,10 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; using System.Linq; /// @@ -20,7 +24,10 @@ public partial class JobPreparationAndReleaseTaskExecutionInformation /// Initializes a new instance of the /// JobPreparationAndReleaseTaskExecutionInformation class. /// - public JobPreparationAndReleaseTaskExecutionInformation() { } + public JobPreparationAndReleaseTaskExecutionInformation() + { + CustomInit(); + } /// /// Initializes a new instance of the @@ -40,38 +47,44 @@ public JobPreparationAndReleaseTaskExecutionInformation() { } /// node. public JobPreparationAndReleaseTaskExecutionInformation(string poolId = default(string), string nodeId = default(string), string nodeUrl = default(string), JobPreparationTaskExecutionInformation jobPreparationTaskExecutionInfo = default(JobPreparationTaskExecutionInformation), JobReleaseTaskExecutionInformation jobReleaseTaskExecutionInfo = default(JobReleaseTaskExecutionInformation)) { - this.PoolId = poolId; - this.NodeId = nodeId; - this.NodeUrl = nodeUrl; - this.JobPreparationTaskExecutionInfo = jobPreparationTaskExecutionInfo; - this.JobReleaseTaskExecutionInfo = jobReleaseTaskExecutionInfo; + PoolId = poolId; + NodeId = nodeId; + NodeUrl = nodeUrl; + JobPreparationTaskExecutionInfo = jobPreparationTaskExecutionInfo; + JobReleaseTaskExecutionInfo = jobReleaseTaskExecutionInfo; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the ID of the pool containing the compute node to /// which this entry refers. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "poolId")] + [JsonProperty(PropertyName = "poolId")] public string PoolId { get; set; } /// /// Gets or sets the ID of the compute node to which this entry refers. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "nodeId")] + [JsonProperty(PropertyName = "nodeId")] public string NodeId { get; set; } /// /// Gets or sets the URL of the compute node to which this entry /// refers. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "nodeUrl")] + [JsonProperty(PropertyName = "nodeUrl")] public string NodeUrl { get; set; } /// /// Gets or sets information about the execution status of the Job /// Preparation task on this compute node. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "jobPreparationTaskExecutionInfo")] + [JsonProperty(PropertyName = "jobPreparationTaskExecutionInfo")] public JobPreparationTaskExecutionInformation JobPreparationTaskExecutionInfo { get; set; } /// @@ -82,24 +95,24 @@ public JobPreparationAndReleaseTaskExecutionInformation() { } /// This property is set only if the Job Release task has run on the /// node. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "jobReleaseTaskExecutionInfo")] + [JsonProperty(PropertyName = "jobReleaseTaskExecutionInfo")] public JobReleaseTaskExecutionInformation JobReleaseTaskExecutionInfo { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (this.JobPreparationTaskExecutionInfo != null) + if (JobPreparationTaskExecutionInfo != null) { - this.JobPreparationTaskExecutionInfo.Validate(); + JobPreparationTaskExecutionInfo.Validate(); } - if (this.JobReleaseTaskExecutionInfo != null) + if (JobReleaseTaskExecutionInfo != null) { - this.JobReleaseTaskExecutionInfo.Validate(); + JobReleaseTaskExecutionInfo.Validate(); } } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobPreparationTask.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobPreparationTask.cs index f50ce424db2f..f93da32cf2c7 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobPreparationTask.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobPreparationTask.cs @@ -8,18 +8,48 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// /// A Job Preparation task to run before any tasks of the job on any given /// compute node. /// + /// + /// You can use Job Preparation to prepare a compute node to run tasks for + /// the job. Activities commonly performed in Job Preparation include: + /// Downloading common resource files used by all the tasks in the job. The + /// Job Preparation task can download these common resource files to the + /// shared location on the compute node. (AZ_BATCH_NODE_ROOT_DIR\shared), + /// or starting a local service on the compute node so that all tasks of + /// that job can communicate with it. If the Job Preparation task fails + /// (that is, exhausts its retry count before exiting with exit code 0), + /// Batch will not run tasks of this job on the compute node. The node + /// remains ineligible to run tasks of this job until it is reimaged. The + /// node remains active and can be used for other jobs. The Job Preparation + /// task can run multiple times on the same compute node. Therefore, you + /// should write the Job Preparation task to handle re-execution. If the + /// compute node is rebooted, the Job Preparation task is run again on the + /// node before scheduling any other task of the job, if + /// rerunOnNodeRebootAfterSuccess is true or if the Job Preparation task + /// did not previously complete. If the compute node is reimaged, the Job + /// Preparation task is run again before scheduling any task of the job. + /// public partial class JobPreparationTask { /// /// Initializes a new instance of the JobPreparationTask class. /// - public JobPreparationTask() { } + public JobPreparationTask() + { + CustomInit(); + } /// /// Initializes a new instance of the JobPreparationTask class. @@ -37,24 +67,32 @@ public JobPreparationTask() { } /// Preparation task. /// Whether the Batch service should wait /// for the Job Preparation task to complete successfully before - /// scheduling any other tasks of the job on the compute node. + /// scheduling any other tasks of the job on the compute node. A Job + /// Preparation task has completed successfully if it exits with exit + /// code 0. /// The user identity under which the Job /// Preparation task runs. /// Whether the Batch /// service should rerun the Job Preparation task after a compute node /// reboots. - public JobPreparationTask(string commandLine, string id = default(string), System.Collections.Generic.IList resourceFiles = default(System.Collections.Generic.IList), System.Collections.Generic.IList environmentSettings = default(System.Collections.Generic.IList), TaskConstraints constraints = default(TaskConstraints), bool? waitForSuccess = default(bool?), UserIdentity userIdentity = default(UserIdentity), bool? rerunOnNodeRebootAfterSuccess = default(bool?)) + public JobPreparationTask(string commandLine, string id = default(string), IList resourceFiles = default(IList), IList environmentSettings = default(IList), TaskConstraints constraints = default(TaskConstraints), bool? waitForSuccess = default(bool?), UserIdentity userIdentity = default(UserIdentity), bool? rerunOnNodeRebootAfterSuccess = default(bool?)) { - this.Id = id; - this.CommandLine = commandLine; - this.ResourceFiles = resourceFiles; - this.EnvironmentSettings = environmentSettings; - this.Constraints = constraints; - this.WaitForSuccess = waitForSuccess; - this.UserIdentity = userIdentity; - this.RerunOnNodeRebootAfterSuccess = rerunOnNodeRebootAfterSuccess; + Id = id; + CommandLine = commandLine; + ResourceFiles = resourceFiles; + EnvironmentSettings = environmentSettings; + Constraints = constraints; + WaitForSuccess = waitForSuccess; + UserIdentity = userIdentity; + RerunOnNodeRebootAfterSuccess = rerunOnNodeRebootAfterSuccess; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets a string that uniquely identifies the Job Preparation /// task within the job. @@ -64,13 +102,13 @@ public JobPreparationTask() { } /// including hyphens and underscores and cannot contain more than 64 /// characters. If you do not specify this property, the Batch service /// assigns a default value of 'jobpreparation'. No other task in the - /// job can have the same id as the Job Preparation task. If you try to + /// job can have the same ID as the Job Preparation task. If you try to /// submit a task with the same id, the Batch service rejects the /// request with error code TaskIdSameAsJobPreparationTask; if you are /// calling the REST API directly, the HTTP status code is 409 /// (Conflict). /// - [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + [JsonProperty(PropertyName = "id")] public string Id { get; set; } /// @@ -83,7 +121,7 @@ public JobPreparationTask() { } /// should invoke the shell in the command line, for example using "cmd /// /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "commandLine")] + [JsonProperty(PropertyName = "commandLine")] public string CommandLine { get; set; } /// @@ -94,26 +132,27 @@ public JobPreparationTask() { } /// Files listed under this element are located in the task's working /// directory. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "resourceFiles")] - public System.Collections.Generic.IList ResourceFiles { get; set; } + [JsonProperty(PropertyName = "resourceFiles")] + public IList ResourceFiles { get; set; } /// /// Gets or sets a list of environment variable settings for the Job /// Preparation task. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "environmentSettings")] - public System.Collections.Generic.IList EnvironmentSettings { get; set; } + [JsonProperty(PropertyName = "environmentSettings")] + public IList EnvironmentSettings { get; set; } /// /// Gets or sets constraints that apply to the Job Preparation task. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "constraints")] + [JsonProperty(PropertyName = "constraints")] public TaskConstraints Constraints { get; set; } /// /// Gets or sets whether the Batch service should wait for the Job /// Preparation task to complete successfully before scheduling any - /// other tasks of the job on the compute node. + /// other tasks of the job on the compute node. A Job Preparation task + /// has completed successfully if it exits with exit code 0. /// /// /// If true and the Job Preparation task fails on a compute node, the @@ -129,7 +168,7 @@ public JobPreparationTask() { } /// new tasks will continue to be scheduled on the node. The default /// value is true. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "waitForSuccess")] + [JsonProperty(PropertyName = "waitForSuccess")] public bool? WaitForSuccess { get; set; } /// @@ -138,9 +177,10 @@ public JobPreparationTask() { } /// /// /// If omitted, the task runs as a non-administrative user unique to - /// the task. + /// the task on Windows nodes, or a a non-administrative user unique to + /// the pool on Linux nodes. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "userIdentity")] + [JsonProperty(PropertyName = "userIdentity")] public UserIdentity UserIdentity { get; set; } /// @@ -155,24 +195,24 @@ public JobPreparationTask() { } /// to behave correctly if run multiple times. The default value is /// true. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "rerunOnNodeRebootAfterSuccess")] + [JsonProperty(PropertyName = "rerunOnNodeRebootAfterSuccess")] public bool? RerunOnNodeRebootAfterSuccess { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (this.CommandLine == null) + if (CommandLine == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "CommandLine"); + throw new ValidationException(ValidationRules.CannotBeNull, "CommandLine"); } - if (this.ResourceFiles != null) + if (ResourceFiles != null) { - foreach (var element in this.ResourceFiles) + foreach (var element in ResourceFiles) { if (element != null) { @@ -180,9 +220,9 @@ public virtual void Validate() } } } - if (this.EnvironmentSettings != null) + if (EnvironmentSettings != null) { - foreach (var element1 in this.EnvironmentSettings) + foreach (var element1 in EnvironmentSettings) { if (element1 != null) { diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobPreparationTaskExecutionInformation.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobPreparationTaskExecutionInformation.cs index 610bf3efef63..15c2706bd3aa 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobPreparationTaskExecutionInformation.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobPreparationTaskExecutionInformation.cs @@ -8,6 +8,10 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; using System.Linq; /// @@ -20,7 +24,10 @@ public partial class JobPreparationTaskExecutionInformation /// Initializes a new instance of the /// JobPreparationTaskExecutionInformation class. /// - public JobPreparationTaskExecutionInformation() { } + public JobPreparationTaskExecutionInformation() + { + CustomInit(); + } /// /// Initializes a new instance of the @@ -52,25 +59,32 @@ public JobPreparationTaskExecutionInformation() { } /// The result of the task execution. public JobPreparationTaskExecutionInformation(System.DateTime startTime, JobPreparationTaskState state, int retryCount, System.DateTime? endTime = default(System.DateTime?), string taskRootDirectory = default(string), string taskRootDirectoryUrl = default(string), int? exitCode = default(int?), TaskFailureInformation failureInfo = default(TaskFailureInformation), System.DateTime? lastRetryTime = default(System.DateTime?), TaskExecutionResult? result = default(TaskExecutionResult?)) { - this.StartTime = startTime; - this.EndTime = endTime; - this.State = state; - this.TaskRootDirectory = taskRootDirectory; - this.TaskRootDirectoryUrl = taskRootDirectoryUrl; - this.ExitCode = exitCode; - this.FailureInfo = failureInfo; - this.RetryCount = retryCount; - this.LastRetryTime = lastRetryTime; - this.Result = result; + StartTime = startTime; + EndTime = endTime; + State = state; + TaskRootDirectory = taskRootDirectory; + TaskRootDirectoryUrl = taskRootDirectoryUrl; + ExitCode = exitCode; + FailureInfo = failureInfo; + RetryCount = retryCount; + LastRetryTime = lastRetryTime; + Result = result; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the time at which the task started running. /// /// - /// Note that every time the task is restarted, this value is updated. + /// If the task has been restarted or retried, this is the most recent + /// time at which the task started running. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "startTime")] + [JsonProperty(PropertyName = "startTime")] public System.DateTime StartTime { get; set; } /// @@ -79,7 +93,7 @@ public JobPreparationTaskExecutionInformation() { } /// /// This property is set only if the task is in the Completed state. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "endTime")] + [JsonProperty(PropertyName = "endTime")] public System.DateTime? EndTime { get; set; } /// @@ -87,13 +101,15 @@ public JobPreparationTaskExecutionInformation() { } /// compute node. /// /// + /// Values are: + /// /// running - the task is currently running (including retrying). /// completed - the task has exited with exit code 0, or the task has /// exhausted its retry limit, or the Batch service was unable to start - /// the task due to scheduling errors. Possible values include: - /// 'running', 'completed' + /// the task due to task preparation errors (such as resource file + /// download failures). Possible values include: 'running', 'completed' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "state")] + [JsonProperty(PropertyName = "state")] public JobPreparationTaskState State { get; set; } /// @@ -101,14 +117,14 @@ public JobPreparationTaskExecutionInformation() { } /// compute node. You can use this path to retrieve files created by /// the task, such as log files. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "taskRootDirectory")] + [JsonProperty(PropertyName = "taskRootDirectory")] public string TaskRootDirectory { get; set; } /// /// Gets or sets the URL to the root directory of the Job Preparation /// task on the compute node. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "taskRootDirectoryUrl")] + [JsonProperty(PropertyName = "taskRootDirectoryUrl")] public string TaskRootDirectoryUrl { get; set; } /// @@ -125,7 +141,7 @@ public JobPreparationTaskExecutionInformation() { } /// compute node operating system, such as when a process is forcibly /// terminated. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "exitCode")] + [JsonProperty(PropertyName = "exitCode")] public int? ExitCode { get; set; } /// @@ -135,7 +151,7 @@ public JobPreparationTaskExecutionInformation() { } /// This property is set only if the task is in the completed state and /// encountered a failure. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "failureInfo")] + [JsonProperty(PropertyName = "failureInfo")] public TaskFailureInformation FailureInfo { get; set; } /// @@ -145,7 +161,13 @@ public JobPreparationTaskExecutionInformation() { } /// upload errors are not retried. The Batch service will retry the /// task up to the limit specified by the constraints. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "retryCount")] + /// + /// Task application failures (non-zero exit code) are retried, + /// pre-processing errors (the task could not be run) and file upload + /// errors are not retried. The Batch service will retry the task up to + /// the limit specified by the constraints. + /// + [JsonProperty(PropertyName = "retryCount")] public int RetryCount { get; set; } /// @@ -160,7 +182,7 @@ public JobPreparationTaskExecutionInformation() { } /// during a retry, then the startTime is updated but the lastRetryTime /// is not. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "lastRetryTime")] + [JsonProperty(PropertyName = "lastRetryTime")] public System.DateTime? LastRetryTime { get; set; } /// @@ -171,20 +193,20 @@ public JobPreparationTaskExecutionInformation() { } /// found in the failureInfo property. Possible values include: /// 'success', 'failure' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "result")] + [JsonProperty(PropertyName = "result")] public TaskExecutionResult? Result { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (this.FailureInfo != null) + if (FailureInfo != null) { - this.FailureInfo.Validate(); + FailureInfo.Validate(); } } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobPreparationTaskState.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobPreparationTaskState.cs index 375228d9bc99..279e3bcbcf81 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobPreparationTaskState.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobPreparationTaskState.cs @@ -8,16 +8,52 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; /// /// Defines values for JobPreparationTaskState. /// - [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + [JsonConverter(typeof(StringEnumConverter))] public enum JobPreparationTaskState { - [System.Runtime.Serialization.EnumMember(Value = "running")] + [EnumMember(Value = "running")] Running, - [System.Runtime.Serialization.EnumMember(Value = "completed")] + [EnumMember(Value = "completed")] Completed } + internal static class JobPreparationTaskStateEnumExtension + { + internal static string ToSerializedValue(this JobPreparationTaskState? value) => + value == null ? null : ((JobPreparationTaskState)value).ToSerializedValue(); + + internal static string ToSerializedValue(this JobPreparationTaskState value) + { + switch( value ) + { + case JobPreparationTaskState.Running: + return "running"; + case JobPreparationTaskState.Completed: + return "completed"; + } + return null; + } + + internal static JobPreparationTaskState? ParseJobPreparationTaskState(this string value) + { + switch( value ) + { + case "running": + return JobPreparationTaskState.Running; + case "completed": + return JobPreparationTaskState.Completed; + } + return null; + } + } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobReleaseTask.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobReleaseTask.cs index e76a4e801fbc..e63b6ac8b872 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobReleaseTask.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobReleaseTask.cs @@ -8,18 +8,47 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// /// A Job Release task to run on job completion on any compute node where /// the job has run. /// + /// + /// The Job Release task runs when the job ends, because of one of the + /// following: The user calls the Terminate Job API, or the Delete Job API + /// while the job is still active, the job's maximum wall clock time + /// constraint is reached, and the job is still active, or the job's Job + /// Manager task completed, and the job is configured to terminate when the + /// Job Manager completes. The Job Release task runs on each compute node + /// where tasks of the job have run and the Job Preparation task ran and + /// completed. If you reimage a compute node after it has run the Job + /// Preparation task, and the job ends without any further tasks of the job + /// running on that compute node (and hence the Job Preparation task does + /// not re-run), then the Job Release task does not run on that node. If a + /// compute node reboots while the Job Release task is still running, the + /// Job Release task runs again when the compute node starts up. The job is + /// not marked as complete until all Job Release tasks have completed. The + /// Job Release task runs in the background. It does not occupy a + /// scheduling slot; that is, it does not count towards the maxTasksPerNode + /// limit specified on the pool. + /// public partial class JobReleaseTask { /// /// Initializes a new instance of the JobReleaseTask class. /// - public JobReleaseTask() { } + public JobReleaseTask() + { + CustomInit(); + } /// /// Initializes a new instance of the JobReleaseTask class. @@ -47,17 +76,23 @@ public JobReleaseTask() { } /// contents. /// The user identity under which the Job /// Release task runs. - public JobReleaseTask(string commandLine, string id = default(string), System.Collections.Generic.IList resourceFiles = default(System.Collections.Generic.IList), System.Collections.Generic.IList environmentSettings = default(System.Collections.Generic.IList), System.TimeSpan? maxWallClockTime = default(System.TimeSpan?), System.TimeSpan? retentionTime = default(System.TimeSpan?), UserIdentity userIdentity = default(UserIdentity)) + public JobReleaseTask(string commandLine, string id = default(string), IList resourceFiles = default(IList), IList environmentSettings = default(IList), System.TimeSpan? maxWallClockTime = default(System.TimeSpan?), System.TimeSpan? retentionTime = default(System.TimeSpan?), UserIdentity userIdentity = default(UserIdentity)) { - this.Id = id; - this.CommandLine = commandLine; - this.ResourceFiles = resourceFiles; - this.EnvironmentSettings = environmentSettings; - this.MaxWallClockTime = maxWallClockTime; - this.RetentionTime = retentionTime; - this.UserIdentity = userIdentity; + Id = id; + CommandLine = commandLine; + ResourceFiles = resourceFiles; + EnvironmentSettings = environmentSettings; + MaxWallClockTime = maxWallClockTime; + RetentionTime = retentionTime; + UserIdentity = userIdentity; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets a string that uniquely identifies the Job Release task /// within the job. @@ -67,12 +102,12 @@ public JobReleaseTask() { } /// including hyphens and underscores and cannot contain more than 64 /// characters. If you do not specify this property, the Batch service /// assigns a default value of 'jobrelease'. No other task in the job - /// can have the same id as the Job Release task. If you try to submit + /// can have the same ID as the Job Release task. If you try to submit /// a task with the same id, the Batch service rejects the request with /// error code TaskIdSameAsJobReleaseTask; if you are calling the REST /// API directly, the HTTP status code is 409 (Conflict). /// - [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + [JsonProperty(PropertyName = "id")] public string Id { get; set; } /// @@ -85,7 +120,7 @@ public JobReleaseTask() { } /// should invoke the shell in the command line, for example using "cmd /// /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "commandLine")] + [JsonProperty(PropertyName = "commandLine")] public string CommandLine { get; set; } /// @@ -96,15 +131,15 @@ public JobReleaseTask() { } /// Files listed under this element are located in the task's working /// directory. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "resourceFiles")] - public System.Collections.Generic.IList ResourceFiles { get; set; } + [JsonProperty(PropertyName = "resourceFiles")] + public IList ResourceFiles { get; set; } /// /// Gets or sets a list of environment variable settings for the Job /// Release task. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "environmentSettings")] - public System.Collections.Generic.IList EnvironmentSettings { get; set; } + [JsonProperty(PropertyName = "environmentSettings")] + public IList EnvironmentSettings { get; set; } /// /// Gets or sets the maximum elapsed time that the Job Release task may @@ -115,7 +150,7 @@ public JobReleaseTask() { } /// Batch service rejects it with an error; if you are calling the REST /// API directly, the HTTP status code is 400 (Bad Request). /// - [Newtonsoft.Json.JsonProperty(PropertyName = "maxWallClockTime")] + [JsonProperty(PropertyName = "maxWallClockTime")] public System.TimeSpan? MaxWallClockTime { get; set; } /// @@ -127,7 +162,7 @@ public JobReleaseTask() { } /// The default is infinite, i.e. the task directory will be retained /// until the compute node is removed or reimaged. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "retentionTime")] + [JsonProperty(PropertyName = "retentionTime")] public System.TimeSpan? RetentionTime { get; set; } /// @@ -138,24 +173,24 @@ public JobReleaseTask() { } /// If omitted, the task runs as a non-administrative user unique to /// the task. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "userIdentity")] + [JsonProperty(PropertyName = "userIdentity")] public UserIdentity UserIdentity { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (this.CommandLine == null) + if (CommandLine == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "CommandLine"); + throw new ValidationException(ValidationRules.CannotBeNull, "CommandLine"); } - if (this.ResourceFiles != null) + if (ResourceFiles != null) { - foreach (var element in this.ResourceFiles) + foreach (var element in ResourceFiles) { if (element != null) { @@ -163,9 +198,9 @@ public virtual void Validate() } } } - if (this.EnvironmentSettings != null) + if (EnvironmentSettings != null) { - foreach (var element1 in this.EnvironmentSettings) + foreach (var element1 in EnvironmentSettings) { if (element1 != null) { diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobReleaseTaskExecutionInformation.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobReleaseTaskExecutionInformation.cs index 00bc2ae709b6..b2fad9453617 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobReleaseTaskExecutionInformation.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobReleaseTaskExecutionInformation.cs @@ -8,6 +8,10 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; using System.Linq; /// @@ -20,15 +24,17 @@ public partial class JobReleaseTaskExecutionInformation /// Initializes a new instance of the /// JobReleaseTaskExecutionInformation class. /// - public JobReleaseTaskExecutionInformation() { } + public JobReleaseTaskExecutionInformation() + { + CustomInit(); + } /// /// Initializes a new instance of the /// JobReleaseTaskExecutionInformation class. /// - /// The time at which the task started running. - /// Note that every time the task is restarted, this value is - /// updated. + /// The time at which the task started + /// running. /// The current state of the Job Release task on /// the compute node. /// The time at which the Job Release task @@ -45,21 +51,30 @@ public JobReleaseTaskExecutionInformation() { } /// The result of the task execution. public JobReleaseTaskExecutionInformation(System.DateTime startTime, JobReleaseTaskState state, System.DateTime? endTime = default(System.DateTime?), string taskRootDirectory = default(string), string taskRootDirectoryUrl = default(string), int? exitCode = default(int?), TaskFailureInformation failureInfo = default(TaskFailureInformation), TaskExecutionResult? result = default(TaskExecutionResult?)) { - this.StartTime = startTime; - this.EndTime = endTime; - this.State = state; - this.TaskRootDirectory = taskRootDirectory; - this.TaskRootDirectoryUrl = taskRootDirectoryUrl; - this.ExitCode = exitCode; - this.FailureInfo = failureInfo; - this.Result = result; + StartTime = startTime; + EndTime = endTime; + State = state; + TaskRootDirectory = taskRootDirectory; + TaskRootDirectoryUrl = taskRootDirectoryUrl; + ExitCode = exitCode; + FailureInfo = failureInfo; + Result = result; + CustomInit(); } /// - /// Gets or sets the time at which the task started running. Note that - /// every time the task is restarted, this value is updated. + /// An initialization method that performs custom operations like setting defaults /// - [Newtonsoft.Json.JsonProperty(PropertyName = "startTime")] + partial void CustomInit(); + + /// + /// Gets or sets the time at which the task started running. + /// + /// + /// If the task has been restarted or retried, this is the most recent + /// time at which the task started running. + /// + [JsonProperty(PropertyName = "startTime")] public System.DateTime StartTime { get; set; } /// @@ -68,7 +83,7 @@ public JobReleaseTaskExecutionInformation() { } /// /// This property is set only if the task is in the Completed state. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "endTime")] + [JsonProperty(PropertyName = "endTime")] public System.DateTime? EndTime { get; set; } /// @@ -76,12 +91,15 @@ public JobReleaseTaskExecutionInformation() { } /// compute node. /// /// + /// Values are: + /// /// running - the task is currently running (including retrying). /// completed - the task has exited, or the Batch service was unable to - /// start the task due to scheduling errors. Possible values include: - /// 'running', 'completed' + /// start the task due to task preparation errors (such as resource + /// file download failures). Possible values include: 'running', + /// 'completed' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "state")] + [JsonProperty(PropertyName = "state")] public JobReleaseTaskState State { get; set; } /// @@ -89,14 +107,14 @@ public JobReleaseTaskExecutionInformation() { } /// compute node. You can use this path to retrieve files created by /// the task, such as log files. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "taskRootDirectory")] + [JsonProperty(PropertyName = "taskRootDirectory")] public string TaskRootDirectory { get; set; } /// /// Gets or sets the URL to the root directory of the Job Release task /// on the compute node. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "taskRootDirectoryUrl")] + [JsonProperty(PropertyName = "taskRootDirectoryUrl")] public string TaskRootDirectoryUrl { get; set; } /// @@ -113,7 +131,7 @@ public JobReleaseTaskExecutionInformation() { } /// compute node operating system, such as when a process is forcibly /// terminated. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "exitCode")] + [JsonProperty(PropertyName = "exitCode")] public int? ExitCode { get; set; } /// @@ -123,7 +141,7 @@ public JobReleaseTaskExecutionInformation() { } /// This property is set only if the task is in the completed state and /// encountered a failure. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "failureInfo")] + [JsonProperty(PropertyName = "failureInfo")] public TaskFailureInformation FailureInfo { get; set; } /// @@ -134,20 +152,20 @@ public JobReleaseTaskExecutionInformation() { } /// found in the failureInfo property. Possible values include: /// 'success', 'failure' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "result")] + [JsonProperty(PropertyName = "result")] public TaskExecutionResult? Result { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (this.FailureInfo != null) + if (FailureInfo != null) { - this.FailureInfo.Validate(); + FailureInfo.Validate(); } } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobReleaseTaskState.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobReleaseTaskState.cs index ff32d1adca4a..f9bb15b5aa52 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobReleaseTaskState.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobReleaseTaskState.cs @@ -8,16 +8,52 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; /// /// Defines values for JobReleaseTaskState. /// - [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + [JsonConverter(typeof(StringEnumConverter))] public enum JobReleaseTaskState { - [System.Runtime.Serialization.EnumMember(Value = "running")] + [EnumMember(Value = "running")] Running, - [System.Runtime.Serialization.EnumMember(Value = "completed")] + [EnumMember(Value = "completed")] Completed } + internal static class JobReleaseTaskStateEnumExtension + { + internal static string ToSerializedValue(this JobReleaseTaskState? value) => + value == null ? null : ((JobReleaseTaskState)value).ToSerializedValue(); + + internal static string ToSerializedValue(this JobReleaseTaskState value) + { + switch( value ) + { + case JobReleaseTaskState.Running: + return "running"; + case JobReleaseTaskState.Completed: + return "completed"; + } + return null; + } + + internal static JobReleaseTaskState? ParseJobReleaseTaskState(this string value) + { + switch( value ) + { + case "running": + return JobReleaseTaskState.Running; + case "completed": + return JobReleaseTaskState.Completed; + } + return null; + } + } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobScheduleAddHeaders.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobScheduleAddHeaders.cs index e9836edfc3b5..ac67f39dd4d0 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobScheduleAddHeaders.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobScheduleAddHeaders.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class JobScheduleAddHeaders /// /// Initializes a new instance of the JobScheduleAddHeaders class. /// - public JobScheduleAddHeaders() { } + public JobScheduleAddHeaders() + { + CustomInit(); + } /// /// Initializes a new instance of the JobScheduleAddHeaders class. @@ -44,19 +53,25 @@ public JobScheduleAddHeaders() { } /// the request applied. public JobScheduleAddHeaders(System.Guid? clientRequestId = default(System.Guid?), System.Guid? requestId = default(System.Guid?), string eTag = default(string), System.DateTime? lastModified = default(System.DateTime?), string dataServiceId = default(string)) { - this.ClientRequestId = clientRequestId; - this.RequestId = requestId; - this.ETag = eTag; - this.LastModified = lastModified; - this.DataServiceId = dataServiceId; + ClientRequestId = clientRequestId; + RequestId = requestId; + ETag = eTag; + LastModified = lastModified; + DataServiceId = dataServiceId; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the client-request-id provided by the client during /// the request. This will be returned only if the /// return-client-request-id parameter was set to true. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "client-request-id")] + [JsonProperty(PropertyName = "client-request-id")] public System.Guid? ClientRequestId { get; set; } /// @@ -68,7 +83,7 @@ public JobScheduleAddHeaders() { } /// request was made, the Batch account against which the request was /// made, and the region that account resides in. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "request-id")] + [JsonProperty(PropertyName = "request-id")] public System.Guid? RequestId { get; set; } /// @@ -78,21 +93,21 @@ public JobScheduleAddHeaders() { } /// the If-Modified-Since, If-Unmodified-Since, If-Match or /// If-None-Match headers. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "ETag")] + [JsonProperty(PropertyName = "ETag")] public string ETag { get; set; } /// /// Gets or sets the time at which the resource was last modified. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "Last-Modified")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "Last-Modified")] public System.DateTime? LastModified { get; set; } /// /// Gets or sets the OData ID of the resource to which the request /// applied. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "DataServiceId")] + [JsonProperty(PropertyName = "DataServiceId")] public string DataServiceId { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobScheduleAddOptions.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobScheduleAddOptions.cs index c38d1b1d0002..fbc6a6400ce7 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobScheduleAddOptions.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobScheduleAddOptions.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class JobScheduleAddOptions /// /// Initializes a new instance of the JobScheduleAddOptions class. /// - public JobScheduleAddOptions() { } + public JobScheduleAddOptions() + { + CustomInit(); + } /// /// Initializes a new instance of the JobScheduleAddOptions class. @@ -36,17 +45,23 @@ public JobScheduleAddOptions() { } /// it explicitly if you are calling the REST API directly. public JobScheduleAddOptions(int? timeout = default(int?), System.Guid? clientRequestId = default(System.Guid?), bool? returnClientRequestId = default(bool?), System.DateTime? ocpDate = default(System.DateTime?)) { - this.Timeout = timeout; - this.ClientRequestId = clientRequestId; - this.ReturnClientRequestId = returnClientRequestId; - this.OcpDate = ocpDate; + Timeout = timeout; + ClientRequestId = clientRequestId; + ReturnClientRequestId = returnClientRequestId; + OcpDate = ocpDate; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the maximum time that the server can spend processing /// the request, in seconds. The default is 30 seconds. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public int? Timeout { get; set; } /// @@ -54,14 +69,14 @@ public JobScheduleAddOptions() { } /// a GUID with no decoration such as curly braces, e.g. /// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public System.Guid? ClientRequestId { get; set; } /// /// Gets or sets whether the server should return the client-request-id /// in the response. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public bool? ReturnClientRequestId { get; set; } /// @@ -69,8 +84,8 @@ public JobScheduleAddOptions() { } /// typically set this to the current system clock time; set it /// explicitly if you are calling the REST API directly. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? OcpDate { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobScheduleAddParameter.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobScheduleAddParameter.cs index b46970d4912b..7cce090d7f22 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobScheduleAddParameter.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobScheduleAddParameter.cs @@ -8,6 +8,13 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// @@ -19,7 +26,10 @@ public partial class JobScheduleAddParameter /// /// Initializes a new instance of the JobScheduleAddParameter class. /// - public JobScheduleAddParameter() { } + public JobScheduleAddParameter() + { + CustomInit(); + } /// /// Initializes a new instance of the JobScheduleAddParameter class. @@ -34,15 +44,21 @@ public JobScheduleAddParameter() { } /// schedule. /// A list of name-value pairs associated with /// the schedule as metadata. - public JobScheduleAddParameter(string id, Schedule schedule, JobSpecification jobSpecification, string displayName = default(string), System.Collections.Generic.IList metadata = default(System.Collections.Generic.IList)) + public JobScheduleAddParameter(string id, Schedule schedule, JobSpecification jobSpecification, string displayName = default(string), IList metadata = default(IList)) { - this.Id = id; - this.DisplayName = displayName; - this.Schedule = schedule; - this.JobSpecification = jobSpecification; - this.Metadata = metadata; + Id = id; + DisplayName = displayName; + Schedule = schedule; + JobSpecification = jobSpecification; + Metadata = metadata; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets a string that uniquely identifies the schedule within /// the account. @@ -50,11 +66,11 @@ public JobScheduleAddParameter() { } /// /// The ID can contain any combination of alphanumeric characters /// including hyphens and underscores, and cannot contain more than 64 - /// characters. The id is case-preserving and case-insensitive (that - /// is, you may not have two ids within an account that differ only by + /// characters. The ID is case-preserving and case-insensitive (that + /// is, you may not have two IDs within an account that differ only by /// case). /// - [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + [JsonProperty(PropertyName = "id")] public string Id { get; set; } /// @@ -64,20 +80,20 @@ public JobScheduleAddParameter() { } /// The display name need not be unique and can contain any Unicode /// characters up to a maximum length of 1024. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "displayName")] + [JsonProperty(PropertyName = "displayName")] public string DisplayName { get; set; } /// /// Gets or sets the schedule according to which jobs will be created. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "schedule")] + [JsonProperty(PropertyName = "schedule")] public Schedule Schedule { get; set; } /// /// Gets or sets the details of the jobs to be created on this /// schedule. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "jobSpecification")] + [JsonProperty(PropertyName = "jobSpecification")] public JobSpecification JobSpecification { get; set; } /// @@ -88,36 +104,36 @@ public JobScheduleAddParameter() { } /// The Batch service does not assign any meaning to metadata; it is /// solely for the use of user code. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "metadata")] - public System.Collections.Generic.IList Metadata { get; set; } + [JsonProperty(PropertyName = "metadata")] + public IList Metadata { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (this.Id == null) + if (Id == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Id"); + throw new ValidationException(ValidationRules.CannotBeNull, "Id"); } - if (this.Schedule == null) + if (Schedule == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Schedule"); + throw new ValidationException(ValidationRules.CannotBeNull, "Schedule"); } - if (this.JobSpecification == null) + if (JobSpecification == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "JobSpecification"); + throw new ValidationException(ValidationRules.CannotBeNull, "JobSpecification"); } - if (this.JobSpecification != null) + if (JobSpecification != null) { - this.JobSpecification.Validate(); + JobSpecification.Validate(); } - if (this.Metadata != null) + if (Metadata != null) { - foreach (var element in this.Metadata) + foreach (var element in Metadata) { if (element != null) { diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobScheduleDeleteHeaders.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobScheduleDeleteHeaders.cs index 2bc206b03c6e..19e401f711a6 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobScheduleDeleteHeaders.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobScheduleDeleteHeaders.cs @@ -8,6 +8,10 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +22,10 @@ public partial class JobScheduleDeleteHeaders /// /// Initializes a new instance of the JobScheduleDeleteHeaders class. /// - public JobScheduleDeleteHeaders() { } + public JobScheduleDeleteHeaders() + { + CustomInit(); + } /// /// Initializes a new instance of the JobScheduleDeleteHeaders class. @@ -35,16 +42,22 @@ public JobScheduleDeleteHeaders() { } /// request was made, and the region that account resides in. public JobScheduleDeleteHeaders(string clientRequestId = default(string), string requestId = default(string)) { - this.ClientRequestId = clientRequestId; - this.RequestId = requestId; + ClientRequestId = clientRequestId; + RequestId = requestId; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the client-request-id provided by the client during /// the request. This will be returned only if the /// return-client-request-id parameter was set to true. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "client-request-id")] + [JsonProperty(PropertyName = "client-request-id")] public string ClientRequestId { get; set; } /// @@ -56,7 +69,7 @@ public JobScheduleDeleteHeaders() { } /// request was made, the Batch account against which the request was /// made, and the region that account resides in. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "request-id")] + [JsonProperty(PropertyName = "request-id")] public string RequestId { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobScheduleDeleteOptions.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobScheduleDeleteOptions.cs index 87fcef8baf4a..ebcf740b7b03 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobScheduleDeleteOptions.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobScheduleDeleteOptions.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class JobScheduleDeleteOptions /// /// Initializes a new instance of the JobScheduleDeleteOptions class. /// - public JobScheduleDeleteOptions() { } + public JobScheduleDeleteOptions() + { + CustomInit(); + } /// /// Initializes a new instance of the JobScheduleDeleteOptions class. @@ -52,21 +61,27 @@ public JobScheduleDeleteOptions() { } /// modified since the specified time. public JobScheduleDeleteOptions(int? timeout = default(int?), System.Guid? clientRequestId = default(System.Guid?), bool? returnClientRequestId = default(bool?), System.DateTime? ocpDate = default(System.DateTime?), string ifMatch = default(string), string ifNoneMatch = default(string), System.DateTime? ifModifiedSince = default(System.DateTime?), System.DateTime? ifUnmodifiedSince = default(System.DateTime?)) { - this.Timeout = timeout; - this.ClientRequestId = clientRequestId; - this.ReturnClientRequestId = returnClientRequestId; - this.OcpDate = ocpDate; - this.IfMatch = ifMatch; - this.IfNoneMatch = ifNoneMatch; - this.IfModifiedSince = ifModifiedSince; - this.IfUnmodifiedSince = ifUnmodifiedSince; + Timeout = timeout; + ClientRequestId = clientRequestId; + ReturnClientRequestId = returnClientRequestId; + OcpDate = ocpDate; + IfMatch = ifMatch; + IfNoneMatch = ifNoneMatch; + IfModifiedSince = ifModifiedSince; + IfUnmodifiedSince = ifUnmodifiedSince; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the maximum time that the server can spend processing /// the request, in seconds. The default is 30 seconds. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public int? Timeout { get; set; } /// @@ -74,14 +89,14 @@ public JobScheduleDeleteOptions() { } /// a GUID with no decoration such as curly braces, e.g. /// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public System.Guid? ClientRequestId { get; set; } /// /// Gets or sets whether the server should return the client-request-id /// in the response. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public bool? ReturnClientRequestId { get; set; } /// @@ -89,8 +104,8 @@ public JobScheduleDeleteOptions() { } /// typically set this to the current system clock time; set it /// explicitly if you are calling the REST API directly. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? OcpDate { get; set; } /// @@ -99,7 +114,7 @@ public JobScheduleDeleteOptions() { } /// if the resource's current ETag on the service exactly matches the /// value specified by the client. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public string IfMatch { get; set; } /// @@ -108,7 +123,7 @@ public JobScheduleDeleteOptions() { } /// if the resource's current ETag on the service does not match the /// value specified by the client. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public string IfNoneMatch { get; set; } /// @@ -117,8 +132,8 @@ public JobScheduleDeleteOptions() { } /// if the resource on the service has been modified since the /// specified time. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? IfModifiedSince { get; set; } /// @@ -127,8 +142,8 @@ public JobScheduleDeleteOptions() { } /// if the resource on the service has not been modified since the /// specified time. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? IfUnmodifiedSince { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobScheduleDisableHeaders.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobScheduleDisableHeaders.cs index 446f66ed79c7..8b11194578a8 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobScheduleDisableHeaders.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobScheduleDisableHeaders.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class JobScheduleDisableHeaders /// /// Initializes a new instance of the JobScheduleDisableHeaders class. /// - public JobScheduleDisableHeaders() { } + public JobScheduleDisableHeaders() + { + CustomInit(); + } /// /// Initializes a new instance of the JobScheduleDisableHeaders class. @@ -44,19 +53,25 @@ public JobScheduleDisableHeaders() { } /// the request applied. public JobScheduleDisableHeaders(System.Guid? clientRequestId = default(System.Guid?), System.Guid? requestId = default(System.Guid?), string eTag = default(string), System.DateTime? lastModified = default(System.DateTime?), string dataServiceId = default(string)) { - this.ClientRequestId = clientRequestId; - this.RequestId = requestId; - this.ETag = eTag; - this.LastModified = lastModified; - this.DataServiceId = dataServiceId; + ClientRequestId = clientRequestId; + RequestId = requestId; + ETag = eTag; + LastModified = lastModified; + DataServiceId = dataServiceId; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the client-request-id provided by the client during /// the request. This will be returned only if the /// return-client-request-id parameter was set to true. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "client-request-id")] + [JsonProperty(PropertyName = "client-request-id")] public System.Guid? ClientRequestId { get; set; } /// @@ -68,7 +83,7 @@ public JobScheduleDisableHeaders() { } /// request was made, the Batch account against which the request was /// made, and the region that account resides in. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "request-id")] + [JsonProperty(PropertyName = "request-id")] public System.Guid? RequestId { get; set; } /// @@ -78,21 +93,21 @@ public JobScheduleDisableHeaders() { } /// the If-Modified-Since, If-Unmodified-Since, If-Match or /// If-None-Match headers. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "ETag")] + [JsonProperty(PropertyName = "ETag")] public string ETag { get; set; } /// /// Gets or sets the time at which the resource was last modified. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "Last-Modified")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "Last-Modified")] public System.DateTime? LastModified { get; set; } /// /// Gets or sets the OData ID of the resource to which the request /// applied. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "DataServiceId")] + [JsonProperty(PropertyName = "DataServiceId")] public string DataServiceId { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobScheduleDisableOptions.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobScheduleDisableOptions.cs index 43e086011215..12915865f22e 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobScheduleDisableOptions.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobScheduleDisableOptions.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class JobScheduleDisableOptions /// /// Initializes a new instance of the JobScheduleDisableOptions class. /// - public JobScheduleDisableOptions() { } + public JobScheduleDisableOptions() + { + CustomInit(); + } /// /// Initializes a new instance of the JobScheduleDisableOptions class. @@ -52,21 +61,27 @@ public JobScheduleDisableOptions() { } /// modified since the specified time. public JobScheduleDisableOptions(int? timeout = default(int?), System.Guid? clientRequestId = default(System.Guid?), bool? returnClientRequestId = default(bool?), System.DateTime? ocpDate = default(System.DateTime?), string ifMatch = default(string), string ifNoneMatch = default(string), System.DateTime? ifModifiedSince = default(System.DateTime?), System.DateTime? ifUnmodifiedSince = default(System.DateTime?)) { - this.Timeout = timeout; - this.ClientRequestId = clientRequestId; - this.ReturnClientRequestId = returnClientRequestId; - this.OcpDate = ocpDate; - this.IfMatch = ifMatch; - this.IfNoneMatch = ifNoneMatch; - this.IfModifiedSince = ifModifiedSince; - this.IfUnmodifiedSince = ifUnmodifiedSince; + Timeout = timeout; + ClientRequestId = clientRequestId; + ReturnClientRequestId = returnClientRequestId; + OcpDate = ocpDate; + IfMatch = ifMatch; + IfNoneMatch = ifNoneMatch; + IfModifiedSince = ifModifiedSince; + IfUnmodifiedSince = ifUnmodifiedSince; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the maximum time that the server can spend processing /// the request, in seconds. The default is 30 seconds. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public int? Timeout { get; set; } /// @@ -74,14 +89,14 @@ public JobScheduleDisableOptions() { } /// a GUID with no decoration such as curly braces, e.g. /// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public System.Guid? ClientRequestId { get; set; } /// /// Gets or sets whether the server should return the client-request-id /// in the response. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public bool? ReturnClientRequestId { get; set; } /// @@ -89,8 +104,8 @@ public JobScheduleDisableOptions() { } /// typically set this to the current system clock time; set it /// explicitly if you are calling the REST API directly. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? OcpDate { get; set; } /// @@ -99,7 +114,7 @@ public JobScheduleDisableOptions() { } /// if the resource's current ETag on the service exactly matches the /// value specified by the client. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public string IfMatch { get; set; } /// @@ -108,7 +123,7 @@ public JobScheduleDisableOptions() { } /// if the resource's current ETag on the service does not match the /// value specified by the client. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public string IfNoneMatch { get; set; } /// @@ -117,8 +132,8 @@ public JobScheduleDisableOptions() { } /// if the resource on the service has been modified since the /// specified time. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? IfModifiedSince { get; set; } /// @@ -127,8 +142,8 @@ public JobScheduleDisableOptions() { } /// if the resource on the service has not been modified since the /// specified time. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? IfUnmodifiedSince { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobScheduleEnableHeaders.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobScheduleEnableHeaders.cs index 79d6258624b5..2fba33739e07 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobScheduleEnableHeaders.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobScheduleEnableHeaders.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class JobScheduleEnableHeaders /// /// Initializes a new instance of the JobScheduleEnableHeaders class. /// - public JobScheduleEnableHeaders() { } + public JobScheduleEnableHeaders() + { + CustomInit(); + } /// /// Initializes a new instance of the JobScheduleEnableHeaders class. @@ -44,19 +53,25 @@ public JobScheduleEnableHeaders() { } /// the request applied. public JobScheduleEnableHeaders(System.Guid? clientRequestId = default(System.Guid?), System.Guid? requestId = default(System.Guid?), string eTag = default(string), System.DateTime? lastModified = default(System.DateTime?), string dataServiceId = default(string)) { - this.ClientRequestId = clientRequestId; - this.RequestId = requestId; - this.ETag = eTag; - this.LastModified = lastModified; - this.DataServiceId = dataServiceId; + ClientRequestId = clientRequestId; + RequestId = requestId; + ETag = eTag; + LastModified = lastModified; + DataServiceId = dataServiceId; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the client-request-id provided by the client during /// the request. This will be returned only if the /// return-client-request-id parameter was set to true. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "client-request-id")] + [JsonProperty(PropertyName = "client-request-id")] public System.Guid? ClientRequestId { get; set; } /// @@ -68,7 +83,7 @@ public JobScheduleEnableHeaders() { } /// request was made, the Batch account against which the request was /// made, and the region that account resides in. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "request-id")] + [JsonProperty(PropertyName = "request-id")] public System.Guid? RequestId { get; set; } /// @@ -78,21 +93,21 @@ public JobScheduleEnableHeaders() { } /// the If-Modified-Since, If-Unmodified-Since, If-Match or /// If-None-Match headers. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "ETag")] + [JsonProperty(PropertyName = "ETag")] public string ETag { get; set; } /// /// Gets or sets the time at which the resource was last modified. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "Last-Modified")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "Last-Modified")] public System.DateTime? LastModified { get; set; } /// /// Gets or sets the OData ID of the resource to which the request /// applied. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "DataServiceId")] + [JsonProperty(PropertyName = "DataServiceId")] public string DataServiceId { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobScheduleEnableOptions.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobScheduleEnableOptions.cs index 1d3242bb7eaf..ff106bd2f631 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobScheduleEnableOptions.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobScheduleEnableOptions.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class JobScheduleEnableOptions /// /// Initializes a new instance of the JobScheduleEnableOptions class. /// - public JobScheduleEnableOptions() { } + public JobScheduleEnableOptions() + { + CustomInit(); + } /// /// Initializes a new instance of the JobScheduleEnableOptions class. @@ -52,21 +61,27 @@ public JobScheduleEnableOptions() { } /// modified since the specified time. public JobScheduleEnableOptions(int? timeout = default(int?), System.Guid? clientRequestId = default(System.Guid?), bool? returnClientRequestId = default(bool?), System.DateTime? ocpDate = default(System.DateTime?), string ifMatch = default(string), string ifNoneMatch = default(string), System.DateTime? ifModifiedSince = default(System.DateTime?), System.DateTime? ifUnmodifiedSince = default(System.DateTime?)) { - this.Timeout = timeout; - this.ClientRequestId = clientRequestId; - this.ReturnClientRequestId = returnClientRequestId; - this.OcpDate = ocpDate; - this.IfMatch = ifMatch; - this.IfNoneMatch = ifNoneMatch; - this.IfModifiedSince = ifModifiedSince; - this.IfUnmodifiedSince = ifUnmodifiedSince; + Timeout = timeout; + ClientRequestId = clientRequestId; + ReturnClientRequestId = returnClientRequestId; + OcpDate = ocpDate; + IfMatch = ifMatch; + IfNoneMatch = ifNoneMatch; + IfModifiedSince = ifModifiedSince; + IfUnmodifiedSince = ifUnmodifiedSince; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the maximum time that the server can spend processing /// the request, in seconds. The default is 30 seconds. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public int? Timeout { get; set; } /// @@ -74,14 +89,14 @@ public JobScheduleEnableOptions() { } /// a GUID with no decoration such as curly braces, e.g. /// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public System.Guid? ClientRequestId { get; set; } /// /// Gets or sets whether the server should return the client-request-id /// in the response. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public bool? ReturnClientRequestId { get; set; } /// @@ -89,8 +104,8 @@ public JobScheduleEnableOptions() { } /// typically set this to the current system clock time; set it /// explicitly if you are calling the REST API directly. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? OcpDate { get; set; } /// @@ -99,7 +114,7 @@ public JobScheduleEnableOptions() { } /// if the resource's current ETag on the service exactly matches the /// value specified by the client. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public string IfMatch { get; set; } /// @@ -108,7 +123,7 @@ public JobScheduleEnableOptions() { } /// if the resource's current ETag on the service does not match the /// value specified by the client. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public string IfNoneMatch { get; set; } /// @@ -117,8 +132,8 @@ public JobScheduleEnableOptions() { } /// if the resource on the service has been modified since the /// specified time. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? IfModifiedSince { get; set; } /// @@ -127,8 +142,8 @@ public JobScheduleEnableOptions() { } /// if the resource on the service has not been modified since the /// specified time. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? IfUnmodifiedSince { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobScheduleExecutionInformation.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobScheduleExecutionInformation.cs index c5e4632981d2..3494ba25da3a 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobScheduleExecutionInformation.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobScheduleExecutionInformation.cs @@ -8,6 +8,10 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; using System.Linq; /// @@ -20,7 +24,10 @@ public partial class JobScheduleExecutionInformation /// Initializes a new instance of the JobScheduleExecutionInformation /// class. /// - public JobScheduleExecutionInformation() { } + public JobScheduleExecutionInformation() + { + CustomInit(); + } /// /// Initializes a new instance of the JobScheduleExecutionInformation @@ -33,11 +40,17 @@ public JobScheduleExecutionInformation() { } /// The time at which the schedule ended. public JobScheduleExecutionInformation(System.DateTime? nextRunTime = default(System.DateTime?), RecentJob recentJob = default(RecentJob), System.DateTime? endTime = default(System.DateTime?)) { - this.NextRunTime = nextRunTime; - this.RecentJob = recentJob; - this.EndTime = endTime; + NextRunTime = nextRunTime; + RecentJob = recentJob; + EndTime = endTime; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the next time at which a job will be created under /// this schedule. @@ -48,7 +61,7 @@ public JobScheduleExecutionInformation() { } /// disabled, no job will be created at nextRunTime unless the job is /// enabled before then. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "nextRunTime")] + [JsonProperty(PropertyName = "nextRunTime")] public System.DateTime? NextRunTime { get; set; } /// @@ -59,7 +72,7 @@ public JobScheduleExecutionInformation() { } /// This property is present only if the at least one job has run under /// the schedule. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "recentJob")] + [JsonProperty(PropertyName = "recentJob")] public RecentJob RecentJob { get; set; } /// @@ -69,7 +82,7 @@ public JobScheduleExecutionInformation() { } /// This property is set only if the job schedule is in the completed /// state. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "endTime")] + [JsonProperty(PropertyName = "endTime")] public System.DateTime? EndTime { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobScheduleExistsHeaders.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobScheduleExistsHeaders.cs index c100ca1d9f7b..e3b50417ed45 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobScheduleExistsHeaders.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobScheduleExistsHeaders.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class JobScheduleExistsHeaders /// /// Initializes a new instance of the JobScheduleExistsHeaders class. /// - public JobScheduleExistsHeaders() { } + public JobScheduleExistsHeaders() + { + CustomInit(); + } /// /// Initializes a new instance of the JobScheduleExistsHeaders class. @@ -42,18 +51,24 @@ public JobScheduleExistsHeaders() { } /// modified. public JobScheduleExistsHeaders(System.Guid? clientRequestId = default(System.Guid?), System.Guid? requestId = default(System.Guid?), string eTag = default(string), System.DateTime? lastModified = default(System.DateTime?)) { - this.ClientRequestId = clientRequestId; - this.RequestId = requestId; - this.ETag = eTag; - this.LastModified = lastModified; + ClientRequestId = clientRequestId; + RequestId = requestId; + ETag = eTag; + LastModified = lastModified; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the client-request-id provided by the client during /// the request. This will be returned only if the /// return-client-request-id parameter was set to true. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "client-request-id")] + [JsonProperty(PropertyName = "client-request-id")] public System.Guid? ClientRequestId { get; set; } /// @@ -65,7 +80,7 @@ public JobScheduleExistsHeaders() { } /// request was made, the Batch account against which the request was /// made, and the region that account resides in. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "request-id")] + [JsonProperty(PropertyName = "request-id")] public System.Guid? RequestId { get; set; } /// @@ -75,14 +90,14 @@ public JobScheduleExistsHeaders() { } /// the If-Modified-Since, If-Unmodified-Since, If-Match or /// If-None-Match headers. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "ETag")] + [JsonProperty(PropertyName = "ETag")] public string ETag { get; set; } /// /// Gets or sets the time at which the resource was last modified. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "Last-Modified")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "Last-Modified")] public System.DateTime? LastModified { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobScheduleExistsOptions.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobScheduleExistsOptions.cs index b02e633d211b..1780f409cde7 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobScheduleExistsOptions.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobScheduleExistsOptions.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class JobScheduleExistsOptions /// /// Initializes a new instance of the JobScheduleExistsOptions class. /// - public JobScheduleExistsOptions() { } + public JobScheduleExistsOptions() + { + CustomInit(); + } /// /// Initializes a new instance of the JobScheduleExistsOptions class. @@ -52,21 +61,27 @@ public JobScheduleExistsOptions() { } /// modified since the specified time. public JobScheduleExistsOptions(int? timeout = default(int?), System.Guid? clientRequestId = default(System.Guid?), bool? returnClientRequestId = default(bool?), System.DateTime? ocpDate = default(System.DateTime?), string ifMatch = default(string), string ifNoneMatch = default(string), System.DateTime? ifModifiedSince = default(System.DateTime?), System.DateTime? ifUnmodifiedSince = default(System.DateTime?)) { - this.Timeout = timeout; - this.ClientRequestId = clientRequestId; - this.ReturnClientRequestId = returnClientRequestId; - this.OcpDate = ocpDate; - this.IfMatch = ifMatch; - this.IfNoneMatch = ifNoneMatch; - this.IfModifiedSince = ifModifiedSince; - this.IfUnmodifiedSince = ifUnmodifiedSince; + Timeout = timeout; + ClientRequestId = clientRequestId; + ReturnClientRequestId = returnClientRequestId; + OcpDate = ocpDate; + IfMatch = ifMatch; + IfNoneMatch = ifNoneMatch; + IfModifiedSince = ifModifiedSince; + IfUnmodifiedSince = ifUnmodifiedSince; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the maximum time that the server can spend processing /// the request, in seconds. The default is 30 seconds. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public int? Timeout { get; set; } /// @@ -74,14 +89,14 @@ public JobScheduleExistsOptions() { } /// a GUID with no decoration such as curly braces, e.g. /// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public System.Guid? ClientRequestId { get; set; } /// /// Gets or sets whether the server should return the client-request-id /// in the response. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public bool? ReturnClientRequestId { get; set; } /// @@ -89,8 +104,8 @@ public JobScheduleExistsOptions() { } /// typically set this to the current system clock time; set it /// explicitly if you are calling the REST API directly. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? OcpDate { get; set; } /// @@ -99,7 +114,7 @@ public JobScheduleExistsOptions() { } /// if the resource's current ETag on the service exactly matches the /// value specified by the client. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public string IfMatch { get; set; } /// @@ -108,7 +123,7 @@ public JobScheduleExistsOptions() { } /// if the resource's current ETag on the service does not match the /// value specified by the client. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public string IfNoneMatch { get; set; } /// @@ -117,8 +132,8 @@ public JobScheduleExistsOptions() { } /// if the resource on the service has been modified since the /// specified time. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? IfModifiedSince { get; set; } /// @@ -127,8 +142,8 @@ public JobScheduleExistsOptions() { } /// if the resource on the service has not been modified since the /// specified time. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? IfUnmodifiedSince { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobScheduleGetHeaders.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobScheduleGetHeaders.cs index f90dd9b78725..1f9f81ea424b 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobScheduleGetHeaders.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobScheduleGetHeaders.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class JobScheduleGetHeaders /// /// Initializes a new instance of the JobScheduleGetHeaders class. /// - public JobScheduleGetHeaders() { } + public JobScheduleGetHeaders() + { + CustomInit(); + } /// /// Initializes a new instance of the JobScheduleGetHeaders class. @@ -42,18 +51,24 @@ public JobScheduleGetHeaders() { } /// modified. public JobScheduleGetHeaders(System.Guid? clientRequestId = default(System.Guid?), System.Guid? requestId = default(System.Guid?), string eTag = default(string), System.DateTime? lastModified = default(System.DateTime?)) { - this.ClientRequestId = clientRequestId; - this.RequestId = requestId; - this.ETag = eTag; - this.LastModified = lastModified; + ClientRequestId = clientRequestId; + RequestId = requestId; + ETag = eTag; + LastModified = lastModified; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the client-request-id provided by the client during /// the request. This will be returned only if the /// return-client-request-id parameter was set to true. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "client-request-id")] + [JsonProperty(PropertyName = "client-request-id")] public System.Guid? ClientRequestId { get; set; } /// @@ -65,7 +80,7 @@ public JobScheduleGetHeaders() { } /// request was made, the Batch account against which the request was /// made, and the region that account resides in. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "request-id")] + [JsonProperty(PropertyName = "request-id")] public System.Guid? RequestId { get; set; } /// @@ -75,14 +90,14 @@ public JobScheduleGetHeaders() { } /// the If-Modified-Since, If-Unmodified-Since, If-Match or /// If-None-Match headers. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "ETag")] + [JsonProperty(PropertyName = "ETag")] public string ETag { get; set; } /// /// Gets or sets the time at which the resource was last modified. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "Last-Modified")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "Last-Modified")] public System.DateTime? LastModified { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobScheduleGetOptions.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobScheduleGetOptions.cs index 500ce581b097..188913fb715c 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobScheduleGetOptions.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobScheduleGetOptions.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class JobScheduleGetOptions /// /// Initializes a new instance of the JobScheduleGetOptions class. /// - public JobScheduleGetOptions() { } + public JobScheduleGetOptions() + { + CustomInit(); + } /// /// Initializes a new instance of the JobScheduleGetOptions class. @@ -54,35 +63,41 @@ public JobScheduleGetOptions() { } /// modified since the specified time. public JobScheduleGetOptions(string select = default(string), string expand = default(string), int? timeout = default(int?), System.Guid? clientRequestId = default(System.Guid?), bool? returnClientRequestId = default(bool?), System.DateTime? ocpDate = default(System.DateTime?), string ifMatch = default(string), string ifNoneMatch = default(string), System.DateTime? ifModifiedSince = default(System.DateTime?), System.DateTime? ifUnmodifiedSince = default(System.DateTime?)) { - this.Select = select; - this.Expand = expand; - this.Timeout = timeout; - this.ClientRequestId = clientRequestId; - this.ReturnClientRequestId = returnClientRequestId; - this.OcpDate = ocpDate; - this.IfMatch = ifMatch; - this.IfNoneMatch = ifNoneMatch; - this.IfModifiedSince = ifModifiedSince; - this.IfUnmodifiedSince = ifUnmodifiedSince; + Select = select; + Expand = expand; + Timeout = timeout; + ClientRequestId = clientRequestId; + ReturnClientRequestId = returnClientRequestId; + OcpDate = ocpDate; + IfMatch = ifMatch; + IfNoneMatch = ifNoneMatch; + IfModifiedSince = ifModifiedSince; + IfUnmodifiedSince = ifUnmodifiedSince; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets an OData $select clause. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public string Select { get; set; } /// /// Gets or sets an OData $expand clause. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public string Expand { get; set; } /// /// Gets or sets the maximum time that the server can spend processing /// the request, in seconds. The default is 30 seconds. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public int? Timeout { get; set; } /// @@ -90,14 +105,14 @@ public JobScheduleGetOptions() { } /// a GUID with no decoration such as curly braces, e.g. /// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public System.Guid? ClientRequestId { get; set; } /// /// Gets or sets whether the server should return the client-request-id /// in the response. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public bool? ReturnClientRequestId { get; set; } /// @@ -105,8 +120,8 @@ public JobScheduleGetOptions() { } /// typically set this to the current system clock time; set it /// explicitly if you are calling the REST API directly. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? OcpDate { get; set; } /// @@ -115,7 +130,7 @@ public JobScheduleGetOptions() { } /// if the resource's current ETag on the service exactly matches the /// value specified by the client. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public string IfMatch { get; set; } /// @@ -124,7 +139,7 @@ public JobScheduleGetOptions() { } /// if the resource's current ETag on the service does not match the /// value specified by the client. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public string IfNoneMatch { get; set; } /// @@ -133,8 +148,8 @@ public JobScheduleGetOptions() { } /// if the resource on the service has been modified since the /// specified time. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? IfModifiedSince { get; set; } /// @@ -143,8 +158,8 @@ public JobScheduleGetOptions() { } /// if the resource on the service has not been modified since the /// specified time. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? IfUnmodifiedSince { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobScheduleListHeaders.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobScheduleListHeaders.cs index b7e9ad1406a7..18e46c117d0b 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobScheduleListHeaders.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobScheduleListHeaders.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class JobScheduleListHeaders /// /// Initializes a new instance of the JobScheduleListHeaders class. /// - public JobScheduleListHeaders() { } + public JobScheduleListHeaders() + { + CustomInit(); + } /// /// Initializes a new instance of the JobScheduleListHeaders class. @@ -42,18 +51,24 @@ public JobScheduleListHeaders() { } /// modified. public JobScheduleListHeaders(System.Guid? clientRequestId = default(System.Guid?), System.Guid? requestId = default(System.Guid?), string eTag = default(string), System.DateTime? lastModified = default(System.DateTime?)) { - this.ClientRequestId = clientRequestId; - this.RequestId = requestId; - this.ETag = eTag; - this.LastModified = lastModified; + ClientRequestId = clientRequestId; + RequestId = requestId; + ETag = eTag; + LastModified = lastModified; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the client-request-id provided by the client during /// the request. This will be returned only if the /// return-client-request-id parameter was set to true. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "client-request-id")] + [JsonProperty(PropertyName = "client-request-id")] public System.Guid? ClientRequestId { get; set; } /// @@ -65,7 +80,7 @@ public JobScheduleListHeaders() { } /// request was made, the Batch account against which the request was /// made, and the region that account resides in. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "request-id")] + [JsonProperty(PropertyName = "request-id")] public System.Guid? RequestId { get; set; } /// @@ -75,14 +90,14 @@ public JobScheduleListHeaders() { } /// the If-Modified-Since, If-Unmodified-Since, If-Match or /// If-None-Match headers. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "ETag")] + [JsonProperty(PropertyName = "ETag")] public string ETag { get; set; } /// /// Gets or sets the time at which the resource was last modified. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "Last-Modified")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "Last-Modified")] public System.DateTime? LastModified { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobScheduleListNextOptions.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobScheduleListNextOptions.cs index e18efe20ccb1..69db8638291c 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobScheduleListNextOptions.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobScheduleListNextOptions.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class JobScheduleListNextOptions /// /// Initializes a new instance of the JobScheduleListNextOptions class. /// - public JobScheduleListNextOptions() { } + public JobScheduleListNextOptions() + { + CustomInit(); + } /// /// Initializes a new instance of the JobScheduleListNextOptions class. @@ -33,24 +42,30 @@ public JobScheduleListNextOptions() { } /// it explicitly if you are calling the REST API directly. public JobScheduleListNextOptions(System.Guid? clientRequestId = default(System.Guid?), bool? returnClientRequestId = default(bool?), System.DateTime? ocpDate = default(System.DateTime?)) { - this.ClientRequestId = clientRequestId; - this.ReturnClientRequestId = returnClientRequestId; - this.OcpDate = ocpDate; + ClientRequestId = clientRequestId; + ReturnClientRequestId = returnClientRequestId; + OcpDate = ocpDate; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the caller-generated request identity, in the form of /// a GUID with no decoration such as curly braces, e.g. /// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public System.Guid? ClientRequestId { get; set; } /// /// Gets or sets whether the server should return the client-request-id /// in the response. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public bool? ReturnClientRequestId { get; set; } /// @@ -58,8 +73,8 @@ public JobScheduleListNextOptions() { } /// typically set this to the current system clock time; set it /// explicitly if you are calling the REST API directly. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? OcpDate { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobScheduleListOptions.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobScheduleListOptions.cs index 552275c593a4..4233acf7d933 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobScheduleListOptions.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobScheduleListOptions.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class JobScheduleListOptions /// /// Initializes a new instance of the JobScheduleListOptions class. /// - public JobScheduleListOptions() { } + public JobScheduleListOptions() + { + CustomInit(); + } /// /// Initializes a new instance of the JobScheduleListOptions class. @@ -42,46 +51,52 @@ public JobScheduleListOptions() { } /// it explicitly if you are calling the REST API directly. public JobScheduleListOptions(string filter = default(string), string select = default(string), string expand = default(string), int? maxResults = default(int?), int? timeout = default(int?), System.Guid? clientRequestId = default(System.Guid?), bool? returnClientRequestId = default(bool?), System.DateTime? ocpDate = default(System.DateTime?)) { - this.Filter = filter; - this.Select = select; - this.Expand = expand; - this.MaxResults = maxResults; - this.Timeout = timeout; - this.ClientRequestId = clientRequestId; - this.ReturnClientRequestId = returnClientRequestId; - this.OcpDate = ocpDate; + Filter = filter; + Select = select; + Expand = expand; + MaxResults = maxResults; + Timeout = timeout; + ClientRequestId = clientRequestId; + ReturnClientRequestId = returnClientRequestId; + OcpDate = ocpDate; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets an OData $filter clause. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public string Filter { get; set; } /// /// Gets or sets an OData $select clause. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public string Select { get; set; } /// /// Gets or sets an OData $expand clause. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public string Expand { get; set; } /// /// Gets or sets the maximum number of items to return in the response. /// A maximum of 1000 job schedules can be returned. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public int? MaxResults { get; set; } /// /// Gets or sets the maximum time that the server can spend processing /// the request, in seconds. The default is 30 seconds. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public int? Timeout { get; set; } /// @@ -89,14 +104,14 @@ public JobScheduleListOptions() { } /// a GUID with no decoration such as curly braces, e.g. /// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public System.Guid? ClientRequestId { get; set; } /// /// Gets or sets whether the server should return the client-request-id /// in the response. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public bool? ReturnClientRequestId { get; set; } /// @@ -104,8 +119,8 @@ public JobScheduleListOptions() { } /// typically set this to the current system clock time; set it /// explicitly if you are calling the REST API directly. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? OcpDate { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobSchedulePatchHeaders.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobSchedulePatchHeaders.cs index 982874e89747..b307f3ec837c 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobSchedulePatchHeaders.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobSchedulePatchHeaders.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class JobSchedulePatchHeaders /// /// Initializes a new instance of the JobSchedulePatchHeaders class. /// - public JobSchedulePatchHeaders() { } + public JobSchedulePatchHeaders() + { + CustomInit(); + } /// /// Initializes a new instance of the JobSchedulePatchHeaders class. @@ -44,19 +53,25 @@ public JobSchedulePatchHeaders() { } /// the request applied. public JobSchedulePatchHeaders(System.Guid? clientRequestId = default(System.Guid?), System.Guid? requestId = default(System.Guid?), string eTag = default(string), System.DateTime? lastModified = default(System.DateTime?), string dataServiceId = default(string)) { - this.ClientRequestId = clientRequestId; - this.RequestId = requestId; - this.ETag = eTag; - this.LastModified = lastModified; - this.DataServiceId = dataServiceId; + ClientRequestId = clientRequestId; + RequestId = requestId; + ETag = eTag; + LastModified = lastModified; + DataServiceId = dataServiceId; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the client-request-id provided by the client during /// the request. This will be returned only if the /// return-client-request-id parameter was set to true. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "client-request-id")] + [JsonProperty(PropertyName = "client-request-id")] public System.Guid? ClientRequestId { get; set; } /// @@ -68,7 +83,7 @@ public JobSchedulePatchHeaders() { } /// request was made, the Batch account against which the request was /// made, and the region that account resides in. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "request-id")] + [JsonProperty(PropertyName = "request-id")] public System.Guid? RequestId { get; set; } /// @@ -78,21 +93,21 @@ public JobSchedulePatchHeaders() { } /// the If-Modified-Since, If-Unmodified-Since, If-Match or /// If-None-Match headers. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "ETag")] + [JsonProperty(PropertyName = "ETag")] public string ETag { get; set; } /// /// Gets or sets the time at which the resource was last modified. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "Last-Modified")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "Last-Modified")] public System.DateTime? LastModified { get; set; } /// /// Gets or sets the OData ID of the resource to which the request /// applied. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "DataServiceId")] + [JsonProperty(PropertyName = "DataServiceId")] public string DataServiceId { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobSchedulePatchOptions.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobSchedulePatchOptions.cs index b77a8040befb..9204a96dc8f1 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobSchedulePatchOptions.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobSchedulePatchOptions.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class JobSchedulePatchOptions /// /// Initializes a new instance of the JobSchedulePatchOptions class. /// - public JobSchedulePatchOptions() { } + public JobSchedulePatchOptions() + { + CustomInit(); + } /// /// Initializes a new instance of the JobSchedulePatchOptions class. @@ -52,21 +61,27 @@ public JobSchedulePatchOptions() { } /// modified since the specified time. public JobSchedulePatchOptions(int? timeout = default(int?), System.Guid? clientRequestId = default(System.Guid?), bool? returnClientRequestId = default(bool?), System.DateTime? ocpDate = default(System.DateTime?), string ifMatch = default(string), string ifNoneMatch = default(string), System.DateTime? ifModifiedSince = default(System.DateTime?), System.DateTime? ifUnmodifiedSince = default(System.DateTime?)) { - this.Timeout = timeout; - this.ClientRequestId = clientRequestId; - this.ReturnClientRequestId = returnClientRequestId; - this.OcpDate = ocpDate; - this.IfMatch = ifMatch; - this.IfNoneMatch = ifNoneMatch; - this.IfModifiedSince = ifModifiedSince; - this.IfUnmodifiedSince = ifUnmodifiedSince; + Timeout = timeout; + ClientRequestId = clientRequestId; + ReturnClientRequestId = returnClientRequestId; + OcpDate = ocpDate; + IfMatch = ifMatch; + IfNoneMatch = ifNoneMatch; + IfModifiedSince = ifModifiedSince; + IfUnmodifiedSince = ifUnmodifiedSince; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the maximum time that the server can spend processing /// the request, in seconds. The default is 30 seconds. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public int? Timeout { get; set; } /// @@ -74,14 +89,14 @@ public JobSchedulePatchOptions() { } /// a GUID with no decoration such as curly braces, e.g. /// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public System.Guid? ClientRequestId { get; set; } /// /// Gets or sets whether the server should return the client-request-id /// in the response. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public bool? ReturnClientRequestId { get; set; } /// @@ -89,8 +104,8 @@ public JobSchedulePatchOptions() { } /// typically set this to the current system clock time; set it /// explicitly if you are calling the REST API directly. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? OcpDate { get; set; } /// @@ -99,7 +114,7 @@ public JobSchedulePatchOptions() { } /// if the resource's current ETag on the service exactly matches the /// value specified by the client. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public string IfMatch { get; set; } /// @@ -108,7 +123,7 @@ public JobSchedulePatchOptions() { } /// if the resource's current ETag on the service does not match the /// value specified by the client. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public string IfNoneMatch { get; set; } /// @@ -117,8 +132,8 @@ public JobSchedulePatchOptions() { } /// if the resource on the service has been modified since the /// specified time. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? IfModifiedSince { get; set; } /// @@ -127,8 +142,8 @@ public JobSchedulePatchOptions() { } /// if the resource on the service has not been modified since the /// specified time. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? IfUnmodifiedSince { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobSchedulePatchParameter.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobSchedulePatchParameter.cs index 679cf78eac71..3da6e29a4b05 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobSchedulePatchParameter.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobSchedulePatchParameter.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class JobSchedulePatchParameter /// /// Initializes a new instance of the JobSchedulePatchParameter class. /// - public JobSchedulePatchParameter() { } + public JobSchedulePatchParameter() + { + CustomInit(); + } /// /// Initializes a new instance of the JobSchedulePatchParameter class. @@ -29,13 +38,19 @@ public JobSchedulePatchParameter() { } /// created on this schedule. /// A list of name-value pairs associated with /// the job schedule as metadata. - public JobSchedulePatchParameter(Schedule schedule = default(Schedule), JobSpecification jobSpecification = default(JobSpecification), System.Collections.Generic.IList metadata = default(System.Collections.Generic.IList)) + public JobSchedulePatchParameter(Schedule schedule = default(Schedule), JobSpecification jobSpecification = default(JobSpecification), IList metadata = default(IList)) { - this.Schedule = schedule; - this.JobSpecification = jobSpecification; - this.Metadata = metadata; + Schedule = schedule; + JobSpecification = jobSpecification; + Metadata = metadata; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the schedule according to which jobs will be created. /// @@ -43,7 +58,7 @@ public JobSchedulePatchParameter() { } /// If you do not specify this element, the existing schedule is left /// unchanged. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "schedule")] + [JsonProperty(PropertyName = "schedule")] public Schedule Schedule { get; set; } /// @@ -55,7 +70,7 @@ public JobSchedulePatchParameter() { } /// taken place. Any currently active job continues with the older /// specification. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "jobSpecification")] + [JsonProperty(PropertyName = "jobSpecification")] public JobSpecification JobSpecification { get; set; } /// @@ -66,24 +81,24 @@ public JobSchedulePatchParameter() { } /// If you do not specify this element, existing metadata is left /// unchanged. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "metadata")] - public System.Collections.Generic.IList Metadata { get; set; } + [JsonProperty(PropertyName = "metadata")] + public IList Metadata { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (this.JobSpecification != null) + if (JobSpecification != null) { - this.JobSpecification.Validate(); + JobSpecification.Validate(); } - if (this.Metadata != null) + if (Metadata != null) { - foreach (var element in this.Metadata) + foreach (var element in Metadata) { if (element != null) { diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobScheduleState.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobScheduleState.cs index 727379a9e243..d0c1bae17924 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobScheduleState.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobScheduleState.cs @@ -8,22 +8,70 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; /// /// Defines values for JobScheduleState. /// - [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + [JsonConverter(typeof(StringEnumConverter))] public enum JobScheduleState { - [System.Runtime.Serialization.EnumMember(Value = "active")] + [EnumMember(Value = "active")] Active, - [System.Runtime.Serialization.EnumMember(Value = "completed")] + [EnumMember(Value = "completed")] Completed, - [System.Runtime.Serialization.EnumMember(Value = "disabled")] + [EnumMember(Value = "disabled")] Disabled, - [System.Runtime.Serialization.EnumMember(Value = "terminating")] + [EnumMember(Value = "terminating")] Terminating, - [System.Runtime.Serialization.EnumMember(Value = "deleting")] + [EnumMember(Value = "deleting")] Deleting } + internal static class JobScheduleStateEnumExtension + { + internal static string ToSerializedValue(this JobScheduleState? value) => + value == null ? null : ((JobScheduleState)value).ToSerializedValue(); + + internal static string ToSerializedValue(this JobScheduleState value) + { + switch( value ) + { + case JobScheduleState.Active: + return "active"; + case JobScheduleState.Completed: + return "completed"; + case JobScheduleState.Disabled: + return "disabled"; + case JobScheduleState.Terminating: + return "terminating"; + case JobScheduleState.Deleting: + return "deleting"; + } + return null; + } + + internal static JobScheduleState? ParseJobScheduleState(this string value) + { + switch( value ) + { + case "active": + return JobScheduleState.Active; + case "completed": + return JobScheduleState.Completed; + case "disabled": + return JobScheduleState.Disabled; + case "terminating": + return JobScheduleState.Terminating; + case "deleting": + return JobScheduleState.Deleting; + } + return null; + } + } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobScheduleStatistics.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobScheduleStatistics.cs index 7be20b56ca87..8b397535994d 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobScheduleStatistics.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobScheduleStatistics.cs @@ -8,6 +8,11 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +23,10 @@ public partial class JobScheduleStatistics /// /// Initializes a new instance of the JobScheduleStatistics class. /// - public JobScheduleStatistics() { } + public JobScheduleStatistics() + { + CustomInit(); + } /// /// Initializes a new instance of the JobScheduleStatistics class. @@ -63,33 +71,39 @@ public JobScheduleStatistics() { } /// time is the time to the most recent task execution.) public JobScheduleStatistics(string url, System.DateTime startTime, System.DateTime lastUpdateTime, System.TimeSpan userCPUTime, System.TimeSpan kernelCPUTime, System.TimeSpan wallClockTime, long readIOps, long writeIOps, double readIOGiB, double writeIOGiB, long numSucceededTasks, long numFailedTasks, long numTaskRetries, System.TimeSpan waitTime) { - this.Url = url; - this.StartTime = startTime; - this.LastUpdateTime = lastUpdateTime; - this.UserCPUTime = userCPUTime; - this.KernelCPUTime = kernelCPUTime; - this.WallClockTime = wallClockTime; - this.ReadIOps = readIOps; - this.WriteIOps = writeIOps; - this.ReadIOGiB = readIOGiB; - this.WriteIOGiB = writeIOGiB; - this.NumSucceededTasks = numSucceededTasks; - this.NumFailedTasks = numFailedTasks; - this.NumTaskRetries = numTaskRetries; - this.WaitTime = waitTime; + Url = url; + StartTime = startTime; + LastUpdateTime = lastUpdateTime; + UserCPUTime = userCPUTime; + KernelCPUTime = kernelCPUTime; + WallClockTime = wallClockTime; + ReadIOps = readIOps; + WriteIOps = writeIOps; + ReadIOGiB = readIOGiB; + WriteIOGiB = writeIOGiB; + NumSucceededTasks = numSucceededTasks; + NumFailedTasks = numFailedTasks; + NumTaskRetries = numTaskRetries; + WaitTime = waitTime; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the URL of the statistics. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "url")] + [JsonProperty(PropertyName = "url")] public string Url { get; set; } /// /// Gets or sets the start time of the time range covered by the /// statistics. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "startTime")] + [JsonProperty(PropertyName = "startTime")] public System.DateTime StartTime { get; set; } /// @@ -97,7 +111,7 @@ public JobScheduleStatistics(string url, System.DateTime startTime, System.DateT /// All statistics are limited to the range between startTime and /// lastUpdateTime. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "lastUpdateTime")] + [JsonProperty(PropertyName = "lastUpdateTime")] public System.DateTime LastUpdateTime { get; set; } /// @@ -105,7 +119,7 @@ public JobScheduleStatistics(string url, System.DateTime startTime, System.DateT /// and all compute nodes) consumed by all tasks in all jobs created /// under the schedule. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "userCPUTime")] + [JsonProperty(PropertyName = "userCPUTime")] public System.TimeSpan UserCPUTime { get; set; } /// @@ -113,7 +127,7 @@ public JobScheduleStatistics(string url, System.DateTime startTime, System.DateT /// cores and all compute nodes) consumed by all tasks in all jobs /// created under the schedule. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "kernelCPUTime")] + [JsonProperty(PropertyName = "kernelCPUTime")] public System.TimeSpan KernelCPUTime { get; set; } /// @@ -127,35 +141,35 @@ public JobScheduleStatistics(string url, System.DateTime startTime, System.DateT /// If a task was retried, this includes the wall clock time of all the /// task retries. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "wallClockTime")] + [JsonProperty(PropertyName = "wallClockTime")] public System.TimeSpan WallClockTime { get; set; } /// /// Gets or sets the total number of disk read operations made by all /// tasks in all jobs created under the schedule. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "readIOps")] + [JsonProperty(PropertyName = "readIOps")] public long ReadIOps { get; set; } /// /// Gets or sets the total number of disk write operations made by all /// tasks in all jobs created under the schedule. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "writeIOps")] + [JsonProperty(PropertyName = "writeIOps")] public long WriteIOps { get; set; } /// /// Gets or sets the total gibibytes read from disk by all tasks in all /// jobs created under the schedule. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "readIOGiB")] + [JsonProperty(PropertyName = "readIOGiB")] public double ReadIOGiB { get; set; } /// /// Gets or sets the total gibibytes written to disk by all tasks in /// all jobs created under the schedule. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "writeIOGiB")] + [JsonProperty(PropertyName = "writeIOGiB")] public double WriteIOGiB { get; set; } /// @@ -163,7 +177,7 @@ public JobScheduleStatistics(string url, System.DateTime startTime, System.DateT /// during the given time range in jobs created under the schedule. A /// task completes successfully if it returns exit code 0. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "numSucceededTasks")] + [JsonProperty(PropertyName = "numSucceededTasks")] public long NumSucceededTasks { get; set; } /// @@ -171,14 +185,14 @@ public JobScheduleStatistics(string url, System.DateTime startTime, System.DateT /// time range in jobs created under the schedule. A task fails if it /// exhausts its maximum retry count without returning exit code 0. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "numFailedTasks")] + [JsonProperty(PropertyName = "numFailedTasks")] public long NumFailedTasks { get; set; } /// /// Gets or sets the total number of retries during the given time /// range on all tasks in all jobs created under the schedule. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "numTaskRetries")] + [JsonProperty(PropertyName = "numTaskRetries")] public long NumTaskRetries { get; set; } /// @@ -192,20 +206,20 @@ public JobScheduleStatistics(string url, System.DateTime startTime, System.DateT /// This value is only reported in the account lifetime statistics; it /// is not included in the job statistics. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "waitTime")] + [JsonProperty(PropertyName = "waitTime")] public System.TimeSpan WaitTime { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (this.Url == null) + if (Url == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Url"); + throw new ValidationException(ValidationRules.CannotBeNull, "Url"); } } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobScheduleTerminateHeaders.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobScheduleTerminateHeaders.cs index c3fec80602cf..1551723f655b 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobScheduleTerminateHeaders.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobScheduleTerminateHeaders.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -19,7 +25,10 @@ public partial class JobScheduleTerminateHeaders /// Initializes a new instance of the JobScheduleTerminateHeaders /// class. /// - public JobScheduleTerminateHeaders() { } + public JobScheduleTerminateHeaders() + { + CustomInit(); + } /// /// Initializes a new instance of the JobScheduleTerminateHeaders @@ -46,19 +55,25 @@ public JobScheduleTerminateHeaders() { } /// the request applied. public JobScheduleTerminateHeaders(System.Guid? clientRequestId = default(System.Guid?), System.Guid? requestId = default(System.Guid?), string eTag = default(string), System.DateTime? lastModified = default(System.DateTime?), string dataServiceId = default(string)) { - this.ClientRequestId = clientRequestId; - this.RequestId = requestId; - this.ETag = eTag; - this.LastModified = lastModified; - this.DataServiceId = dataServiceId; + ClientRequestId = clientRequestId; + RequestId = requestId; + ETag = eTag; + LastModified = lastModified; + DataServiceId = dataServiceId; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the client-request-id provided by the client during /// the request. This will be returned only if the /// return-client-request-id parameter was set to true. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "client-request-id")] + [JsonProperty(PropertyName = "client-request-id")] public System.Guid? ClientRequestId { get; set; } /// @@ -70,7 +85,7 @@ public JobScheduleTerminateHeaders() { } /// request was made, the Batch account against which the request was /// made, and the region that account resides in. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "request-id")] + [JsonProperty(PropertyName = "request-id")] public System.Guid? RequestId { get; set; } /// @@ -80,21 +95,21 @@ public JobScheduleTerminateHeaders() { } /// the If-Modified-Since, If-Unmodified-Since, If-Match or /// If-None-Match headers. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "ETag")] + [JsonProperty(PropertyName = "ETag")] public string ETag { get; set; } /// /// Gets or sets the time at which the resource was last modified. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "Last-Modified")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "Last-Modified")] public System.DateTime? LastModified { get; set; } /// /// Gets or sets the OData ID of the resource to which the request /// applied. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "DataServiceId")] + [JsonProperty(PropertyName = "DataServiceId")] public string DataServiceId { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobScheduleTerminateOptions.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobScheduleTerminateOptions.cs index 36e2b333a081..281b22ddfdc8 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobScheduleTerminateOptions.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobScheduleTerminateOptions.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -19,7 +25,10 @@ public partial class JobScheduleTerminateOptions /// Initializes a new instance of the JobScheduleTerminateOptions /// class. /// - public JobScheduleTerminateOptions() { } + public JobScheduleTerminateOptions() + { + CustomInit(); + } /// /// Initializes a new instance of the JobScheduleTerminateOptions @@ -54,21 +63,27 @@ public JobScheduleTerminateOptions() { } /// modified since the specified time. public JobScheduleTerminateOptions(int? timeout = default(int?), System.Guid? clientRequestId = default(System.Guid?), bool? returnClientRequestId = default(bool?), System.DateTime? ocpDate = default(System.DateTime?), string ifMatch = default(string), string ifNoneMatch = default(string), System.DateTime? ifModifiedSince = default(System.DateTime?), System.DateTime? ifUnmodifiedSince = default(System.DateTime?)) { - this.Timeout = timeout; - this.ClientRequestId = clientRequestId; - this.ReturnClientRequestId = returnClientRequestId; - this.OcpDate = ocpDate; - this.IfMatch = ifMatch; - this.IfNoneMatch = ifNoneMatch; - this.IfModifiedSince = ifModifiedSince; - this.IfUnmodifiedSince = ifUnmodifiedSince; + Timeout = timeout; + ClientRequestId = clientRequestId; + ReturnClientRequestId = returnClientRequestId; + OcpDate = ocpDate; + IfMatch = ifMatch; + IfNoneMatch = ifNoneMatch; + IfModifiedSince = ifModifiedSince; + IfUnmodifiedSince = ifUnmodifiedSince; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the maximum time that the server can spend processing /// the request, in seconds. The default is 30 seconds. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public int? Timeout { get; set; } /// @@ -76,14 +91,14 @@ public JobScheduleTerminateOptions() { } /// a GUID with no decoration such as curly braces, e.g. /// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public System.Guid? ClientRequestId { get; set; } /// /// Gets or sets whether the server should return the client-request-id /// in the response. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public bool? ReturnClientRequestId { get; set; } /// @@ -91,8 +106,8 @@ public JobScheduleTerminateOptions() { } /// typically set this to the current system clock time; set it /// explicitly if you are calling the REST API directly. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? OcpDate { get; set; } /// @@ -101,7 +116,7 @@ public JobScheduleTerminateOptions() { } /// if the resource's current ETag on the service exactly matches the /// value specified by the client. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public string IfMatch { get; set; } /// @@ -110,7 +125,7 @@ public JobScheduleTerminateOptions() { } /// if the resource's current ETag on the service does not match the /// value specified by the client. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public string IfNoneMatch { get; set; } /// @@ -119,8 +134,8 @@ public JobScheduleTerminateOptions() { } /// if the resource on the service has been modified since the /// specified time. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? IfModifiedSince { get; set; } /// @@ -129,8 +144,8 @@ public JobScheduleTerminateOptions() { } /// if the resource on the service has not been modified since the /// specified time. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? IfUnmodifiedSince { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobScheduleUpdateHeaders.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobScheduleUpdateHeaders.cs index 0f41c33e911e..1f7c809fb6ec 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobScheduleUpdateHeaders.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobScheduleUpdateHeaders.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class JobScheduleUpdateHeaders /// /// Initializes a new instance of the JobScheduleUpdateHeaders class. /// - public JobScheduleUpdateHeaders() { } + public JobScheduleUpdateHeaders() + { + CustomInit(); + } /// /// Initializes a new instance of the JobScheduleUpdateHeaders class. @@ -44,19 +53,25 @@ public JobScheduleUpdateHeaders() { } /// the request applied. public JobScheduleUpdateHeaders(System.Guid? clientRequestId = default(System.Guid?), System.Guid? requestId = default(System.Guid?), string eTag = default(string), System.DateTime? lastModified = default(System.DateTime?), string dataServiceId = default(string)) { - this.ClientRequestId = clientRequestId; - this.RequestId = requestId; - this.ETag = eTag; - this.LastModified = lastModified; - this.DataServiceId = dataServiceId; + ClientRequestId = clientRequestId; + RequestId = requestId; + ETag = eTag; + LastModified = lastModified; + DataServiceId = dataServiceId; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the client-request-id provided by the client during /// the request. This will be returned only if the /// return-client-request-id parameter was set to true. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "client-request-id")] + [JsonProperty(PropertyName = "client-request-id")] public System.Guid? ClientRequestId { get; set; } /// @@ -68,7 +83,7 @@ public JobScheduleUpdateHeaders() { } /// request was made, the Batch account against which the request was /// made, and the region that account resides in. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "request-id")] + [JsonProperty(PropertyName = "request-id")] public System.Guid? RequestId { get; set; } /// @@ -78,21 +93,21 @@ public JobScheduleUpdateHeaders() { } /// the If-Modified-Since, If-Unmodified-Since, If-Match or /// If-None-Match headers. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "ETag")] + [JsonProperty(PropertyName = "ETag")] public string ETag { get; set; } /// /// Gets or sets the time at which the resource was last modified. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "Last-Modified")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "Last-Modified")] public System.DateTime? LastModified { get; set; } /// /// Gets or sets the OData ID of the resource to which the request /// applied. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "DataServiceId")] + [JsonProperty(PropertyName = "DataServiceId")] public string DataServiceId { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobScheduleUpdateOptions.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobScheduleUpdateOptions.cs index f6a5c0837446..10dde62da06d 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobScheduleUpdateOptions.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobScheduleUpdateOptions.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class JobScheduleUpdateOptions /// /// Initializes a new instance of the JobScheduleUpdateOptions class. /// - public JobScheduleUpdateOptions() { } + public JobScheduleUpdateOptions() + { + CustomInit(); + } /// /// Initializes a new instance of the JobScheduleUpdateOptions class. @@ -52,21 +61,27 @@ public JobScheduleUpdateOptions() { } /// modified since the specified time. public JobScheduleUpdateOptions(int? timeout = default(int?), System.Guid? clientRequestId = default(System.Guid?), bool? returnClientRequestId = default(bool?), System.DateTime? ocpDate = default(System.DateTime?), string ifMatch = default(string), string ifNoneMatch = default(string), System.DateTime? ifModifiedSince = default(System.DateTime?), System.DateTime? ifUnmodifiedSince = default(System.DateTime?)) { - this.Timeout = timeout; - this.ClientRequestId = clientRequestId; - this.ReturnClientRequestId = returnClientRequestId; - this.OcpDate = ocpDate; - this.IfMatch = ifMatch; - this.IfNoneMatch = ifNoneMatch; - this.IfModifiedSince = ifModifiedSince; - this.IfUnmodifiedSince = ifUnmodifiedSince; + Timeout = timeout; + ClientRequestId = clientRequestId; + ReturnClientRequestId = returnClientRequestId; + OcpDate = ocpDate; + IfMatch = ifMatch; + IfNoneMatch = ifNoneMatch; + IfModifiedSince = ifModifiedSince; + IfUnmodifiedSince = ifUnmodifiedSince; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the maximum time that the server can spend processing /// the request, in seconds. The default is 30 seconds. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public int? Timeout { get; set; } /// @@ -74,14 +89,14 @@ public JobScheduleUpdateOptions() { } /// a GUID with no decoration such as curly braces, e.g. /// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public System.Guid? ClientRequestId { get; set; } /// /// Gets or sets whether the server should return the client-request-id /// in the response. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public bool? ReturnClientRequestId { get; set; } /// @@ -89,8 +104,8 @@ public JobScheduleUpdateOptions() { } /// typically set this to the current system clock time; set it /// explicitly if you are calling the REST API directly. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? OcpDate { get; set; } /// @@ -99,7 +114,7 @@ public JobScheduleUpdateOptions() { } /// if the resource's current ETag on the service exactly matches the /// value specified by the client. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public string IfMatch { get; set; } /// @@ -108,7 +123,7 @@ public JobScheduleUpdateOptions() { } /// if the resource's current ETag on the service does not match the /// value specified by the client. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public string IfNoneMatch { get; set; } /// @@ -117,8 +132,8 @@ public JobScheduleUpdateOptions() { } /// if the resource on the service has been modified since the /// specified time. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? IfModifiedSince { get; set; } /// @@ -127,8 +142,8 @@ public JobScheduleUpdateOptions() { } /// if the resource on the service has not been modified since the /// specified time. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? IfUnmodifiedSince { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobScheduleUpdateParameter.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobScheduleUpdateParameter.cs index 0093ee07bbc2..aa01963f45b2 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobScheduleUpdateParameter.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobScheduleUpdateParameter.cs @@ -8,6 +8,13 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// @@ -18,7 +25,10 @@ public partial class JobScheduleUpdateParameter /// /// Initializes a new instance of the JobScheduleUpdateParameter class. /// - public JobScheduleUpdateParameter() { } + public JobScheduleUpdateParameter() + { + CustomInit(); + } /// /// Initializes a new instance of the JobScheduleUpdateParameter class. @@ -29,13 +39,19 @@ public JobScheduleUpdateParameter() { } /// this schedule. /// A list of name-value pairs associated with /// the job schedule as metadata. - public JobScheduleUpdateParameter(Schedule schedule, JobSpecification jobSpecification, System.Collections.Generic.IList metadata = default(System.Collections.Generic.IList)) + public JobScheduleUpdateParameter(Schedule schedule, JobSpecification jobSpecification, IList metadata = default(IList)) { - this.Schedule = schedule; - this.JobSpecification = jobSpecification; - this.Metadata = metadata; + Schedule = schedule; + JobSpecification = jobSpecification; + Metadata = metadata; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the schedule according to which jobs will be created. /// @@ -44,7 +60,7 @@ public JobScheduleUpdateParameter() { } /// default schedule: that is, a single job scheduled to run /// immediately. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "schedule")] + [JsonProperty(PropertyName = "schedule")] public Schedule Schedule { get; set; } /// @@ -55,7 +71,7 @@ public JobScheduleUpdateParameter() { } /// taken place. Any currently active job continues with the older /// specification. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "jobSpecification")] + [JsonProperty(PropertyName = "jobSpecification")] public JobSpecification JobSpecification { get; set; } /// @@ -66,32 +82,32 @@ public JobScheduleUpdateParameter() { } /// If you do not specify this element, it takes the default value of /// an empty list; in effect, any existing metadata is deleted. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "metadata")] - public System.Collections.Generic.IList Metadata { get; set; } + [JsonProperty(PropertyName = "metadata")] + public IList Metadata { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (this.Schedule == null) + if (Schedule == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Schedule"); + throw new ValidationException(ValidationRules.CannotBeNull, "Schedule"); } - if (this.JobSpecification == null) + if (JobSpecification == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "JobSpecification"); + throw new ValidationException(ValidationRules.CannotBeNull, "JobSpecification"); } - if (this.JobSpecification != null) + if (JobSpecification != null) { - this.JobSpecification.Validate(); + JobSpecification.Validate(); } - if (this.Metadata != null) + if (Metadata != null) { - foreach (var element in this.Metadata) + foreach (var element in Metadata) { if (element != null) { diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobSchedulingError.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobSchedulingError.cs index 948923121fe9..eaaab4149c0d 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobSchedulingError.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobSchedulingError.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class JobSchedulingError /// /// Initializes a new instance of the JobSchedulingError class. /// - public JobSchedulingError() { } + public JobSchedulingError() + { + CustomInit(); + } /// /// Initializes a new instance of the JobSchedulingError class. @@ -33,48 +42,54 @@ public JobSchedulingError() { } /// interface. /// A list of additional error details related to /// the scheduling error. - public JobSchedulingError(ErrorCategory category, string code = default(string), string message = default(string), System.Collections.Generic.IList details = default(System.Collections.Generic.IList)) + public JobSchedulingError(ErrorCategory category, string code = default(string), string message = default(string), IList details = default(IList)) { - this.Category = category; - this.Code = code; - this.Message = message; - this.Details = details; + Category = category; + Code = code; + Message = message; + Details = details; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the category of the job scheduling error. /// /// /// Possible values include: 'userError', 'serverError' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "category")] + [JsonProperty(PropertyName = "category")] public ErrorCategory Category { get; set; } /// /// Gets or sets an identifier for the job scheduling error. Codes are /// invariant and are intended to be consumed programmatically. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "code")] + [JsonProperty(PropertyName = "code")] public string Code { get; set; } /// /// Gets or sets a message describing the job scheduling error, /// intended to be suitable for display in a user interface. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "message")] + [JsonProperty(PropertyName = "message")] public string Message { get; set; } /// /// Gets or sets a list of additional error details related to the /// scheduling error. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "details")] - public System.Collections.Generic.IList Details { get; set; } + [JsonProperty(PropertyName = "details")] + public IList Details { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobSpecification.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobSpecification.cs index cf419680610c..be81a5173df1 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobSpecification.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobSpecification.cs @@ -8,6 +8,13 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// @@ -18,7 +25,10 @@ public partial class JobSpecification /// /// Initializes a new instance of the JobSpecification class. /// - public JobSpecification() { } + public JobSpecification() + { + CustomInit(); + } /// /// Initializes a new instance of the JobSpecification class. @@ -29,16 +39,18 @@ public JobSpecification() { } /// schedule. /// The display name for jobs created under /// this schedule. - /// The flag that determines if this - /// job will use tasks with dependencies. + /// Whether tasks in the job can + /// define dependencies on each other. The default is false. /// The action the Batch service /// should take when all tasks in a job created under this schedule are /// in the completed state. /// The action the Batch service should /// take when any task fails in a job created under this schedule. A - /// task is considered to have failed if it completes with a non-zero - /// exit code and has exhausted its retry count, or if it had a - /// scheduling error. + /// task is considered to have failed if it have failed if has a + /// failureInfo. A failureInfo is set if the task completes with a + /// non-zero exit code after exhausting its retry count, or if there + /// was an error starting the task, for example due to a resource file + /// download error. /// The execution constraints for jobs /// created under this schedule. /// The details of a Job Manager task to @@ -53,22 +65,28 @@ public JobSpecification() { } /// Job Manager, Job Preparation and Job Release tasks). /// A list of name-value pairs associated with /// each job created under this schedule as metadata. - public JobSpecification(PoolInformation poolInfo, int? priority = default(int?), string displayName = default(string), bool? usesTaskDependencies = default(bool?), OnAllTasksComplete? onAllTasksComplete = default(OnAllTasksComplete?), OnTaskFailure? onTaskFailure = default(OnTaskFailure?), JobConstraints constraints = default(JobConstraints), JobManagerTask jobManagerTask = default(JobManagerTask), JobPreparationTask jobPreparationTask = default(JobPreparationTask), JobReleaseTask jobReleaseTask = default(JobReleaseTask), System.Collections.Generic.IList commonEnvironmentSettings = default(System.Collections.Generic.IList), System.Collections.Generic.IList metadata = default(System.Collections.Generic.IList)) + public JobSpecification(PoolInformation poolInfo, int? priority = default(int?), string displayName = default(string), bool? usesTaskDependencies = default(bool?), OnAllTasksComplete? onAllTasksComplete = default(OnAllTasksComplete?), OnTaskFailure? onTaskFailure = default(OnTaskFailure?), JobConstraints constraints = default(JobConstraints), JobManagerTask jobManagerTask = default(JobManagerTask), JobPreparationTask jobPreparationTask = default(JobPreparationTask), JobReleaseTask jobReleaseTask = default(JobReleaseTask), IList commonEnvironmentSettings = default(IList), IList metadata = default(IList)) { - this.Priority = priority; - this.DisplayName = displayName; - this.UsesTaskDependencies = usesTaskDependencies; - this.OnAllTasksComplete = onAllTasksComplete; - this.OnTaskFailure = onTaskFailure; - this.Constraints = constraints; - this.JobManagerTask = jobManagerTask; - this.JobPreparationTask = jobPreparationTask; - this.JobReleaseTask = jobReleaseTask; - this.CommonEnvironmentSettings = commonEnvironmentSettings; - this.PoolInfo = poolInfo; - this.Metadata = metadata; + Priority = priority; + DisplayName = displayName; + UsesTaskDependencies = usesTaskDependencies; + OnAllTasksComplete = onAllTasksComplete; + OnTaskFailure = onTaskFailure; + Constraints = constraints; + JobManagerTask = jobManagerTask; + JobPreparationTask = jobPreparationTask; + JobReleaseTask = jobReleaseTask; + CommonEnvironmentSettings = commonEnvironmentSettings; + PoolInfo = poolInfo; + Metadata = metadata; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the priority of jobs created under this schedule. /// @@ -79,7 +97,7 @@ public JobSpecification() { } /// the job schedule. You can update a job's priority after it has been /// created using by using the update job API. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "priority")] + [JsonProperty(PropertyName = "priority")] public int? Priority { get; set; } /// @@ -89,14 +107,14 @@ public JobSpecification() { } /// The name need not be unique and can contain any Unicode characters /// up to a maximum length of 1024. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "displayName")] + [JsonProperty(PropertyName = "displayName")] public string DisplayName { get; set; } /// - /// Gets or sets the flag that determines if this job will use tasks - /// with dependencies. + /// Gets or sets whether tasks in the job can define dependencies on + /// each other. The default is false. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "usesTaskDependencies")] + [JsonProperty(PropertyName = "usesTaskDependencies")] public bool? UsesTaskDependencies { get; set; } /// @@ -113,27 +131,29 @@ public JobSpecification() { } /// terminateJob once you have finished adding tasks. The default is /// noAction. Possible values include: 'noAction', 'terminateJob' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "onAllTasksComplete")] + [JsonProperty(PropertyName = "onAllTasksComplete")] public OnAllTasksComplete? OnAllTasksComplete { get; set; } /// /// Gets or sets the action the Batch service should take when any task /// fails in a job created under this schedule. A task is considered to - /// have failed if it completes with a non-zero exit code and has - /// exhausted its retry count, or if it had a scheduling error. + /// have failed if it have failed if has a failureInfo. A failureInfo + /// is set if the task completes with a non-zero exit code after + /// exhausting its retry count, or if there was an error starting the + /// task, for example due to a resource file download error. /// /// /// The default is noAction. Possible values include: 'noAction', /// 'performExitOptionsJobAction' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "onTaskFailure")] + [JsonProperty(PropertyName = "onTaskFailure")] public OnTaskFailure? OnTaskFailure { get; set; } /// /// Gets or sets the execution constraints for jobs created under this /// schedule. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "constraints")] + [JsonProperty(PropertyName = "constraints")] public JobConstraints Constraints { get; set; } /// @@ -147,7 +167,7 @@ public JobSpecification() { } /// Manager task when the job is created, and will try to schedule the /// Job Manager task before scheduling other tasks in the job. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "jobManagerTask")] + [JsonProperty(PropertyName = "jobManagerTask")] public JobManagerTask JobManagerTask { get; set; } /// @@ -159,7 +179,7 @@ public JobSpecification() { } /// Job Preparation task on a compute node before starting any tasks of /// that job on that compute node. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "jobPreparationTask")] + [JsonProperty(PropertyName = "jobPreparationTask")] public JobPreparationTask JobPreparationTask { get; set; } /// @@ -175,7 +195,7 @@ public JobSpecification() { } /// job. The Batch service runs the Job Release task on the compute /// nodes that have run the Job Preparation task. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "jobReleaseTask")] + [JsonProperty(PropertyName = "jobReleaseTask")] public JobReleaseTask JobReleaseTask { get; set; } /// @@ -188,14 +208,14 @@ public JobSpecification() { } /// Individual tasks can override an environment setting specified here /// by specifying the same setting name with a different value. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "commonEnvironmentSettings")] - public System.Collections.Generic.IList CommonEnvironmentSettings { get; set; } + [JsonProperty(PropertyName = "commonEnvironmentSettings")] + public IList CommonEnvironmentSettings { get; set; } /// /// Gets or sets the pool on which the Batch service runs the tasks of /// jobs created under this schedule. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "poolInfo")] + [JsonProperty(PropertyName = "poolInfo")] public PoolInformation PoolInfo { get; set; } /// @@ -206,36 +226,36 @@ public JobSpecification() { } /// The Batch service does not assign any meaning to metadata; it is /// solely for the use of user code. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "metadata")] - public System.Collections.Generic.IList Metadata { get; set; } + [JsonProperty(PropertyName = "metadata")] + public IList Metadata { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (this.PoolInfo == null) + if (PoolInfo == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "PoolInfo"); + throw new ValidationException(ValidationRules.CannotBeNull, "PoolInfo"); } - if (this.JobManagerTask != null) + if (JobManagerTask != null) { - this.JobManagerTask.Validate(); + JobManagerTask.Validate(); } - if (this.JobPreparationTask != null) + if (JobPreparationTask != null) { - this.JobPreparationTask.Validate(); + JobPreparationTask.Validate(); } - if (this.JobReleaseTask != null) + if (JobReleaseTask != null) { - this.JobReleaseTask.Validate(); + JobReleaseTask.Validate(); } - if (this.CommonEnvironmentSettings != null) + if (CommonEnvironmentSettings != null) { - foreach (var element in this.CommonEnvironmentSettings) + foreach (var element in CommonEnvironmentSettings) { if (element != null) { @@ -243,13 +263,13 @@ public virtual void Validate() } } } - if (this.PoolInfo != null) + if (PoolInfo != null) { - this.PoolInfo.Validate(); + PoolInfo.Validate(); } - if (this.Metadata != null) + if (Metadata != null) { - foreach (var element1 in this.Metadata) + foreach (var element1 in Metadata) { if (element1 != null) { diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobState.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobState.cs index eb0383866ffd..b5c1ce88392e 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobState.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobState.cs @@ -8,26 +8,82 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; /// /// Defines values for JobState. /// - [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + [JsonConverter(typeof(StringEnumConverter))] public enum JobState { - [System.Runtime.Serialization.EnumMember(Value = "active")] + [EnumMember(Value = "active")] Active, - [System.Runtime.Serialization.EnumMember(Value = "disabling")] + [EnumMember(Value = "disabling")] Disabling, - [System.Runtime.Serialization.EnumMember(Value = "disabled")] + [EnumMember(Value = "disabled")] Disabled, - [System.Runtime.Serialization.EnumMember(Value = "enabling")] + [EnumMember(Value = "enabling")] Enabling, - [System.Runtime.Serialization.EnumMember(Value = "terminating")] + [EnumMember(Value = "terminating")] Terminating, - [System.Runtime.Serialization.EnumMember(Value = "completed")] + [EnumMember(Value = "completed")] Completed, - [System.Runtime.Serialization.EnumMember(Value = "deleting")] + [EnumMember(Value = "deleting")] Deleting } + internal static class JobStateEnumExtension + { + internal static string ToSerializedValue(this JobState? value) => + value == null ? null : ((JobState)value).ToSerializedValue(); + + internal static string ToSerializedValue(this JobState value) + { + switch( value ) + { + case JobState.Active: + return "active"; + case JobState.Disabling: + return "disabling"; + case JobState.Disabled: + return "disabled"; + case JobState.Enabling: + return "enabling"; + case JobState.Terminating: + return "terminating"; + case JobState.Completed: + return "completed"; + case JobState.Deleting: + return "deleting"; + } + return null; + } + + internal static JobState? ParseJobState(this string value) + { + switch( value ) + { + case "active": + return JobState.Active; + case "disabling": + return JobState.Disabling; + case "disabled": + return JobState.Disabled; + case "enabling": + return JobState.Enabling; + case "terminating": + return JobState.Terminating; + case "completed": + return JobState.Completed; + case "deleting": + return JobState.Deleting; + } + return null; + } + } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobStatistics.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobStatistics.cs index de3bfcf9f2c4..b1095cc83e25 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobStatistics.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobStatistics.cs @@ -8,6 +8,11 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +23,10 @@ public partial class JobStatistics /// /// Initializes a new instance of the JobStatistics class. /// - public JobStatistics() { } + public JobStatistics() + { + CustomInit(); + } /// /// Initializes a new instance of the JobStatistics class. @@ -56,33 +64,39 @@ public JobStatistics() { } /// job. public JobStatistics(string url, System.DateTime startTime, System.DateTime lastUpdateTime, System.TimeSpan userCPUTime, System.TimeSpan kernelCPUTime, System.TimeSpan wallClockTime, long readIOps, long writeIOps, double readIOGiB, double writeIOGiB, long numSucceededTasks, long numFailedTasks, long numTaskRetries, System.TimeSpan waitTime) { - this.Url = url; - this.StartTime = startTime; - this.LastUpdateTime = lastUpdateTime; - this.UserCPUTime = userCPUTime; - this.KernelCPUTime = kernelCPUTime; - this.WallClockTime = wallClockTime; - this.ReadIOps = readIOps; - this.WriteIOps = writeIOps; - this.ReadIOGiB = readIOGiB; - this.WriteIOGiB = writeIOGiB; - this.NumSucceededTasks = numSucceededTasks; - this.NumFailedTasks = numFailedTasks; - this.NumTaskRetries = numTaskRetries; - this.WaitTime = waitTime; + Url = url; + StartTime = startTime; + LastUpdateTime = lastUpdateTime; + UserCPUTime = userCPUTime; + KernelCPUTime = kernelCPUTime; + WallClockTime = wallClockTime; + ReadIOps = readIOps; + WriteIOps = writeIOps; + ReadIOGiB = readIOGiB; + WriteIOGiB = writeIOGiB; + NumSucceededTasks = numSucceededTasks; + NumFailedTasks = numFailedTasks; + NumTaskRetries = numTaskRetries; + WaitTime = waitTime; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the URL of the statistics. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "url")] + [JsonProperty(PropertyName = "url")] public string Url { get; set; } /// /// Gets or sets the start time of the time range covered by the /// statistics. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "startTime")] + [JsonProperty(PropertyName = "startTime")] public System.DateTime StartTime { get; set; } /// @@ -90,55 +104,62 @@ public JobStatistics(string url, System.DateTime startTime, System.DateTime last /// All statistics are limited to the range between startTime and /// lastUpdateTime. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "lastUpdateTime")] + [JsonProperty(PropertyName = "lastUpdateTime")] public System.DateTime LastUpdateTime { get; set; } /// /// Gets or sets the total user mode CPU time (summed across all cores /// and all compute nodes) consumed by all tasks in the job. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "userCPUTime")] + [JsonProperty(PropertyName = "userCPUTime")] public System.TimeSpan UserCPUTime { get; set; } /// /// Gets or sets the total kernel mode CPU time (summed across all /// cores and all compute nodes) consumed by all tasks in the job. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "kernelCPUTime")] + [JsonProperty(PropertyName = "kernelCPUTime")] public System.TimeSpan KernelCPUTime { get; set; } /// /// Gets or sets the total wall clock time of all tasks in the job. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "wallClockTime")] + /// + /// The wall clock time is the elapsed time from when the task started + /// running on a compute node to when it finished (or to the last time + /// the statistics were updated, if the task had not finished by then). + /// If a task was retried, this includes the wall clock time of all the + /// task retries. + /// + [JsonProperty(PropertyName = "wallClockTime")] public System.TimeSpan WallClockTime { get; set; } /// /// Gets or sets the total number of disk read operations made by all /// tasks in the job. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "readIOps")] + [JsonProperty(PropertyName = "readIOps")] public long ReadIOps { get; set; } /// /// Gets or sets the total number of disk write operations made by all /// tasks in the job. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "writeIOps")] + [JsonProperty(PropertyName = "writeIOps")] public long WriteIOps { get; set; } /// /// Gets or sets the total amount of data in GiB read from disk by all /// tasks in the job. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "readIOGiB")] + [JsonProperty(PropertyName = "readIOGiB")] public double ReadIOGiB { get; set; } /// /// Gets or sets the total amount of data in GiB written to disk by all /// tasks in the job. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "writeIOGiB")] + [JsonProperty(PropertyName = "writeIOGiB")] public double WriteIOGiB { get; set; } /// @@ -148,7 +169,7 @@ public JobStatistics(string url, System.DateTime startTime, System.DateTime last /// /// A task completes successfully if it returns exit code 0. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "numSucceededTasks")] + [JsonProperty(PropertyName = "numSucceededTasks")] public long NumSucceededTasks { get; set; } /// @@ -159,14 +180,14 @@ public JobStatistics(string url, System.DateTime startTime, System.DateTime last /// A task fails if it exhausts its maximum retry count without /// returning exit code 0. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "numFailedTasks")] + [JsonProperty(PropertyName = "numFailedTasks")] public long NumFailedTasks { get; set; } /// /// Gets or sets the total number of retries on all the tasks in the /// job during the given time range. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "numTaskRetries")] + [JsonProperty(PropertyName = "numTaskRetries")] public long NumTaskRetries { get; set; } /// @@ -179,20 +200,20 @@ public JobStatistics(string url, System.DateTime startTime, System.DateTime last /// recent task execution.) This value is only reported in the account /// lifetime statistics; it is not included in the job statistics. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "waitTime")] + [JsonProperty(PropertyName = "waitTime")] public System.TimeSpan WaitTime { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (this.Url == null) + if (Url == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Url"); + throw new ValidationException(ValidationRules.CannotBeNull, "Url"); } } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobTerminateHeaders.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobTerminateHeaders.cs index 04b93d4c67e7..09ed8953f633 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobTerminateHeaders.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobTerminateHeaders.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class JobTerminateHeaders /// /// Initializes a new instance of the JobTerminateHeaders class. /// - public JobTerminateHeaders() { } + public JobTerminateHeaders() + { + CustomInit(); + } /// /// Initializes a new instance of the JobTerminateHeaders class. @@ -44,19 +53,25 @@ public JobTerminateHeaders() { } /// the request applied. public JobTerminateHeaders(System.Guid? clientRequestId = default(System.Guid?), System.Guid? requestId = default(System.Guid?), string eTag = default(string), System.DateTime? lastModified = default(System.DateTime?), string dataServiceId = default(string)) { - this.ClientRequestId = clientRequestId; - this.RequestId = requestId; - this.ETag = eTag; - this.LastModified = lastModified; - this.DataServiceId = dataServiceId; + ClientRequestId = clientRequestId; + RequestId = requestId; + ETag = eTag; + LastModified = lastModified; + DataServiceId = dataServiceId; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the client-request-id provided by the client during /// the request. This will be returned only if the /// return-client-request-id parameter was set to true. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "client-request-id")] + [JsonProperty(PropertyName = "client-request-id")] public System.Guid? ClientRequestId { get; set; } /// @@ -68,7 +83,7 @@ public JobTerminateHeaders() { } /// request was made, the Batch account against which the request was /// made, and the region that account resides in. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "request-id")] + [JsonProperty(PropertyName = "request-id")] public System.Guid? RequestId { get; set; } /// @@ -78,21 +93,21 @@ public JobTerminateHeaders() { } /// the If-Modified-Since, If-Unmodified-Since, If-Match or /// If-None-Match headers. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "ETag")] + [JsonProperty(PropertyName = "ETag")] public string ETag { get; set; } /// /// Gets or sets the time at which the resource was last modified. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "Last-Modified")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "Last-Modified")] public System.DateTime? LastModified { get; set; } /// /// Gets or sets the OData ID of the resource to which the request /// applied. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "DataServiceId")] + [JsonProperty(PropertyName = "DataServiceId")] public string DataServiceId { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobTerminateOptions.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobTerminateOptions.cs index 956f6f965b8d..d329a4822db3 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobTerminateOptions.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobTerminateOptions.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class JobTerminateOptions /// /// Initializes a new instance of the JobTerminateOptions class. /// - public JobTerminateOptions() { } + public JobTerminateOptions() + { + CustomInit(); + } /// /// Initializes a new instance of the JobTerminateOptions class. @@ -52,21 +61,27 @@ public JobTerminateOptions() { } /// modified since the specified time. public JobTerminateOptions(int? timeout = default(int?), System.Guid? clientRequestId = default(System.Guid?), bool? returnClientRequestId = default(bool?), System.DateTime? ocpDate = default(System.DateTime?), string ifMatch = default(string), string ifNoneMatch = default(string), System.DateTime? ifModifiedSince = default(System.DateTime?), System.DateTime? ifUnmodifiedSince = default(System.DateTime?)) { - this.Timeout = timeout; - this.ClientRequestId = clientRequestId; - this.ReturnClientRequestId = returnClientRequestId; - this.OcpDate = ocpDate; - this.IfMatch = ifMatch; - this.IfNoneMatch = ifNoneMatch; - this.IfModifiedSince = ifModifiedSince; - this.IfUnmodifiedSince = ifUnmodifiedSince; + Timeout = timeout; + ClientRequestId = clientRequestId; + ReturnClientRequestId = returnClientRequestId; + OcpDate = ocpDate; + IfMatch = ifMatch; + IfNoneMatch = ifNoneMatch; + IfModifiedSince = ifModifiedSince; + IfUnmodifiedSince = ifUnmodifiedSince; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the maximum time that the server can spend processing /// the request, in seconds. The default is 30 seconds. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public int? Timeout { get; set; } /// @@ -74,14 +89,14 @@ public JobTerminateOptions() { } /// a GUID with no decoration such as curly braces, e.g. /// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public System.Guid? ClientRequestId { get; set; } /// /// Gets or sets whether the server should return the client-request-id /// in the response. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public bool? ReturnClientRequestId { get; set; } /// @@ -89,8 +104,8 @@ public JobTerminateOptions() { } /// typically set this to the current system clock time; set it /// explicitly if you are calling the REST API directly. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? OcpDate { get; set; } /// @@ -99,7 +114,7 @@ public JobTerminateOptions() { } /// if the resource's current ETag on the service exactly matches the /// value specified by the client. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public string IfMatch { get; set; } /// @@ -108,7 +123,7 @@ public JobTerminateOptions() { } /// if the resource's current ETag on the service does not match the /// value specified by the client. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public string IfNoneMatch { get; set; } /// @@ -117,8 +132,8 @@ public JobTerminateOptions() { } /// if the resource on the service has been modified since the /// specified time. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? IfModifiedSince { get; set; } /// @@ -127,8 +142,8 @@ public JobTerminateOptions() { } /// if the resource on the service has not been modified since the /// specified time. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? IfUnmodifiedSince { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobTerminateParameter.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobTerminateParameter.cs index 56ab07c9c019..095dbea1ac81 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobTerminateParameter.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobTerminateParameter.cs @@ -8,6 +8,10 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +22,10 @@ public partial class JobTerminateParameter /// /// Initializes a new instance of the JobTerminateParameter class. /// - public JobTerminateParameter() { } + public JobTerminateParameter() + { + CustomInit(); + } /// /// Initializes a new instance of the JobTerminateParameter class. @@ -27,14 +34,20 @@ public JobTerminateParameter() { } /// job's TerminateReason. The default is 'UserTerminate'. public JobTerminateParameter(string terminateReason = default(string)) { - this.TerminateReason = terminateReason; + TerminateReason = terminateReason; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the text you want to appear as the job's /// TerminateReason. The default is 'UserTerminate'. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "terminateReason")] + [JsonProperty(PropertyName = "terminateReason")] public string TerminateReason { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobUpdateHeaders.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobUpdateHeaders.cs index 80e20c58344c..8dda12f1668e 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobUpdateHeaders.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobUpdateHeaders.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class JobUpdateHeaders /// /// Initializes a new instance of the JobUpdateHeaders class. /// - public JobUpdateHeaders() { } + public JobUpdateHeaders() + { + CustomInit(); + } /// /// Initializes a new instance of the JobUpdateHeaders class. @@ -44,19 +53,25 @@ public JobUpdateHeaders() { } /// the request applied. public JobUpdateHeaders(System.Guid? clientRequestId = default(System.Guid?), System.Guid? requestId = default(System.Guid?), string eTag = default(string), System.DateTime? lastModified = default(System.DateTime?), string dataServiceId = default(string)) { - this.ClientRequestId = clientRequestId; - this.RequestId = requestId; - this.ETag = eTag; - this.LastModified = lastModified; - this.DataServiceId = dataServiceId; + ClientRequestId = clientRequestId; + RequestId = requestId; + ETag = eTag; + LastModified = lastModified; + DataServiceId = dataServiceId; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the client-request-id provided by the client during /// the request. This will be returned only if the /// return-client-request-id parameter was set to true. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "client-request-id")] + [JsonProperty(PropertyName = "client-request-id")] public System.Guid? ClientRequestId { get; set; } /// @@ -68,7 +83,7 @@ public JobUpdateHeaders() { } /// request was made, the Batch account against which the request was /// made, and the region that account resides in. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "request-id")] + [JsonProperty(PropertyName = "request-id")] public System.Guid? RequestId { get; set; } /// @@ -78,21 +93,21 @@ public JobUpdateHeaders() { } /// the If-Modified-Since, If-Unmodified-Since, If-Match or /// If-None-Match headers. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "ETag")] + [JsonProperty(PropertyName = "ETag")] public string ETag { get; set; } /// /// Gets or sets the time at which the resource was last modified. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "Last-Modified")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "Last-Modified")] public System.DateTime? LastModified { get; set; } /// /// Gets or sets the OData ID of the resource to which the request /// applied. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "DataServiceId")] + [JsonProperty(PropertyName = "DataServiceId")] public string DataServiceId { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobUpdateOptions.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobUpdateOptions.cs index 7231efdc6ac9..1a8a4cd1f6ad 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobUpdateOptions.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobUpdateOptions.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class JobUpdateOptions /// /// Initializes a new instance of the JobUpdateOptions class. /// - public JobUpdateOptions() { } + public JobUpdateOptions() + { + CustomInit(); + } /// /// Initializes a new instance of the JobUpdateOptions class. @@ -52,21 +61,27 @@ public JobUpdateOptions() { } /// modified since the specified time. public JobUpdateOptions(int? timeout = default(int?), System.Guid? clientRequestId = default(System.Guid?), bool? returnClientRequestId = default(bool?), System.DateTime? ocpDate = default(System.DateTime?), string ifMatch = default(string), string ifNoneMatch = default(string), System.DateTime? ifModifiedSince = default(System.DateTime?), System.DateTime? ifUnmodifiedSince = default(System.DateTime?)) { - this.Timeout = timeout; - this.ClientRequestId = clientRequestId; - this.ReturnClientRequestId = returnClientRequestId; - this.OcpDate = ocpDate; - this.IfMatch = ifMatch; - this.IfNoneMatch = ifNoneMatch; - this.IfModifiedSince = ifModifiedSince; - this.IfUnmodifiedSince = ifUnmodifiedSince; + Timeout = timeout; + ClientRequestId = clientRequestId; + ReturnClientRequestId = returnClientRequestId; + OcpDate = ocpDate; + IfMatch = ifMatch; + IfNoneMatch = ifNoneMatch; + IfModifiedSince = ifModifiedSince; + IfUnmodifiedSince = ifUnmodifiedSince; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the maximum time that the server can spend processing /// the request, in seconds. The default is 30 seconds. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public int? Timeout { get; set; } /// @@ -74,14 +89,14 @@ public JobUpdateOptions() { } /// a GUID with no decoration such as curly braces, e.g. /// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public System.Guid? ClientRequestId { get; set; } /// /// Gets or sets whether the server should return the client-request-id /// in the response. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public bool? ReturnClientRequestId { get; set; } /// @@ -89,8 +104,8 @@ public JobUpdateOptions() { } /// typically set this to the current system clock time; set it /// explicitly if you are calling the REST API directly. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? OcpDate { get; set; } /// @@ -99,7 +114,7 @@ public JobUpdateOptions() { } /// if the resource's current ETag on the service exactly matches the /// value specified by the client. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public string IfMatch { get; set; } /// @@ -108,7 +123,7 @@ public JobUpdateOptions() { } /// if the resource's current ETag on the service does not match the /// value specified by the client. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public string IfNoneMatch { get; set; } /// @@ -117,8 +132,8 @@ public JobUpdateOptions() { } /// if the resource on the service has been modified since the /// specified time. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? IfModifiedSince { get; set; } /// @@ -127,8 +142,8 @@ public JobUpdateOptions() { } /// if the resource on the service has not been modified since the /// specified time. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? IfUnmodifiedSince { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobUpdateParameter.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobUpdateParameter.cs index 75ffb9e3b9b4..9b742fd87e08 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobUpdateParameter.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/JobUpdateParameter.cs @@ -8,6 +8,13 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// @@ -18,7 +25,10 @@ public partial class JobUpdateParameter /// /// Initializes a new instance of the JobUpdateParameter class. /// - public JobUpdateParameter() { } + public JobUpdateParameter() + { + CustomInit(); + } /// /// Initializes a new instance of the JobUpdateParameter class. @@ -33,15 +43,21 @@ public JobUpdateParameter() { } /// The action the Batch service /// should take when all tasks in the job are in the completed /// state. - public JobUpdateParameter(PoolInformation poolInfo, int? priority = default(int?), JobConstraints constraints = default(JobConstraints), System.Collections.Generic.IList metadata = default(System.Collections.Generic.IList), OnAllTasksComplete? onAllTasksComplete = default(OnAllTasksComplete?)) + public JobUpdateParameter(PoolInformation poolInfo, int? priority = default(int?), JobConstraints constraints = default(JobConstraints), IList metadata = default(IList), OnAllTasksComplete? onAllTasksComplete = default(OnAllTasksComplete?)) { - this.Priority = priority; - this.Constraints = constraints; - this.PoolInfo = poolInfo; - this.Metadata = metadata; - this.OnAllTasksComplete = onAllTasksComplete; + Priority = priority; + Constraints = constraints; + PoolInfo = poolInfo; + Metadata = metadata; + OnAllTasksComplete = onAllTasksComplete; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the priority of the job. /// @@ -50,7 +66,7 @@ public JobUpdateParameter() { } /// lowest priority and 1000 being the highest priority. If omitted, it /// is set to the default value 0. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "priority")] + [JsonProperty(PropertyName = "priority")] public int? Priority { get; set; } /// @@ -59,7 +75,7 @@ public JobUpdateParameter() { } /// /// If omitted, the constraints are cleared. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "constraints")] + [JsonProperty(PropertyName = "constraints")] public JobConstraints Constraints { get; set; } /// @@ -74,7 +90,7 @@ public JobUpdateParameter() { } /// keepAlive property can be updated, and then only if the auto pool /// has a poolLifetimeOption of job. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "poolInfo")] + [JsonProperty(PropertyName = "poolInfo")] public PoolInformation PoolInfo { get; set; } /// @@ -85,8 +101,8 @@ public JobUpdateParameter() { } /// If omitted, it takes the default value of an empty list; in effect, /// any existing metadata is deleted. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "metadata")] - public System.Collections.Generic.IList Metadata { get; set; } + [JsonProperty(PropertyName = "metadata")] + public IList Metadata { get; set; } /// /// Gets or sets the action the Batch service should take when all @@ -96,30 +112,37 @@ public JobUpdateParameter() { } /// If omitted, the completion behavior is set to noAction. If the /// current value is terminateJob, this is an error because a job's /// completion behavior may not be changed from terminateJob to - /// noAction. Possible values include: 'noAction', 'terminateJob' + /// noAction. You may not change the value from terminatejob to + /// noaction - that is, once you have engaged automatic job + /// termination, you cannot turn it off again. If you try to do this, + /// the request fails and Batch returns status code 400 (Bad Request) + /// and an 'invalid property value' error response. If you do not + /// specify this element in a PUT request, it is equivalent to passing + /// noaction. This is an error if the current value is terminatejob. + /// Possible values include: 'noAction', 'terminateJob' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "onAllTasksComplete")] + [JsonProperty(PropertyName = "onAllTasksComplete")] public OnAllTasksComplete? OnAllTasksComplete { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (this.PoolInfo == null) + if (PoolInfo == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "PoolInfo"); + throw new ValidationException(ValidationRules.CannotBeNull, "PoolInfo"); } - if (this.PoolInfo != null) + if (PoolInfo != null) { - this.PoolInfo.Validate(); + PoolInfo.Validate(); } - if (this.Metadata != null) + if (Metadata != null) { - foreach (var element in this.Metadata) + foreach (var element in Metadata) { if (element != null) { diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/LinuxUserConfiguration.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/LinuxUserConfiguration.cs index 2d91db8a46e8..a68854240fdf 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/LinuxUserConfiguration.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/LinuxUserConfiguration.cs @@ -8,6 +8,10 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +22,10 @@ public partial class LinuxUserConfiguration /// /// Initializes a new instance of the LinuxUserConfiguration class. /// - public LinuxUserConfiguration() { } + public LinuxUserConfiguration() + { + CustomInit(); + } /// /// Initializes a new instance of the LinuxUserConfiguration class. @@ -29,11 +36,17 @@ public LinuxUserConfiguration() { } /// account. public LinuxUserConfiguration(int? uid = default(int?), int? gid = default(int?), string sshPrivateKey = default(string)) { - this.Uid = uid; - this.Gid = gid; - this.SshPrivateKey = sshPrivateKey; + Uid = uid; + Gid = gid; + SshPrivateKey = sshPrivateKey; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the user ID of the user account. /// @@ -42,7 +55,7 @@ public LinuxUserConfiguration() { } /// all. If not specified the underlying operating system picks the /// uid. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "uid")] + [JsonProperty(PropertyName = "uid")] public int? Uid { get; set; } /// @@ -53,7 +66,7 @@ public LinuxUserConfiguration() { } /// all. If not specified the underlying operating system picks the /// gid. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "gid")] + [JsonProperty(PropertyName = "gid")] public int? Gid { get; set; } /// @@ -69,7 +82,7 @@ public LinuxUserConfiguration() { } /// password-less SSH is not configured between nodes (no modification /// of the user's .ssh directory is done). /// - [Newtonsoft.Json.JsonProperty(PropertyName = "sshPrivateKey")] + [JsonProperty(PropertyName = "sshPrivateKey")] public string SshPrivateKey { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/MetadataItem.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/MetadataItem.cs index bb7281e98af3..cb3428fe1f11 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/MetadataItem.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/MetadataItem.cs @@ -8,6 +8,11 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Newtonsoft.Json; using System.Linq; /// @@ -22,7 +27,10 @@ public partial class MetadataItem /// /// Initializes a new instance of the MetadataItem class. /// - public MetadataItem() { } + public MetadataItem() + { + CustomInit(); + } /// /// Initializes a new instance of the MetadataItem class. @@ -31,37 +39,43 @@ public MetadataItem() { } /// The value of the metadata item. public MetadataItem(string name, string value) { - this.Name = name; - this.Value = value; + Name = name; + Value = value; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the name of the metadata item. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// /// Gets or sets the value of the metadata item. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "value")] + [JsonProperty(PropertyName = "value")] public string Value { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (this.Name == null) + if (Name == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Name"); + throw new ValidationException(ValidationRules.CannotBeNull, "Name"); } - if (this.Value == null) + if (Value == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Value"); + throw new ValidationException(ValidationRules.CannotBeNull, "Value"); } } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/MultiInstanceSettings.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/MultiInstanceSettings.cs index 88b5a8c7bb38..9e0ceee2c504 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/MultiInstanceSettings.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/MultiInstanceSettings.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// @@ -21,7 +27,10 @@ public partial class MultiInstanceSettings /// /// Initializes a new instance of the MultiInstanceSettings class. /// - public MultiInstanceSettings() { } + public MultiInstanceSettings() + { + CustomInit(); + } /// /// Initializes a new instance of the MultiInstanceSettings class. @@ -34,17 +43,23 @@ public MultiInstanceSettings() { } /// A list of files that the Batch /// service will download before running the coordination command /// line. - public MultiInstanceSettings(int numberOfInstances, string coordinationCommandLine = default(string), System.Collections.Generic.IList commonResourceFiles = default(System.Collections.Generic.IList)) + public MultiInstanceSettings(int numberOfInstances, string coordinationCommandLine = default(string), IList commonResourceFiles = default(IList)) { - this.NumberOfInstances = numberOfInstances; - this.CoordinationCommandLine = coordinationCommandLine; - this.CommonResourceFiles = commonResourceFiles; + NumberOfInstances = numberOfInstances; + CoordinationCommandLine = coordinationCommandLine; + CommonResourceFiles = commonResourceFiles; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the number of compute nodes required by the task. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "numberOfInstances")] + [JsonProperty(PropertyName = "numberOfInstances")] public int NumberOfInstances { get; set; } /// @@ -57,7 +72,7 @@ public MultiInstanceSettings() { } /// and verifies that the service is ready to process inter-node /// messages. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "coordinationCommandLine")] + [JsonProperty(PropertyName = "coordinationCommandLine")] public string CoordinationCommandLine { get; set; } /// @@ -68,22 +83,25 @@ public MultiInstanceSettings() { } /// The difference between common resource files and task resource /// files is that common resource files are downloaded for all subtasks /// including the primary, whereas task resource files are downloaded - /// only for the primary. + /// only for the primary. Also note that these resource files are not + /// downloaded to the task working directory, but instead are + /// downloaded to the task root directory (one directory above the + /// working directory). /// - [Newtonsoft.Json.JsonProperty(PropertyName = "commonResourceFiles")] - public System.Collections.Generic.IList CommonResourceFiles { get; set; } + [JsonProperty(PropertyName = "commonResourceFiles")] + public IList CommonResourceFiles { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (this.CommonResourceFiles != null) + if (CommonResourceFiles != null) { - foreach (var element in this.CommonResourceFiles) + foreach (var element in CommonResourceFiles) { if (element != null) { diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/NameValuePair.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/NameValuePair.cs index 883a54b7aae7..bef769af7ff2 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/NameValuePair.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/NameValuePair.cs @@ -8,6 +8,10 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +22,10 @@ public partial class NameValuePair /// /// Initializes a new instance of the NameValuePair class. /// - public NameValuePair() { } + public NameValuePair() + { + CustomInit(); + } /// /// Initializes a new instance of the NameValuePair class. @@ -27,20 +34,26 @@ public NameValuePair() { } /// The value in the name-value pair. public NameValuePair(string name = default(string), string value = default(string)) { - this.Name = name; - this.Value = value; + Name = name; + Value = value; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the name in the name-value pair. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// /// Gets or sets the value in the name-value pair. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "value")] + [JsonProperty(PropertyName = "value")] public string Value { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/NetworkConfiguration.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/NetworkConfiguration.cs index 7cd151c58001..f2ac3ef583f0 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/NetworkConfiguration.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/NetworkConfiguration.cs @@ -8,6 +8,10 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +22,10 @@ public partial class NetworkConfiguration /// /// Initializes a new instance of the NetworkConfiguration class. /// - public NetworkConfiguration() { } + public NetworkConfiguration() + { + CustomInit(); + } /// /// Initializes a new instance of the NetworkConfiguration class. @@ -31,10 +38,16 @@ public NetworkConfiguration() { } /// on compute nodes in the Batch pool. public NetworkConfiguration(string subnetId = default(string), PoolEndpointConfiguration endpointConfiguration = default(PoolEndpointConfiguration)) { - this.SubnetId = subnetId; - this.EndpointConfiguration = endpointConfiguration; + SubnetId = subnetId; + EndpointConfiguration = endpointConfiguration; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the ARM resource identifier of the virtual network /// subnet which the compute nodes of the pool will join. This is of @@ -57,9 +70,18 @@ public NetworkConfiguration() { } /// denied by an NSG, then the Batch service will set the state of the /// compute nodes to unusable. For pools created via /// virtualMachineConfiguration the Batch account must have - /// poolAllocationMode userSubscription in order to use a VNet. + /// poolAllocationMode userSubscription in order to use a VNet. If the + /// specified VNet has any associated Network Security Groups (NSG), + /// then a few reserved system ports must be enabled for inbound + /// communication. For pools created with a virtual machine + /// configuration, enable ports 29876 and 29877, as well as port 22 for + /// Linux and port 3389 for Windows. For pools created with a cloud + /// service configuration, enable ports 10100, 20100, and 30100. Also + /// enable outbound connections to Azure Storage on port 443. For more + /// details see: + /// https://docs.microsoft.com/en-us/azure/batch/batch-api-basics#virtual-network-vnet-and-firewall-configuration /// - [Newtonsoft.Json.JsonProperty(PropertyName = "subnetId")] + [JsonProperty(PropertyName = "subnetId")] public string SubnetId { get; set; } /// @@ -70,20 +92,20 @@ public NetworkConfiguration() { } /// Pool endpoint configuration is only supported on pools with the /// virtualMachineConfiguration property. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "endpointConfiguration")] + [JsonProperty(PropertyName = "endpointConfiguration")] public PoolEndpointConfiguration EndpointConfiguration { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (this.EndpointConfiguration != null) + if (EndpointConfiguration != null) { - this.EndpointConfiguration.Validate(); + EndpointConfiguration.Validate(); } } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/NetworkSecurityGroupRule.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/NetworkSecurityGroupRule.cs index 9e1ce65b9ef4..7e90cb95f034 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/NetworkSecurityGroupRule.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/NetworkSecurityGroupRule.cs @@ -8,6 +8,11 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +23,10 @@ public partial class NetworkSecurityGroupRule /// /// Initializes a new instance of the NetworkSecurityGroupRule class. /// - public NetworkSecurityGroupRule() { } + public NetworkSecurityGroupRule() + { + CustomInit(); + } /// /// Initializes a new instance of the NetworkSecurityGroupRule class. @@ -30,11 +38,17 @@ public NetworkSecurityGroupRule() { } /// to match for the rule. public NetworkSecurityGroupRule(int priority, NetworkSecurityGroupRuleAccess access, string sourceAddressPrefix) { - this.Priority = priority; - this.Access = access; - this.SourceAddressPrefix = sourceAddressPrefix; + Priority = priority; + Access = access; + SourceAddressPrefix = sourceAddressPrefix; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the priority for this rule. /// @@ -47,7 +61,7 @@ public NetworkSecurityGroupRule(int priority, NetworkSecurityGroupRuleAccess acc /// to 3500. If any reserved or duplicate values are provided the /// request fails with HTTP status code 400. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "priority")] + [JsonProperty(PropertyName = "priority")] public int Priority { get; set; } /// @@ -57,7 +71,7 @@ public NetworkSecurityGroupRule(int priority, NetworkSecurityGroupRuleAccess acc /// /// Possible values include: 'allow', 'deny' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "access")] + [JsonProperty(PropertyName = "access")] public NetworkSecurityGroupRuleAccess Access { get; set; } /// @@ -70,20 +84,20 @@ public NetworkSecurityGroupRule(int priority, NetworkSecurityGroupRuleAccess acc /// any other values are provided the request fails with HTTP status /// code 400. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "sourceAddressPrefix")] + [JsonProperty(PropertyName = "sourceAddressPrefix")] public string SourceAddressPrefix { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (this.SourceAddressPrefix == null) + if (SourceAddressPrefix == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "SourceAddressPrefix"); + throw new ValidationException(ValidationRules.CannotBeNull, "SourceAddressPrefix"); } } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/NetworkSecurityGroupRuleAccess.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/NetworkSecurityGroupRuleAccess.cs index ac316c53da7c..ace220d96713 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/NetworkSecurityGroupRuleAccess.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/NetworkSecurityGroupRuleAccess.cs @@ -8,16 +8,52 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; /// /// Defines values for NetworkSecurityGroupRuleAccess. /// - [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + [JsonConverter(typeof(StringEnumConverter))] public enum NetworkSecurityGroupRuleAccess { - [System.Runtime.Serialization.EnumMember(Value = "allow")] + [EnumMember(Value = "allow")] Allow, - [System.Runtime.Serialization.EnumMember(Value = "deny")] + [EnumMember(Value = "deny")] Deny } + internal static class NetworkSecurityGroupRuleAccessEnumExtension + { + internal static string ToSerializedValue(this NetworkSecurityGroupRuleAccess? value) => + value == null ? null : ((NetworkSecurityGroupRuleAccess)value).ToSerializedValue(); + + internal static string ToSerializedValue(this NetworkSecurityGroupRuleAccess value) + { + switch( value ) + { + case NetworkSecurityGroupRuleAccess.Allow: + return "allow"; + case NetworkSecurityGroupRuleAccess.Deny: + return "deny"; + } + return null; + } + + internal static NetworkSecurityGroupRuleAccess? ParseNetworkSecurityGroupRuleAccess(this string value) + { + switch( value ) + { + case "allow": + return NetworkSecurityGroupRuleAccess.Allow; + case "deny": + return NetworkSecurityGroupRuleAccess.Deny; + } + return null; + } + } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/NodeAgentSku.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/NodeAgentSku.cs index f2b62f2efa01..c0913721ae0d 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/NodeAgentSku.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/NodeAgentSku.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// @@ -24,7 +30,10 @@ public partial class NodeAgentSku /// /// Initializes a new instance of the NodeAgentSku class. /// - public NodeAgentSku() { } + public NodeAgentSku() + { + CustomInit(); + } /// /// Initializes a new instance of the NodeAgentSku class. @@ -34,17 +43,23 @@ public NodeAgentSku() { } /// to be compatible with this node agent SKU. /// The type of operating system (e.g. Windows or /// Linux) compatible with the node agent SKU. - public NodeAgentSku(string id = default(string), System.Collections.Generic.IList verifiedImageReferences = default(System.Collections.Generic.IList), OSType? osType = default(OSType?)) + public NodeAgentSku(string id = default(string), IList verifiedImageReferences = default(IList), OSType? osType = default(OSType?)) { - this.Id = id; - this.VerifiedImageReferences = verifiedImageReferences; - this.OsType = osType; + Id = id; + VerifiedImageReferences = verifiedImageReferences; + OsType = osType; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the ID of the node agent SKU. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + [JsonProperty(PropertyName = "id")] public string Id { get; set; } /// @@ -55,8 +70,8 @@ public NodeAgentSku() { } /// This collection is not exhaustive (the node agent may be compatible /// with other images). /// - [Newtonsoft.Json.JsonProperty(PropertyName = "verifiedImageReferences")] - public System.Collections.Generic.IList VerifiedImageReferences { get; set; } + [JsonProperty(PropertyName = "verifiedImageReferences")] + public IList VerifiedImageReferences { get; set; } /// /// Gets or sets the type of operating system (e.g. Windows or Linux) @@ -65,7 +80,7 @@ public NodeAgentSku() { } /// /// Possible values include: 'linux', 'windows' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "osType")] + [JsonProperty(PropertyName = "osType")] public OSType? OsType { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/NodeDisableSchedulingParameter.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/NodeDisableSchedulingParameter.cs index 3298285b6a21..854b89ceacaf 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/NodeDisableSchedulingParameter.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/NodeDisableSchedulingParameter.cs @@ -8,6 +8,10 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; using System.Linq; /// @@ -19,7 +23,10 @@ public partial class NodeDisableSchedulingParameter /// Initializes a new instance of the NodeDisableSchedulingParameter /// class. /// - public NodeDisableSchedulingParameter() { } + public NodeDisableSchedulingParameter() + { + CustomInit(); + } /// /// Initializes a new instance of the NodeDisableSchedulingParameter @@ -30,18 +37,36 @@ public NodeDisableSchedulingParameter() { } /// node. public NodeDisableSchedulingParameter(DisableComputeNodeSchedulingOption? nodeDisableSchedulingOption = default(DisableComputeNodeSchedulingOption?)) { - this.NodeDisableSchedulingOption = nodeDisableSchedulingOption; + NodeDisableSchedulingOption = nodeDisableSchedulingOption; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets what to do with currently running tasks when disabling /// task scheduling on the compute node. /// /// + /// Values are: + /// + /// requeue - Terminate running task processes and requeue the tasks. + /// The tasks may run again on other compute nodes, or when task + /// scheduling is re-enabled on this node. Enter offline state as soon + /// as tasks have been terminated. + /// terminate - Terminate running tasks. The tasks will not run again. + /// Enter offline state as soon as tasks have been terminated. + /// taskcompletion - Allow currently running tasks to complete. + /// Schedule no new tasks while waiting. Enter offline state when all + /// tasks have completed. + /// /// The default value is requeue. Possible values include: 'requeue', /// 'terminate', 'taskCompletion' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "nodeDisableSchedulingOption")] + [JsonProperty(PropertyName = "nodeDisableSchedulingOption")] public DisableComputeNodeSchedulingOption? NodeDisableSchedulingOption { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/NodeFile.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/NodeFile.cs index 39ca75647a63..38bf53dc75c8 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/NodeFile.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/NodeFile.cs @@ -8,6 +8,10 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +22,10 @@ public partial class NodeFile /// /// Initializes a new instance of the NodeFile class. /// - public NodeFile() { } + public NodeFile() + { + CustomInit(); + } /// /// Initializes a new instance of the NodeFile class. @@ -30,47 +37,53 @@ public NodeFile() { } /// The file properties. public NodeFile(string name = default(string), string url = default(string), bool? isDirectory = default(bool?), FileProperties properties = default(FileProperties)) { - this.Name = name; - this.Url = url; - this.IsDirectory = isDirectory; - this.Properties = properties; + Name = name; + Url = url; + IsDirectory = isDirectory; + Properties = properties; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the file path. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// /// Gets or sets the URL of the file. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "url")] + [JsonProperty(PropertyName = "url")] public string Url { get; set; } /// /// Gets or sets whether the object represents a directory. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "isDirectory")] + [JsonProperty(PropertyName = "isDirectory")] public bool? IsDirectory { get; set; } /// /// Gets or sets the file properties. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties")] + [JsonProperty(PropertyName = "properties")] public FileProperties Properties { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (this.Properties != null) + if (Properties != null) { - this.Properties.Validate(); + Properties.Validate(); } } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/NodeRebootParameter.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/NodeRebootParameter.cs index c5ec117eddbb..56af6314894d 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/NodeRebootParameter.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/NodeRebootParameter.cs @@ -8,6 +8,10 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +22,10 @@ public partial class NodeRebootParameter /// /// Initializes a new instance of the NodeRebootParameter class. /// - public NodeRebootParameter() { } + public NodeRebootParameter() + { + CustomInit(); + } /// /// Initializes a new instance of the NodeRebootParameter class. @@ -27,18 +34,39 @@ public NodeRebootParameter() { } /// what to do with currently running tasks. public NodeRebootParameter(ComputeNodeRebootOption? nodeRebootOption = default(ComputeNodeRebootOption?)) { - this.NodeRebootOption = nodeRebootOption; + NodeRebootOption = nodeRebootOption; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets when to reboot the compute node and what to do with /// currently running tasks. /// /// + /// Values are: + /// + /// requeue - Terminate running task processes and requeue the tasks. + /// The tasks will run again when a node is available. Restart the node + /// as soon as tasks have been terminated. + /// terminate - Terminate running tasks. The tasks will not run again. + /// Restart the node as soon as tasks have been terminated. + /// taskcompletion - Allow currently running tasks to complete. + /// Schedule no new tasks while waiting. Restart the node when all + /// tasks have completed. + /// retaineddata - Allow currently running tasks to complete, then wait + /// for all task data retention periods to expire. Schedule no new + /// tasks while waiting. Restart the node when all task retention + /// periods have expired. + /// /// The default value is requeue. Possible values include: 'requeue', /// 'terminate', 'taskCompletion', 'retainedData' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "nodeRebootOption")] + [JsonProperty(PropertyName = "nodeRebootOption")] public ComputeNodeRebootOption? NodeRebootOption { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/NodeReimageParameter.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/NodeReimageParameter.cs index ff579223c780..bf56c6ac8360 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/NodeReimageParameter.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/NodeReimageParameter.cs @@ -8,6 +8,10 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +22,10 @@ public partial class NodeReimageParameter /// /// Initializes a new instance of the NodeReimageParameter class. /// - public NodeReimageParameter() { } + public NodeReimageParameter() + { + CustomInit(); + } /// /// Initializes a new instance of the NodeReimageParameter class. @@ -27,18 +34,39 @@ public NodeReimageParameter() { } /// and what to do with currently running tasks. public NodeReimageParameter(ComputeNodeReimageOption? nodeReimageOption = default(ComputeNodeReimageOption?)) { - this.NodeReimageOption = nodeReimageOption; + NodeReimageOption = nodeReimageOption; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets when to reimage the compute node and what to do with /// currently running tasks. /// /// + /// Values are: + /// + /// requeue - Terminate running task processes and requeue the tasks. + /// The tasks will run again when a node is available. Reimage the node + /// as soon as tasks have been terminated. + /// terminate - Terminate running tasks. The tasks will not run again. + /// Reimage the node as soon as tasks have been terminated. + /// taskcompletion - Allow currently running tasks to complete. + /// Schedule no new tasks while waiting. Reimage the node when all + /// tasks have completed. + /// retaineddata - Allow currently running tasks to complete, then wait + /// for all task data retention periods to expire. Schedule no new + /// tasks while waiting. Reimage the node when all task retention + /// periods have expired. + /// /// The default value is requeue. Possible values include: 'requeue', /// 'terminate', 'taskCompletion', 'retainedData' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "nodeReimageOption")] + [JsonProperty(PropertyName = "nodeReimageOption")] public ComputeNodeReimageOption? NodeReimageOption { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/NodeRemoveParameter.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/NodeRemoveParameter.cs index c3a23e592cc1..6b90c956c0ae 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/NodeRemoveParameter.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/NodeRemoveParameter.cs @@ -8,6 +8,13 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// @@ -18,31 +25,40 @@ public partial class NodeRemoveParameter /// /// Initializes a new instance of the NodeRemoveParameter class. /// - public NodeRemoveParameter() { } + public NodeRemoveParameter() + { + CustomInit(); + } /// /// Initializes a new instance of the NodeRemoveParameter class. /// - /// A list containing the ids of the compute + /// A list containing the IDs of the compute /// nodes to be removed from the specified pool. /// The timeout for removal of compute /// nodes to the pool. /// Determines what to do with a /// node and its running task(s) after it has been selected for /// deallocation. - public NodeRemoveParameter(System.Collections.Generic.IList nodeList, System.TimeSpan? resizeTimeout = default(System.TimeSpan?), ComputeNodeDeallocationOption? nodeDeallocationOption = default(ComputeNodeDeallocationOption?)) + public NodeRemoveParameter(IList nodeList, System.TimeSpan? resizeTimeout = default(System.TimeSpan?), ComputeNodeDeallocationOption? nodeDeallocationOption = default(ComputeNodeDeallocationOption?)) { - this.NodeList = nodeList; - this.ResizeTimeout = resizeTimeout; - this.NodeDeallocationOption = nodeDeallocationOption; + NodeList = nodeList; + ResizeTimeout = resizeTimeout; + NodeDeallocationOption = nodeDeallocationOption; + CustomInit(); } /// - /// Gets or sets a list containing the ids of the compute nodes to be + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets a list containing the IDs of the compute nodes to be /// removed from the specified pool. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "nodeList")] - public System.Collections.Generic.IList NodeList { get; set; } + [JsonProperty(PropertyName = "nodeList")] + public IList NodeList { get; set; } /// /// Gets or sets the timeout for removal of compute nodes to the pool. @@ -53,7 +69,7 @@ public NodeRemoveParameter() { } /// an error; if you are calling the REST API directly, the HTTP status /// code is 400 (Bad Request). /// - [Newtonsoft.Json.JsonProperty(PropertyName = "resizeTimeout")] + [JsonProperty(PropertyName = "resizeTimeout")] public System.TimeSpan? ResizeTimeout { get; set; } /// @@ -64,26 +80,26 @@ public NodeRemoveParameter() { } /// The default value is requeue. Possible values include: 'requeue', /// 'terminate', 'taskCompletion', 'retainedData' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "nodeDeallocationOption")] + [JsonProperty(PropertyName = "nodeDeallocationOption")] public ComputeNodeDeallocationOption? NodeDeallocationOption { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (this.NodeList == null) + if (NodeList == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "NodeList"); + throw new ValidationException(ValidationRules.CannotBeNull, "NodeList"); } - if (this.NodeList != null) + if (NodeList != null) { - if (this.NodeList.Count > 100) + if (NodeList.Count > 100) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxItems, "NodeList", 100); + throw new ValidationException(ValidationRules.MaxItems, "NodeList", 100); } } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/NodeUpdateUserParameter.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/NodeUpdateUserParameter.cs index c8cf9c60b232..25c91fb0d9a7 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/NodeUpdateUserParameter.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/NodeUpdateUserParameter.cs @@ -8,6 +8,10 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +22,10 @@ public partial class NodeUpdateUserParameter /// /// Initializes a new instance of the NodeUpdateUserParameter class. /// - public NodeUpdateUserParameter() { } + public NodeUpdateUserParameter() + { + CustomInit(); + } /// /// Initializes a new instance of the NodeUpdateUserParameter class. @@ -30,11 +37,17 @@ public NodeUpdateUserParameter() { } /// remote login to the compute node. public NodeUpdateUserParameter(string password = default(string), System.DateTime? expiryTime = default(System.DateTime?), string sshPublicKey = default(string)) { - this.Password = password; - this.ExpiryTime = expiryTime; - this.SshPublicKey = sshPublicKey; + Password = password; + ExpiryTime = expiryTime; + SshPublicKey = sshPublicKey; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the password of the account. /// @@ -46,7 +59,7 @@ public NodeUpdateUserParameter() { } /// with the sshPublicKey property. If omitted, any existing password /// is removed. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "password")] + [JsonProperty(PropertyName = "password")] public string Password { get; set; } /// @@ -56,7 +69,7 @@ public NodeUpdateUserParameter() { } /// If omitted, the default is 1 day from the current time. For Linux /// compute nodes, the expiryTime has a precision up to a day. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "expiryTime")] + [JsonProperty(PropertyName = "expiryTime")] public System.DateTime? ExpiryTime { get; set; } /// @@ -71,7 +84,7 @@ public NodeUpdateUserParameter() { } /// directly, the HTTP status code is 400 (Bad Request). If omitted, /// any existing SSH public key is removed. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "sshPublicKey")] + [JsonProperty(PropertyName = "sshPublicKey")] public string SshPublicKey { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/OSDisk.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/OSDisk.cs index 7aa10fa8e96c..9b9959de6fb8 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/OSDisk.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/OSDisk.cs @@ -8,6 +8,13 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// @@ -18,7 +25,10 @@ public partial class OSDisk /// /// Initializes a new instance of the OSDisk class. /// - public OSDisk() { } + public OSDisk() + { + CustomInit(); + } /// /// Initializes a new instance of the OSDisk class. @@ -27,12 +37,18 @@ public OSDisk() { } /// URIs. /// The type of caching to enable for the OS /// disk. - public OSDisk(System.Collections.Generic.IList imageUris, CachingType? caching = default(CachingType?)) + public OSDisk(IList imageUris, CachingType? caching = default(CachingType?)) { - this.ImageUris = imageUris; - this.Caching = caching; + ImageUris = imageUris; + Caching = caching; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the collection of Virtual Hard Disk (VHD) URIs. /// @@ -46,34 +62,38 @@ public OSDisk() { } /// the pool. If you do not supply enough VHD URIs, the pool will /// partially allocate compute nodes, and a resize error will occur. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "imageUris")] - public System.Collections.Generic.IList ImageUris { get; set; } + [JsonProperty(PropertyName = "imageUris")] + public IList ImageUris { get; set; } /// /// Gets or sets the type of caching to enable for the OS disk. /// /// - /// none - The caching mode for the disk is not enabled. readOnly - The - /// caching mode for the disk is read only. readWrite - The caching - /// mode for the disk is read and write. The default value for caching - /// is none. For information about the caching options see: + /// Values are: + /// + /// none - The caching mode for the disk is not enabled. + /// readOnly - The caching mode for the disk is read only. + /// readWrite - The caching mode for the disk is read and write. + /// + /// The default value for caching is none. For information about the + /// caching options see: /// https://blogs.msdn.microsoft.com/windowsazurestorage/2012/06/27/exploring-windows-azure-drives-disks-and-images/. /// Possible values include: 'none', 'readOnly', 'readWrite' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "caching")] + [JsonProperty(PropertyName = "caching")] public CachingType? Caching { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (this.ImageUris == null) + if (ImageUris == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "ImageUris"); + throw new ValidationException(ValidationRules.CannotBeNull, "ImageUris"); } } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/OSType.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/OSType.cs index d617adf61c84..89f0f88d22e8 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/OSType.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/OSType.cs @@ -8,16 +8,52 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; /// /// Defines values for OSType. /// - [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + [JsonConverter(typeof(StringEnumConverter))] public enum OSType { - [System.Runtime.Serialization.EnumMember(Value = "linux")] + [EnumMember(Value = "linux")] Linux, - [System.Runtime.Serialization.EnumMember(Value = "windows")] + [EnumMember(Value = "windows")] Windows } + internal static class OSTypeEnumExtension + { + internal static string ToSerializedValue(this OSType? value) => + value == null ? null : ((OSType)value).ToSerializedValue(); + + internal static string ToSerializedValue(this OSType value) + { + switch( value ) + { + case OSType.Linux: + return "linux"; + case OSType.Windows: + return "windows"; + } + return null; + } + + internal static OSType? ParseOSType(this string value) + { + switch( value ) + { + case "linux": + return OSType.Linux; + case "windows": + return OSType.Windows; + } + return null; + } + } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/OnAllTasksComplete.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/OnAllTasksComplete.cs index 361d1ec24c3d..d6aedae26a79 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/OnAllTasksComplete.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/OnAllTasksComplete.cs @@ -8,16 +8,52 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; /// /// Defines values for OnAllTasksComplete. /// - [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + [JsonConverter(typeof(StringEnumConverter))] public enum OnAllTasksComplete { - [System.Runtime.Serialization.EnumMember(Value = "noAction")] + [EnumMember(Value = "noAction")] NoAction, - [System.Runtime.Serialization.EnumMember(Value = "terminateJob")] + [EnumMember(Value = "terminateJob")] TerminateJob } + internal static class OnAllTasksCompleteEnumExtension + { + internal static string ToSerializedValue(this OnAllTasksComplete? value) => + value == null ? null : ((OnAllTasksComplete)value).ToSerializedValue(); + + internal static string ToSerializedValue(this OnAllTasksComplete value) + { + switch( value ) + { + case OnAllTasksComplete.NoAction: + return "noAction"; + case OnAllTasksComplete.TerminateJob: + return "terminateJob"; + } + return null; + } + + internal static OnAllTasksComplete? ParseOnAllTasksComplete(this string value) + { + switch( value ) + { + case "noAction": + return OnAllTasksComplete.NoAction; + case "terminateJob": + return OnAllTasksComplete.TerminateJob; + } + return null; + } + } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/OnTaskFailure.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/OnTaskFailure.cs index 5d87f3f43a78..72ab2ed2a27d 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/OnTaskFailure.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/OnTaskFailure.cs @@ -8,16 +8,52 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; /// /// Defines values for OnTaskFailure. /// - [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + [JsonConverter(typeof(StringEnumConverter))] public enum OnTaskFailure { - [System.Runtime.Serialization.EnumMember(Value = "noAction")] + [EnumMember(Value = "noAction")] NoAction, - [System.Runtime.Serialization.EnumMember(Value = "performExitOptionsJobAction")] + [EnumMember(Value = "performExitOptionsJobAction")] PerformExitOptionsJobAction } + internal static class OnTaskFailureEnumExtension + { + internal static string ToSerializedValue(this OnTaskFailure? value) => + value == null ? null : ((OnTaskFailure)value).ToSerializedValue(); + + internal static string ToSerializedValue(this OnTaskFailure value) + { + switch( value ) + { + case OnTaskFailure.NoAction: + return "noAction"; + case OnTaskFailure.PerformExitOptionsJobAction: + return "performExitOptionsJobAction"; + } + return null; + } + + internal static OnTaskFailure? ParseOnTaskFailure(this string value) + { + switch( value ) + { + case "noAction": + return OnTaskFailure.NoAction; + case "performExitOptionsJobAction": + return OnTaskFailure.PerformExitOptionsJobAction; + } + return null; + } + } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/OutputFile.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/OutputFile.cs index ac6a67dc63bf..b74f77250175 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/OutputFile.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/OutputFile.cs @@ -8,6 +8,11 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Newtonsoft.Json; using System.Linq; /// @@ -20,7 +25,10 @@ public partial class OutputFile /// /// Initializes a new instance of the OutputFile class. /// - public OutputFile() { } + public OutputFile() + { + CustomInit(); + } /// /// Initializes a new instance of the OutputFile class. @@ -34,11 +42,17 @@ public OutputFile() { } /// upload. public OutputFile(string filePattern, OutputFileDestination destination, OutputFileUploadOptions uploadOptions) { - this.FilePattern = filePattern; - this.Destination = destination; - this.UploadOptions = uploadOptions; + FilePattern = filePattern; + Destination = destination; + UploadOptions = uploadOptions; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets a pattern indicating which file(s) to upload. /// @@ -62,49 +76,49 @@ public OutputFile(string filePattern, OutputFileDestination destination, OutputF /// variables (%var% on Windows or $var on Linux) are expanded prior to /// the pattern being applied. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "filePattern")] + [JsonProperty(PropertyName = "filePattern")] public string FilePattern { get; set; } /// /// Gets or sets the destination for the output file(s). /// - [Newtonsoft.Json.JsonProperty(PropertyName = "destination")] + [JsonProperty(PropertyName = "destination")] public OutputFileDestination Destination { get; set; } /// /// Gets or sets additional options for the upload operation, including /// under what conditions to perform the upload. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "uploadOptions")] + [JsonProperty(PropertyName = "uploadOptions")] public OutputFileUploadOptions UploadOptions { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (this.FilePattern == null) + if (FilePattern == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "FilePattern"); + throw new ValidationException(ValidationRules.CannotBeNull, "FilePattern"); } - if (this.Destination == null) + if (Destination == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Destination"); + throw new ValidationException(ValidationRules.CannotBeNull, "Destination"); } - if (this.UploadOptions == null) + if (UploadOptions == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "UploadOptions"); + throw new ValidationException(ValidationRules.CannotBeNull, "UploadOptions"); } - if (this.Destination != null) + if (Destination != null) { - this.Destination.Validate(); + Destination.Validate(); } - if (this.UploadOptions != null) + if (UploadOptions != null) { - this.UploadOptions.Validate(); + UploadOptions.Validate(); } } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/OutputFileBlobContainerDestination.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/OutputFileBlobContainerDestination.cs index 17c9e611d8d2..a3aef2972e57 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/OutputFileBlobContainerDestination.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/OutputFileBlobContainerDestination.cs @@ -8,6 +8,11 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Newtonsoft.Json; using System.Linq; /// @@ -20,7 +25,10 @@ public partial class OutputFileBlobContainerDestination /// Initializes a new instance of the /// OutputFileBlobContainerDestination class. /// - public OutputFileBlobContainerDestination() { } + public OutputFileBlobContainerDestination() + { + CustomInit(); + } /// /// Initializes a new instance of the @@ -32,10 +40,16 @@ public OutputFileBlobContainerDestination() { } /// the Azure Storage container. public OutputFileBlobContainerDestination(string containerUrl, string path = default(string)) { - this.Path = path; - this.ContainerUrl = containerUrl; + Path = path; + ContainerUrl = containerUrl; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the destination blob or virtual directory within the /// Azure Storage container. @@ -50,7 +64,7 @@ public OutputFileBlobContainerDestination() { } /// the root of the container with a blob name matching their file /// name. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "path")] + [JsonProperty(PropertyName = "path")] public string Path { get; set; } /// @@ -61,20 +75,20 @@ public OutputFileBlobContainerDestination() { } /// The URL must include a Shared Access Signature (SAS) granting write /// permissions to the container. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "containerUrl")] + [JsonProperty(PropertyName = "containerUrl")] public string ContainerUrl { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (this.ContainerUrl == null) + if (ContainerUrl == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "ContainerUrl"); + throw new ValidationException(ValidationRules.CannotBeNull, "ContainerUrl"); } } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/OutputFileDestination.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/OutputFileDestination.cs index aec5af85df13..d0aed0623868 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/OutputFileDestination.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/OutputFileDestination.cs @@ -8,6 +8,10 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +22,10 @@ public partial class OutputFileDestination /// /// Initializes a new instance of the OutputFileDestination class. /// - public OutputFileDestination() { } + public OutputFileDestination() + { + CustomInit(); + } /// /// Initializes a new instance of the OutputFileDestination class. @@ -27,27 +34,33 @@ public OutputFileDestination() { } /// files are uploaded. public OutputFileDestination(OutputFileBlobContainerDestination container = default(OutputFileBlobContainerDestination)) { - this.Container = container; + Container = container; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets a location in Azure blob storage to which files are /// uploaded. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "container")] + [JsonProperty(PropertyName = "container")] public OutputFileBlobContainerDestination Container { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (this.Container != null) + if (Container != null) { - this.Container.Validate(); + Container.Validate(); } } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/OutputFileUploadCondition.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/OutputFileUploadCondition.cs index 72413b39d339..22e6b2bd97a8 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/OutputFileUploadCondition.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/OutputFileUploadCondition.cs @@ -8,18 +8,58 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; /// /// Defines values for OutputFileUploadCondition. /// - [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + [JsonConverter(typeof(StringEnumConverter))] public enum OutputFileUploadCondition { - [System.Runtime.Serialization.EnumMember(Value = "taskSuccess")] + [EnumMember(Value = "taskSuccess")] TaskSuccess, - [System.Runtime.Serialization.EnumMember(Value = "taskFailure")] + [EnumMember(Value = "taskFailure")] TaskFailure, - [System.Runtime.Serialization.EnumMember(Value = "taskCompletion")] + [EnumMember(Value = "taskCompletion")] TaskCompletion } + internal static class OutputFileUploadConditionEnumExtension + { + internal static string ToSerializedValue(this OutputFileUploadCondition? value) => + value == null ? null : ((OutputFileUploadCondition)value).ToSerializedValue(); + + internal static string ToSerializedValue(this OutputFileUploadCondition value) + { + switch( value ) + { + case OutputFileUploadCondition.TaskSuccess: + return "taskSuccess"; + case OutputFileUploadCondition.TaskFailure: + return "taskFailure"; + case OutputFileUploadCondition.TaskCompletion: + return "taskCompletion"; + } + return null; + } + + internal static OutputFileUploadCondition? ParseOutputFileUploadCondition(this string value) + { + switch( value ) + { + case "taskSuccess": + return OutputFileUploadCondition.TaskSuccess; + case "taskFailure": + return OutputFileUploadCondition.TaskFailure; + case "taskCompletion": + return OutputFileUploadCondition.TaskCompletion; + } + return null; + } + } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/OutputFileUploadOptions.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/OutputFileUploadOptions.cs index 02cebd3aec4d..28616db0b847 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/OutputFileUploadOptions.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/OutputFileUploadOptions.cs @@ -8,6 +8,10 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; using System.Linq; /// @@ -19,7 +23,10 @@ public partial class OutputFileUploadOptions /// /// Initializes a new instance of the OutputFileUploadOptions class. /// - public OutputFileUploadOptions() { } + public OutputFileUploadOptions() + { + CustomInit(); + } /// /// Initializes a new instance of the OutputFileUploadOptions class. @@ -28,9 +35,15 @@ public OutputFileUploadOptions() { } /// output file or set of files should be uploaded. public OutputFileUploadOptions(OutputFileUploadCondition uploadCondition) { - this.UploadCondition = uploadCondition; + UploadCondition = uploadCondition; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the conditions under which the task output file or set /// of files should be uploaded. @@ -39,13 +52,13 @@ public OutputFileUploadOptions(OutputFileUploadCondition uploadCondition) /// The default is taskCompletion. Possible values include: /// 'taskSuccess', 'taskFailure', 'taskCompletion' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "uploadCondition")] + [JsonProperty(PropertyName = "uploadCondition")] public OutputFileUploadCondition UploadCondition { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/Page.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/Page.cs index ba2742884f57..3d2e9d1a8384 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/Page.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/Page.cs @@ -8,37 +8,45 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + 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("odata.nextLink")] - public System.String NextPageLink { get; private set; } + [JsonProperty("odata.nextLink")] + 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/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolAddHeaders.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolAddHeaders.cs index 80bff665912d..9f251781828f 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolAddHeaders.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolAddHeaders.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class PoolAddHeaders /// /// Initializes a new instance of the PoolAddHeaders class. /// - public PoolAddHeaders() { } + public PoolAddHeaders() + { + CustomInit(); + } /// /// Initializes a new instance of the PoolAddHeaders class. @@ -44,19 +53,25 @@ public PoolAddHeaders() { } /// the request applied. public PoolAddHeaders(System.Guid? clientRequestId = default(System.Guid?), System.Guid? requestId = default(System.Guid?), string eTag = default(string), System.DateTime? lastModified = default(System.DateTime?), string dataServiceId = default(string)) { - this.ClientRequestId = clientRequestId; - this.RequestId = requestId; - this.ETag = eTag; - this.LastModified = lastModified; - this.DataServiceId = dataServiceId; + ClientRequestId = clientRequestId; + RequestId = requestId; + ETag = eTag; + LastModified = lastModified; + DataServiceId = dataServiceId; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the client-request-id provided by the client during /// the request. This will be returned only if the /// return-client-request-id parameter was set to true. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "client-request-id")] + [JsonProperty(PropertyName = "client-request-id")] public System.Guid? ClientRequestId { get; set; } /// @@ -68,7 +83,7 @@ public PoolAddHeaders() { } /// request was made, the Batch account against which the request was /// made, and the region that account resides in. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "request-id")] + [JsonProperty(PropertyName = "request-id")] public System.Guid? RequestId { get; set; } /// @@ -78,21 +93,21 @@ public PoolAddHeaders() { } /// the If-Modified-Since, If-Unmodified-Since, If-Match or /// If-None-Match headers. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "ETag")] + [JsonProperty(PropertyName = "ETag")] public string ETag { get; set; } /// /// Gets or sets the time at which the resource was last modified. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "Last-Modified")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "Last-Modified")] public System.DateTime? LastModified { get; set; } /// /// Gets or sets the OData ID of the resource to which the request /// applied. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "DataServiceId")] + [JsonProperty(PropertyName = "DataServiceId")] public string DataServiceId { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolAddOptions.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolAddOptions.cs index 37670610df94..3495e19636b9 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolAddOptions.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolAddOptions.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class PoolAddOptions /// /// Initializes a new instance of the PoolAddOptions class. /// - public PoolAddOptions() { } + public PoolAddOptions() + { + CustomInit(); + } /// /// Initializes a new instance of the PoolAddOptions class. @@ -36,17 +45,23 @@ public PoolAddOptions() { } /// it explicitly if you are calling the REST API directly. public PoolAddOptions(int? timeout = default(int?), System.Guid? clientRequestId = default(System.Guid?), bool? returnClientRequestId = default(bool?), System.DateTime? ocpDate = default(System.DateTime?)) { - this.Timeout = timeout; - this.ClientRequestId = clientRequestId; - this.ReturnClientRequestId = returnClientRequestId; - this.OcpDate = ocpDate; + Timeout = timeout; + ClientRequestId = clientRequestId; + ReturnClientRequestId = returnClientRequestId; + OcpDate = ocpDate; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the maximum time that the server can spend processing /// the request, in seconds. The default is 30 seconds. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public int? Timeout { get; set; } /// @@ -54,14 +69,14 @@ public PoolAddOptions() { } /// a GUID with no decoration such as curly braces, e.g. /// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public System.Guid? ClientRequestId { get; set; } /// /// Gets or sets whether the server should return the client-request-id /// in the response. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public bool? ReturnClientRequestId { get; set; } /// @@ -69,8 +84,8 @@ public PoolAddOptions() { } /// typically set this to the current system clock time; set it /// explicitly if you are calling the REST API directly. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? OcpDate { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolAddParameter.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolAddParameter.cs index 6eb099e2a7da..5b34ebe0d224 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolAddParameter.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolAddParameter.cs @@ -8,6 +8,13 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// @@ -18,7 +25,10 @@ public partial class PoolAddParameter /// /// Initializes a new instance of the PoolAddParameter class. /// - public PoolAddParameter() { } + public PoolAddParameter() + { + CustomInit(); + } /// /// Initializes a new instance of the PoolAddParameter class. @@ -60,37 +70,43 @@ public PoolAddParameter() { } /// pool. /// The maximum number of tasks that can /// run concurrently on a single compute node in the pool. - /// How the Batch service - /// distributes tasks between compute nodes in the pool. + /// How tasks are distributed across + /// compute nodes in a pool. /// The list of user accounts to be created /// on each node in the pool. /// A list of name-value pairs associated with /// the pool as metadata. - public PoolAddParameter(string id, string vmSize, string displayName = default(string), CloudServiceConfiguration cloudServiceConfiguration = default(CloudServiceConfiguration), VirtualMachineConfiguration virtualMachineConfiguration = default(VirtualMachineConfiguration), System.TimeSpan? resizeTimeout = default(System.TimeSpan?), int? targetDedicatedNodes = default(int?), int? targetLowPriorityNodes = default(int?), bool? enableAutoScale = default(bool?), string autoScaleFormula = default(string), System.TimeSpan? autoScaleEvaluationInterval = default(System.TimeSpan?), bool? enableInterNodeCommunication = default(bool?), NetworkConfiguration networkConfiguration = default(NetworkConfiguration), StartTask startTask = default(StartTask), System.Collections.Generic.IList certificateReferences = default(System.Collections.Generic.IList), System.Collections.Generic.IList applicationPackageReferences = default(System.Collections.Generic.IList), System.Collections.Generic.IList applicationLicenses = default(System.Collections.Generic.IList), int? maxTasksPerNode = default(int?), TaskSchedulingPolicy taskSchedulingPolicy = default(TaskSchedulingPolicy), System.Collections.Generic.IList userAccounts = default(System.Collections.Generic.IList), System.Collections.Generic.IList metadata = default(System.Collections.Generic.IList)) + public PoolAddParameter(string id, string vmSize, string displayName = default(string), CloudServiceConfiguration cloudServiceConfiguration = default(CloudServiceConfiguration), VirtualMachineConfiguration virtualMachineConfiguration = default(VirtualMachineConfiguration), System.TimeSpan? resizeTimeout = default(System.TimeSpan?), int? targetDedicatedNodes = default(int?), int? targetLowPriorityNodes = default(int?), bool? enableAutoScale = default(bool?), string autoScaleFormula = default(string), System.TimeSpan? autoScaleEvaluationInterval = default(System.TimeSpan?), bool? enableInterNodeCommunication = default(bool?), NetworkConfiguration networkConfiguration = default(NetworkConfiguration), StartTask startTask = default(StartTask), IList certificateReferences = default(IList), IList applicationPackageReferences = default(IList), IList applicationLicenses = default(IList), int? maxTasksPerNode = default(int?), TaskSchedulingPolicy taskSchedulingPolicy = default(TaskSchedulingPolicy), IList userAccounts = default(IList), IList metadata = default(IList)) { - this.Id = id; - this.DisplayName = displayName; - this.VmSize = vmSize; - this.CloudServiceConfiguration = cloudServiceConfiguration; - this.VirtualMachineConfiguration = virtualMachineConfiguration; - this.ResizeTimeout = resizeTimeout; - this.TargetDedicatedNodes = targetDedicatedNodes; - this.TargetLowPriorityNodes = targetLowPriorityNodes; - this.EnableAutoScale = enableAutoScale; - this.AutoScaleFormula = autoScaleFormula; - this.AutoScaleEvaluationInterval = autoScaleEvaluationInterval; - this.EnableInterNodeCommunication = enableInterNodeCommunication; - this.NetworkConfiguration = networkConfiguration; - this.StartTask = startTask; - this.CertificateReferences = certificateReferences; - this.ApplicationPackageReferences = applicationPackageReferences; - this.ApplicationLicenses = applicationLicenses; - this.MaxTasksPerNode = maxTasksPerNode; - this.TaskSchedulingPolicy = taskSchedulingPolicy; - this.UserAccounts = userAccounts; - this.Metadata = metadata; + Id = id; + DisplayName = displayName; + VmSize = vmSize; + CloudServiceConfiguration = cloudServiceConfiguration; + VirtualMachineConfiguration = virtualMachineConfiguration; + ResizeTimeout = resizeTimeout; + TargetDedicatedNodes = targetDedicatedNodes; + TargetLowPriorityNodes = targetLowPriorityNodes; + EnableAutoScale = enableAutoScale; + AutoScaleFormula = autoScaleFormula; + AutoScaleEvaluationInterval = autoScaleEvaluationInterval; + EnableInterNodeCommunication = enableInterNodeCommunication; + NetworkConfiguration = networkConfiguration; + StartTask = startTask; + CertificateReferences = certificateReferences; + ApplicationPackageReferences = applicationPackageReferences; + ApplicationLicenses = applicationLicenses; + MaxTasksPerNode = maxTasksPerNode; + TaskSchedulingPolicy = taskSchedulingPolicy; + UserAccounts = userAccounts; + Metadata = metadata; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets a string that uniquely identifies the pool within the /// account. @@ -102,7 +118,7 @@ public PoolAddParameter() { } /// is, you may not have two pool IDs within an account that differ /// only by case). /// - [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + [JsonProperty(PropertyName = "id")] public string Id { get; set; } /// @@ -112,7 +128,7 @@ public PoolAddParameter() { } /// The display name need not be unique and can contain any Unicode /// characters up to a maximum length of 1024. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "displayName")] + [JsonProperty(PropertyName = "displayName")] public string DisplayName { get; set; } /// @@ -135,7 +151,7 @@ public PoolAddParameter() { } /// premium storage (STANDARD_GS, STANDARD_DS, and STANDARD_DSV2 /// series). /// - [Newtonsoft.Json.JsonProperty(PropertyName = "vmSize")] + [JsonProperty(PropertyName = "vmSize")] public string VmSize { get; set; } /// @@ -147,7 +163,7 @@ public PoolAddParameter() { } /// property cannot be specified if the Batch account was created with /// its poolAllocationMode property set to 'UserSubscription'. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "cloudServiceConfiguration")] + [JsonProperty(PropertyName = "cloudServiceConfiguration")] public CloudServiceConfiguration CloudServiceConfiguration { get; set; } /// @@ -157,7 +173,7 @@ public PoolAddParameter() { } /// This property and cloudServiceConfiguration are mutually exclusive /// and one of the properties must be specified. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "virtualMachineConfiguration")] + [JsonProperty(PropertyName = "virtualMachineConfiguration")] public VirtualMachineConfiguration VirtualMachineConfiguration { get; set; } /// @@ -171,7 +187,7 @@ public PoolAddParameter() { } /// minutes, the Batch service returns an error; if you are calling the /// REST API directly, the HTTP status code is 400 (Bad Request). /// - [Newtonsoft.Json.JsonProperty(PropertyName = "resizeTimeout")] + [JsonProperty(PropertyName = "resizeTimeout")] public System.TimeSpan? ResizeTimeout { get; set; } /// @@ -183,7 +199,7 @@ public PoolAddParameter() { } /// true. If enableAutoScale is set to false, then you must set either /// targetDedicatedNodes, targetLowPriorityNodes, or both. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "targetDedicatedNodes")] + [JsonProperty(PropertyName = "targetDedicatedNodes")] public int? TargetDedicatedNodes { get; set; } /// @@ -195,7 +211,7 @@ public PoolAddParameter() { } /// true. If enableAutoScale is set to false, then you must set either /// targetDedicatedNodes, targetLowPriorityNodes, or both. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "targetLowPriorityNodes")] + [JsonProperty(PropertyName = "targetLowPriorityNodes")] public int? TargetLowPriorityNodes { get; set; } /// @@ -208,7 +224,7 @@ public PoolAddParameter() { } /// autoScaleFormula property is required and the pool automatically /// resizes according to the formula. The default value is false. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "enableAutoScale")] + [JsonProperty(PropertyName = "enableAutoScale")] public bool? EnableAutoScale { get; set; } /// @@ -225,7 +241,7 @@ public PoolAddParameter() { } /// Batch pool' /// (https://azure.microsoft.com/documentation/articles/batch-automatic-scaling/). /// - [Newtonsoft.Json.JsonProperty(PropertyName = "autoScaleFormula")] + [JsonProperty(PropertyName = "autoScaleFormula")] public string AutoScaleFormula { get; set; } /// @@ -239,7 +255,7 @@ public PoolAddParameter() { } /// an error; if you are calling the REST API directly, the HTTP status /// code is 400 (Bad Request). /// - [Newtonsoft.Json.JsonProperty(PropertyName = "autoScaleEvaluationInterval")] + [JsonProperty(PropertyName = "autoScaleEvaluationInterval")] public System.TimeSpan? AutoScaleEvaluationInterval { get; set; } /// @@ -252,13 +268,13 @@ public PoolAddParameter() { } /// may result in the pool not reaching its desired size. The default /// value is false. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "enableInterNodeCommunication")] + [JsonProperty(PropertyName = "enableInterNodeCommunication")] public bool? EnableInterNodeCommunication { get; set; } /// /// Gets or sets the network configuration for the pool. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "networkConfiguration")] + [JsonProperty(PropertyName = "networkConfiguration")] public NetworkConfiguration NetworkConfiguration { get; set; } /// @@ -269,7 +285,7 @@ public PoolAddParameter() { } /// The task runs when the node is added to the pool or when the node /// is restarted. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "startTask")] + [JsonProperty(PropertyName = "startTask")] public StartTask StartTask { get; set; } /// @@ -287,15 +303,15 @@ public PoolAddParameter() { } /// /home/{user-name}/certs) and certificates are placed in that /// directory. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "certificateReferences")] - public System.Collections.Generic.IList CertificateReferences { get; set; } + [JsonProperty(PropertyName = "certificateReferences")] + public IList CertificateReferences { get; set; } /// /// Gets or sets the list of application packages to be installed on /// each compute node in the pool. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "applicationPackageReferences")] - public System.Collections.Generic.IList ApplicationPackageReferences { get; set; } + [JsonProperty(PropertyName = "applicationPackageReferences")] + public IList ApplicationPackageReferences { get; set; } /// /// Gets or sets the list of application licenses the Batch service @@ -306,8 +322,8 @@ public PoolAddParameter() { } /// Batch service application licenses. If a license is requested which /// is not supported, pool creation will fail. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "applicationLicenses")] - public System.Collections.Generic.IList ApplicationLicenses { get; set; } + [JsonProperty(PropertyName = "applicationLicenses")] + public IList ApplicationLicenses { get; set; } /// /// Gets or sets the maximum number of tasks that can run concurrently @@ -317,22 +333,22 @@ public PoolAddParameter() { } /// The default value is 1. The maximum value of this setting depends /// on the size of the compute nodes in the pool (the vmSize setting). /// - [Newtonsoft.Json.JsonProperty(PropertyName = "maxTasksPerNode")] + [JsonProperty(PropertyName = "maxTasksPerNode")] public int? MaxTasksPerNode { get; set; } /// - /// Gets or sets how the Batch service distributes tasks between - /// compute nodes in the pool. + /// Gets or sets how tasks are distributed across compute nodes in a + /// pool. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "taskSchedulingPolicy")] + [JsonProperty(PropertyName = "taskSchedulingPolicy")] public TaskSchedulingPolicy TaskSchedulingPolicy { get; set; } /// /// Gets or sets the list of user accounts to be created on each node /// in the pool. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "userAccounts")] - public System.Collections.Generic.IList UserAccounts { get; set; } + [JsonProperty(PropertyName = "userAccounts")] + public IList UserAccounts { get; set; } /// /// Gets or sets a list of name-value pairs associated with the pool as @@ -342,44 +358,44 @@ public PoolAddParameter() { } /// The Batch service does not assign any meaning to metadata; it is /// solely for the use of user code. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "metadata")] - public System.Collections.Generic.IList Metadata { get; set; } + [JsonProperty(PropertyName = "metadata")] + public IList Metadata { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (this.Id == null) + if (Id == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Id"); + throw new ValidationException(ValidationRules.CannotBeNull, "Id"); } - if (this.VmSize == null) + if (VmSize == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "VmSize"); + throw new ValidationException(ValidationRules.CannotBeNull, "VmSize"); } - if (this.CloudServiceConfiguration != null) + if (CloudServiceConfiguration != null) { - this.CloudServiceConfiguration.Validate(); + CloudServiceConfiguration.Validate(); } - if (this.VirtualMachineConfiguration != null) + if (VirtualMachineConfiguration != null) { - this.VirtualMachineConfiguration.Validate(); + VirtualMachineConfiguration.Validate(); } - if (this.NetworkConfiguration != null) + if (NetworkConfiguration != null) { - this.NetworkConfiguration.Validate(); + NetworkConfiguration.Validate(); } - if (this.StartTask != null) + if (StartTask != null) { - this.StartTask.Validate(); + StartTask.Validate(); } - if (this.CertificateReferences != null) + if (CertificateReferences != null) { - foreach (var element in this.CertificateReferences) + foreach (var element in CertificateReferences) { if (element != null) { @@ -387,9 +403,9 @@ public virtual void Validate() } } } - if (this.ApplicationPackageReferences != null) + if (ApplicationPackageReferences != null) { - foreach (var element1 in this.ApplicationPackageReferences) + foreach (var element1 in ApplicationPackageReferences) { if (element1 != null) { @@ -397,13 +413,13 @@ public virtual void Validate() } } } - if (this.TaskSchedulingPolicy != null) + if (TaskSchedulingPolicy != null) { - this.TaskSchedulingPolicy.Validate(); + TaskSchedulingPolicy.Validate(); } - if (this.UserAccounts != null) + if (UserAccounts != null) { - foreach (var element2 in this.UserAccounts) + foreach (var element2 in UserAccounts) { if (element2 != null) { @@ -411,9 +427,9 @@ public virtual void Validate() } } } - if (this.Metadata != null) + if (Metadata != null) { - foreach (var element3 in this.Metadata) + foreach (var element3 in Metadata) { if (element3 != null) { diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolDeleteHeaders.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolDeleteHeaders.cs index dfb10efa2d64..4b4cab1d1ec7 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolDeleteHeaders.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolDeleteHeaders.cs @@ -8,6 +8,10 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +22,10 @@ public partial class PoolDeleteHeaders /// /// Initializes a new instance of the PoolDeleteHeaders class. /// - public PoolDeleteHeaders() { } + public PoolDeleteHeaders() + { + CustomInit(); + } /// /// Initializes a new instance of the PoolDeleteHeaders class. @@ -35,16 +42,22 @@ public PoolDeleteHeaders() { } /// request was made, and the region that account resides in. public PoolDeleteHeaders(string clientRequestId = default(string), string requestId = default(string)) { - this.ClientRequestId = clientRequestId; - this.RequestId = requestId; + ClientRequestId = clientRequestId; + RequestId = requestId; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the client-request-id provided by the client during /// the request. This will be returned only if the /// return-client-request-id parameter was set to true. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "client-request-id")] + [JsonProperty(PropertyName = "client-request-id")] public string ClientRequestId { get; set; } /// @@ -56,7 +69,7 @@ public PoolDeleteHeaders() { } /// request was made, the Batch account against which the request was /// made, and the region that account resides in. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "request-id")] + [JsonProperty(PropertyName = "request-id")] public string RequestId { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolDeleteOptions.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolDeleteOptions.cs index a503d6338a72..49cc416b05bb 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolDeleteOptions.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolDeleteOptions.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class PoolDeleteOptions /// /// Initializes a new instance of the PoolDeleteOptions class. /// - public PoolDeleteOptions() { } + public PoolDeleteOptions() + { + CustomInit(); + } /// /// Initializes a new instance of the PoolDeleteOptions class. @@ -52,21 +61,27 @@ public PoolDeleteOptions() { } /// modified since the specified time. public PoolDeleteOptions(int? timeout = default(int?), System.Guid? clientRequestId = default(System.Guid?), bool? returnClientRequestId = default(bool?), System.DateTime? ocpDate = default(System.DateTime?), string ifMatch = default(string), string ifNoneMatch = default(string), System.DateTime? ifModifiedSince = default(System.DateTime?), System.DateTime? ifUnmodifiedSince = default(System.DateTime?)) { - this.Timeout = timeout; - this.ClientRequestId = clientRequestId; - this.ReturnClientRequestId = returnClientRequestId; - this.OcpDate = ocpDate; - this.IfMatch = ifMatch; - this.IfNoneMatch = ifNoneMatch; - this.IfModifiedSince = ifModifiedSince; - this.IfUnmodifiedSince = ifUnmodifiedSince; + Timeout = timeout; + ClientRequestId = clientRequestId; + ReturnClientRequestId = returnClientRequestId; + OcpDate = ocpDate; + IfMatch = ifMatch; + IfNoneMatch = ifNoneMatch; + IfModifiedSince = ifModifiedSince; + IfUnmodifiedSince = ifUnmodifiedSince; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the maximum time that the server can spend processing /// the request, in seconds. The default is 30 seconds. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public int? Timeout { get; set; } /// @@ -74,14 +89,14 @@ public PoolDeleteOptions() { } /// a GUID with no decoration such as curly braces, e.g. /// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public System.Guid? ClientRequestId { get; set; } /// /// Gets or sets whether the server should return the client-request-id /// in the response. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public bool? ReturnClientRequestId { get; set; } /// @@ -89,8 +104,8 @@ public PoolDeleteOptions() { } /// typically set this to the current system clock time; set it /// explicitly if you are calling the REST API directly. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? OcpDate { get; set; } /// @@ -99,7 +114,7 @@ public PoolDeleteOptions() { } /// if the resource's current ETag on the service exactly matches the /// value specified by the client. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public string IfMatch { get; set; } /// @@ -108,7 +123,7 @@ public PoolDeleteOptions() { } /// if the resource's current ETag on the service does not match the /// value specified by the client. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public string IfNoneMatch { get; set; } /// @@ -117,8 +132,8 @@ public PoolDeleteOptions() { } /// if the resource on the service has been modified since the /// specified time. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? IfModifiedSince { get; set; } /// @@ -127,8 +142,8 @@ public PoolDeleteOptions() { } /// if the resource on the service has not been modified since the /// specified time. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? IfUnmodifiedSince { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolDisableAutoScaleHeaders.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolDisableAutoScaleHeaders.cs index a706d5579c7c..aec8357ab491 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolDisableAutoScaleHeaders.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolDisableAutoScaleHeaders.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -19,7 +25,10 @@ public partial class PoolDisableAutoScaleHeaders /// Initializes a new instance of the PoolDisableAutoScaleHeaders /// class. /// - public PoolDisableAutoScaleHeaders() { } + public PoolDisableAutoScaleHeaders() + { + CustomInit(); + } /// /// Initializes a new instance of the PoolDisableAutoScaleHeaders @@ -46,19 +55,25 @@ public PoolDisableAutoScaleHeaders() { } /// the request applied. public PoolDisableAutoScaleHeaders(System.Guid? clientRequestId = default(System.Guid?), System.Guid? requestId = default(System.Guid?), string eTag = default(string), System.DateTime? lastModified = default(System.DateTime?), string dataServiceId = default(string)) { - this.ClientRequestId = clientRequestId; - this.RequestId = requestId; - this.ETag = eTag; - this.LastModified = lastModified; - this.DataServiceId = dataServiceId; + ClientRequestId = clientRequestId; + RequestId = requestId; + ETag = eTag; + LastModified = lastModified; + DataServiceId = dataServiceId; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the client-request-id provided by the client during /// the request. This will be returned only if the /// return-client-request-id parameter was set to true. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "client-request-id")] + [JsonProperty(PropertyName = "client-request-id")] public System.Guid? ClientRequestId { get; set; } /// @@ -70,7 +85,7 @@ public PoolDisableAutoScaleHeaders() { } /// request was made, the Batch account against which the request was /// made, and the region that account resides in. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "request-id")] + [JsonProperty(PropertyName = "request-id")] public System.Guid? RequestId { get; set; } /// @@ -80,21 +95,21 @@ public PoolDisableAutoScaleHeaders() { } /// the If-Modified-Since, If-Unmodified-Since, If-Match or /// If-None-Match headers. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "ETag")] + [JsonProperty(PropertyName = "ETag")] public string ETag { get; set; } /// /// Gets or sets the time at which the resource was last modified. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "Last-Modified")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "Last-Modified")] public System.DateTime? LastModified { get; set; } /// /// Gets or sets the OData ID of the resource to which the request /// applied. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "DataServiceId")] + [JsonProperty(PropertyName = "DataServiceId")] public string DataServiceId { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolDisableAutoScaleOptions.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolDisableAutoScaleOptions.cs index 7843e1524c79..6cf09813f1eb 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolDisableAutoScaleOptions.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolDisableAutoScaleOptions.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -19,7 +25,10 @@ public partial class PoolDisableAutoScaleOptions /// Initializes a new instance of the PoolDisableAutoScaleOptions /// class. /// - public PoolDisableAutoScaleOptions() { } + public PoolDisableAutoScaleOptions() + { + CustomInit(); + } /// /// Initializes a new instance of the PoolDisableAutoScaleOptions @@ -38,17 +47,23 @@ public PoolDisableAutoScaleOptions() { } /// it explicitly if you are calling the REST API directly. public PoolDisableAutoScaleOptions(int? timeout = default(int?), System.Guid? clientRequestId = default(System.Guid?), bool? returnClientRequestId = default(bool?), System.DateTime? ocpDate = default(System.DateTime?)) { - this.Timeout = timeout; - this.ClientRequestId = clientRequestId; - this.ReturnClientRequestId = returnClientRequestId; - this.OcpDate = ocpDate; + Timeout = timeout; + ClientRequestId = clientRequestId; + ReturnClientRequestId = returnClientRequestId; + OcpDate = ocpDate; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the maximum time that the server can spend processing /// the request, in seconds. The default is 30 seconds. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public int? Timeout { get; set; } /// @@ -56,14 +71,14 @@ public PoolDisableAutoScaleOptions() { } /// a GUID with no decoration such as curly braces, e.g. /// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public System.Guid? ClientRequestId { get; set; } /// /// Gets or sets whether the server should return the client-request-id /// in the response. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public bool? ReturnClientRequestId { get; set; } /// @@ -71,8 +86,8 @@ public PoolDisableAutoScaleOptions() { } /// typically set this to the current system clock time; set it /// explicitly if you are calling the REST API directly. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? OcpDate { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolEnableAutoScaleHeaders.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolEnableAutoScaleHeaders.cs index 16345933a034..6dc5a6b2e7aa 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolEnableAutoScaleHeaders.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolEnableAutoScaleHeaders.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class PoolEnableAutoScaleHeaders /// /// Initializes a new instance of the PoolEnableAutoScaleHeaders class. /// - public PoolEnableAutoScaleHeaders() { } + public PoolEnableAutoScaleHeaders() + { + CustomInit(); + } /// /// Initializes a new instance of the PoolEnableAutoScaleHeaders class. @@ -44,19 +53,25 @@ public PoolEnableAutoScaleHeaders() { } /// the request applied. public PoolEnableAutoScaleHeaders(System.Guid? clientRequestId = default(System.Guid?), System.Guid? requestId = default(System.Guid?), string eTag = default(string), System.DateTime? lastModified = default(System.DateTime?), string dataServiceId = default(string)) { - this.ClientRequestId = clientRequestId; - this.RequestId = requestId; - this.ETag = eTag; - this.LastModified = lastModified; - this.DataServiceId = dataServiceId; + ClientRequestId = clientRequestId; + RequestId = requestId; + ETag = eTag; + LastModified = lastModified; + DataServiceId = dataServiceId; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the client-request-id provided by the client during /// the request. This will be returned only if the /// return-client-request-id parameter was set to true. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "client-request-id")] + [JsonProperty(PropertyName = "client-request-id")] public System.Guid? ClientRequestId { get; set; } /// @@ -68,7 +83,7 @@ public PoolEnableAutoScaleHeaders() { } /// request was made, the Batch account against which the request was /// made, and the region that account resides in. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "request-id")] + [JsonProperty(PropertyName = "request-id")] public System.Guid? RequestId { get; set; } /// @@ -78,21 +93,21 @@ public PoolEnableAutoScaleHeaders() { } /// the If-Modified-Since, If-Unmodified-Since, If-Match or /// If-None-Match headers. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "ETag")] + [JsonProperty(PropertyName = "ETag")] public string ETag { get; set; } /// /// Gets or sets the time at which the resource was last modified. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "Last-Modified")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "Last-Modified")] public System.DateTime? LastModified { get; set; } /// /// Gets or sets the OData ID of the resource to which the request /// applied. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "DataServiceId")] + [JsonProperty(PropertyName = "DataServiceId")] public string DataServiceId { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolEnableAutoScaleOptions.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolEnableAutoScaleOptions.cs index afc5aa63c2d5..f788c9b7cc94 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolEnableAutoScaleOptions.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolEnableAutoScaleOptions.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class PoolEnableAutoScaleOptions /// /// Initializes a new instance of the PoolEnableAutoScaleOptions class. /// - public PoolEnableAutoScaleOptions() { } + public PoolEnableAutoScaleOptions() + { + CustomInit(); + } /// /// Initializes a new instance of the PoolEnableAutoScaleOptions class. @@ -52,21 +61,27 @@ public PoolEnableAutoScaleOptions() { } /// modified since the specified time. public PoolEnableAutoScaleOptions(int? timeout = default(int?), System.Guid? clientRequestId = default(System.Guid?), bool? returnClientRequestId = default(bool?), System.DateTime? ocpDate = default(System.DateTime?), string ifMatch = default(string), string ifNoneMatch = default(string), System.DateTime? ifModifiedSince = default(System.DateTime?), System.DateTime? ifUnmodifiedSince = default(System.DateTime?)) { - this.Timeout = timeout; - this.ClientRequestId = clientRequestId; - this.ReturnClientRequestId = returnClientRequestId; - this.OcpDate = ocpDate; - this.IfMatch = ifMatch; - this.IfNoneMatch = ifNoneMatch; - this.IfModifiedSince = ifModifiedSince; - this.IfUnmodifiedSince = ifUnmodifiedSince; + Timeout = timeout; + ClientRequestId = clientRequestId; + ReturnClientRequestId = returnClientRequestId; + OcpDate = ocpDate; + IfMatch = ifMatch; + IfNoneMatch = ifNoneMatch; + IfModifiedSince = ifModifiedSince; + IfUnmodifiedSince = ifUnmodifiedSince; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the maximum time that the server can spend processing /// the request, in seconds. The default is 30 seconds. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public int? Timeout { get; set; } /// @@ -74,14 +89,14 @@ public PoolEnableAutoScaleOptions() { } /// a GUID with no decoration such as curly braces, e.g. /// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public System.Guid? ClientRequestId { get; set; } /// /// Gets or sets whether the server should return the client-request-id /// in the response. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public bool? ReturnClientRequestId { get; set; } /// @@ -89,8 +104,8 @@ public PoolEnableAutoScaleOptions() { } /// typically set this to the current system clock time; set it /// explicitly if you are calling the REST API directly. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? OcpDate { get; set; } /// @@ -99,7 +114,7 @@ public PoolEnableAutoScaleOptions() { } /// if the resource's current ETag on the service exactly matches the /// value specified by the client. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public string IfMatch { get; set; } /// @@ -108,7 +123,7 @@ public PoolEnableAutoScaleOptions() { } /// if the resource's current ETag on the service does not match the /// value specified by the client. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public string IfNoneMatch { get; set; } /// @@ -117,8 +132,8 @@ public PoolEnableAutoScaleOptions() { } /// if the resource on the service has been modified since the /// specified time. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? IfModifiedSince { get; set; } /// @@ -127,8 +142,8 @@ public PoolEnableAutoScaleOptions() { } /// if the resource on the service has not been modified since the /// specified time. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? IfUnmodifiedSince { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolEnableAutoScaleParameter.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolEnableAutoScaleParameter.cs index 17b8a3a43c9e..a6f022a19343 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolEnableAutoScaleParameter.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolEnableAutoScaleParameter.cs @@ -8,6 +8,10 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; using System.Linq; /// @@ -19,7 +23,10 @@ public partial class PoolEnableAutoScaleParameter /// Initializes a new instance of the PoolEnableAutoScaleParameter /// class. /// - public PoolEnableAutoScaleParameter() { } + public PoolEnableAutoScaleParameter() + { + CustomInit(); + } /// /// Initializes a new instance of the PoolEnableAutoScaleParameter @@ -32,10 +39,16 @@ public PoolEnableAutoScaleParameter() { } /// autoscale formula. public PoolEnableAutoScaleParameter(string autoScaleFormula = default(string), System.TimeSpan? autoScaleEvaluationInterval = default(System.TimeSpan?)) { - this.AutoScaleFormula = autoScaleFormula; - this.AutoScaleEvaluationInterval = autoScaleEvaluationInterval; + AutoScaleFormula = autoScaleFormula; + AutoScaleEvaluationInterval = autoScaleEvaluationInterval; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the formula for the desired number of compute nodes in /// the pool. @@ -48,7 +61,7 @@ public PoolEnableAutoScaleParameter() { } /// an Azure Batch pool /// (https://azure.microsoft.com/en-us/documentation/articles/batch-automatic-scaling). /// - [Newtonsoft.Json.JsonProperty(PropertyName = "autoScaleFormula")] + [JsonProperty(PropertyName = "autoScaleFormula")] public string AutoScaleFormula { get; set; } /// @@ -66,7 +79,7 @@ public PoolEnableAutoScaleParameter() { } /// evaluation schedule will be started, with its starting time being /// the time when this request was issued. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "autoScaleEvaluationInterval")] + [JsonProperty(PropertyName = "autoScaleEvaluationInterval")] public System.TimeSpan? AutoScaleEvaluationInterval { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolEndpointConfiguration.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolEndpointConfiguration.cs index 828d8784df2e..9d80282bf0e3 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolEndpointConfiguration.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolEndpointConfiguration.cs @@ -8,6 +8,13 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// @@ -18,7 +25,10 @@ public partial class PoolEndpointConfiguration /// /// Initializes a new instance of the PoolEndpointConfiguration class. /// - public PoolEndpointConfiguration() { } + public PoolEndpointConfiguration() + { + CustomInit(); + } /// /// Initializes a new instance of the PoolEndpointConfiguration class. @@ -26,11 +36,17 @@ public PoolEndpointConfiguration() { } /// A list of inbound NAT pools that can /// be used to address specific ports on an individual compute node /// externally. - public PoolEndpointConfiguration(System.Collections.Generic.IList inboundNATPools) + public PoolEndpointConfiguration(IList inboundNATPools) { - this.InboundNATPools = inboundNATPools; + InboundNATPools = inboundNATPools; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets a list of inbound NAT pools that can be used to /// address specific ports on an individual compute node externally. @@ -40,24 +56,24 @@ public PoolEndpointConfiguration(System.Collections.Generic.IList - [Newtonsoft.Json.JsonProperty(PropertyName = "inboundNATPools")] - public System.Collections.Generic.IList InboundNATPools { get; set; } + [JsonProperty(PropertyName = "inboundNATPools")] + public IList InboundNATPools { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (this.InboundNATPools == null) + if (InboundNATPools == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "InboundNATPools"); + throw new ValidationException(ValidationRules.CannotBeNull, "InboundNATPools"); } - if (this.InboundNATPools != null) + if (InboundNATPools != null) { - foreach (var element in this.InboundNATPools) + foreach (var element in InboundNATPools) { if (element != null) { diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolEvaluateAutoScaleHeaders.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolEvaluateAutoScaleHeaders.cs index bd86c95c485a..8859e9f58b7d 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolEvaluateAutoScaleHeaders.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolEvaluateAutoScaleHeaders.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -19,7 +25,10 @@ public partial class PoolEvaluateAutoScaleHeaders /// Initializes a new instance of the PoolEvaluateAutoScaleHeaders /// class. /// - public PoolEvaluateAutoScaleHeaders() { } + public PoolEvaluateAutoScaleHeaders() + { + CustomInit(); + } /// /// Initializes a new instance of the PoolEvaluateAutoScaleHeaders @@ -46,19 +55,25 @@ public PoolEvaluateAutoScaleHeaders() { } /// the request applied. public PoolEvaluateAutoScaleHeaders(System.Guid? clientRequestId = default(System.Guid?), System.Guid? requestId = default(System.Guid?), string eTag = default(string), System.DateTime? lastModified = default(System.DateTime?), string dataServiceId = default(string)) { - this.ClientRequestId = clientRequestId; - this.RequestId = requestId; - this.ETag = eTag; - this.LastModified = lastModified; - this.DataServiceId = dataServiceId; + ClientRequestId = clientRequestId; + RequestId = requestId; + ETag = eTag; + LastModified = lastModified; + DataServiceId = dataServiceId; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the client-request-id provided by the client during /// the request. This will be returned only if the /// return-client-request-id parameter was set to true. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "client-request-id")] + [JsonProperty(PropertyName = "client-request-id")] public System.Guid? ClientRequestId { get; set; } /// @@ -70,7 +85,7 @@ public PoolEvaluateAutoScaleHeaders() { } /// request was made, the Batch account against which the request was /// made, and the region that account resides in. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "request-id")] + [JsonProperty(PropertyName = "request-id")] public System.Guid? RequestId { get; set; } /// @@ -80,21 +95,21 @@ public PoolEvaluateAutoScaleHeaders() { } /// the If-Modified-Since, If-Unmodified-Since, If-Match or /// If-None-Match headers. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "ETag")] + [JsonProperty(PropertyName = "ETag")] public string ETag { get; set; } /// /// Gets or sets the time at which the resource was last modified. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "Last-Modified")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "Last-Modified")] public System.DateTime? LastModified { get; set; } /// /// Gets or sets the OData ID of the resource to which the request /// applied. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "DataServiceId")] + [JsonProperty(PropertyName = "DataServiceId")] public string DataServiceId { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolEvaluateAutoScaleOptions.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolEvaluateAutoScaleOptions.cs index 5afc93a10fb7..c7aae9c7e8bd 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolEvaluateAutoScaleOptions.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolEvaluateAutoScaleOptions.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -19,7 +25,10 @@ public partial class PoolEvaluateAutoScaleOptions /// Initializes a new instance of the PoolEvaluateAutoScaleOptions /// class. /// - public PoolEvaluateAutoScaleOptions() { } + public PoolEvaluateAutoScaleOptions() + { + CustomInit(); + } /// /// Initializes a new instance of the PoolEvaluateAutoScaleOptions @@ -38,17 +47,23 @@ public PoolEvaluateAutoScaleOptions() { } /// it explicitly if you are calling the REST API directly. public PoolEvaluateAutoScaleOptions(int? timeout = default(int?), System.Guid? clientRequestId = default(System.Guid?), bool? returnClientRequestId = default(bool?), System.DateTime? ocpDate = default(System.DateTime?)) { - this.Timeout = timeout; - this.ClientRequestId = clientRequestId; - this.ReturnClientRequestId = returnClientRequestId; - this.OcpDate = ocpDate; + Timeout = timeout; + ClientRequestId = clientRequestId; + ReturnClientRequestId = returnClientRequestId; + OcpDate = ocpDate; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the maximum time that the server can spend processing /// the request, in seconds. The default is 30 seconds. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public int? Timeout { get; set; } /// @@ -56,14 +71,14 @@ public PoolEvaluateAutoScaleOptions() { } /// a GUID with no decoration such as curly braces, e.g. /// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public System.Guid? ClientRequestId { get; set; } /// /// Gets or sets whether the server should return the client-request-id /// in the response. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public bool? ReturnClientRequestId { get; set; } /// @@ -71,8 +86,8 @@ public PoolEvaluateAutoScaleOptions() { } /// typically set this to the current system clock time; set it /// explicitly if you are calling the REST API directly. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? OcpDate { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolEvaluateAutoScaleParameter.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolEvaluateAutoScaleParameter.cs index cefd438614e6..0e25e764406d 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolEvaluateAutoScaleParameter.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolEvaluateAutoScaleParameter.cs @@ -8,6 +8,11 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Newtonsoft.Json; using System.Linq; /// @@ -19,7 +24,10 @@ public partial class PoolEvaluateAutoScaleParameter /// Initializes a new instance of the PoolEvaluateAutoScaleParameter /// class. /// - public PoolEvaluateAutoScaleParameter() { } + public PoolEvaluateAutoScaleParameter() + { + CustomInit(); + } /// /// Initializes a new instance of the PoolEvaluateAutoScaleParameter @@ -29,9 +37,15 @@ public PoolEvaluateAutoScaleParameter() { } /// of compute nodes in the pool. public PoolEvaluateAutoScaleParameter(string autoScaleFormula) { - this.AutoScaleFormula = autoScaleFormula; + AutoScaleFormula = autoScaleFormula; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the formula for the desired number of compute nodes in /// the pool. @@ -44,20 +58,20 @@ public PoolEvaluateAutoScaleParameter(string autoScaleFormula) /// Batch pool /// (https://azure.microsoft.com/en-us/documentation/articles/batch-automatic-scaling). /// - [Newtonsoft.Json.JsonProperty(PropertyName = "autoScaleFormula")] + [JsonProperty(PropertyName = "autoScaleFormula")] public string AutoScaleFormula { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (this.AutoScaleFormula == null) + if (AutoScaleFormula == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "AutoScaleFormula"); + throw new ValidationException(ValidationRules.CannotBeNull, "AutoScaleFormula"); } } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolExistsHeaders.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolExistsHeaders.cs index c07f40fc06e3..c10b3220e723 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolExistsHeaders.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolExistsHeaders.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class PoolExistsHeaders /// /// Initializes a new instance of the PoolExistsHeaders class. /// - public PoolExistsHeaders() { } + public PoolExistsHeaders() + { + CustomInit(); + } /// /// Initializes a new instance of the PoolExistsHeaders class. @@ -42,18 +51,24 @@ public PoolExistsHeaders() { } /// modified. public PoolExistsHeaders(System.Guid? clientRequestId = default(System.Guid?), System.Guid? requestId = default(System.Guid?), string eTag = default(string), System.DateTime? lastModified = default(System.DateTime?)) { - this.ClientRequestId = clientRequestId; - this.RequestId = requestId; - this.ETag = eTag; - this.LastModified = lastModified; + ClientRequestId = clientRequestId; + RequestId = requestId; + ETag = eTag; + LastModified = lastModified; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the client-request-id provided by the client during /// the request. This will be returned only if the /// return-client-request-id parameter was set to true. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "client-request-id")] + [JsonProperty(PropertyName = "client-request-id")] public System.Guid? ClientRequestId { get; set; } /// @@ -65,7 +80,7 @@ public PoolExistsHeaders() { } /// request was made, the Batch account against which the request was /// made, and the region that account resides in. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "request-id")] + [JsonProperty(PropertyName = "request-id")] public System.Guid? RequestId { get; set; } /// @@ -75,14 +90,14 @@ public PoolExistsHeaders() { } /// the If-Modified-Since, If-Unmodified-Since, If-Match or /// If-None-Match headers. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "ETag")] + [JsonProperty(PropertyName = "ETag")] public string ETag { get; set; } /// /// Gets or sets the time at which the resource was last modified. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "Last-Modified")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "Last-Modified")] public System.DateTime? LastModified { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolExistsOptions.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolExistsOptions.cs index 753c96994a47..f3c8663040e1 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolExistsOptions.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolExistsOptions.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class PoolExistsOptions /// /// Initializes a new instance of the PoolExistsOptions class. /// - public PoolExistsOptions() { } + public PoolExistsOptions() + { + CustomInit(); + } /// /// Initializes a new instance of the PoolExistsOptions class. @@ -52,21 +61,27 @@ public PoolExistsOptions() { } /// modified since the specified time. public PoolExistsOptions(int? timeout = default(int?), System.Guid? clientRequestId = default(System.Guid?), bool? returnClientRequestId = default(bool?), System.DateTime? ocpDate = default(System.DateTime?), string ifMatch = default(string), string ifNoneMatch = default(string), System.DateTime? ifModifiedSince = default(System.DateTime?), System.DateTime? ifUnmodifiedSince = default(System.DateTime?)) { - this.Timeout = timeout; - this.ClientRequestId = clientRequestId; - this.ReturnClientRequestId = returnClientRequestId; - this.OcpDate = ocpDate; - this.IfMatch = ifMatch; - this.IfNoneMatch = ifNoneMatch; - this.IfModifiedSince = ifModifiedSince; - this.IfUnmodifiedSince = ifUnmodifiedSince; + Timeout = timeout; + ClientRequestId = clientRequestId; + ReturnClientRequestId = returnClientRequestId; + OcpDate = ocpDate; + IfMatch = ifMatch; + IfNoneMatch = ifNoneMatch; + IfModifiedSince = ifModifiedSince; + IfUnmodifiedSince = ifUnmodifiedSince; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the maximum time that the server can spend processing /// the request, in seconds. The default is 30 seconds. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public int? Timeout { get; set; } /// @@ -74,14 +89,14 @@ public PoolExistsOptions() { } /// a GUID with no decoration such as curly braces, e.g. /// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public System.Guid? ClientRequestId { get; set; } /// /// Gets or sets whether the server should return the client-request-id /// in the response. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public bool? ReturnClientRequestId { get; set; } /// @@ -89,8 +104,8 @@ public PoolExistsOptions() { } /// typically set this to the current system clock time; set it /// explicitly if you are calling the REST API directly. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? OcpDate { get; set; } /// @@ -99,7 +114,7 @@ public PoolExistsOptions() { } /// if the resource's current ETag on the service exactly matches the /// value specified by the client. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public string IfMatch { get; set; } /// @@ -108,7 +123,7 @@ public PoolExistsOptions() { } /// if the resource's current ETag on the service does not match the /// value specified by the client. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public string IfNoneMatch { get; set; } /// @@ -117,8 +132,8 @@ public PoolExistsOptions() { } /// if the resource on the service has been modified since the /// specified time. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? IfModifiedSince { get; set; } /// @@ -127,8 +142,8 @@ public PoolExistsOptions() { } /// if the resource on the service has not been modified since the /// specified time. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? IfUnmodifiedSince { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolGetAllLifetimeStatisticsHeaders.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolGetAllLifetimeStatisticsHeaders.cs index 68aa469b0324..38a70666fcd9 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolGetAllLifetimeStatisticsHeaders.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolGetAllLifetimeStatisticsHeaders.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -19,7 +25,10 @@ public partial class PoolGetAllLifetimeStatisticsHeaders /// Initializes a new instance of the /// PoolGetAllLifetimeStatisticsHeaders class. /// - public PoolGetAllLifetimeStatisticsHeaders() { } + public PoolGetAllLifetimeStatisticsHeaders() + { + CustomInit(); + } /// /// Initializes a new instance of the @@ -44,18 +53,24 @@ public PoolGetAllLifetimeStatisticsHeaders() { } /// modified. public PoolGetAllLifetimeStatisticsHeaders(System.Guid? clientRequestId = default(System.Guid?), System.Guid? requestId = default(System.Guid?), string eTag = default(string), System.DateTime? lastModified = default(System.DateTime?)) { - this.ClientRequestId = clientRequestId; - this.RequestId = requestId; - this.ETag = eTag; - this.LastModified = lastModified; + ClientRequestId = clientRequestId; + RequestId = requestId; + ETag = eTag; + LastModified = lastModified; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the client-request-id provided by the client during /// the request. This will be returned only if the /// return-client-request-id parameter was set to true. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "client-request-id")] + [JsonProperty(PropertyName = "client-request-id")] public System.Guid? ClientRequestId { get; set; } /// @@ -67,7 +82,7 @@ public PoolGetAllLifetimeStatisticsHeaders() { } /// request was made, the Batch account against which the request was /// made, and the region that account resides in. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "request-id")] + [JsonProperty(PropertyName = "request-id")] public System.Guid? RequestId { get; set; } /// @@ -77,14 +92,14 @@ public PoolGetAllLifetimeStatisticsHeaders() { } /// the If-Modified-Since, If-Unmodified-Since, If-Match or /// If-None-Match headers. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "ETag")] + [JsonProperty(PropertyName = "ETag")] public string ETag { get; set; } /// /// Gets or sets the time at which the resource was last modified. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "Last-Modified")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "Last-Modified")] public System.DateTime? LastModified { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolGetAllLifetimeStatisticsOptions.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolGetAllLifetimeStatisticsOptions.cs index e98c3b32d5e6..5ec476b097ce 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolGetAllLifetimeStatisticsOptions.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolGetAllLifetimeStatisticsOptions.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -19,7 +25,10 @@ public partial class PoolGetAllLifetimeStatisticsOptions /// Initializes a new instance of the /// PoolGetAllLifetimeStatisticsOptions class. /// - public PoolGetAllLifetimeStatisticsOptions() { } + public PoolGetAllLifetimeStatisticsOptions() + { + CustomInit(); + } /// /// Initializes a new instance of the @@ -38,17 +47,23 @@ public PoolGetAllLifetimeStatisticsOptions() { } /// it explicitly if you are calling the REST API directly. public PoolGetAllLifetimeStatisticsOptions(int? timeout = default(int?), System.Guid? clientRequestId = default(System.Guid?), bool? returnClientRequestId = default(bool?), System.DateTime? ocpDate = default(System.DateTime?)) { - this.Timeout = timeout; - this.ClientRequestId = clientRequestId; - this.ReturnClientRequestId = returnClientRequestId; - this.OcpDate = ocpDate; + Timeout = timeout; + ClientRequestId = clientRequestId; + ReturnClientRequestId = returnClientRequestId; + OcpDate = ocpDate; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the maximum time that the server can spend processing /// the request, in seconds. The default is 30 seconds. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public int? Timeout { get; set; } /// @@ -56,14 +71,14 @@ public PoolGetAllLifetimeStatisticsOptions() { } /// a GUID with no decoration such as curly braces, e.g. /// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public System.Guid? ClientRequestId { get; set; } /// /// Gets or sets whether the server should return the client-request-id /// in the response. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public bool? ReturnClientRequestId { get; set; } /// @@ -71,8 +86,8 @@ public PoolGetAllLifetimeStatisticsOptions() { } /// typically set this to the current system clock time; set it /// explicitly if you are calling the REST API directly. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? OcpDate { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolGetHeaders.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolGetHeaders.cs index a3f85210a6f1..0a86b946ef8e 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolGetHeaders.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolGetHeaders.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class PoolGetHeaders /// /// Initializes a new instance of the PoolGetHeaders class. /// - public PoolGetHeaders() { } + public PoolGetHeaders() + { + CustomInit(); + } /// /// Initializes a new instance of the PoolGetHeaders class. @@ -42,18 +51,24 @@ public PoolGetHeaders() { } /// modified. public PoolGetHeaders(System.Guid? clientRequestId = default(System.Guid?), System.Guid? requestId = default(System.Guid?), string eTag = default(string), System.DateTime? lastModified = default(System.DateTime?)) { - this.ClientRequestId = clientRequestId; - this.RequestId = requestId; - this.ETag = eTag; - this.LastModified = lastModified; + ClientRequestId = clientRequestId; + RequestId = requestId; + ETag = eTag; + LastModified = lastModified; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the client-request-id provided by the client during /// the request. This will be returned only if the /// return-client-request-id parameter was set to true. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "client-request-id")] + [JsonProperty(PropertyName = "client-request-id")] public System.Guid? ClientRequestId { get; set; } /// @@ -65,7 +80,7 @@ public PoolGetHeaders() { } /// request was made, the Batch account against which the request was /// made, and the region that account resides in. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "request-id")] + [JsonProperty(PropertyName = "request-id")] public System.Guid? RequestId { get; set; } /// @@ -75,14 +90,14 @@ public PoolGetHeaders() { } /// the If-Modified-Since, If-Unmodified-Since, If-Match or /// If-None-Match headers. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "ETag")] + [JsonProperty(PropertyName = "ETag")] public string ETag { get; set; } /// /// Gets or sets the time at which the resource was last modified. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "Last-Modified")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "Last-Modified")] public System.DateTime? LastModified { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolGetOptions.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolGetOptions.cs index 9c346c97917a..885053aeba75 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolGetOptions.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolGetOptions.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class PoolGetOptions /// /// Initializes a new instance of the PoolGetOptions class. /// - public PoolGetOptions() { } + public PoolGetOptions() + { + CustomInit(); + } /// /// Initializes a new instance of the PoolGetOptions class. @@ -54,35 +63,41 @@ public PoolGetOptions() { } /// modified since the specified time. public PoolGetOptions(string select = default(string), string expand = default(string), int? timeout = default(int?), System.Guid? clientRequestId = default(System.Guid?), bool? returnClientRequestId = default(bool?), System.DateTime? ocpDate = default(System.DateTime?), string ifMatch = default(string), string ifNoneMatch = default(string), System.DateTime? ifModifiedSince = default(System.DateTime?), System.DateTime? ifUnmodifiedSince = default(System.DateTime?)) { - this.Select = select; - this.Expand = expand; - this.Timeout = timeout; - this.ClientRequestId = clientRequestId; - this.ReturnClientRequestId = returnClientRequestId; - this.OcpDate = ocpDate; - this.IfMatch = ifMatch; - this.IfNoneMatch = ifNoneMatch; - this.IfModifiedSince = ifModifiedSince; - this.IfUnmodifiedSince = ifUnmodifiedSince; + Select = select; + Expand = expand; + Timeout = timeout; + ClientRequestId = clientRequestId; + ReturnClientRequestId = returnClientRequestId; + OcpDate = ocpDate; + IfMatch = ifMatch; + IfNoneMatch = ifNoneMatch; + IfModifiedSince = ifModifiedSince; + IfUnmodifiedSince = ifUnmodifiedSince; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets an OData $select clause. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public string Select { get; set; } /// /// Gets or sets an OData $expand clause. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public string Expand { get; set; } /// /// Gets or sets the maximum time that the server can spend processing /// the request, in seconds. The default is 30 seconds. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public int? Timeout { get; set; } /// @@ -90,14 +105,14 @@ public PoolGetOptions() { } /// a GUID with no decoration such as curly braces, e.g. /// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public System.Guid? ClientRequestId { get; set; } /// /// Gets or sets whether the server should return the client-request-id /// in the response. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public bool? ReturnClientRequestId { get; set; } /// @@ -105,8 +120,8 @@ public PoolGetOptions() { } /// typically set this to the current system clock time; set it /// explicitly if you are calling the REST API directly. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? OcpDate { get; set; } /// @@ -115,7 +130,7 @@ public PoolGetOptions() { } /// if the resource's current ETag on the service exactly matches the /// value specified by the client. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public string IfMatch { get; set; } /// @@ -124,7 +139,7 @@ public PoolGetOptions() { } /// if the resource's current ETag on the service does not match the /// value specified by the client. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public string IfNoneMatch { get; set; } /// @@ -133,8 +148,8 @@ public PoolGetOptions() { } /// if the resource on the service has been modified since the /// specified time. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? IfModifiedSince { get; set; } /// @@ -143,8 +158,8 @@ public PoolGetOptions() { } /// if the resource on the service has not been modified since the /// specified time. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? IfUnmodifiedSince { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolInformation.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolInformation.cs index a06adb679ac8..73cb6a4fe9d3 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolInformation.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolInformation.cs @@ -8,6 +8,10 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +22,10 @@ public partial class PoolInformation /// /// Initializes a new instance of the PoolInformation class. /// - public PoolInformation() { } + public PoolInformation() + { + CustomInit(); + } /// /// Initializes a new instance of the PoolInformation class. @@ -30,10 +37,16 @@ public PoolInformation() { } /// job is submitted. public PoolInformation(string poolId = default(string), AutoPoolSpecification autoPoolSpecification = default(AutoPoolSpecification)) { - this.PoolId = poolId; - this.AutoPoolSpecification = autoPoolSpecification; + PoolId = poolId; + AutoPoolSpecification = autoPoolSpecification; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the ID of an existing pool. All the tasks of the job /// will run on the specified pool. @@ -47,7 +60,7 @@ public PoolInformation() { } /// You must specify either the pool ID or the auto pool specification, /// but not both. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "poolId")] + [JsonProperty(PropertyName = "poolId")] public string PoolId { get; set; } /// @@ -64,20 +77,20 @@ public PoolInformation() { } /// You must specify either the pool ID or the auto pool specification, /// but not both. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "autoPoolSpecification")] + [JsonProperty(PropertyName = "autoPoolSpecification")] public AutoPoolSpecification AutoPoolSpecification { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (this.AutoPoolSpecification != null) + if (AutoPoolSpecification != null) { - this.AutoPoolSpecification.Validate(); + AutoPoolSpecification.Validate(); } } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolLifetimeOption.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolLifetimeOption.cs index 744f43e140cd..c6ddc08069b1 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolLifetimeOption.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolLifetimeOption.cs @@ -8,16 +8,52 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; /// /// Defines values for PoolLifetimeOption. /// - [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + [JsonConverter(typeof(StringEnumConverter))] public enum PoolLifetimeOption { - [System.Runtime.Serialization.EnumMember(Value = "jobSchedule")] + [EnumMember(Value = "jobSchedule")] JobSchedule, - [System.Runtime.Serialization.EnumMember(Value = "job")] + [EnumMember(Value = "job")] Job } + internal static class PoolLifetimeOptionEnumExtension + { + internal static string ToSerializedValue(this PoolLifetimeOption? value) => + value == null ? null : ((PoolLifetimeOption)value).ToSerializedValue(); + + internal static string ToSerializedValue(this PoolLifetimeOption value) + { + switch( value ) + { + case PoolLifetimeOption.JobSchedule: + return "jobSchedule"; + case PoolLifetimeOption.Job: + return "job"; + } + return null; + } + + internal static PoolLifetimeOption? ParsePoolLifetimeOption(this string value) + { + switch( value ) + { + case "jobSchedule": + return PoolLifetimeOption.JobSchedule; + case "job": + return PoolLifetimeOption.Job; + } + return null; + } + } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolListHeaders.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolListHeaders.cs index 03790f756dc3..6dd243000565 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolListHeaders.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolListHeaders.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class PoolListHeaders /// /// Initializes a new instance of the PoolListHeaders class. /// - public PoolListHeaders() { } + public PoolListHeaders() + { + CustomInit(); + } /// /// Initializes a new instance of the PoolListHeaders class. @@ -42,18 +51,24 @@ public PoolListHeaders() { } /// modified. public PoolListHeaders(System.Guid? clientRequestId = default(System.Guid?), System.Guid? requestId = default(System.Guid?), string eTag = default(string), System.DateTime? lastModified = default(System.DateTime?)) { - this.ClientRequestId = clientRequestId; - this.RequestId = requestId; - this.ETag = eTag; - this.LastModified = lastModified; + ClientRequestId = clientRequestId; + RequestId = requestId; + ETag = eTag; + LastModified = lastModified; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the client-request-id provided by the client during /// the request. This will be returned only if the /// return-client-request-id parameter was set to true. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "client-request-id")] + [JsonProperty(PropertyName = "client-request-id")] public System.Guid? ClientRequestId { get; set; } /// @@ -65,7 +80,7 @@ public PoolListHeaders() { } /// request was made, the Batch account against which the request was /// made, and the region that account resides in. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "request-id")] + [JsonProperty(PropertyName = "request-id")] public System.Guid? RequestId { get; set; } /// @@ -75,14 +90,14 @@ public PoolListHeaders() { } /// the If-Modified-Since, If-Unmodified-Since, If-Match or /// If-None-Match headers. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "ETag")] + [JsonProperty(PropertyName = "ETag")] public string ETag { get; set; } /// /// Gets or sets the time at which the resource was last modified. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "Last-Modified")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "Last-Modified")] public System.DateTime? LastModified { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolListNextOptions.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolListNextOptions.cs index 4e91a66fd08c..58dd6c850702 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolListNextOptions.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolListNextOptions.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class PoolListNextOptions /// /// Initializes a new instance of the PoolListNextOptions class. /// - public PoolListNextOptions() { } + public PoolListNextOptions() + { + CustomInit(); + } /// /// Initializes a new instance of the PoolListNextOptions class. @@ -33,24 +42,30 @@ public PoolListNextOptions() { } /// it explicitly if you are calling the REST API directly. public PoolListNextOptions(System.Guid? clientRequestId = default(System.Guid?), bool? returnClientRequestId = default(bool?), System.DateTime? ocpDate = default(System.DateTime?)) { - this.ClientRequestId = clientRequestId; - this.ReturnClientRequestId = returnClientRequestId; - this.OcpDate = ocpDate; + ClientRequestId = clientRequestId; + ReturnClientRequestId = returnClientRequestId; + OcpDate = ocpDate; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the caller-generated request identity, in the form of /// a GUID with no decoration such as curly braces, e.g. /// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public System.Guid? ClientRequestId { get; set; } /// /// Gets or sets whether the server should return the client-request-id /// in the response. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public bool? ReturnClientRequestId { get; set; } /// @@ -58,8 +73,8 @@ public PoolListNextOptions() { } /// typically set this to the current system clock time; set it /// explicitly if you are calling the REST API directly. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? OcpDate { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolListOptions.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolListOptions.cs index 8ecf27870175..a96bfbbe44ef 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolListOptions.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolListOptions.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class PoolListOptions /// /// Initializes a new instance of the PoolListOptions class. /// - public PoolListOptions() { } + public PoolListOptions() + { + CustomInit(); + } /// /// Initializes a new instance of the PoolListOptions class. @@ -41,46 +50,52 @@ public PoolListOptions() { } /// it explicitly if you are calling the REST API directly. public PoolListOptions(string filter = default(string), string select = default(string), string expand = default(string), int? maxResults = default(int?), int? timeout = default(int?), System.Guid? clientRequestId = default(System.Guid?), bool? returnClientRequestId = default(bool?), System.DateTime? ocpDate = default(System.DateTime?)) { - this.Filter = filter; - this.Select = select; - this.Expand = expand; - this.MaxResults = maxResults; - this.Timeout = timeout; - this.ClientRequestId = clientRequestId; - this.ReturnClientRequestId = returnClientRequestId; - this.OcpDate = ocpDate; + Filter = filter; + Select = select; + Expand = expand; + MaxResults = maxResults; + Timeout = timeout; + ClientRequestId = clientRequestId; + ReturnClientRequestId = returnClientRequestId; + OcpDate = ocpDate; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets an OData $filter clause. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public string Filter { get; set; } /// /// Gets or sets an OData $select clause. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public string Select { get; set; } /// /// Gets or sets an OData $expand clause. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public string Expand { get; set; } /// /// Gets or sets the maximum number of items to return in the response. /// A maximum of 1000 pools can be returned. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public int? MaxResults { get; set; } /// /// Gets or sets the maximum time that the server can spend processing /// the request, in seconds. The default is 30 seconds. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public int? Timeout { get; set; } /// @@ -88,14 +103,14 @@ public PoolListOptions() { } /// a GUID with no decoration such as curly braces, e.g. /// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public System.Guid? ClientRequestId { get; set; } /// /// Gets or sets whether the server should return the client-request-id /// in the response. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public bool? ReturnClientRequestId { get; set; } /// @@ -103,8 +118,8 @@ public PoolListOptions() { } /// typically set this to the current system clock time; set it /// explicitly if you are calling the REST API directly. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? OcpDate { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolListUsageMetricsHeaders.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolListUsageMetricsHeaders.cs index 0c67e35db1d1..63706ae6493c 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolListUsageMetricsHeaders.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolListUsageMetricsHeaders.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -19,7 +25,10 @@ public partial class PoolListUsageMetricsHeaders /// Initializes a new instance of the PoolListUsageMetricsHeaders /// class. /// - public PoolListUsageMetricsHeaders() { } + public PoolListUsageMetricsHeaders() + { + CustomInit(); + } /// /// Initializes a new instance of the PoolListUsageMetricsHeaders @@ -44,18 +53,24 @@ public PoolListUsageMetricsHeaders() { } /// modified. public PoolListUsageMetricsHeaders(System.Guid? clientRequestId = default(System.Guid?), System.Guid? requestId = default(System.Guid?), string eTag = default(string), System.DateTime? lastModified = default(System.DateTime?)) { - this.ClientRequestId = clientRequestId; - this.RequestId = requestId; - this.ETag = eTag; - this.LastModified = lastModified; + ClientRequestId = clientRequestId; + RequestId = requestId; + ETag = eTag; + LastModified = lastModified; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the client-request-id provided by the client during /// the request. This will be returned only if the /// return-client-request-id parameter was set to true. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "client-request-id")] + [JsonProperty(PropertyName = "client-request-id")] public System.Guid? ClientRequestId { get; set; } /// @@ -67,7 +82,7 @@ public PoolListUsageMetricsHeaders() { } /// request was made, the Batch account against which the request was /// made, and the region that account resides in. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "request-id")] + [JsonProperty(PropertyName = "request-id")] public System.Guid? RequestId { get; set; } /// @@ -77,14 +92,14 @@ public PoolListUsageMetricsHeaders() { } /// the If-Modified-Since, If-Unmodified-Since, If-Match or /// If-None-Match headers. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "ETag")] + [JsonProperty(PropertyName = "ETag")] public string ETag { get; set; } /// /// Gets or sets the time at which the resource was last modified. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "Last-Modified")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "Last-Modified")] public System.DateTime? LastModified { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolListUsageMetricsNextOptions.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolListUsageMetricsNextOptions.cs index 4e9259343a05..85f40faffaa4 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolListUsageMetricsNextOptions.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolListUsageMetricsNextOptions.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -19,7 +25,10 @@ public partial class PoolListUsageMetricsNextOptions /// Initializes a new instance of the PoolListUsageMetricsNextOptions /// class. /// - public PoolListUsageMetricsNextOptions() { } + public PoolListUsageMetricsNextOptions() + { + CustomInit(); + } /// /// Initializes a new instance of the PoolListUsageMetricsNextOptions @@ -35,24 +44,30 @@ public PoolListUsageMetricsNextOptions() { } /// it explicitly if you are calling the REST API directly. public PoolListUsageMetricsNextOptions(System.Guid? clientRequestId = default(System.Guid?), bool? returnClientRequestId = default(bool?), System.DateTime? ocpDate = default(System.DateTime?)) { - this.ClientRequestId = clientRequestId; - this.ReturnClientRequestId = returnClientRequestId; - this.OcpDate = ocpDate; + ClientRequestId = clientRequestId; + ReturnClientRequestId = returnClientRequestId; + OcpDate = ocpDate; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the caller-generated request identity, in the form of /// a GUID with no decoration such as curly braces, e.g. /// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public System.Guid? ClientRequestId { get; set; } /// /// Gets or sets whether the server should return the client-request-id /// in the response. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public bool? ReturnClientRequestId { get; set; } /// @@ -60,8 +75,8 @@ public PoolListUsageMetricsNextOptions() { } /// typically set this to the current system clock time; set it /// explicitly if you are calling the REST API directly. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? OcpDate { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolListUsageMetricsOptions.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolListUsageMetricsOptions.cs index 7f6d80152f8a..a86c2af37d22 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolListUsageMetricsOptions.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolListUsageMetricsOptions.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -19,7 +25,10 @@ public partial class PoolListUsageMetricsOptions /// Initializes a new instance of the PoolListUsageMetricsOptions /// class. /// - public PoolListUsageMetricsOptions() { } + public PoolListUsageMetricsOptions() + { + CustomInit(); + } /// /// Initializes a new instance of the PoolListUsageMetricsOptions @@ -52,23 +61,29 @@ public PoolListUsageMetricsOptions() { } /// it explicitly if you are calling the REST API directly. public PoolListUsageMetricsOptions(System.DateTime? startTime = default(System.DateTime?), System.DateTime? endTime = default(System.DateTime?), string filter = default(string), int? maxResults = default(int?), int? timeout = default(int?), System.Guid? clientRequestId = default(System.Guid?), bool? returnClientRequestId = default(bool?), System.DateTime? ocpDate = default(System.DateTime?)) { - this.StartTime = startTime; - this.EndTime = endTime; - this.Filter = filter; - this.MaxResults = maxResults; - this.Timeout = timeout; - this.ClientRequestId = clientRequestId; - this.ReturnClientRequestId = returnClientRequestId; - this.OcpDate = ocpDate; + StartTime = startTime; + EndTime = endTime; + Filter = filter; + MaxResults = maxResults; + Timeout = timeout; + ClientRequestId = clientRequestId; + ReturnClientRequestId = returnClientRequestId; + OcpDate = ocpDate; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the earliest time from which to include metrics. This /// must be at least two and a half hours before the current time. If /// not specified this defaults to the start time of the last /// aggregation interval currently available. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public System.DateTime? StartTime { get; set; } /// @@ -77,7 +92,7 @@ public PoolListUsageMetricsOptions() { } /// specified this defaults to the end time of the last aggregation /// interval currently available. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public System.DateTime? EndTime { get; set; } /// @@ -85,21 +100,21 @@ public PoolListUsageMetricsOptions() { } /// response includes all pools that existed in the account in the time /// range of the returned aggregation intervals. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public string Filter { get; set; } /// /// Gets or sets the maximum number of items to return in the response. /// A maximum of 1000 results will be returned. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public int? MaxResults { get; set; } /// /// Gets or sets the maximum time that the server can spend processing /// the request, in seconds. The default is 30 seconds. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public int? Timeout { get; set; } /// @@ -107,14 +122,14 @@ public PoolListUsageMetricsOptions() { } /// a GUID with no decoration such as curly braces, e.g. /// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public System.Guid? ClientRequestId { get; set; } /// /// Gets or sets whether the server should return the client-request-id /// in the response. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public bool? ReturnClientRequestId { get; set; } /// @@ -122,8 +137,8 @@ public PoolListUsageMetricsOptions() { } /// typically set this to the current system clock time; set it /// explicitly if you are calling the REST API directly. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? OcpDate { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolPatchHeaders.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolPatchHeaders.cs index 5262fcba7a9f..536b669d8640 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolPatchHeaders.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolPatchHeaders.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class PoolPatchHeaders /// /// Initializes a new instance of the PoolPatchHeaders class. /// - public PoolPatchHeaders() { } + public PoolPatchHeaders() + { + CustomInit(); + } /// /// Initializes a new instance of the PoolPatchHeaders class. @@ -44,19 +53,25 @@ public PoolPatchHeaders() { } /// the request applied. public PoolPatchHeaders(System.Guid? clientRequestId = default(System.Guid?), System.Guid? requestId = default(System.Guid?), string eTag = default(string), System.DateTime? lastModified = default(System.DateTime?), string dataServiceId = default(string)) { - this.ClientRequestId = clientRequestId; - this.RequestId = requestId; - this.ETag = eTag; - this.LastModified = lastModified; - this.DataServiceId = dataServiceId; + ClientRequestId = clientRequestId; + RequestId = requestId; + ETag = eTag; + LastModified = lastModified; + DataServiceId = dataServiceId; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the client-request-id provided by the client during /// the request. This will be returned only if the /// return-client-request-id parameter was set to true. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "client-request-id")] + [JsonProperty(PropertyName = "client-request-id")] public System.Guid? ClientRequestId { get; set; } /// @@ -68,7 +83,7 @@ public PoolPatchHeaders() { } /// request was made, the Batch account against which the request was /// made, and the region that account resides in. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "request-id")] + [JsonProperty(PropertyName = "request-id")] public System.Guid? RequestId { get; set; } /// @@ -78,21 +93,21 @@ public PoolPatchHeaders() { } /// the If-Modified-Since, If-Unmodified-Since, If-Match or /// If-None-Match headers. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "ETag")] + [JsonProperty(PropertyName = "ETag")] public string ETag { get; set; } /// /// Gets or sets the time at which the resource was last modified. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "Last-Modified")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "Last-Modified")] public System.DateTime? LastModified { get; set; } /// /// Gets or sets the OData ID of the resource to which the request /// applied. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "DataServiceId")] + [JsonProperty(PropertyName = "DataServiceId")] public string DataServiceId { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolPatchOptions.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolPatchOptions.cs index 5878ac0625a6..de5d8bcdc00c 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolPatchOptions.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolPatchOptions.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class PoolPatchOptions /// /// Initializes a new instance of the PoolPatchOptions class. /// - public PoolPatchOptions() { } + public PoolPatchOptions() + { + CustomInit(); + } /// /// Initializes a new instance of the PoolPatchOptions class. @@ -52,21 +61,27 @@ public PoolPatchOptions() { } /// modified since the specified time. public PoolPatchOptions(int? timeout = default(int?), System.Guid? clientRequestId = default(System.Guid?), bool? returnClientRequestId = default(bool?), System.DateTime? ocpDate = default(System.DateTime?), string ifMatch = default(string), string ifNoneMatch = default(string), System.DateTime? ifModifiedSince = default(System.DateTime?), System.DateTime? ifUnmodifiedSince = default(System.DateTime?)) { - this.Timeout = timeout; - this.ClientRequestId = clientRequestId; - this.ReturnClientRequestId = returnClientRequestId; - this.OcpDate = ocpDate; - this.IfMatch = ifMatch; - this.IfNoneMatch = ifNoneMatch; - this.IfModifiedSince = ifModifiedSince; - this.IfUnmodifiedSince = ifUnmodifiedSince; + Timeout = timeout; + ClientRequestId = clientRequestId; + ReturnClientRequestId = returnClientRequestId; + OcpDate = ocpDate; + IfMatch = ifMatch; + IfNoneMatch = ifNoneMatch; + IfModifiedSince = ifModifiedSince; + IfUnmodifiedSince = ifUnmodifiedSince; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the maximum time that the server can spend processing /// the request, in seconds. The default is 30 seconds. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public int? Timeout { get; set; } /// @@ -74,14 +89,14 @@ public PoolPatchOptions() { } /// a GUID with no decoration such as curly braces, e.g. /// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public System.Guid? ClientRequestId { get; set; } /// /// Gets or sets whether the server should return the client-request-id /// in the response. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public bool? ReturnClientRequestId { get; set; } /// @@ -89,8 +104,8 @@ public PoolPatchOptions() { } /// typically set this to the current system clock time; set it /// explicitly if you are calling the REST API directly. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? OcpDate { get; set; } /// @@ -99,7 +114,7 @@ public PoolPatchOptions() { } /// if the resource's current ETag on the service exactly matches the /// value specified by the client. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public string IfMatch { get; set; } /// @@ -108,7 +123,7 @@ public PoolPatchOptions() { } /// if the resource's current ETag on the service does not match the /// value specified by the client. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public string IfNoneMatch { get; set; } /// @@ -117,8 +132,8 @@ public PoolPatchOptions() { } /// if the resource on the service has been modified since the /// specified time. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? IfModifiedSince { get; set; } /// @@ -127,8 +142,8 @@ public PoolPatchOptions() { } /// if the resource on the service has not been modified since the /// specified time. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? IfUnmodifiedSince { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolPatchParameter.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolPatchParameter.cs index 7f50fab12f5b..25b29797437b 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolPatchParameter.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolPatchParameter.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class PoolPatchParameter /// /// Initializes a new instance of the PoolPatchParameter class. /// - public PoolPatchParameter() { } + public PoolPatchParameter() + { + CustomInit(); + } /// /// Initializes a new instance of the PoolPatchParameter class. @@ -32,23 +41,30 @@ public PoolPatchParameter() { } /// packages to be installed on each compute node in the pool. /// A list of name-value pairs associated with /// the pool as metadata. - public PoolPatchParameter(StartTask startTask = default(StartTask), System.Collections.Generic.IList certificateReferences = default(System.Collections.Generic.IList), System.Collections.Generic.IList applicationPackageReferences = default(System.Collections.Generic.IList), System.Collections.Generic.IList metadata = default(System.Collections.Generic.IList)) + public PoolPatchParameter(StartTask startTask = default(StartTask), IList certificateReferences = default(IList), IList applicationPackageReferences = default(IList), IList metadata = default(IList)) { - this.StartTask = startTask; - this.CertificateReferences = certificateReferences; - this.ApplicationPackageReferences = applicationPackageReferences; - this.Metadata = metadata; + StartTask = startTask; + CertificateReferences = certificateReferences; + ApplicationPackageReferences = applicationPackageReferences; + Metadata = metadata; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets a task to run on each compute node as it joins the /// pool. The task runs when the node is added to the pool or when the /// node is restarted. /// /// + /// If this element is present, it overwrites any existing start task. /// If omitted, any existing start task is left unchanged. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "startTask")] + [JsonProperty(PropertyName = "startTask")] public StartTask StartTask { get; set; } /// @@ -56,19 +72,20 @@ public PoolPatchParameter() { } /// node in the pool. /// /// - /// If omitted, any existing certificate references are left unchanged. - /// For Windows compute nodes, the Batch service installs the - /// certificates to the specified certificate store and location. For - /// Linux compute nodes, the certificates are stored in a directory - /// inside the task working directory and an environment variable - /// AZ_BATCH_CERTIFICATES_DIR is supplied to the task to query for this - /// location. For certificates with visibility of 'remoteUser', a - /// 'certs' directory is created in the user's home directory (e.g., - /// /home/{user-name}/certs) and certificates are placed in that - /// directory. + /// If this element is present, it replaces any existing certificate + /// references configured on the pool. If omitted, any existing + /// certificate references are left unchanged. For Windows compute + /// nodes, the Batch service installs the certificates to the specified + /// certificate store and location. For Linux compute nodes, the + /// certificates are stored in a directory inside the task working + /// directory and an environment variable AZ_BATCH_CERTIFICATES_DIR is + /// supplied to the task to query for this location. For certificates + /// with visibility of 'remoteUser', a 'certs' directory is created in + /// the user's home directory (e.g., /home/{user-name}/certs) and + /// certificates are placed in that directory. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "certificateReferences")] - public System.Collections.Generic.IList CertificateReferences { get; set; } + [JsonProperty(PropertyName = "certificateReferences")] + public IList CertificateReferences { get; set; } /// /// Gets or sets a list of application packages to be installed on each @@ -84,8 +101,8 @@ public PoolPatchParameter() { } /// omitted, any existing application package references are left /// unchanged. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "applicationPackageReferences")] - public System.Collections.Generic.IList ApplicationPackageReferences { get; set; } + [JsonProperty(PropertyName = "applicationPackageReferences")] + public IList ApplicationPackageReferences { get; set; } /// /// Gets or sets a list of name-value pairs associated with the pool as @@ -97,24 +114,24 @@ public PoolPatchParameter() { } /// metadata is removed from the pool. If omitted, any existing /// metadata is left unchanged. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "metadata")] - public System.Collections.Generic.IList Metadata { get; set; } + [JsonProperty(PropertyName = "metadata")] + public IList Metadata { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (this.StartTask != null) + if (StartTask != null) { - this.StartTask.Validate(); + StartTask.Validate(); } - if (this.CertificateReferences != null) + if (CertificateReferences != null) { - foreach (var element in this.CertificateReferences) + foreach (var element in CertificateReferences) { if (element != null) { @@ -122,9 +139,9 @@ public virtual void Validate() } } } - if (this.ApplicationPackageReferences != null) + if (ApplicationPackageReferences != null) { - foreach (var element1 in this.ApplicationPackageReferences) + foreach (var element1 in ApplicationPackageReferences) { if (element1 != null) { @@ -132,9 +149,9 @@ public virtual void Validate() } } } - if (this.Metadata != null) + if (Metadata != null) { - foreach (var element2 in this.Metadata) + foreach (var element2 in Metadata) { if (element2 != null) { diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolRemoveNodesHeaders.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolRemoveNodesHeaders.cs index 17e4404ec960..b10bf3c2d3a1 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolRemoveNodesHeaders.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolRemoveNodesHeaders.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class PoolRemoveNodesHeaders /// /// Initializes a new instance of the PoolRemoveNodesHeaders class. /// - public PoolRemoveNodesHeaders() { } + public PoolRemoveNodesHeaders() + { + CustomInit(); + } /// /// Initializes a new instance of the PoolRemoveNodesHeaders class. @@ -44,19 +53,25 @@ public PoolRemoveNodesHeaders() { } /// the request applied. public PoolRemoveNodesHeaders(System.Guid? clientRequestId = default(System.Guid?), System.Guid? requestId = default(System.Guid?), string eTag = default(string), System.DateTime? lastModified = default(System.DateTime?), string dataServiceId = default(string)) { - this.ClientRequestId = clientRequestId; - this.RequestId = requestId; - this.ETag = eTag; - this.LastModified = lastModified; - this.DataServiceId = dataServiceId; + ClientRequestId = clientRequestId; + RequestId = requestId; + ETag = eTag; + LastModified = lastModified; + DataServiceId = dataServiceId; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the client-request-id provided by the client during /// the request. This will be returned only if the /// return-client-request-id parameter was set to true. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "client-request-id")] + [JsonProperty(PropertyName = "client-request-id")] public System.Guid? ClientRequestId { get; set; } /// @@ -68,7 +83,7 @@ public PoolRemoveNodesHeaders() { } /// request was made, the Batch account against which the request was /// made, and the region that account resides in. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "request-id")] + [JsonProperty(PropertyName = "request-id")] public System.Guid? RequestId { get; set; } /// @@ -78,21 +93,21 @@ public PoolRemoveNodesHeaders() { } /// the If-Modified-Since, If-Unmodified-Since, If-Match or /// If-None-Match headers. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "ETag")] + [JsonProperty(PropertyName = "ETag")] public string ETag { get; set; } /// /// Gets or sets the time at which the resource was last modified. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "Last-Modified")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "Last-Modified")] public System.DateTime? LastModified { get; set; } /// /// Gets or sets the OData ID of the resource to which the request /// applied. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "DataServiceId")] + [JsonProperty(PropertyName = "DataServiceId")] public string DataServiceId { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolRemoveNodesOptions.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolRemoveNodesOptions.cs index b789850b5fe5..0afa3e6e3b94 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolRemoveNodesOptions.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolRemoveNodesOptions.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class PoolRemoveNodesOptions /// /// Initializes a new instance of the PoolRemoveNodesOptions class. /// - public PoolRemoveNodesOptions() { } + public PoolRemoveNodesOptions() + { + CustomInit(); + } /// /// Initializes a new instance of the PoolRemoveNodesOptions class. @@ -52,21 +61,27 @@ public PoolRemoveNodesOptions() { } /// modified since the specified time. public PoolRemoveNodesOptions(int? timeout = default(int?), System.Guid? clientRequestId = default(System.Guid?), bool? returnClientRequestId = default(bool?), System.DateTime? ocpDate = default(System.DateTime?), string ifMatch = default(string), string ifNoneMatch = default(string), System.DateTime? ifModifiedSince = default(System.DateTime?), System.DateTime? ifUnmodifiedSince = default(System.DateTime?)) { - this.Timeout = timeout; - this.ClientRequestId = clientRequestId; - this.ReturnClientRequestId = returnClientRequestId; - this.OcpDate = ocpDate; - this.IfMatch = ifMatch; - this.IfNoneMatch = ifNoneMatch; - this.IfModifiedSince = ifModifiedSince; - this.IfUnmodifiedSince = ifUnmodifiedSince; + Timeout = timeout; + ClientRequestId = clientRequestId; + ReturnClientRequestId = returnClientRequestId; + OcpDate = ocpDate; + IfMatch = ifMatch; + IfNoneMatch = ifNoneMatch; + IfModifiedSince = ifModifiedSince; + IfUnmodifiedSince = ifUnmodifiedSince; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the maximum time that the server can spend processing /// the request, in seconds. The default is 30 seconds. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public int? Timeout { get; set; } /// @@ -74,14 +89,14 @@ public PoolRemoveNodesOptions() { } /// a GUID with no decoration such as curly braces, e.g. /// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public System.Guid? ClientRequestId { get; set; } /// /// Gets or sets whether the server should return the client-request-id /// in the response. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public bool? ReturnClientRequestId { get; set; } /// @@ -89,8 +104,8 @@ public PoolRemoveNodesOptions() { } /// typically set this to the current system clock time; set it /// explicitly if you are calling the REST API directly. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? OcpDate { get; set; } /// @@ -99,7 +114,7 @@ public PoolRemoveNodesOptions() { } /// if the resource's current ETag on the service exactly matches the /// value specified by the client. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public string IfMatch { get; set; } /// @@ -108,7 +123,7 @@ public PoolRemoveNodesOptions() { } /// if the resource's current ETag on the service does not match the /// value specified by the client. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public string IfNoneMatch { get; set; } /// @@ -117,8 +132,8 @@ public PoolRemoveNodesOptions() { } /// if the resource on the service has been modified since the /// specified time. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? IfModifiedSince { get; set; } /// @@ -127,8 +142,8 @@ public PoolRemoveNodesOptions() { } /// if the resource on the service has not been modified since the /// specified time. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? IfUnmodifiedSince { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolResizeHeaders.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolResizeHeaders.cs index d21854772489..275b9125dc05 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolResizeHeaders.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolResizeHeaders.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class PoolResizeHeaders /// /// Initializes a new instance of the PoolResizeHeaders class. /// - public PoolResizeHeaders() { } + public PoolResizeHeaders() + { + CustomInit(); + } /// /// Initializes a new instance of the PoolResizeHeaders class. @@ -44,19 +53,25 @@ public PoolResizeHeaders() { } /// the request applied. public PoolResizeHeaders(System.Guid? clientRequestId = default(System.Guid?), System.Guid? requestId = default(System.Guid?), string eTag = default(string), System.DateTime? lastModified = default(System.DateTime?), string dataServiceId = default(string)) { - this.ClientRequestId = clientRequestId; - this.RequestId = requestId; - this.ETag = eTag; - this.LastModified = lastModified; - this.DataServiceId = dataServiceId; + ClientRequestId = clientRequestId; + RequestId = requestId; + ETag = eTag; + LastModified = lastModified; + DataServiceId = dataServiceId; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the client-request-id provided by the client during /// the request. This will be returned only if the /// return-client-request-id parameter was set to true. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "client-request-id")] + [JsonProperty(PropertyName = "client-request-id")] public System.Guid? ClientRequestId { get; set; } /// @@ -68,7 +83,7 @@ public PoolResizeHeaders() { } /// request was made, the Batch account against which the request was /// made, and the region that account resides in. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "request-id")] + [JsonProperty(PropertyName = "request-id")] public System.Guid? RequestId { get; set; } /// @@ -78,21 +93,21 @@ public PoolResizeHeaders() { } /// the If-Modified-Since, If-Unmodified-Since, If-Match or /// If-None-Match headers. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "ETag")] + [JsonProperty(PropertyName = "ETag")] public string ETag { get; set; } /// /// Gets or sets the time at which the resource was last modified. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "Last-Modified")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "Last-Modified")] public System.DateTime? LastModified { get; set; } /// /// Gets or sets the OData ID of the resource to which the request /// applied. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "DataServiceId")] + [JsonProperty(PropertyName = "DataServiceId")] public string DataServiceId { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolResizeOptions.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolResizeOptions.cs index aaa2593716bc..44a6b1cd5e57 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolResizeOptions.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolResizeOptions.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class PoolResizeOptions /// /// Initializes a new instance of the PoolResizeOptions class. /// - public PoolResizeOptions() { } + public PoolResizeOptions() + { + CustomInit(); + } /// /// Initializes a new instance of the PoolResizeOptions class. @@ -52,21 +61,27 @@ public PoolResizeOptions() { } /// modified since the specified time. public PoolResizeOptions(int? timeout = default(int?), System.Guid? clientRequestId = default(System.Guid?), bool? returnClientRequestId = default(bool?), System.DateTime? ocpDate = default(System.DateTime?), string ifMatch = default(string), string ifNoneMatch = default(string), System.DateTime? ifModifiedSince = default(System.DateTime?), System.DateTime? ifUnmodifiedSince = default(System.DateTime?)) { - this.Timeout = timeout; - this.ClientRequestId = clientRequestId; - this.ReturnClientRequestId = returnClientRequestId; - this.OcpDate = ocpDate; - this.IfMatch = ifMatch; - this.IfNoneMatch = ifNoneMatch; - this.IfModifiedSince = ifModifiedSince; - this.IfUnmodifiedSince = ifUnmodifiedSince; + Timeout = timeout; + ClientRequestId = clientRequestId; + ReturnClientRequestId = returnClientRequestId; + OcpDate = ocpDate; + IfMatch = ifMatch; + IfNoneMatch = ifNoneMatch; + IfModifiedSince = ifModifiedSince; + IfUnmodifiedSince = ifUnmodifiedSince; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the maximum time that the server can spend processing /// the request, in seconds. The default is 30 seconds. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public int? Timeout { get; set; } /// @@ -74,14 +89,14 @@ public PoolResizeOptions() { } /// a GUID with no decoration such as curly braces, e.g. /// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public System.Guid? ClientRequestId { get; set; } /// /// Gets or sets whether the server should return the client-request-id /// in the response. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public bool? ReturnClientRequestId { get; set; } /// @@ -89,8 +104,8 @@ public PoolResizeOptions() { } /// typically set this to the current system clock time; set it /// explicitly if you are calling the REST API directly. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? OcpDate { get; set; } /// @@ -99,7 +114,7 @@ public PoolResizeOptions() { } /// if the resource's current ETag on the service exactly matches the /// value specified by the client. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public string IfMatch { get; set; } /// @@ -108,7 +123,7 @@ public PoolResizeOptions() { } /// if the resource's current ETag on the service does not match the /// value specified by the client. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public string IfNoneMatch { get; set; } /// @@ -117,8 +132,8 @@ public PoolResizeOptions() { } /// if the resource on the service has been modified since the /// specified time. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? IfModifiedSince { get; set; } /// @@ -127,8 +142,8 @@ public PoolResizeOptions() { } /// if the resource on the service has not been modified since the /// specified time. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? IfUnmodifiedSince { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolResizeParameter.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolResizeParameter.cs index 87e7a2d32b47..4035068b178f 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolResizeParameter.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolResizeParameter.cs @@ -8,6 +8,10 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +22,10 @@ public partial class PoolResizeParameter /// /// Initializes a new instance of the PoolResizeParameter class. /// - public PoolResizeParameter() { } + public PoolResizeParameter() + { + CustomInit(); + } /// /// Initializes a new instance of the PoolResizeParameter class. @@ -35,24 +42,30 @@ public PoolResizeParameter() { } /// decreasing. public PoolResizeParameter(int? targetDedicatedNodes = default(int?), int? targetLowPriorityNodes = default(int?), System.TimeSpan? resizeTimeout = default(System.TimeSpan?), ComputeNodeDeallocationOption? nodeDeallocationOption = default(ComputeNodeDeallocationOption?)) { - this.TargetDedicatedNodes = targetDedicatedNodes; - this.TargetLowPriorityNodes = targetLowPriorityNodes; - this.ResizeTimeout = resizeTimeout; - this.NodeDeallocationOption = nodeDeallocationOption; + TargetDedicatedNodes = targetDedicatedNodes; + TargetLowPriorityNodes = targetLowPriorityNodes; + ResizeTimeout = resizeTimeout; + NodeDeallocationOption = nodeDeallocationOption; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the desired number of dedicated compute nodes in the /// pool. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "targetDedicatedNodes")] + [JsonProperty(PropertyName = "targetDedicatedNodes")] public int? TargetDedicatedNodes { get; set; } /// /// Gets or sets the desired number of low-priority compute nodes in /// the pool. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "targetLowPriorityNodes")] + [JsonProperty(PropertyName = "targetLowPriorityNodes")] public int? TargetLowPriorityNodes { get; set; } /// @@ -65,7 +78,7 @@ public PoolResizeParameter() { } /// an error; if you are calling the REST API directly, the HTTP status /// code is 400 (Bad Request). /// - [Newtonsoft.Json.JsonProperty(PropertyName = "resizeTimeout")] + [JsonProperty(PropertyName = "resizeTimeout")] public System.TimeSpan? ResizeTimeout { get; set; } /// @@ -76,7 +89,7 @@ public PoolResizeParameter() { } /// The default value is requeue. Possible values include: 'requeue', /// 'terminate', 'taskCompletion', 'retainedData' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "nodeDeallocationOption")] + [JsonProperty(PropertyName = "nodeDeallocationOption")] public ComputeNodeDeallocationOption? NodeDeallocationOption { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolSpecification.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolSpecification.cs index aade63d46b17..818b9fd39371 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolSpecification.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolSpecification.cs @@ -8,6 +8,13 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// @@ -18,7 +25,10 @@ public partial class PoolSpecification /// /// Initializes a new instance of the PoolSpecification class. /// - public PoolSpecification() { } + public PoolSpecification() + { + CustomInit(); + } /// /// Initializes a new instance of the PoolSpecification class. @@ -32,8 +42,8 @@ public PoolSpecification() { } /// configuration for the pool. /// The maximum number of tasks that can /// run concurrently on a single compute node in the pool. - /// How tasks are distributed among - /// compute nodes in the pool. + /// How tasks are distributed across + /// compute nodes in a pool. /// The timeout for allocation of compute /// nodes to the pool. /// The desired number of dedicated @@ -65,30 +75,36 @@ public PoolSpecification() { } /// on each node in the pool. /// A list of name-value pairs associated with /// the pool as metadata. - public PoolSpecification(string vmSize, string displayName = default(string), CloudServiceConfiguration cloudServiceConfiguration = default(CloudServiceConfiguration), VirtualMachineConfiguration virtualMachineConfiguration = default(VirtualMachineConfiguration), int? maxTasksPerNode = default(int?), TaskSchedulingPolicy taskSchedulingPolicy = default(TaskSchedulingPolicy), System.TimeSpan? resizeTimeout = default(System.TimeSpan?), int? targetDedicatedNodes = default(int?), int? targetLowPriorityNodes = default(int?), bool? enableAutoScale = default(bool?), string autoScaleFormula = default(string), System.TimeSpan? autoScaleEvaluationInterval = default(System.TimeSpan?), bool? enableInterNodeCommunication = default(bool?), NetworkConfiguration networkConfiguration = default(NetworkConfiguration), StartTask startTask = default(StartTask), System.Collections.Generic.IList certificateReferences = default(System.Collections.Generic.IList), System.Collections.Generic.IList applicationPackageReferences = default(System.Collections.Generic.IList), System.Collections.Generic.IList applicationLicenses = default(System.Collections.Generic.IList), System.Collections.Generic.IList userAccounts = default(System.Collections.Generic.IList), System.Collections.Generic.IList metadata = default(System.Collections.Generic.IList)) + public PoolSpecification(string vmSize, string displayName = default(string), CloudServiceConfiguration cloudServiceConfiguration = default(CloudServiceConfiguration), VirtualMachineConfiguration virtualMachineConfiguration = default(VirtualMachineConfiguration), int? maxTasksPerNode = default(int?), TaskSchedulingPolicy taskSchedulingPolicy = default(TaskSchedulingPolicy), System.TimeSpan? resizeTimeout = default(System.TimeSpan?), int? targetDedicatedNodes = default(int?), int? targetLowPriorityNodes = default(int?), bool? enableAutoScale = default(bool?), string autoScaleFormula = default(string), System.TimeSpan? autoScaleEvaluationInterval = default(System.TimeSpan?), bool? enableInterNodeCommunication = default(bool?), NetworkConfiguration networkConfiguration = default(NetworkConfiguration), StartTask startTask = default(StartTask), IList certificateReferences = default(IList), IList applicationPackageReferences = default(IList), IList applicationLicenses = default(IList), IList userAccounts = default(IList), IList metadata = default(IList)) { - this.DisplayName = displayName; - this.VmSize = vmSize; - this.CloudServiceConfiguration = cloudServiceConfiguration; - this.VirtualMachineConfiguration = virtualMachineConfiguration; - this.MaxTasksPerNode = maxTasksPerNode; - this.TaskSchedulingPolicy = taskSchedulingPolicy; - this.ResizeTimeout = resizeTimeout; - this.TargetDedicatedNodes = targetDedicatedNodes; - this.TargetLowPriorityNodes = targetLowPriorityNodes; - this.EnableAutoScale = enableAutoScale; - this.AutoScaleFormula = autoScaleFormula; - this.AutoScaleEvaluationInterval = autoScaleEvaluationInterval; - this.EnableInterNodeCommunication = enableInterNodeCommunication; - this.NetworkConfiguration = networkConfiguration; - this.StartTask = startTask; - this.CertificateReferences = certificateReferences; - this.ApplicationPackageReferences = applicationPackageReferences; - this.ApplicationLicenses = applicationLicenses; - this.UserAccounts = userAccounts; - this.Metadata = metadata; + DisplayName = displayName; + VmSize = vmSize; + CloudServiceConfiguration = cloudServiceConfiguration; + VirtualMachineConfiguration = virtualMachineConfiguration; + MaxTasksPerNode = maxTasksPerNode; + TaskSchedulingPolicy = taskSchedulingPolicy; + ResizeTimeout = resizeTimeout; + TargetDedicatedNodes = targetDedicatedNodes; + TargetLowPriorityNodes = targetLowPriorityNodes; + EnableAutoScale = enableAutoScale; + AutoScaleFormula = autoScaleFormula; + AutoScaleEvaluationInterval = autoScaleEvaluationInterval; + EnableInterNodeCommunication = enableInterNodeCommunication; + NetworkConfiguration = networkConfiguration; + StartTask = startTask; + CertificateReferences = certificateReferences; + ApplicationPackageReferences = applicationPackageReferences; + ApplicationLicenses = applicationLicenses; + UserAccounts = userAccounts; + Metadata = metadata; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the display name for the pool. /// @@ -96,7 +112,7 @@ public PoolSpecification() { } /// The display name need not be unique and can contain any Unicode /// characters up to a maximum length of 1024. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "displayName")] + [JsonProperty(PropertyName = "displayName")] public string DisplayName { get; set; } /// @@ -119,7 +135,7 @@ public PoolSpecification() { } /// premium storage (STANDARD_GS, STANDARD_DS, and STANDARD_DSV2 /// series). /// - [Newtonsoft.Json.JsonProperty(PropertyName = "vmSize")] + [JsonProperty(PropertyName = "vmSize")] public string VmSize { get; set; } /// @@ -135,7 +151,7 @@ public PoolSpecification() { } /// account was created with its poolAllocationMode property set to /// 'UserSubscription'. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "cloudServiceConfiguration")] + [JsonProperty(PropertyName = "cloudServiceConfiguration")] public CloudServiceConfiguration CloudServiceConfiguration { get; set; } /// @@ -149,7 +165,7 @@ public PoolSpecification() { } /// you are calling the REST API directly, the HTTP status code is 400 /// (Bad Request). /// - [Newtonsoft.Json.JsonProperty(PropertyName = "virtualMachineConfiguration")] + [JsonProperty(PropertyName = "virtualMachineConfiguration")] public VirtualMachineConfiguration VirtualMachineConfiguration { get; set; } /// @@ -160,14 +176,14 @@ public PoolSpecification() { } /// The default value is 1. The maximum value of this setting depends /// on the size of the compute nodes in the pool (the vmSize setting). /// - [Newtonsoft.Json.JsonProperty(PropertyName = "maxTasksPerNode")] + [JsonProperty(PropertyName = "maxTasksPerNode")] public int? MaxTasksPerNode { get; set; } /// - /// Gets or sets how tasks are distributed among compute nodes in the + /// Gets or sets how tasks are distributed across compute nodes in a /// pool. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "taskSchedulingPolicy")] + [JsonProperty(PropertyName = "taskSchedulingPolicy")] public TaskSchedulingPolicy TaskSchedulingPolicy { get; set; } /// @@ -182,7 +198,7 @@ public PoolSpecification() { } /// you are calling the REST API directly, the HTTP status code is 400 /// (Bad Request). /// - [Newtonsoft.Json.JsonProperty(PropertyName = "resizeTimeout")] + [JsonProperty(PropertyName = "resizeTimeout")] public System.TimeSpan? ResizeTimeout { get; set; } /// @@ -194,7 +210,7 @@ public PoolSpecification() { } /// true. If enableAutoScale is set to false, then you must set either /// targetDedicatedNodes, targetLowPriorityNodes, or both. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "targetDedicatedNodes")] + [JsonProperty(PropertyName = "targetDedicatedNodes")] public int? TargetDedicatedNodes { get; set; } /// @@ -206,7 +222,7 @@ public PoolSpecification() { } /// true. If enableAutoScale is set to false, then you must set either /// targetDedicatedNodes, targetLowPriorityNodes, or both. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "targetLowPriorityNodes")] + [JsonProperty(PropertyName = "targetLowPriorityNodes")] public int? TargetLowPriorityNodes { get; set; } /// @@ -219,7 +235,7 @@ public PoolSpecification() { } /// autoScaleFormula element is required. The pool automatically /// resizes according to the formula. The default value is false. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "enableAutoScale")] + [JsonProperty(PropertyName = "enableAutoScale")] public bool? EnableAutoScale { get; set; } /// @@ -233,7 +249,7 @@ public PoolSpecification() { } /// formula is not valid, the Batch service rejects the request with /// detailed error information. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "autoScaleFormula")] + [JsonProperty(PropertyName = "autoScaleFormula")] public string AutoScaleFormula { get; set; } /// @@ -248,7 +264,7 @@ public PoolSpecification() { } /// calling the REST API directly, the HTTP status code is 400 (Bad /// Request). /// - [Newtonsoft.Json.JsonProperty(PropertyName = "autoScaleEvaluationInterval")] + [JsonProperty(PropertyName = "autoScaleEvaluationInterval")] public System.TimeSpan? AutoScaleEvaluationInterval { get; set; } /// @@ -261,13 +277,13 @@ public PoolSpecification() { } /// may result in the pool not reaching its desired size. The default /// value is false. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "enableInterNodeCommunication")] + [JsonProperty(PropertyName = "enableInterNodeCommunication")] public bool? EnableInterNodeCommunication { get; set; } /// /// Gets or sets the network configuration for the pool. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "networkConfiguration")] + [JsonProperty(PropertyName = "networkConfiguration")] public NetworkConfiguration NetworkConfiguration { get; set; } /// @@ -275,7 +291,7 @@ public PoolSpecification() { } /// pool. The task runs when the node is added to the pool or when the /// node is restarted. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "startTask")] + [JsonProperty(PropertyName = "startTask")] public StartTask StartTask { get; set; } /// @@ -293,15 +309,15 @@ public PoolSpecification() { } /// /home/{user-name}/certs) and certificates are placed in that /// directory. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "certificateReferences")] - public System.Collections.Generic.IList CertificateReferences { get; set; } + [JsonProperty(PropertyName = "certificateReferences")] + public IList CertificateReferences { get; set; } /// /// Gets or sets the list of application packages to be installed on /// each compute node in the pool. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "applicationPackageReferences")] - public System.Collections.Generic.IList ApplicationPackageReferences { get; set; } + [JsonProperty(PropertyName = "applicationPackageReferences")] + public IList ApplicationPackageReferences { get; set; } /// /// Gets or sets the list of application licenses the Batch service @@ -312,15 +328,15 @@ public PoolSpecification() { } /// Batch service application licenses. If a license is requested which /// is not supported, pool creation will fail. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "applicationLicenses")] - public System.Collections.Generic.IList ApplicationLicenses { get; set; } + [JsonProperty(PropertyName = "applicationLicenses")] + public IList ApplicationLicenses { get; set; } /// /// Gets or sets the list of user accounts to be created on each node /// in the pool. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "userAccounts")] - public System.Collections.Generic.IList UserAccounts { get; set; } + [JsonProperty(PropertyName = "userAccounts")] + public IList UserAccounts { get; set; } /// /// Gets or sets a list of name-value pairs associated with the pool as @@ -330,44 +346,44 @@ public PoolSpecification() { } /// The Batch service does not assign any meaning to metadata; it is /// solely for the use of user code. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "metadata")] - public System.Collections.Generic.IList Metadata { get; set; } + [JsonProperty(PropertyName = "metadata")] + public IList Metadata { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (this.VmSize == null) + if (VmSize == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "VmSize"); + throw new ValidationException(ValidationRules.CannotBeNull, "VmSize"); } - if (this.CloudServiceConfiguration != null) + if (CloudServiceConfiguration != null) { - this.CloudServiceConfiguration.Validate(); + CloudServiceConfiguration.Validate(); } - if (this.VirtualMachineConfiguration != null) + if (VirtualMachineConfiguration != null) { - this.VirtualMachineConfiguration.Validate(); + VirtualMachineConfiguration.Validate(); } - if (this.TaskSchedulingPolicy != null) + if (TaskSchedulingPolicy != null) { - this.TaskSchedulingPolicy.Validate(); + TaskSchedulingPolicy.Validate(); } - if (this.NetworkConfiguration != null) + if (NetworkConfiguration != null) { - this.NetworkConfiguration.Validate(); + NetworkConfiguration.Validate(); } - if (this.StartTask != null) + if (StartTask != null) { - this.StartTask.Validate(); + StartTask.Validate(); } - if (this.CertificateReferences != null) + if (CertificateReferences != null) { - foreach (var element in this.CertificateReferences) + foreach (var element in CertificateReferences) { if (element != null) { @@ -375,9 +391,9 @@ public virtual void Validate() } } } - if (this.ApplicationPackageReferences != null) + if (ApplicationPackageReferences != null) { - foreach (var element1 in this.ApplicationPackageReferences) + foreach (var element1 in ApplicationPackageReferences) { if (element1 != null) { @@ -385,9 +401,9 @@ public virtual void Validate() } } } - if (this.UserAccounts != null) + if (UserAccounts != null) { - foreach (var element2 in this.UserAccounts) + foreach (var element2 in UserAccounts) { if (element2 != null) { @@ -395,9 +411,9 @@ public virtual void Validate() } } } - if (this.Metadata != null) + if (Metadata != null) { - foreach (var element3 in this.Metadata) + foreach (var element3 in Metadata) { if (element3 != null) { diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolState.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolState.cs index f1c9127286c7..bb586877099d 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolState.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolState.cs @@ -8,18 +8,58 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; /// /// Defines values for PoolState. /// - [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + [JsonConverter(typeof(StringEnumConverter))] public enum PoolState { - [System.Runtime.Serialization.EnumMember(Value = "active")] + [EnumMember(Value = "active")] Active, - [System.Runtime.Serialization.EnumMember(Value = "deleting")] + [EnumMember(Value = "deleting")] Deleting, - [System.Runtime.Serialization.EnumMember(Value = "upgrading")] + [EnumMember(Value = "upgrading")] Upgrading } + internal static class PoolStateEnumExtension + { + internal static string ToSerializedValue(this PoolState? value) => + value == null ? null : ((PoolState)value).ToSerializedValue(); + + internal static string ToSerializedValue(this PoolState value) + { + switch( value ) + { + case PoolState.Active: + return "active"; + case PoolState.Deleting: + return "deleting"; + case PoolState.Upgrading: + return "upgrading"; + } + return null; + } + + internal static PoolState? ParsePoolState(this string value) + { + switch( value ) + { + case "active": + return PoolState.Active; + case "deleting": + return PoolState.Deleting; + case "upgrading": + return PoolState.Upgrading; + } + return null; + } + } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolStatistics.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolStatistics.cs index 0417c0911461..fff7293c6f36 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolStatistics.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolStatistics.cs @@ -8,6 +8,11 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Newtonsoft.Json; using System.Linq; /// @@ -19,7 +24,10 @@ public partial class PoolStatistics /// /// Initializes a new instance of the PoolStatistics class. /// - public PoolStatistics() { } + public PoolStatistics() + { + CustomInit(); + } /// /// Initializes a new instance of the PoolStatistics class. @@ -36,24 +44,30 @@ public PoolStatistics() { } /// consumption by compute nodes in the pool. public PoolStatistics(string url, System.DateTime startTime, System.DateTime lastUpdateTime, UsageStatistics usageStats = default(UsageStatistics), ResourceStatistics resourceStats = default(ResourceStatistics)) { - this.Url = url; - this.StartTime = startTime; - this.LastUpdateTime = lastUpdateTime; - this.UsageStats = usageStats; - this.ResourceStats = resourceStats; + Url = url; + StartTime = startTime; + LastUpdateTime = lastUpdateTime; + UsageStats = usageStats; + ResourceStats = resourceStats; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the URL for the statistics. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "url")] + [JsonProperty(PropertyName = "url")] public string Url { get; set; } /// /// Gets or sets the start time of the time range covered by the /// statistics. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "startTime")] + [JsonProperty(PropertyName = "startTime")] public System.DateTime StartTime { get; set; } /// @@ -61,42 +75,42 @@ public PoolStatistics() { } /// All statistics are limited to the range between startTime and /// lastUpdateTime. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "lastUpdateTime")] + [JsonProperty(PropertyName = "lastUpdateTime")] public System.DateTime LastUpdateTime { get; set; } /// /// Gets or sets statistics related to pool usage, such as the amount /// of core-time used. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "usageStats")] + [JsonProperty(PropertyName = "usageStats")] public UsageStatistics UsageStats { get; set; } /// /// Gets or sets statistics related to resource consumption by compute /// nodes in the pool. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "resourceStats")] + [JsonProperty(PropertyName = "resourceStats")] public ResourceStatistics ResourceStats { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (this.Url == null) + if (Url == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Url"); + throw new ValidationException(ValidationRules.CannotBeNull, "Url"); } - if (this.UsageStats != null) + if (UsageStats != null) { - this.UsageStats.Validate(); + UsageStats.Validate(); } - if (this.ResourceStats != null) + if (ResourceStats != null) { - this.ResourceStats.Validate(); + ResourceStats.Validate(); } } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolStopResizeHeaders.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolStopResizeHeaders.cs index 819e47f8c1e3..e4999ca59cf4 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolStopResizeHeaders.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolStopResizeHeaders.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class PoolStopResizeHeaders /// /// Initializes a new instance of the PoolStopResizeHeaders class. /// - public PoolStopResizeHeaders() { } + public PoolStopResizeHeaders() + { + CustomInit(); + } /// /// Initializes a new instance of the PoolStopResizeHeaders class. @@ -44,19 +53,25 @@ public PoolStopResizeHeaders() { } /// the request applied. public PoolStopResizeHeaders(System.Guid? clientRequestId = default(System.Guid?), System.Guid? requestId = default(System.Guid?), string eTag = default(string), System.DateTime? lastModified = default(System.DateTime?), string dataServiceId = default(string)) { - this.ClientRequestId = clientRequestId; - this.RequestId = requestId; - this.ETag = eTag; - this.LastModified = lastModified; - this.DataServiceId = dataServiceId; + ClientRequestId = clientRequestId; + RequestId = requestId; + ETag = eTag; + LastModified = lastModified; + DataServiceId = dataServiceId; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the client-request-id provided by the client during /// the request. This will be returned only if the /// return-client-request-id parameter was set to true. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "client-request-id")] + [JsonProperty(PropertyName = "client-request-id")] public System.Guid? ClientRequestId { get; set; } /// @@ -68,7 +83,7 @@ public PoolStopResizeHeaders() { } /// request was made, the Batch account against which the request was /// made, and the region that account resides in. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "request-id")] + [JsonProperty(PropertyName = "request-id")] public System.Guid? RequestId { get; set; } /// @@ -78,21 +93,21 @@ public PoolStopResizeHeaders() { } /// the If-Modified-Since, If-Unmodified-Since, If-Match or /// If-None-Match headers. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "ETag")] + [JsonProperty(PropertyName = "ETag")] public string ETag { get; set; } /// /// Gets or sets the time at which the resource was last modified. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "Last-Modified")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "Last-Modified")] public System.DateTime? LastModified { get; set; } /// /// Gets or sets the OData ID of the resource to which the request /// applied. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "DataServiceId")] + [JsonProperty(PropertyName = "DataServiceId")] public string DataServiceId { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolStopResizeOptions.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolStopResizeOptions.cs index a110fd4442ff..70ae655b980b 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolStopResizeOptions.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolStopResizeOptions.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class PoolStopResizeOptions /// /// Initializes a new instance of the PoolStopResizeOptions class. /// - public PoolStopResizeOptions() { } + public PoolStopResizeOptions() + { + CustomInit(); + } /// /// Initializes a new instance of the PoolStopResizeOptions class. @@ -52,21 +61,27 @@ public PoolStopResizeOptions() { } /// modified since the specified time. public PoolStopResizeOptions(int? timeout = default(int?), System.Guid? clientRequestId = default(System.Guid?), bool? returnClientRequestId = default(bool?), System.DateTime? ocpDate = default(System.DateTime?), string ifMatch = default(string), string ifNoneMatch = default(string), System.DateTime? ifModifiedSince = default(System.DateTime?), System.DateTime? ifUnmodifiedSince = default(System.DateTime?)) { - this.Timeout = timeout; - this.ClientRequestId = clientRequestId; - this.ReturnClientRequestId = returnClientRequestId; - this.OcpDate = ocpDate; - this.IfMatch = ifMatch; - this.IfNoneMatch = ifNoneMatch; - this.IfModifiedSince = ifModifiedSince; - this.IfUnmodifiedSince = ifUnmodifiedSince; + Timeout = timeout; + ClientRequestId = clientRequestId; + ReturnClientRequestId = returnClientRequestId; + OcpDate = ocpDate; + IfMatch = ifMatch; + IfNoneMatch = ifNoneMatch; + IfModifiedSince = ifModifiedSince; + IfUnmodifiedSince = ifUnmodifiedSince; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the maximum time that the server can spend processing /// the request, in seconds. The default is 30 seconds. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public int? Timeout { get; set; } /// @@ -74,14 +89,14 @@ public PoolStopResizeOptions() { } /// a GUID with no decoration such as curly braces, e.g. /// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public System.Guid? ClientRequestId { get; set; } /// /// Gets or sets whether the server should return the client-request-id /// in the response. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public bool? ReturnClientRequestId { get; set; } /// @@ -89,8 +104,8 @@ public PoolStopResizeOptions() { } /// typically set this to the current system clock time; set it /// explicitly if you are calling the REST API directly. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? OcpDate { get; set; } /// @@ -99,7 +114,7 @@ public PoolStopResizeOptions() { } /// if the resource's current ETag on the service exactly matches the /// value specified by the client. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public string IfMatch { get; set; } /// @@ -108,7 +123,7 @@ public PoolStopResizeOptions() { } /// if the resource's current ETag on the service does not match the /// value specified by the client. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public string IfNoneMatch { get; set; } /// @@ -117,8 +132,8 @@ public PoolStopResizeOptions() { } /// if the resource on the service has been modified since the /// specified time. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? IfModifiedSince { get; set; } /// @@ -127,8 +142,8 @@ public PoolStopResizeOptions() { } /// if the resource on the service has not been modified since the /// specified time. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? IfUnmodifiedSince { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolUpdatePropertiesHeaders.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolUpdatePropertiesHeaders.cs index 7390d43123dd..d416c9796c85 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolUpdatePropertiesHeaders.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolUpdatePropertiesHeaders.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -19,7 +25,10 @@ public partial class PoolUpdatePropertiesHeaders /// Initializes a new instance of the PoolUpdatePropertiesHeaders /// class. /// - public PoolUpdatePropertiesHeaders() { } + public PoolUpdatePropertiesHeaders() + { + CustomInit(); + } /// /// Initializes a new instance of the PoolUpdatePropertiesHeaders @@ -46,19 +55,25 @@ public PoolUpdatePropertiesHeaders() { } /// the request applied. public PoolUpdatePropertiesHeaders(System.Guid? clientRequestId = default(System.Guid?), System.Guid? requestId = default(System.Guid?), string eTag = default(string), System.DateTime? lastModified = default(System.DateTime?), string dataServiceId = default(string)) { - this.ClientRequestId = clientRequestId; - this.RequestId = requestId; - this.ETag = eTag; - this.LastModified = lastModified; - this.DataServiceId = dataServiceId; + ClientRequestId = clientRequestId; + RequestId = requestId; + ETag = eTag; + LastModified = lastModified; + DataServiceId = dataServiceId; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the client-request-id provided by the client during /// the request. This will be returned only if the /// return-client-request-id parameter was set to true. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "client-request-id")] + [JsonProperty(PropertyName = "client-request-id")] public System.Guid? ClientRequestId { get; set; } /// @@ -70,7 +85,7 @@ public PoolUpdatePropertiesHeaders() { } /// request was made, the Batch account against which the request was /// made, and the region that account resides in. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "request-id")] + [JsonProperty(PropertyName = "request-id")] public System.Guid? RequestId { get; set; } /// @@ -80,21 +95,21 @@ public PoolUpdatePropertiesHeaders() { } /// the If-Modified-Since, If-Unmodified-Since, If-Match or /// If-None-Match headers. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "ETag")] + [JsonProperty(PropertyName = "ETag")] public string ETag { get; set; } /// /// Gets or sets the time at which the resource was last modified. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "Last-Modified")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "Last-Modified")] public System.DateTime? LastModified { get; set; } /// /// Gets or sets the OData ID of the resource to which the request /// applied. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "DataServiceId")] + [JsonProperty(PropertyName = "DataServiceId")] public string DataServiceId { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolUpdatePropertiesOptions.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolUpdatePropertiesOptions.cs index c2b4fbbbbd77..368d054fc478 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolUpdatePropertiesOptions.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolUpdatePropertiesOptions.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -19,7 +25,10 @@ public partial class PoolUpdatePropertiesOptions /// Initializes a new instance of the PoolUpdatePropertiesOptions /// class. /// - public PoolUpdatePropertiesOptions() { } + public PoolUpdatePropertiesOptions() + { + CustomInit(); + } /// /// Initializes a new instance of the PoolUpdatePropertiesOptions @@ -38,17 +47,23 @@ public PoolUpdatePropertiesOptions() { } /// it explicitly if you are calling the REST API directly. public PoolUpdatePropertiesOptions(int? timeout = default(int?), System.Guid? clientRequestId = default(System.Guid?), bool? returnClientRequestId = default(bool?), System.DateTime? ocpDate = default(System.DateTime?)) { - this.Timeout = timeout; - this.ClientRequestId = clientRequestId; - this.ReturnClientRequestId = returnClientRequestId; - this.OcpDate = ocpDate; + Timeout = timeout; + ClientRequestId = clientRequestId; + ReturnClientRequestId = returnClientRequestId; + OcpDate = ocpDate; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the maximum time that the server can spend processing /// the request, in seconds. The default is 30 seconds. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public int? Timeout { get; set; } /// @@ -56,14 +71,14 @@ public PoolUpdatePropertiesOptions() { } /// a GUID with no decoration such as curly braces, e.g. /// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public System.Guid? ClientRequestId { get; set; } /// /// Gets or sets whether the server should return the client-request-id /// in the response. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public bool? ReturnClientRequestId { get; set; } /// @@ -71,8 +86,8 @@ public PoolUpdatePropertiesOptions() { } /// typically set this to the current system clock time; set it /// explicitly if you are calling the REST API directly. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? OcpDate { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolUpdatePropertiesParameter.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolUpdatePropertiesParameter.cs index 09bc42690475..9e0c19c8ba77 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolUpdatePropertiesParameter.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolUpdatePropertiesParameter.cs @@ -8,6 +8,13 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// @@ -19,7 +26,10 @@ public partial class PoolUpdatePropertiesParameter /// Initializes a new instance of the PoolUpdatePropertiesParameter /// class. /// - public PoolUpdatePropertiesParameter() { } + public PoolUpdatePropertiesParameter() + { + CustomInit(); + } /// /// Initializes a new instance of the PoolUpdatePropertiesParameter @@ -34,14 +44,20 @@ public PoolUpdatePropertiesParameter() { } /// A task to run on each compute node as it /// joins the pool. The task runs when the node is added to the pool or /// when the node is restarted. - public PoolUpdatePropertiesParameter(System.Collections.Generic.IList certificateReferences, System.Collections.Generic.IList applicationPackageReferences, System.Collections.Generic.IList metadata, StartTask startTask = default(StartTask)) + public PoolUpdatePropertiesParameter(IList certificateReferences, IList applicationPackageReferences, IList metadata, StartTask startTask = default(StartTask)) { - this.StartTask = startTask; - this.CertificateReferences = certificateReferences; - this.ApplicationPackageReferences = applicationPackageReferences; - this.Metadata = metadata; + StartTask = startTask; + CertificateReferences = certificateReferences; + ApplicationPackageReferences = applicationPackageReferences; + Metadata = metadata; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets a task to run on each compute node as it joins the /// pool. The task runs when the node is added to the pool or when the @@ -51,7 +67,7 @@ public PoolUpdatePropertiesParameter() { } /// If this element is present, it overwrites any existing start task. /// If omitted, any existing start task is removed from the pool. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "startTask")] + [JsonProperty(PropertyName = "startTask")] public StartTask StartTask { get; set; } /// @@ -59,34 +75,35 @@ public PoolUpdatePropertiesParameter() { } /// node in the pool. /// /// - /// If you specify an empty collection, any existing certificate - /// references are removed from the pool. For Windows compute nodes, - /// the Batch service installs the certificates to the specified - /// certificate store and location. For Linux compute nodes, the - /// certificates are stored in a directory inside the task working + /// This list replaces any existing certificate references configured + /// on the pool. If you specify an empty collection, any existing + /// certificate references are removed from the pool. For Windows + /// compute nodes, the Batch service installs the certificates to the + /// specified certificate store and location. For Linux compute nodes, + /// the certificates are stored in a directory inside the task working /// directory and an environment variable AZ_BATCH_CERTIFICATES_DIR is /// supplied to the task to query for this location. For certificates /// with visibility of 'remoteUser', a 'certs' directory is created in /// the user's home directory (e.g., /home/{user-name}/certs) and /// certificates are placed in that directory. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "certificateReferences")] - public System.Collections.Generic.IList CertificateReferences { get; set; } + [JsonProperty(PropertyName = "certificateReferences")] + public IList CertificateReferences { get; set; } /// /// Gets or sets a list of application packages to be installed on each /// compute node in the pool. /// /// - /// Changes to application package references affect all new compute - /// nodes joining the pool, but do not affect compute nodes that are - /// already in the pool until they are rebooted or reimaged. The list - /// replaces any existing application package references. If omitted, - /// or if you specify an empty collection, any existing application - /// packages references are removed from the pool. + /// The list replaces any existing application package references on + /// the pool. Changes to application package references affect all new + /// compute nodes joining the pool, but do not affect compute nodes + /// that are already in the pool until they are rebooted or reimaged. + /// If omitted, or if you specify an empty collection, any existing + /// application packages references are removed from the pool. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "applicationPackageReferences")] - public System.Collections.Generic.IList ApplicationPackageReferences { get; set; } + [JsonProperty(PropertyName = "applicationPackageReferences")] + public IList ApplicationPackageReferences { get; set; } /// /// Gets or sets a list of name-value pairs associated with the pool as @@ -97,36 +114,36 @@ public PoolUpdatePropertiesParameter() { } /// omitted, or if you specify an empty collection, any existing /// metadata is removed from the pool. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "metadata")] - public System.Collections.Generic.IList Metadata { get; set; } + [JsonProperty(PropertyName = "metadata")] + public IList Metadata { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (this.CertificateReferences == null) + if (CertificateReferences == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "CertificateReferences"); + throw new ValidationException(ValidationRules.CannotBeNull, "CertificateReferences"); } - if (this.ApplicationPackageReferences == null) + if (ApplicationPackageReferences == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "ApplicationPackageReferences"); + throw new ValidationException(ValidationRules.CannotBeNull, "ApplicationPackageReferences"); } - if (this.Metadata == null) + if (Metadata == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Metadata"); + throw new ValidationException(ValidationRules.CannotBeNull, "Metadata"); } - if (this.StartTask != null) + if (StartTask != null) { - this.StartTask.Validate(); + StartTask.Validate(); } - if (this.CertificateReferences != null) + if (CertificateReferences != null) { - foreach (var element in this.CertificateReferences) + foreach (var element in CertificateReferences) { if (element != null) { @@ -134,9 +151,9 @@ public virtual void Validate() } } } - if (this.ApplicationPackageReferences != null) + if (ApplicationPackageReferences != null) { - foreach (var element1 in this.ApplicationPackageReferences) + foreach (var element1 in ApplicationPackageReferences) { if (element1 != null) { @@ -144,9 +161,9 @@ public virtual void Validate() } } } - if (this.Metadata != null) + if (Metadata != null) { - foreach (var element2 in this.Metadata) + foreach (var element2 in Metadata) { if (element2 != null) { diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolUpgradeOSHeaders.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolUpgradeOSHeaders.cs index a6a68f828aec..76b304378812 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolUpgradeOSHeaders.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolUpgradeOSHeaders.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class PoolUpgradeOSHeaders /// /// Initializes a new instance of the PoolUpgradeOSHeaders class. /// - public PoolUpgradeOSHeaders() { } + public PoolUpgradeOSHeaders() + { + CustomInit(); + } /// /// Initializes a new instance of the PoolUpgradeOSHeaders class. @@ -44,19 +53,25 @@ public PoolUpgradeOSHeaders() { } /// the request applied. public PoolUpgradeOSHeaders(System.Guid? clientRequestId = default(System.Guid?), System.Guid? requestId = default(System.Guid?), string eTag = default(string), System.DateTime? lastModified = default(System.DateTime?), string dataServiceId = default(string)) { - this.ClientRequestId = clientRequestId; - this.RequestId = requestId; - this.ETag = eTag; - this.LastModified = lastModified; - this.DataServiceId = dataServiceId; + ClientRequestId = clientRequestId; + RequestId = requestId; + ETag = eTag; + LastModified = lastModified; + DataServiceId = dataServiceId; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the client-request-id provided by the client during /// the request. This will be returned only if the /// return-client-request-id parameter was set to true. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "client-request-id")] + [JsonProperty(PropertyName = "client-request-id")] public System.Guid? ClientRequestId { get; set; } /// @@ -68,7 +83,7 @@ public PoolUpgradeOSHeaders() { } /// request was made, the Batch account against which the request was /// made, and the region that account resides in. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "request-id")] + [JsonProperty(PropertyName = "request-id")] public System.Guid? RequestId { get; set; } /// @@ -78,21 +93,21 @@ public PoolUpgradeOSHeaders() { } /// the If-Modified-Since, If-Unmodified-Since, If-Match or /// If-None-Match headers. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "ETag")] + [JsonProperty(PropertyName = "ETag")] public string ETag { get; set; } /// /// Gets or sets the time at which the resource was last modified. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "Last-Modified")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "Last-Modified")] public System.DateTime? LastModified { get; set; } /// /// Gets or sets the OData ID of the resource to which the request /// applied. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "DataServiceId")] + [JsonProperty(PropertyName = "DataServiceId")] public string DataServiceId { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolUpgradeOSOptions.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolUpgradeOSOptions.cs index 02e4ea33833b..43408f4d5737 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolUpgradeOSOptions.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolUpgradeOSOptions.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class PoolUpgradeOSOptions /// /// Initializes a new instance of the PoolUpgradeOSOptions class. /// - public PoolUpgradeOSOptions() { } + public PoolUpgradeOSOptions() + { + CustomInit(); + } /// /// Initializes a new instance of the PoolUpgradeOSOptions class. @@ -52,21 +61,27 @@ public PoolUpgradeOSOptions() { } /// modified since the specified time. public PoolUpgradeOSOptions(int? timeout = default(int?), System.Guid? clientRequestId = default(System.Guid?), bool? returnClientRequestId = default(bool?), System.DateTime? ocpDate = default(System.DateTime?), string ifMatch = default(string), string ifNoneMatch = default(string), System.DateTime? ifModifiedSince = default(System.DateTime?), System.DateTime? ifUnmodifiedSince = default(System.DateTime?)) { - this.Timeout = timeout; - this.ClientRequestId = clientRequestId; - this.ReturnClientRequestId = returnClientRequestId; - this.OcpDate = ocpDate; - this.IfMatch = ifMatch; - this.IfNoneMatch = ifNoneMatch; - this.IfModifiedSince = ifModifiedSince; - this.IfUnmodifiedSince = ifUnmodifiedSince; + Timeout = timeout; + ClientRequestId = clientRequestId; + ReturnClientRequestId = returnClientRequestId; + OcpDate = ocpDate; + IfMatch = ifMatch; + IfNoneMatch = ifNoneMatch; + IfModifiedSince = ifModifiedSince; + IfUnmodifiedSince = ifUnmodifiedSince; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the maximum time that the server can spend processing /// the request, in seconds. The default is 30 seconds. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public int? Timeout { get; set; } /// @@ -74,14 +89,14 @@ public PoolUpgradeOSOptions() { } /// a GUID with no decoration such as curly braces, e.g. /// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public System.Guid? ClientRequestId { get; set; } /// /// Gets or sets whether the server should return the client-request-id /// in the response. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public bool? ReturnClientRequestId { get; set; } /// @@ -89,8 +104,8 @@ public PoolUpgradeOSOptions() { } /// typically set this to the current system clock time; set it /// explicitly if you are calling the REST API directly. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? OcpDate { get; set; } /// @@ -99,7 +114,7 @@ public PoolUpgradeOSOptions() { } /// if the resource's current ETag on the service exactly matches the /// value specified by the client. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public string IfMatch { get; set; } /// @@ -108,7 +123,7 @@ public PoolUpgradeOSOptions() { } /// if the resource's current ETag on the service does not match the /// value specified by the client. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public string IfNoneMatch { get; set; } /// @@ -117,8 +132,8 @@ public PoolUpgradeOSOptions() { } /// if the resource on the service has been modified since the /// specified time. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? IfModifiedSince { get; set; } /// @@ -127,8 +142,8 @@ public PoolUpgradeOSOptions() { } /// if the resource on the service has not been modified since the /// specified time. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? IfUnmodifiedSince { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolUpgradeOSParameter.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolUpgradeOSParameter.cs index b998fcde1e99..ce4334babe31 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolUpgradeOSParameter.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolUpgradeOSParameter.cs @@ -8,6 +8,11 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +23,10 @@ public partial class PoolUpgradeOSParameter /// /// Initializes a new instance of the PoolUpgradeOSParameter class. /// - public PoolUpgradeOSParameter() { } + public PoolUpgradeOSParameter() + { + CustomInit(); + } /// /// Initializes a new instance of the PoolUpgradeOSParameter class. @@ -27,27 +35,33 @@ public PoolUpgradeOSParameter() { } /// installed on the virtual machines in the pool. public PoolUpgradeOSParameter(string targetOSVersion) { - this.TargetOSVersion = targetOSVersion; + TargetOSVersion = targetOSVersion; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the Azure Guest OS version to be installed on the /// virtual machines in the pool. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "targetOSVersion")] + [JsonProperty(PropertyName = "targetOSVersion")] public string TargetOSVersion { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (this.TargetOSVersion == null) + if (TargetOSVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "TargetOSVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "TargetOSVersion"); } } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolUsageMetrics.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolUsageMetrics.cs index ca305594bf3c..ec98eb668c05 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolUsageMetrics.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/PoolUsageMetrics.cs @@ -8,6 +8,11 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +23,10 @@ public partial class PoolUsageMetrics /// /// Initializes a new instance of the PoolUsageMetrics class. /// - public PoolUsageMetrics() { } + public PoolUsageMetrics() + { + CustomInit(); + } /// /// Initializes a new instance of the PoolUsageMetrics class. @@ -39,34 +47,40 @@ public PoolUsageMetrics() { } /// from the pool during this interval, in GiB. public PoolUsageMetrics(string poolId, System.DateTime startTime, System.DateTime endTime, string vmSize, double totalCoreHours, double dataIngressGiB, double dataEgressGiB) { - this.PoolId = poolId; - this.StartTime = startTime; - this.EndTime = endTime; - this.VmSize = vmSize; - this.TotalCoreHours = totalCoreHours; - this.DataIngressGiB = dataIngressGiB; - this.DataEgressGiB = dataEgressGiB; + PoolId = poolId; + StartTime = startTime; + EndTime = endTime; + VmSize = vmSize; + TotalCoreHours = totalCoreHours; + DataIngressGiB = dataIngressGiB; + DataEgressGiB = dataEgressGiB; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the ID of the pool whose metrics are aggregated in /// this entry. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "poolId")] + [JsonProperty(PropertyName = "poolId")] public string PoolId { get; set; } /// /// Gets or sets the start time of the aggregation interval covered by /// this entry. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "startTime")] + [JsonProperty(PropertyName = "startTime")] public System.DateTime StartTime { get; set; } /// /// Gets or sets the end time of the aggregation interval covered by /// this entry. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "endTime")] + [JsonProperty(PropertyName = "endTime")] public System.DateTime EndTime { get; set; } /// @@ -78,10 +92,11 @@ public PoolUsageMetrics(string poolId, System.DateTime startTime, System.DateTim /// Services pools (pools created with cloudServiceConfiguration), see /// Sizes for Cloud Services /// (http://azure.microsoft.com/documentation/articles/cloud-services-sizes-specs/). - /// Batch supports all Cloud Services VM sizes except ExtraSmall, A1V2 - /// and A2V2. For information about available VM sizes for pools using - /// images from the Virtual Machines Marketplace (pools created with - /// virtualMachineConfiguration) see Sizes for Virtual Machines (Linux) + /// Batch supports all Cloud Services VM sizes except ExtraSmall, + /// STANDARD_A1_V2 and STANDARD_A2_V2. For information about available + /// VM sizes for pools using images from the Virtual Machines + /// Marketplace (pools created with virtualMachineConfiguration) see + /// Sizes for Virtual Machines (Linux) /// (https://azure.microsoft.com/documentation/articles/virtual-machines-linux-sizes/) /// or Sizes for Virtual Machines (Windows) /// (https://azure.microsoft.com/documentation/articles/virtual-machines-windows-sizes/). @@ -89,45 +104,45 @@ public PoolUsageMetrics(string poolId, System.DateTime startTime, System.DateTim /// premium storage (STANDARD_GS, STANDARD_DS, and STANDARD_DSV2 /// series). /// - [Newtonsoft.Json.JsonProperty(PropertyName = "vmSize")] + [JsonProperty(PropertyName = "vmSize")] public string VmSize { get; set; } /// /// Gets or sets the total core hours used in the pool during this /// aggregation interval. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "totalCoreHours")] + [JsonProperty(PropertyName = "totalCoreHours")] public double TotalCoreHours { get; set; } /// /// Gets or sets the cross data center network ingress to the pool /// during this interval, in GiB. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "dataIngressGiB")] + [JsonProperty(PropertyName = "dataIngressGiB")] public double DataIngressGiB { get; set; } /// /// Gets or sets the cross data center network egress from the pool /// during this interval, in GiB. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "dataEgressGiB")] + [JsonProperty(PropertyName = "dataEgressGiB")] public double DataEgressGiB { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (this.PoolId == null) + if (PoolId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "PoolId"); + throw new ValidationException(ValidationRules.CannotBeNull, "PoolId"); } - if (this.VmSize == null) + if (VmSize == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "VmSize"); + throw new ValidationException(ValidationRules.CannotBeNull, "VmSize"); } } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/RecentJob.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/RecentJob.cs index dc138a6775e8..a09642bf944c 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/RecentJob.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/RecentJob.cs @@ -8,6 +8,10 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +22,10 @@ public partial class RecentJob /// /// Initializes a new instance of the RecentJob class. /// - public RecentJob() { } + public RecentJob() + { + CustomInit(); + } /// /// Initializes a new instance of the RecentJob class. @@ -27,20 +34,26 @@ public RecentJob() { } /// The URL of the job. public RecentJob(string id = default(string), string url = default(string)) { - this.Id = id; - this.Url = url; + Id = id; + Url = url; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the ID of the job. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + [JsonProperty(PropertyName = "id")] public string Id { get; set; } /// /// Gets or sets the URL of the job. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "url")] + [JsonProperty(PropertyName = "url")] public string Url { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ResizeError.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ResizeError.cs index 3669d84aaddf..d6509ed68b93 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ResizeError.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ResizeError.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class ResizeError /// /// Initializes a new instance of the ResizeError class. /// - public ResizeError() { } + public ResizeError() + { + CustomInit(); + } /// /// Initializes a new instance of the ResizeError class. @@ -30,33 +39,39 @@ public ResizeError() { } /// intended to be suitable for display in a user interface. /// A list of additional error details related to /// the pool resize error. - public ResizeError(string code = default(string), string message = default(string), System.Collections.Generic.IList values = default(System.Collections.Generic.IList)) + public ResizeError(string code = default(string), string message = default(string), IList values = default(IList)) { - this.Code = code; - this.Message = message; - this.Values = values; + Code = code; + Message = message; + Values = values; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets an identifier for the pool resize error. Codes are /// invariant and are intended to be consumed programmatically. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "code")] + [JsonProperty(PropertyName = "code")] public string Code { get; set; } /// /// Gets or sets a message describing the pool resize error, intended /// to be suitable for display in a user interface. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "message")] + [JsonProperty(PropertyName = "message")] public string Message { get; set; } /// /// Gets or sets a list of additional error details related to the pool /// resize error. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "values")] - public System.Collections.Generic.IList Values { get; set; } + [JsonProperty(PropertyName = "values")] + public IList Values { get; set; } } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ResourceFile.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ResourceFile.cs index 86ff1b41f757..ce1494707493 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ResourceFile.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ResourceFile.cs @@ -8,6 +8,11 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +23,10 @@ public partial class ResourceFile /// /// Initializes a new instance of the ResourceFile class. /// - public ResourceFile() { } + public ResourceFile() + { + CustomInit(); + } /// /// Initializes a new instance of the ResourceFile class. @@ -32,11 +40,17 @@ public ResourceFile() { } /// format. public ResourceFile(string blobSource, string filePath, string fileMode = default(string)) { - this.BlobSource = blobSource; - this.FilePath = filePath; - this.FileMode = fileMode; + BlobSource = blobSource; + FilePath = filePath; + FileMode = fileMode; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the URL of the file within Azure Blob Storage. /// @@ -48,14 +62,14 @@ public ResourceFile() { } /// permissions on the blob, or set the ACL for the blob or its /// container to allow public access. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "blobSource")] + [JsonProperty(PropertyName = "blobSource")] public string BlobSource { get; set; } /// /// Gets or sets the location on the compute node to which to download /// the file, relative to the task's working directory. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "filePath")] + [JsonProperty(PropertyName = "filePath")] public string FilePath { get; set; } /// @@ -68,24 +82,24 @@ public ResourceFile() { } /// property is not specified for a Linux node, then a default value of /// 0770 is applied to the file. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "fileMode")] + [JsonProperty(PropertyName = "fileMode")] public string FileMode { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (this.BlobSource == null) + if (BlobSource == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "BlobSource"); + throw new ValidationException(ValidationRules.CannotBeNull, "BlobSource"); } - if (this.FilePath == null) + if (FilePath == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "FilePath"); + throw new ValidationException(ValidationRules.CannotBeNull, "FilePath"); } } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ResourceStatistics.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ResourceStatistics.cs index 960e88689d1f..cdc784bc5c44 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ResourceStatistics.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/ResourceStatistics.cs @@ -8,6 +8,10 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +22,10 @@ public partial class ResourceStatistics /// /// Initializes a new instance of the ResourceStatistics class. /// - public ResourceStatistics() { } + public ResourceStatistics() + { + CustomInit(); + } /// /// Initializes a new instance of the ResourceStatistics class. @@ -52,26 +59,32 @@ public ResourceStatistics() { } /// network writes across all nodes in the pool. public ResourceStatistics(System.DateTime startTime, System.DateTime lastUpdateTime, double avgCPUPercentage, double avgMemoryGiB, double peakMemoryGiB, double avgDiskGiB, double peakDiskGiB, long diskReadIOps, long diskWriteIOps, double diskReadGiB, double diskWriteGiB, double networkReadGiB, double networkWriteGiB) { - this.StartTime = startTime; - this.LastUpdateTime = lastUpdateTime; - this.AvgCPUPercentage = avgCPUPercentage; - this.AvgMemoryGiB = avgMemoryGiB; - this.PeakMemoryGiB = peakMemoryGiB; - this.AvgDiskGiB = avgDiskGiB; - this.PeakDiskGiB = peakDiskGiB; - this.DiskReadIOps = diskReadIOps; - this.DiskWriteIOps = diskWriteIOps; - this.DiskReadGiB = diskReadGiB; - this.DiskWriteGiB = diskWriteGiB; - this.NetworkReadGiB = networkReadGiB; - this.NetworkWriteGiB = networkWriteGiB; + StartTime = startTime; + LastUpdateTime = lastUpdateTime; + AvgCPUPercentage = avgCPUPercentage; + AvgMemoryGiB = avgMemoryGiB; + PeakMemoryGiB = peakMemoryGiB; + AvgDiskGiB = avgDiskGiB; + PeakDiskGiB = peakDiskGiB; + DiskReadIOps = diskReadIOps; + DiskWriteIOps = diskWriteIOps; + DiskReadGiB = diskReadGiB; + DiskWriteGiB = diskWriteGiB; + NetworkReadGiB = networkReadGiB; + NetworkWriteGiB = networkWriteGiB; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the start time of the time range covered by the /// statistics. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "startTime")] + [JsonProperty(PropertyName = "startTime")] public System.DateTime StartTime { get; set; } /// @@ -79,90 +92,90 @@ public ResourceStatistics(System.DateTime startTime, System.DateTime lastUpdateT /// All statistics are limited to the range between startTime and /// lastUpdateTime. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "lastUpdateTime")] + [JsonProperty(PropertyName = "lastUpdateTime")] public System.DateTime LastUpdateTime { get; set; } /// /// Gets or sets the average CPU usage across all nodes in the pool /// (percentage per node). /// - [Newtonsoft.Json.JsonProperty(PropertyName = "avgCPUPercentage")] + [JsonProperty(PropertyName = "avgCPUPercentage")] public double AvgCPUPercentage { get; set; } /// /// Gets or sets the average memory usage in GiB across all nodes in /// the pool. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "avgMemoryGiB")] + [JsonProperty(PropertyName = "avgMemoryGiB")] public double AvgMemoryGiB { get; set; } /// /// Gets or sets the peak memory usage in GiB across all nodes in the /// pool. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "peakMemoryGiB")] + [JsonProperty(PropertyName = "peakMemoryGiB")] public double PeakMemoryGiB { get; set; } /// /// Gets or sets the average used disk space in GiB across all nodes in /// the pool. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "avgDiskGiB")] + [JsonProperty(PropertyName = "avgDiskGiB")] public double AvgDiskGiB { get; set; } /// /// Gets or sets the peak used disk space in GiB across all nodes in /// the pool. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "peakDiskGiB")] + [JsonProperty(PropertyName = "peakDiskGiB")] public double PeakDiskGiB { get; set; } /// /// Gets or sets the total number of disk read operations across all /// nodes in the pool. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "diskReadIOps")] + [JsonProperty(PropertyName = "diskReadIOps")] public long DiskReadIOps { get; set; } /// /// Gets or sets the total number of disk write operations across all /// nodes in the pool. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "diskWriteIOps")] + [JsonProperty(PropertyName = "diskWriteIOps")] public long DiskWriteIOps { get; set; } /// /// Gets or sets the total amount of data in GiB of disk reads across /// all nodes in the pool. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "diskReadGiB")] + [JsonProperty(PropertyName = "diskReadGiB")] public double DiskReadGiB { get; set; } /// /// Gets or sets the total amount of data in GiB of disk writes across /// all nodes in the pool. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "diskWriteGiB")] + [JsonProperty(PropertyName = "diskWriteGiB")] public double DiskWriteGiB { get; set; } /// /// Gets or sets the total amount of data in GiB of network reads /// across all nodes in the pool. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "networkReadGiB")] + [JsonProperty(PropertyName = "networkReadGiB")] public double NetworkReadGiB { get; set; } /// /// Gets or sets the total amount of data in GiB of network writes /// across all nodes in the pool. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "networkWriteGiB")] + [JsonProperty(PropertyName = "networkWriteGiB")] public double NetworkWriteGiB { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/Schedule.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/Schedule.cs index 8f17b66920fa..1dc2883cfeec 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/Schedule.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/Schedule.cs @@ -8,6 +8,10 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +22,10 @@ public partial class Schedule /// /// Initializes a new instance of the Schedule class. /// - public Schedule() { } + public Schedule() + { + CustomInit(); + } /// /// Initializes a new instance of the Schedule class. @@ -38,12 +45,18 @@ public Schedule() { } /// time. public Schedule(System.DateTime? doNotRunUntil = default(System.DateTime?), System.DateTime? doNotRunAfter = default(System.DateTime?), System.TimeSpan? startWindow = default(System.TimeSpan?), System.TimeSpan? recurrenceInterval = default(System.TimeSpan?)) { - this.DoNotRunUntil = doNotRunUntil; - this.DoNotRunAfter = doNotRunAfter; - this.StartWindow = startWindow; - this.RecurrenceInterval = recurrenceInterval; + DoNotRunUntil = doNotRunUntil; + DoNotRunAfter = doNotRunAfter; + StartWindow = startWindow; + RecurrenceInterval = recurrenceInterval; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the earliest time at which any job may be created /// under this job schedule. @@ -52,7 +65,7 @@ public Schedule() { } /// If you do not specify a doNotRunUntil time, the schedule becomes /// ready to create jobs immediately. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "doNotRunUntil")] + [JsonProperty(PropertyName = "doNotRunUntil")] public System.DateTime? DoNotRunUntil { get; set; } /// @@ -66,7 +79,7 @@ public Schedule() { } /// recurring job schedule, the job schedule will remain active until /// you explicitly terminate it. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "doNotRunAfter")] + [JsonProperty(PropertyName = "doNotRunAfter")] public System.DateTime? DoNotRunAfter { get; set; } /// @@ -86,7 +99,7 @@ public Schedule() { } /// rejects the schedule with an error; if you are calling the REST API /// directly, the HTTP status code is 400 (Bad Request). /// - [Newtonsoft.Json.JsonProperty(PropertyName = "startWindow")] + [JsonProperty(PropertyName = "startWindow")] public System.TimeSpan? StartWindow { get; set; } /// @@ -113,7 +126,7 @@ public Schedule() { } /// if you are calling the REST API directly, the HTTP status code is /// 400 (Bad Request). /// - [Newtonsoft.Json.JsonProperty(PropertyName = "recurrenceInterval")] + [JsonProperty(PropertyName = "recurrenceInterval")] public System.TimeSpan? RecurrenceInterval { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/SchedulingState.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/SchedulingState.cs index ebfaff3241da..cb3b749592db 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/SchedulingState.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/SchedulingState.cs @@ -8,16 +8,52 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; /// /// Defines values for SchedulingState. /// - [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + [JsonConverter(typeof(StringEnumConverter))] public enum SchedulingState { - [System.Runtime.Serialization.EnumMember(Value = "enabled")] + [EnumMember(Value = "enabled")] Enabled, - [System.Runtime.Serialization.EnumMember(Value = "disabled")] + [EnumMember(Value = "disabled")] Disabled } + internal static class SchedulingStateEnumExtension + { + internal static string ToSerializedValue(this SchedulingState? value) => + value == null ? null : ((SchedulingState)value).ToSerializedValue(); + + internal static string ToSerializedValue(this SchedulingState value) + { + switch( value ) + { + case SchedulingState.Enabled: + return "enabled"; + case SchedulingState.Disabled: + return "disabled"; + } + return null; + } + + internal static SchedulingState? ParseSchedulingState(this string value) + { + switch( value ) + { + case "enabled": + return SchedulingState.Enabled; + case "disabled": + return SchedulingState.Disabled; + } + return null; + } + } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/StartTask.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/StartTask.cs index abcb6c8cf8d2..5d5a43350d21 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/StartTask.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/StartTask.cs @@ -8,6 +8,13 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// @@ -19,7 +26,10 @@ public partial class StartTask /// /// Initializes a new instance of the StartTask class. /// - public StartTask() { } + public StartTask() + { + CustomInit(); + } /// /// Initializes a new instance of the StartTask class. @@ -39,16 +49,22 @@ public StartTask() { } /// for the start task to complete successfully (that is, to exit with /// exit code 0) before scheduling any tasks on the compute /// node. - public StartTask(string commandLine, System.Collections.Generic.IList resourceFiles = default(System.Collections.Generic.IList), System.Collections.Generic.IList environmentSettings = default(System.Collections.Generic.IList), UserIdentity userIdentity = default(UserIdentity), int? maxTaskRetryCount = default(int?), bool? waitForSuccess = default(bool?)) + public StartTask(string commandLine, IList resourceFiles = default(IList), IList environmentSettings = default(IList), UserIdentity userIdentity = default(UserIdentity), int? maxTaskRetryCount = default(int?), bool? waitForSuccess = default(bool?)) { - this.CommandLine = commandLine; - this.ResourceFiles = resourceFiles; - this.EnvironmentSettings = environmentSettings; - this.UserIdentity = userIdentity; - this.MaxTaskRetryCount = maxTaskRetryCount; - this.WaitForSuccess = waitForSuccess; + CommandLine = commandLine; + ResourceFiles = resourceFiles; + EnvironmentSettings = environmentSettings; + UserIdentity = userIdentity; + MaxTaskRetryCount = maxTaskRetryCount; + WaitForSuccess = waitForSuccess; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the command line of the start task. /// @@ -59,22 +75,26 @@ public StartTask() { } /// should invoke the shell in the command line, for example using "cmd /// /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "commandLine")] + [JsonProperty(PropertyName = "commandLine")] public string CommandLine { get; set; } /// /// Gets or sets a list of files that the Batch service will download /// to the compute node before running the command line. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "resourceFiles")] - public System.Collections.Generic.IList ResourceFiles { get; set; } + /// + /// Files listed under this element are located in the task's working + /// directory. + /// + [JsonProperty(PropertyName = "resourceFiles")] + public IList ResourceFiles { get; set; } /// /// Gets or sets a list of environment variable settings for the start /// task. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "environmentSettings")] - public System.Collections.Generic.IList EnvironmentSettings { get; set; } + [JsonProperty(PropertyName = "environmentSettings")] + public IList EnvironmentSettings { get; set; } /// /// Gets or sets the user identity under which the start task runs. @@ -83,7 +103,7 @@ public StartTask() { } /// If omitted, the task runs as a non-administrative user unique to /// the task. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "userIdentity")] + [JsonProperty(PropertyName = "userIdentity")] public UserIdentity UserIdentity { get; set; } /// @@ -99,7 +119,7 @@ public StartTask() { } /// task. If the maximum retry count is -1, the Batch service retries /// the task without limit. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "maxTaskRetryCount")] + [JsonProperty(PropertyName = "maxTaskRetryCount")] public int? MaxTaskRetryCount { get; set; } /// @@ -113,31 +133,31 @@ public StartTask() { } /// (maxTaskRetryCount). If the task has still not completed /// successfully after all retries, then the Batch service marks the /// compute node unusable, and will not schedule tasks to it. This - /// condition can be detected via the node state and scheduling error - /// detail. If false, the Batch service will not wait for the start + /// condition can be detected via the node state and failure info + /// details. If false, the Batch service will not wait for the start /// task to complete. In this case, other tasks can start executing on /// the compute node while the start task is still running; and even if /// the start task fails, new tasks will continue to be scheduled on /// the node. The default is false. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "waitForSuccess")] + [JsonProperty(PropertyName = "waitForSuccess")] public bool? WaitForSuccess { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (this.CommandLine == null) + if (CommandLine == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "CommandLine"); + throw new ValidationException(ValidationRules.CannotBeNull, "CommandLine"); } - if (this.ResourceFiles != null) + if (ResourceFiles != null) { - foreach (var element in this.ResourceFiles) + foreach (var element in ResourceFiles) { if (element != null) { @@ -145,9 +165,9 @@ public virtual void Validate() } } } - if (this.EnvironmentSettings != null) + if (EnvironmentSettings != null) { - foreach (var element1 in this.EnvironmentSettings) + foreach (var element1 in EnvironmentSettings) { if (element1 != null) { diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/StartTaskInformation.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/StartTaskInformation.cs index 2a4b52d0d2d4..f78c28294fa5 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/StartTaskInformation.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/StartTaskInformation.cs @@ -8,6 +8,10 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +22,10 @@ public partial class StartTaskInformation /// /// Initializes a new instance of the StartTaskInformation class. /// - public StartTaskInformation() { } + public StartTaskInformation() + { + CustomInit(); + } /// /// Initializes a new instance of the StartTaskInformation class. @@ -40,27 +47,36 @@ public StartTaskInformation() { } /// The result of the task execution. public StartTaskInformation(StartTaskState state, System.DateTime startTime, int retryCount, System.DateTime? endTime = default(System.DateTime?), int? exitCode = default(int?), TaskFailureInformation failureInfo = default(TaskFailureInformation), System.DateTime? lastRetryTime = default(System.DateTime?), TaskExecutionResult? result = default(TaskExecutionResult?)) { - this.State = state; - this.StartTime = startTime; - this.EndTime = endTime; - this.ExitCode = exitCode; - this.FailureInfo = failureInfo; - this.RetryCount = retryCount; - this.LastRetryTime = lastRetryTime; - this.Result = result; + State = state; + StartTime = startTime; + EndTime = endTime; + ExitCode = exitCode; + FailureInfo = failureInfo; + RetryCount = retryCount; + LastRetryTime = lastRetryTime; + Result = result; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the state of the start task on the compute node. /// /// - /// running - The start task is currently running. completed - The - /// start task has exited with exit code 0, or the start task has - /// failed and the retry limit has reached, or the start task process - /// did not run due to scheduling errors. Possible values include: + /// Values are: + /// + /// running - The start task is currently running. + /// completed - The start task has exited with exit code 0, or the + /// start task has failed and the retry limit has reached, or the start + /// task process did not run due to task preparation errors (such as + /// resource file download failures). Possible values include: /// 'running', 'completed' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "state")] + [JsonProperty(PropertyName = "state")] public StartTaskState State { get; set; } /// @@ -71,7 +87,7 @@ public StartTaskInformation() { } /// (that is, this is the most recent time at which the start task /// started running). /// - [Newtonsoft.Json.JsonProperty(PropertyName = "startTime")] + [JsonProperty(PropertyName = "startTime")] public System.DateTime StartTime { get; set; } /// @@ -83,7 +99,7 @@ public StartTaskInformation() { } /// pending). This element is not present if the start task is /// currently running. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "endTime")] + [JsonProperty(PropertyName = "endTime")] public System.DateTime? EndTime { get; set; } /// @@ -100,7 +116,7 @@ public StartTaskInformation() { } /// the start task (due to timeout, or user termination via the API) /// you may see an operating system-defined exit code. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "exitCode")] + [JsonProperty(PropertyName = "exitCode")] public int? ExitCode { get; set; } /// @@ -110,7 +126,7 @@ public StartTaskInformation() { } /// This property is set only if the task is in the completed state and /// encountered a failure. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "failureInfo")] + [JsonProperty(PropertyName = "failureInfo")] public TaskFailureInformation FailureInfo { get; set; } /// @@ -118,13 +134,12 @@ public StartTaskInformation() { } /// Batch service. /// /// - /// The number of times the task has been retried by the Batch service. /// Task application failures (non-zero exit code) are retried, /// pre-processing errors (the task could not be run) and file upload /// errors are not retried. The Batch service will retry the task up to /// the limit specified by the constraints. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "retryCount")] + [JsonProperty(PropertyName = "retryCount")] public int RetryCount { get; set; } /// @@ -139,7 +154,7 @@ public StartTaskInformation() { } /// rebooted during a retry, then the startTime is updated but the /// lastRetryTime is not. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "lastRetryTime")] + [JsonProperty(PropertyName = "lastRetryTime")] public System.DateTime? LastRetryTime { get; set; } /// @@ -150,20 +165,20 @@ public StartTaskInformation() { } /// found in the failureInfo property. Possible values include: /// 'success', 'failure' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "result")] + [JsonProperty(PropertyName = "result")] public TaskExecutionResult? Result { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (this.FailureInfo != null) + if (FailureInfo != null) { - this.FailureInfo.Validate(); + FailureInfo.Validate(); } } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/StartTaskState.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/StartTaskState.cs index b75ba99cea94..046114d43c8b 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/StartTaskState.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/StartTaskState.cs @@ -8,16 +8,52 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; /// /// Defines values for StartTaskState. /// - [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + [JsonConverter(typeof(StringEnumConverter))] public enum StartTaskState { - [System.Runtime.Serialization.EnumMember(Value = "running")] + [EnumMember(Value = "running")] Running, - [System.Runtime.Serialization.EnumMember(Value = "completed")] + [EnumMember(Value = "completed")] Completed } + internal static class StartTaskStateEnumExtension + { + internal static string ToSerializedValue(this StartTaskState? value) => + value == null ? null : ((StartTaskState)value).ToSerializedValue(); + + internal static string ToSerializedValue(this StartTaskState value) + { + switch( value ) + { + case StartTaskState.Running: + return "running"; + case StartTaskState.Completed: + return "completed"; + } + return null; + } + + internal static StartTaskState? ParseStartTaskState(this string value) + { + switch( value ) + { + case "running": + return StartTaskState.Running; + case "completed": + return StartTaskState.Completed; + } + return null; + } + } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/SubtaskInformation.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/SubtaskInformation.cs index 31b37bd9350e..ce590e97a68a 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/SubtaskInformation.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/SubtaskInformation.cs @@ -8,6 +8,10 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +22,10 @@ public partial class SubtaskInformation /// /// Initializes a new instance of the SubtaskInformation class. /// - public SubtaskInformation() { } + public SubtaskInformation() + { + CustomInit(); + } /// /// Initializes a new instance of the SubtaskInformation class. @@ -45,30 +52,36 @@ public SubtaskInformation() { } /// The result of the task execution. public SubtaskInformation(int? id = default(int?), ComputeNodeInformation nodeInfo = default(ComputeNodeInformation), System.DateTime? startTime = default(System.DateTime?), System.DateTime? endTime = default(System.DateTime?), int? exitCode = default(int?), TaskFailureInformation failureInfo = default(TaskFailureInformation), SubtaskState? state = default(SubtaskState?), System.DateTime? stateTransitionTime = default(System.DateTime?), SubtaskState? previousState = default(SubtaskState?), System.DateTime? previousStateTransitionTime = default(System.DateTime?), TaskExecutionResult? result = default(TaskExecutionResult?)) { - this.Id = id; - this.NodeInfo = nodeInfo; - this.StartTime = startTime; - this.EndTime = endTime; - this.ExitCode = exitCode; - this.FailureInfo = failureInfo; - this.State = state; - this.StateTransitionTime = stateTransitionTime; - this.PreviousState = previousState; - this.PreviousStateTransitionTime = previousStateTransitionTime; - this.Result = result; + Id = id; + NodeInfo = nodeInfo; + StartTime = startTime; + EndTime = endTime; + ExitCode = exitCode; + FailureInfo = failureInfo; + State = state; + StateTransitionTime = stateTransitionTime; + PreviousState = previousState; + PreviousStateTransitionTime = previousStateTransitionTime; + Result = result; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the ID of the subtask. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + [JsonProperty(PropertyName = "id")] public int? Id { get; set; } /// /// Gets or sets information about the compute node on which the /// subtask ran. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "nodeInfo")] + [JsonProperty(PropertyName = "nodeInfo")] public ComputeNodeInformation NodeInfo { get; set; } /// @@ -76,7 +89,7 @@ public SubtaskInformation() { } /// subtask has been restarted or retried, this is the most recent time /// at which the subtask started running. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "startTime")] + [JsonProperty(PropertyName = "startTime")] public System.DateTime? StartTime { get; set; } /// @@ -85,7 +98,7 @@ public SubtaskInformation() { } /// /// This property is set only if the subtask is in the Completed state. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "endTime")] + [JsonProperty(PropertyName = "endTime")] public System.DateTime? EndTime { get; set; } /// @@ -102,7 +115,7 @@ public SubtaskInformation() { } /// subtask (due to timeout, or user termination via the API) you may /// see an operating system-defined exit code. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "exitCode")] + [JsonProperty(PropertyName = "exitCode")] public int? ExitCode { get; set; } /// @@ -112,7 +125,7 @@ public SubtaskInformation() { } /// This property is set only if the task is in the completed state and /// encountered a failure. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "failureInfo")] + [JsonProperty(PropertyName = "failureInfo")] public TaskFailureInformation FailureInfo { get; set; } /// @@ -121,14 +134,14 @@ public SubtaskInformation() { } /// /// Possible values include: 'preparing', 'running', 'completed' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "state")] + [JsonProperty(PropertyName = "state")] public SubtaskState? State { get; set; } /// /// Gets or sets the time at which the subtask entered its current /// state. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "stateTransitionTime")] + [JsonProperty(PropertyName = "stateTransitionTime")] public System.DateTime? StateTransitionTime { get; set; } /// @@ -138,7 +151,7 @@ public SubtaskInformation() { } /// This property is not set if the subtask is in its initial running /// state. Possible values include: 'preparing', 'running', 'completed' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "previousState")] + [JsonProperty(PropertyName = "previousState")] public SubtaskState? PreviousState { get; set; } /// @@ -149,7 +162,7 @@ public SubtaskInformation() { } /// This property is not set if the subtask is in its initial running /// state. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "previousStateTransitionTime")] + [JsonProperty(PropertyName = "previousStateTransitionTime")] public System.DateTime? PreviousStateTransitionTime { get; set; } /// @@ -160,20 +173,20 @@ public SubtaskInformation() { } /// found in the failureInfo property. Possible values include: /// 'success', 'failure' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "result")] + [JsonProperty(PropertyName = "result")] public TaskExecutionResult? Result { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (this.FailureInfo != null) + if (FailureInfo != null) { - this.FailureInfo.Validate(); + FailureInfo.Validate(); } } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/SubtaskState.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/SubtaskState.cs index 39d7806eef0b..1807cf8d009a 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/SubtaskState.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/SubtaskState.cs @@ -8,18 +8,58 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; /// /// Defines values for SubtaskState. /// - [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + [JsonConverter(typeof(StringEnumConverter))] public enum SubtaskState { - [System.Runtime.Serialization.EnumMember(Value = "preparing")] + [EnumMember(Value = "preparing")] Preparing, - [System.Runtime.Serialization.EnumMember(Value = "running")] + [EnumMember(Value = "running")] Running, - [System.Runtime.Serialization.EnumMember(Value = "completed")] + [EnumMember(Value = "completed")] Completed } + internal static class SubtaskStateEnumExtension + { + internal static string ToSerializedValue(this SubtaskState? value) => + value == null ? null : ((SubtaskState)value).ToSerializedValue(); + + internal static string ToSerializedValue(this SubtaskState value) + { + switch( value ) + { + case SubtaskState.Preparing: + return "preparing"; + case SubtaskState.Running: + return "running"; + case SubtaskState.Completed: + return "completed"; + } + return null; + } + + internal static SubtaskState? ParseSubtaskState(this string value) + { + switch( value ) + { + case "preparing": + return SubtaskState.Preparing; + case "running": + return SubtaskState.Running; + case "completed": + return SubtaskState.Completed; + } + return null; + } + } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskAddCollectionHeaders.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskAddCollectionHeaders.cs index 8e8cf1c39dbe..fa0f8b1f8f1c 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskAddCollectionHeaders.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskAddCollectionHeaders.cs @@ -8,6 +8,10 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +22,10 @@ public partial class TaskAddCollectionHeaders /// /// Initializes a new instance of the TaskAddCollectionHeaders class. /// - public TaskAddCollectionHeaders() { } + public TaskAddCollectionHeaders() + { + CustomInit(); + } /// /// Initializes a new instance of the TaskAddCollectionHeaders class. @@ -35,16 +42,22 @@ public TaskAddCollectionHeaders() { } /// request was made, and the region that account resides in. public TaskAddCollectionHeaders(string clientRequestId = default(string), string requestId = default(string)) { - this.ClientRequestId = clientRequestId; - this.RequestId = requestId; + ClientRequestId = clientRequestId; + RequestId = requestId; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the client-request-id provided by the client during /// the request. This will be returned only if the /// return-client-request-id parameter was set to true. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "client-request-id")] + [JsonProperty(PropertyName = "client-request-id")] public string ClientRequestId { get; set; } /// @@ -56,7 +69,7 @@ public TaskAddCollectionHeaders() { } /// request was made, the Batch account against which the request was /// made, and the region that account resides in. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "request-id")] + [JsonProperty(PropertyName = "request-id")] public string RequestId { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskAddCollectionOptions.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskAddCollectionOptions.cs index 508be54965b0..72a7a22069fa 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskAddCollectionOptions.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskAddCollectionOptions.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class TaskAddCollectionOptions /// /// Initializes a new instance of the TaskAddCollectionOptions class. /// - public TaskAddCollectionOptions() { } + public TaskAddCollectionOptions() + { + CustomInit(); + } /// /// Initializes a new instance of the TaskAddCollectionOptions class. @@ -36,17 +45,23 @@ public TaskAddCollectionOptions() { } /// it explicitly if you are calling the REST API directly. public TaskAddCollectionOptions(int? timeout = default(int?), System.Guid? clientRequestId = default(System.Guid?), bool? returnClientRequestId = default(bool?), System.DateTime? ocpDate = default(System.DateTime?)) { - this.Timeout = timeout; - this.ClientRequestId = clientRequestId; - this.ReturnClientRequestId = returnClientRequestId; - this.OcpDate = ocpDate; + Timeout = timeout; + ClientRequestId = clientRequestId; + ReturnClientRequestId = returnClientRequestId; + OcpDate = ocpDate; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the maximum time that the server can spend processing /// the request, in seconds. The default is 30 seconds. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public int? Timeout { get; set; } /// @@ -54,14 +69,14 @@ public TaskAddCollectionOptions() { } /// a GUID with no decoration such as curly braces, e.g. /// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public System.Guid? ClientRequestId { get; set; } /// /// Gets or sets whether the server should return the client-request-id /// in the response. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public bool? ReturnClientRequestId { get; set; } /// @@ -69,8 +84,8 @@ public TaskAddCollectionOptions() { } /// typically set this to the current system clock time; set it /// explicitly if you are calling the REST API directly. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? OcpDate { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskAddCollectionParameter.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskAddCollectionParameter.cs index 5b205bc1b9b1..d61e1413ba87 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskAddCollectionParameter.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskAddCollectionParameter.cs @@ -8,6 +8,13 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// @@ -18,42 +25,58 @@ public partial class TaskAddCollectionParameter /// /// Initializes a new instance of the TaskAddCollectionParameter class. /// - public TaskAddCollectionParameter() { } + public TaskAddCollectionParameter() + { + CustomInit(); + } /// /// Initializes a new instance of the TaskAddCollectionParameter class. /// /// The collection of tasks to add. - public TaskAddCollectionParameter(System.Collections.Generic.IList value) + public TaskAddCollectionParameter(IList value) { - this.Value = value; + Value = value; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the collection of tasks to add. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "value")] - public System.Collections.Generic.IList Value { get; set; } + /// + /// The total serialized size of this collection must be less than 4MB. + /// If it is greater than 4MB (for example if each task has 100's of + /// resource files or environment variables), the request will fail + /// with code 'RequestBodyTooLarge' and should be retried again with + /// fewer tasks. + /// + [JsonProperty(PropertyName = "value")] + public IList Value { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (this.Value == null) + if (Value == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Value"); + throw new ValidationException(ValidationRules.CannotBeNull, "Value"); } - if (this.Value != null) + if (Value != null) { - if (this.Value.Count > 100) + if (Value.Count > 100) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxItems, "Value", 100); + throw new ValidationException(ValidationRules.MaxItems, "Value", 100); } - foreach (var element in this.Value) + foreach (var element in Value) { if (element != null) { diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskAddCollectionResult.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskAddCollectionResult.cs index 5efccb98f5c6..45daafbe92cc 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskAddCollectionResult.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskAddCollectionResult.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// @@ -18,23 +24,32 @@ public partial class TaskAddCollectionResult /// /// Initializes a new instance of the TaskAddCollectionResult class. /// - public TaskAddCollectionResult() { } + public TaskAddCollectionResult() + { + CustomInit(); + } /// /// Initializes a new instance of the TaskAddCollectionResult class. /// /// The results of the add task collection /// operation. - public TaskAddCollectionResult(System.Collections.Generic.IList value = default(System.Collections.Generic.IList)) + public TaskAddCollectionResult(IList value = default(IList)) { - this.Value = value; + Value = value; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the results of the add task collection operation. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "value")] - public System.Collections.Generic.IList Value { get; set; } + [JsonProperty(PropertyName = "value")] + public IList Value { get; set; } } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskAddHeaders.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskAddHeaders.cs index bf774b7754f7..0a5df663246a 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskAddHeaders.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskAddHeaders.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class TaskAddHeaders /// /// Initializes a new instance of the TaskAddHeaders class. /// - public TaskAddHeaders() { } + public TaskAddHeaders() + { + CustomInit(); + } /// /// Initializes a new instance of the TaskAddHeaders class. @@ -44,19 +53,25 @@ public TaskAddHeaders() { } /// the request applied. public TaskAddHeaders(System.Guid? clientRequestId = default(System.Guid?), System.Guid? requestId = default(System.Guid?), string eTag = default(string), System.DateTime? lastModified = default(System.DateTime?), string dataServiceId = default(string)) { - this.ClientRequestId = clientRequestId; - this.RequestId = requestId; - this.ETag = eTag; - this.LastModified = lastModified; - this.DataServiceId = dataServiceId; + ClientRequestId = clientRequestId; + RequestId = requestId; + ETag = eTag; + LastModified = lastModified; + DataServiceId = dataServiceId; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the client-request-id provided by the client during /// the request. This will be returned only if the /// return-client-request-id parameter was set to true. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "client-request-id")] + [JsonProperty(PropertyName = "client-request-id")] public System.Guid? ClientRequestId { get; set; } /// @@ -68,7 +83,7 @@ public TaskAddHeaders() { } /// request was made, the Batch account against which the request was /// made, and the region that account resides in. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "request-id")] + [JsonProperty(PropertyName = "request-id")] public System.Guid? RequestId { get; set; } /// @@ -78,21 +93,21 @@ public TaskAddHeaders() { } /// the If-Modified-Since, If-Unmodified-Since, If-Match or /// If-None-Match headers. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "ETag")] + [JsonProperty(PropertyName = "ETag")] public string ETag { get; set; } /// /// Gets or sets the time at which the resource was last modified. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "Last-Modified")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "Last-Modified")] public System.DateTime? LastModified { get; set; } /// /// Gets or sets the OData ID of the resource to which the request /// applied. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "DataServiceId")] + [JsonProperty(PropertyName = "DataServiceId")] public string DataServiceId { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskAddOptions.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskAddOptions.cs index b02ef5d970fb..d553d3862383 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskAddOptions.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskAddOptions.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class TaskAddOptions /// /// Initializes a new instance of the TaskAddOptions class. /// - public TaskAddOptions() { } + public TaskAddOptions() + { + CustomInit(); + } /// /// Initializes a new instance of the TaskAddOptions class. @@ -36,17 +45,23 @@ public TaskAddOptions() { } /// it explicitly if you are calling the REST API directly. public TaskAddOptions(int? timeout = default(int?), System.Guid? clientRequestId = default(System.Guid?), bool? returnClientRequestId = default(bool?), System.DateTime? ocpDate = default(System.DateTime?)) { - this.Timeout = timeout; - this.ClientRequestId = clientRequestId; - this.ReturnClientRequestId = returnClientRequestId; - this.OcpDate = ocpDate; + Timeout = timeout; + ClientRequestId = clientRequestId; + ReturnClientRequestId = returnClientRequestId; + OcpDate = ocpDate; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the maximum time that the server can spend processing /// the request, in seconds. The default is 30 seconds. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public int? Timeout { get; set; } /// @@ -54,14 +69,14 @@ public TaskAddOptions() { } /// a GUID with no decoration such as curly braces, e.g. /// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public System.Guid? ClientRequestId { get; set; } /// /// Gets or sets whether the server should return the client-request-id /// in the response. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public bool? ReturnClientRequestId { get; set; } /// @@ -69,8 +84,8 @@ public TaskAddOptions() { } /// typically set this to the current system clock time; set it /// explicitly if you are calling the REST API directly. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? OcpDate { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskAddParameter.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskAddParameter.cs index a4658a059899..dabcfacd3834 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskAddParameter.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskAddParameter.cs @@ -8,6 +8,13 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// @@ -18,7 +25,10 @@ public partial class TaskAddParameter /// /// Initializes a new instance of the TaskAddParameter class. /// - public TaskAddParameter() { } + public TaskAddParameter() + { + CustomInit(); + } /// /// Initializes a new instance of the TaskAddParameter class. @@ -55,24 +65,30 @@ public TaskAddParameter() { } /// The settings for an /// authentication token that the task can use to perform Batch service /// operations. - public TaskAddParameter(string id, string commandLine, string displayName = default(string), ExitConditions exitConditions = default(ExitConditions), System.Collections.Generic.IList resourceFiles = default(System.Collections.Generic.IList), System.Collections.Generic.IList outputFiles = default(System.Collections.Generic.IList), System.Collections.Generic.IList environmentSettings = default(System.Collections.Generic.IList), AffinityInformation affinityInfo = default(AffinityInformation), TaskConstraints constraints = default(TaskConstraints), UserIdentity userIdentity = default(UserIdentity), MultiInstanceSettings multiInstanceSettings = default(MultiInstanceSettings), TaskDependencies dependsOn = default(TaskDependencies), System.Collections.Generic.IList applicationPackageReferences = default(System.Collections.Generic.IList), AuthenticationTokenSettings authenticationTokenSettings = default(AuthenticationTokenSettings)) + public TaskAddParameter(string id, string commandLine, string displayName = default(string), ExitConditions exitConditions = default(ExitConditions), IList resourceFiles = default(IList), IList outputFiles = default(IList), IList environmentSettings = default(IList), AffinityInformation affinityInfo = default(AffinityInformation), TaskConstraints constraints = default(TaskConstraints), UserIdentity userIdentity = default(UserIdentity), MultiInstanceSettings multiInstanceSettings = default(MultiInstanceSettings), TaskDependencies dependsOn = default(TaskDependencies), IList applicationPackageReferences = default(IList), AuthenticationTokenSettings authenticationTokenSettings = default(AuthenticationTokenSettings)) { - this.Id = id; - this.DisplayName = displayName; - this.CommandLine = commandLine; - this.ExitConditions = exitConditions; - this.ResourceFiles = resourceFiles; - this.OutputFiles = outputFiles; - this.EnvironmentSettings = environmentSettings; - this.AffinityInfo = affinityInfo; - this.Constraints = constraints; - this.UserIdentity = userIdentity; - this.MultiInstanceSettings = multiInstanceSettings; - this.DependsOn = dependsOn; - this.ApplicationPackageReferences = applicationPackageReferences; - this.AuthenticationTokenSettings = authenticationTokenSettings; + Id = id; + DisplayName = displayName; + CommandLine = commandLine; + ExitConditions = exitConditions; + ResourceFiles = resourceFiles; + OutputFiles = outputFiles; + EnvironmentSettings = environmentSettings; + AffinityInfo = affinityInfo; + Constraints = constraints; + UserIdentity = userIdentity; + MultiInstanceSettings = multiInstanceSettings; + DependsOn = dependsOn; + ApplicationPackageReferences = applicationPackageReferences; + AuthenticationTokenSettings = authenticationTokenSettings; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets a string that uniquely identifies the task within the /// job. @@ -84,7 +100,7 @@ public TaskAddParameter() { } /// is, you may not have two IDs within a job that differ only by /// case). /// - [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + [JsonProperty(PropertyName = "id")] public string Id { get; set; } /// @@ -94,7 +110,7 @@ public TaskAddParameter() { } /// The display name need not be unique and can contain any Unicode /// characters up to a maximum length of 1024. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "displayName")] + [JsonProperty(PropertyName = "displayName")] public string DisplayName { get; set; } /// @@ -110,14 +126,14 @@ public TaskAddParameter() { } /// command line, for example using "cmd /c MyCommand" in Windows or /// "/bin/sh -c MyCommand" in Linux. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "commandLine")] + [JsonProperty(PropertyName = "commandLine")] public string CommandLine { get; set; } /// /// Gets or sets how the Batch service should respond when the task /// completes. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "exitConditions")] + [JsonProperty(PropertyName = "exitConditions")] public ExitConditions ExitConditions { get; set; } /// @@ -129,8 +145,8 @@ public TaskAddParameter() { } /// downloaded to the compute node on which the primary task is /// executed. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "resourceFiles")] - public System.Collections.Generic.IList ResourceFiles { get; set; } + [JsonProperty(PropertyName = "resourceFiles")] + public IList ResourceFiles { get; set; } /// /// Gets or sets a list of files that the Batch service will upload @@ -140,20 +156,20 @@ public TaskAddParameter() { } /// For multi-instance tasks, the files will only be uploaded from the /// compute node on which the primary task is executed. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "outputFiles")] - public System.Collections.Generic.IList OutputFiles { get; set; } + [JsonProperty(PropertyName = "outputFiles")] + public IList OutputFiles { get; set; } /// /// Gets or sets a list of environment variable settings for the task. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "environmentSettings")] - public System.Collections.Generic.IList EnvironmentSettings { get; set; } + [JsonProperty(PropertyName = "environmentSettings")] + public IList EnvironmentSettings { get; set; } /// /// Gets or sets a locality hint that can be used by the Batch service /// to select a compute node on which to start the new task. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "affinityInfo")] + [JsonProperty(PropertyName = "affinityInfo")] public AffinityInformation AffinityInfo { get; set; } /// @@ -164,7 +180,7 @@ public TaskAddParameter() { } /// maxTaskRetryCount specified for the job, and the maxWallClockTime /// and retentionTime are infinite. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "constraints")] + [JsonProperty(PropertyName = "constraints")] public TaskConstraints Constraints { get; set; } /// @@ -174,7 +190,7 @@ public TaskAddParameter() { } /// If omitted, the task runs as a non-administrative user unique to /// the task. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "userIdentity")] + [JsonProperty(PropertyName = "userIdentity")] public UserIdentity UserIdentity { get; set; } /// @@ -182,7 +198,7 @@ public TaskAddParameter() { } /// multi-instance task, and contains information about how to run the /// multi-instance task. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "multiInstanceSettings")] + [JsonProperty(PropertyName = "multiInstanceSettings")] public MultiInstanceSettings MultiInstanceSettings { get; set; } /// @@ -196,15 +212,24 @@ public TaskAddParameter() { } /// present, the request fails with error code /// TaskDependenciesNotSpecifiedOnJob. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "dependsOn")] + [JsonProperty(PropertyName = "dependsOn")] public TaskDependencies DependsOn { get; set; } /// /// Gets or sets a list of application packages that the Batch service /// will deploy to the compute node before running the command line. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "applicationPackageReferences")] - public System.Collections.Generic.IList ApplicationPackageReferences { get; set; } + /// + /// Application packages are downloaded and deployed to a shared + /// directory, not the task working directory. Therefore, if a + /// referenced package is already on the compute node, and is up to + /// date, then it is not re-downloaded; the existing copy on the + /// compute node is used. If a referenced application package cannot be + /// installed, for example because the package has been deleted or + /// because download failed, the task fails. + /// + [JsonProperty(PropertyName = "applicationPackageReferences")] + public IList ApplicationPackageReferences { get; set; } /// /// Gets or sets the settings for an authentication token that the task @@ -220,28 +245,28 @@ public TaskAddParameter() { } /// permissions in order to add other tasks to the job, or check the /// status of the job or of other tasks under the job. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "authenticationTokenSettings")] + [JsonProperty(PropertyName = "authenticationTokenSettings")] public AuthenticationTokenSettings AuthenticationTokenSettings { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (this.Id == null) + if (Id == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Id"); + throw new ValidationException(ValidationRules.CannotBeNull, "Id"); } - if (this.CommandLine == null) + if (CommandLine == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "CommandLine"); + throw new ValidationException(ValidationRules.CannotBeNull, "CommandLine"); } - if (this.ResourceFiles != null) + if (ResourceFiles != null) { - foreach (var element in this.ResourceFiles) + foreach (var element in ResourceFiles) { if (element != null) { @@ -249,9 +274,9 @@ public virtual void Validate() } } } - if (this.OutputFiles != null) + if (OutputFiles != null) { - foreach (var element1 in this.OutputFiles) + foreach (var element1 in OutputFiles) { if (element1 != null) { @@ -259,9 +284,9 @@ public virtual void Validate() } } } - if (this.EnvironmentSettings != null) + if (EnvironmentSettings != null) { - foreach (var element2 in this.EnvironmentSettings) + foreach (var element2 in EnvironmentSettings) { if (element2 != null) { @@ -269,17 +294,17 @@ public virtual void Validate() } } } - if (this.AffinityInfo != null) + if (AffinityInfo != null) { - this.AffinityInfo.Validate(); + AffinityInfo.Validate(); } - if (this.MultiInstanceSettings != null) + if (MultiInstanceSettings != null) { - this.MultiInstanceSettings.Validate(); + MultiInstanceSettings.Validate(); } - if (this.ApplicationPackageReferences != null) + if (ApplicationPackageReferences != null) { - foreach (var element3 in this.ApplicationPackageReferences) + foreach (var element3 in ApplicationPackageReferences) { if (element3 != null) { diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskAddResult.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskAddResult.cs index 2e8838241bb3..4ad9f703a783 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskAddResult.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskAddResult.cs @@ -8,6 +8,11 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Newtonsoft.Json; using System.Linq; /// @@ -19,7 +24,10 @@ public partial class TaskAddResult /// /// Initializes a new instance of the TaskAddResult class. /// - public TaskAddResult() { } + public TaskAddResult() + { + CustomInit(); + } /// /// Initializes a new instance of the TaskAddResult class. @@ -37,67 +45,86 @@ public TaskAddResult() { } /// the task. public TaskAddResult(TaskAddStatus status, string taskId, string eTag = default(string), System.DateTime? lastModified = default(System.DateTime?), string location = default(string), BatchError error = default(BatchError)) { - this.Status = status; - this.TaskId = taskId; - this.ETag = eTag; - this.LastModified = lastModified; - this.Location = location; - this.Error = error; + Status = status; + TaskId = taskId; + ETag = eTag; + LastModified = lastModified; + Location = location; + Error = error; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the status of the add task request. /// /// - /// Possible values include: 'success', 'clientError', 'serverError' + /// Values are: + /// + /// success - Task was added successfully. + /// clienterror - Task failed to add due to a client error and should + /// not be retried without modifying the request as appropriate. + /// servererror - Task failed to add due to a server error and can be + /// retried without modification. Possible values include: 'success', + /// 'clientError', 'serverError' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "status")] + [JsonProperty(PropertyName = "status")] public TaskAddStatus Status { get; set; } /// /// Gets or sets the ID of the task for which this is the result. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "taskId")] + [JsonProperty(PropertyName = "taskId")] public string TaskId { get; set; } /// /// Gets or sets the ETag of the task, if the task was successfully /// added. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "eTag")] + /// + /// You can use this to detect whether the task has changed between + /// requests. In particular, you can be pass the ETag with an Update + /// Task request to specify that your changes should take effect only + /// if nobody else has modified the job in the meantime. + /// + [JsonProperty(PropertyName = "eTag")] public string ETag { get; set; } /// /// Gets or sets the last modified time of the task. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "lastModified")] + [JsonProperty(PropertyName = "lastModified")] public System.DateTime? LastModified { get; set; } /// /// Gets or sets the URL of the task, if the task was successfully /// added. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + [JsonProperty(PropertyName = "location")] public string Location { get; set; } /// /// Gets or sets the error encountered while attempting to add the /// task. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "error")] + [JsonProperty(PropertyName = "error")] public BatchError Error { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (this.TaskId == null) + if (TaskId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "TaskId"); + throw new ValidationException(ValidationRules.CannotBeNull, "TaskId"); } } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskAddStatus.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskAddStatus.cs index 0798e246d423..c3e4c68eea08 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskAddStatus.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskAddStatus.cs @@ -8,18 +8,58 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; /// /// Defines values for TaskAddStatus. /// - [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + [JsonConverter(typeof(StringEnumConverter))] public enum TaskAddStatus { - [System.Runtime.Serialization.EnumMember(Value = "success")] + [EnumMember(Value = "success")] Success, - [System.Runtime.Serialization.EnumMember(Value = "clientError")] + [EnumMember(Value = "clientError")] ClientError, - [System.Runtime.Serialization.EnumMember(Value = "serverError")] + [EnumMember(Value = "serverError")] ServerError } + internal static class TaskAddStatusEnumExtension + { + internal static string ToSerializedValue(this TaskAddStatus? value) => + value == null ? null : ((TaskAddStatus)value).ToSerializedValue(); + + internal static string ToSerializedValue(this TaskAddStatus value) + { + switch( value ) + { + case TaskAddStatus.Success: + return "success"; + case TaskAddStatus.ClientError: + return "clientError"; + case TaskAddStatus.ServerError: + return "serverError"; + } + return null; + } + + internal static TaskAddStatus? ParseTaskAddStatus(this string value) + { + switch( value ) + { + case "success": + return TaskAddStatus.Success; + case "clientError": + return TaskAddStatus.ClientError; + case "serverError": + return TaskAddStatus.ServerError; + } + return null; + } + } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskConstraints.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskConstraints.cs index 5855fcfcc8b5..44f8a23e5082 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskConstraints.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskConstraints.cs @@ -8,6 +8,10 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +22,10 @@ public partial class TaskConstraints /// /// Initializes a new instance of the TaskConstraints class. /// - public TaskConstraints() { } + public TaskConstraints() + { + CustomInit(); + } /// /// Initializes a new instance of the TaskConstraints class. @@ -36,11 +43,17 @@ public TaskConstraints() { } /// code is nonzero. public TaskConstraints(System.TimeSpan? maxWallClockTime = default(System.TimeSpan?), System.TimeSpan? retentionTime = default(System.TimeSpan?), int? maxTaskRetryCount = default(int?)) { - this.MaxWallClockTime = maxWallClockTime; - this.RetentionTime = retentionTime; - this.MaxTaskRetryCount = maxTaskRetryCount; + MaxWallClockTime = maxWallClockTime; + RetentionTime = retentionTime; + MaxTaskRetryCount = maxTaskRetryCount; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the maximum elapsed time that the task may run, /// measured from the time the task starts. If the task does not @@ -50,7 +63,7 @@ public TaskConstraints() { } /// If this is not specified, there is no time limit on how long the /// task may run. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "maxWallClockTime")] + [JsonProperty(PropertyName = "maxWallClockTime")] public System.TimeSpan? MaxWallClockTime { get; set; } /// @@ -63,7 +76,7 @@ public TaskConstraints() { } /// The default is infinite, i.e. the task directory will be retained /// until the compute node is removed or reimaged. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "retentionTime")] + [JsonProperty(PropertyName = "retentionTime")] public System.TimeSpan? RetentionTime { get; set; } /// @@ -79,7 +92,7 @@ public TaskConstraints() { } /// task. If the maximum retry count is -1, the Batch service retries /// the task without limit. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "maxTaskRetryCount")] + [JsonProperty(PropertyName = "maxTaskRetryCount")] public int? MaxTaskRetryCount { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskCountValidationStatus.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskCountValidationStatus.cs index 341f8a967fb1..479967362b3a 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskCountValidationStatus.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskCountValidationStatus.cs @@ -8,16 +8,52 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; /// /// Defines values for TaskCountValidationStatus. /// - [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + [JsonConverter(typeof(StringEnumConverter))] public enum TaskCountValidationStatus { - [System.Runtime.Serialization.EnumMember(Value = "validated")] + [EnumMember(Value = "validated")] Validated, - [System.Runtime.Serialization.EnumMember(Value = "unvalidated")] + [EnumMember(Value = "unvalidated")] Unvalidated } + internal static class TaskCountValidationStatusEnumExtension + { + internal static string ToSerializedValue(this TaskCountValidationStatus? value) => + value == null ? null : ((TaskCountValidationStatus)value).ToSerializedValue(); + + internal static string ToSerializedValue(this TaskCountValidationStatus value) + { + switch( value ) + { + case TaskCountValidationStatus.Validated: + return "validated"; + case TaskCountValidationStatus.Unvalidated: + return "unvalidated"; + } + return null; + } + + internal static TaskCountValidationStatus? ParseTaskCountValidationStatus(this string value) + { + switch( value ) + { + case "validated": + return TaskCountValidationStatus.Validated; + case "unvalidated": + return TaskCountValidationStatus.Unvalidated; + } + return null; + } + } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskCounts.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskCounts.cs index c735bf621936..a4644551a9da 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskCounts.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskCounts.cs @@ -8,6 +8,10 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +22,10 @@ public partial class TaskCounts /// /// Initializes a new instance of the TaskCounts class. /// - public TaskCounts() { } + public TaskCounts() + { + CustomInit(); + } /// /// Initializes a new instance of the TaskCounts class. @@ -36,69 +43,72 @@ public TaskCounts() { } /// if its result (found in the executionInfo property) is /// 'failure'. /// Whether the task counts have been - /// validated. If the validationStatus is unvalidated, then the Batch - /// service has not been able to check state counts against the task - /// states as reported in the List Tasks API. + /// validated. public TaskCounts(int active, int running, int completed, int succeeded, int failed, TaskCountValidationStatus validationStatus) { - this.Active = active; - this.Running = running; - this.Completed = completed; - this.Succeeded = succeeded; - this.Failed = failed; - this.ValidationStatus = validationStatus; + Active = active; + Running = running; + Completed = completed; + Succeeded = succeeded; + Failed = failed; + ValidationStatus = validationStatus; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the number of tasks in the active state. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "active")] + [JsonProperty(PropertyName = "active")] public int Active { get; set; } /// /// Gets or sets the number of tasks in the running or preparing state. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "running")] + [JsonProperty(PropertyName = "running")] public int Running { get; set; } /// /// Gets or sets the number of tasks in the completed state. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "completed")] + [JsonProperty(PropertyName = "completed")] public int Completed { get; set; } /// /// Gets or sets the number of tasks which succeeded. A task succeeds /// if its result (found in the executionInfo property) is 'success'. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "succeeded")] + [JsonProperty(PropertyName = "succeeded")] public int Succeeded { get; set; } /// /// Gets or sets the number of tasks which failed. A task fails if its /// result (found in the executionInfo property) is 'failure'. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "failed")] + [JsonProperty(PropertyName = "failed")] public int Failed { get; set; } /// - /// Gets or sets whether the task counts have been validated. If the - /// validationStatus is unvalidated, then the Batch service has not - /// been able to check state counts against the task states as reported - /// in the List Tasks API. + /// Gets or sets whether the task counts have been validated. /// /// - /// The validationStatus may be unvalidated if the job contains more - /// than 200,000 tasks. Possible values include: 'validated', - /// 'unvalidated' + /// If the validationStatus is unvalidated, then the Batch service has + /// not been able to check state counts against the task states as + /// reported in the List Tasks API. The validationStatus may be + /// unvalidated if the job contains more than 200,000 tasks. Possible + /// values include: 'validated', 'unvalidated' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "validationStatus")] + [JsonProperty(PropertyName = "validationStatus")] public TaskCountValidationStatus ValidationStatus { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskDeleteHeaders.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskDeleteHeaders.cs index 8c016a784b5b..64d309d27c89 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskDeleteHeaders.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskDeleteHeaders.cs @@ -8,6 +8,10 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +22,10 @@ public partial class TaskDeleteHeaders /// /// Initializes a new instance of the TaskDeleteHeaders class. /// - public TaskDeleteHeaders() { } + public TaskDeleteHeaders() + { + CustomInit(); + } /// /// Initializes a new instance of the TaskDeleteHeaders class. @@ -35,16 +42,22 @@ public TaskDeleteHeaders() { } /// request was made, and the region that account resides in. public TaskDeleteHeaders(string clientRequestId = default(string), string requestId = default(string)) { - this.ClientRequestId = clientRequestId; - this.RequestId = requestId; + ClientRequestId = clientRequestId; + RequestId = requestId; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the client-request-id provided by the client during /// the request. This will be returned only if the /// return-client-request-id parameter was set to true. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "client-request-id")] + [JsonProperty(PropertyName = "client-request-id")] public string ClientRequestId { get; set; } /// @@ -56,7 +69,7 @@ public TaskDeleteHeaders() { } /// request was made, the Batch account against which the request was /// made, and the region that account resides in. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "request-id")] + [JsonProperty(PropertyName = "request-id")] public string RequestId { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskDeleteOptions.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskDeleteOptions.cs index 34e5df6a3197..357740e0303f 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskDeleteOptions.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskDeleteOptions.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class TaskDeleteOptions /// /// Initializes a new instance of the TaskDeleteOptions class. /// - public TaskDeleteOptions() { } + public TaskDeleteOptions() + { + CustomInit(); + } /// /// Initializes a new instance of the TaskDeleteOptions class. @@ -52,21 +61,27 @@ public TaskDeleteOptions() { } /// modified since the specified time. public TaskDeleteOptions(int? timeout = default(int?), System.Guid? clientRequestId = default(System.Guid?), bool? returnClientRequestId = default(bool?), System.DateTime? ocpDate = default(System.DateTime?), string ifMatch = default(string), string ifNoneMatch = default(string), System.DateTime? ifModifiedSince = default(System.DateTime?), System.DateTime? ifUnmodifiedSince = default(System.DateTime?)) { - this.Timeout = timeout; - this.ClientRequestId = clientRequestId; - this.ReturnClientRequestId = returnClientRequestId; - this.OcpDate = ocpDate; - this.IfMatch = ifMatch; - this.IfNoneMatch = ifNoneMatch; - this.IfModifiedSince = ifModifiedSince; - this.IfUnmodifiedSince = ifUnmodifiedSince; + Timeout = timeout; + ClientRequestId = clientRequestId; + ReturnClientRequestId = returnClientRequestId; + OcpDate = ocpDate; + IfMatch = ifMatch; + IfNoneMatch = ifNoneMatch; + IfModifiedSince = ifModifiedSince; + IfUnmodifiedSince = ifUnmodifiedSince; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the maximum time that the server can spend processing /// the request, in seconds. The default is 30 seconds. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public int? Timeout { get; set; } /// @@ -74,14 +89,14 @@ public TaskDeleteOptions() { } /// a GUID with no decoration such as curly braces, e.g. /// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public System.Guid? ClientRequestId { get; set; } /// /// Gets or sets whether the server should return the client-request-id /// in the response. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public bool? ReturnClientRequestId { get; set; } /// @@ -89,8 +104,8 @@ public TaskDeleteOptions() { } /// typically set this to the current system clock time; set it /// explicitly if you are calling the REST API directly. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? OcpDate { get; set; } /// @@ -99,7 +114,7 @@ public TaskDeleteOptions() { } /// if the resource's current ETag on the service exactly matches the /// value specified by the client. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public string IfMatch { get; set; } /// @@ -108,7 +123,7 @@ public TaskDeleteOptions() { } /// if the resource's current ETag on the service does not match the /// value specified by the client. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public string IfNoneMatch { get; set; } /// @@ -117,8 +132,8 @@ public TaskDeleteOptions() { } /// if the resource on the service has been modified since the /// specified time. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? IfModifiedSince { get; set; } /// @@ -127,8 +142,8 @@ public TaskDeleteOptions() { } /// if the resource on the service has not been modified since the /// specified time. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? IfUnmodifiedSince { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskDependencies.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskDependencies.cs index 86aa4c350f32..fe3b61edfa34 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskDependencies.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskDependencies.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// @@ -20,7 +26,10 @@ public partial class TaskDependencies /// /// Initializes a new instance of the TaskDependencies class. /// - public TaskDependencies() { } + public TaskDependencies() + { + CustomInit(); + } /// /// Initializes a new instance of the TaskDependencies class. @@ -31,27 +40,40 @@ public TaskDependencies() { } /// The list of task ID ranges that this /// task depends on. All tasks in all ranges must complete successfully /// before the dependent task can be scheduled. - public TaskDependencies(System.Collections.Generic.IList taskIds = default(System.Collections.Generic.IList), System.Collections.Generic.IList taskIdRanges = default(System.Collections.Generic.IList)) + public TaskDependencies(IList taskIds = default(IList), IList taskIdRanges = default(IList)) { - this.TaskIds = taskIds; - this.TaskIdRanges = taskIdRanges; + TaskIds = taskIds; + TaskIdRanges = taskIdRanges; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the list of task IDs that this task depends on. All /// tasks in this list must complete successfully before the dependent /// task can be scheduled. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "taskIds")] - public System.Collections.Generic.IList TaskIds { get; set; } + /// + /// The taskIds collection is limited to 64000 characters total (i.e. + /// the combined length of all task IDs). If the taskIds collection + /// exceeds the maximum length, the Add Task request fails with error + /// code TaskDependencyListTooLong. In this case consider using task ID + /// ranges instead. + /// + [JsonProperty(PropertyName = "taskIds")] + public IList TaskIds { get; set; } /// /// Gets or sets the list of task ID ranges that this task depends on. /// All tasks in all ranges must complete successfully before the /// dependent task can be scheduled. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "taskIdRanges")] - public System.Collections.Generic.IList TaskIdRanges { get; set; } + [JsonProperty(PropertyName = "taskIdRanges")] + public IList TaskIdRanges { get; set; } } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskExecutionInformation.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskExecutionInformation.cs index 7216b8e4f905..d147273222e6 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskExecutionInformation.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskExecutionInformation.cs @@ -8,6 +8,10 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +22,10 @@ public partial class TaskExecutionInformation /// /// Initializes a new instance of the TaskExecutionInformation class. /// - public TaskExecutionInformation() { } + public TaskExecutionInformation() + { + CustomInit(); + } /// /// Initializes a new instance of the TaskExecutionInformation class. @@ -43,17 +50,23 @@ public TaskExecutionInformation() { } /// The result of the task execution. public TaskExecutionInformation(int retryCount, int requeueCount, System.DateTime? startTime = default(System.DateTime?), System.DateTime? endTime = default(System.DateTime?), int? exitCode = default(int?), TaskFailureInformation failureInfo = default(TaskFailureInformation), System.DateTime? lastRetryTime = default(System.DateTime?), System.DateTime? lastRequeueTime = default(System.DateTime?), TaskExecutionResult? result = default(TaskExecutionResult?)) { - this.StartTime = startTime; - this.EndTime = endTime; - this.ExitCode = exitCode; - this.FailureInfo = failureInfo; - this.RetryCount = retryCount; - this.LastRetryTime = lastRetryTime; - this.RequeueCount = requeueCount; - this.LastRequeueTime = lastRequeueTime; - this.Result = result; + StartTime = startTime; + EndTime = endTime; + ExitCode = exitCode; + FailureInfo = failureInfo; + RetryCount = retryCount; + LastRetryTime = lastRetryTime; + RequeueCount = requeueCount; + LastRequeueTime = lastRequeueTime; + Result = result; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the time at which the task started running. /// @@ -66,7 +79,7 @@ public TaskExecutionInformation() { } /// property is present only for tasks that are in the running or /// completed state. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "startTime")] + [JsonProperty(PropertyName = "startTime")] public System.DateTime? StartTime { get; set; } /// @@ -75,7 +88,7 @@ public TaskExecutionInformation() { } /// /// This property is set only if the task is in the Completed state. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "endTime")] + [JsonProperty(PropertyName = "endTime")] public System.DateTime? EndTime { get; set; } /// @@ -92,7 +105,7 @@ public TaskExecutionInformation() { } /// task (due to timeout, or user termination via the API) you may see /// an operating system-defined exit code. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "exitCode")] + [JsonProperty(PropertyName = "exitCode")] public int? ExitCode { get; set; } /// @@ -102,7 +115,7 @@ public TaskExecutionInformation() { } /// This property is set only if the task is in the completed state and /// encountered a failure. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "failureInfo")] + [JsonProperty(PropertyName = "failureInfo")] public TaskFailureInformation FailureInfo { get; set; } /// @@ -110,13 +123,12 @@ public TaskExecutionInformation() { } /// Batch service. /// /// - /// The number of times the task has been retried by the Batch service. /// Task application failures (non-zero exit code) are retried, /// pre-processing errors (the task could not be run) and file upload /// errors are not retried. The Batch service will retry the task up to /// the limit specified by the constraints. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "retryCount")] + [JsonProperty(PropertyName = "retryCount")] public int RetryCount { get; set; } /// @@ -131,7 +143,7 @@ public TaskExecutionInformation() { } /// rebooted during a retry, then the startTime is updated but the /// lastRetryTime is not. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "lastRetryTime")] + [JsonProperty(PropertyName = "lastRetryTime")] public System.DateTime? LastRetryTime { get; set; } /// @@ -144,7 +156,7 @@ public TaskExecutionInformation() { } /// running tasks on the nodes be requeued for execution. This count /// tracks how many times the task has been requeued for these reasons. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "requeueCount")] + [JsonProperty(PropertyName = "requeueCount")] public int RequeueCount { get; set; } /// @@ -154,7 +166,7 @@ public TaskExecutionInformation() { } /// /// This property is set only if the requeueCount is nonzero. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "lastRequeueTime")] + [JsonProperty(PropertyName = "lastRequeueTime")] public System.DateTime? LastRequeueTime { get; set; } /// @@ -165,20 +177,20 @@ public TaskExecutionInformation() { } /// found in the failureInfo property. Possible values include: /// 'success', 'failure' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "result")] + [JsonProperty(PropertyName = "result")] public TaskExecutionResult? Result { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (this.FailureInfo != null) + if (FailureInfo != null) { - this.FailureInfo.Validate(); + FailureInfo.Validate(); } } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskExecutionResult.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskExecutionResult.cs index 9f565385cb59..9231db5d28cc 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskExecutionResult.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskExecutionResult.cs @@ -8,16 +8,52 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; /// /// Defines values for TaskExecutionResult. /// - [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + [JsonConverter(typeof(StringEnumConverter))] public enum TaskExecutionResult { - [System.Runtime.Serialization.EnumMember(Value = "success")] + [EnumMember(Value = "success")] Success, - [System.Runtime.Serialization.EnumMember(Value = "failure")] + [EnumMember(Value = "failure")] Failure } + internal static class TaskExecutionResultEnumExtension + { + internal static string ToSerializedValue(this TaskExecutionResult? value) => + value == null ? null : ((TaskExecutionResult)value).ToSerializedValue(); + + internal static string ToSerializedValue(this TaskExecutionResult value) + { + switch( value ) + { + case TaskExecutionResult.Success: + return "success"; + case TaskExecutionResult.Failure: + return "failure"; + } + return null; + } + + internal static TaskExecutionResult? ParseTaskExecutionResult(this string value) + { + switch( value ) + { + case "success": + return TaskExecutionResult.Success; + case "failure": + return TaskExecutionResult.Failure; + } + return null; + } + } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskFailureInformation.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskFailureInformation.cs index 468a4d454c02..6e9ed109ceab 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskFailureInformation.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskFailureInformation.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class TaskFailureInformation /// /// Initializes a new instance of the TaskFailureInformation class. /// - public TaskFailureInformation() { } + public TaskFailureInformation() + { + CustomInit(); + } /// /// Initializes a new instance of the TaskFailureInformation class. @@ -30,47 +39,53 @@ public TaskFailureInformation() { } /// to be suitable for display in a user interface. /// A list of additional details related to the /// error. - public TaskFailureInformation(ErrorCategory category, string code = default(string), string message = default(string), System.Collections.Generic.IList details = default(System.Collections.Generic.IList)) + public TaskFailureInformation(ErrorCategory category, string code = default(string), string message = default(string), IList details = default(IList)) { - this.Category = category; - this.Code = code; - this.Message = message; - this.Details = details; + Category = category; + Code = code; + Message = message; + Details = details; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the category of the task error. /// /// /// Possible values include: 'userError', 'serverError' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "category")] + [JsonProperty(PropertyName = "category")] public ErrorCategory Category { get; set; } /// /// Gets or sets an identifier for the task error. Codes are invariant /// and are intended to be consumed programmatically. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "code")] + [JsonProperty(PropertyName = "code")] public string Code { get; set; } /// /// Gets or sets a message describing the task error, intended to be /// suitable for display in a user interface. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "message")] + [JsonProperty(PropertyName = "message")] public string Message { get; set; } /// /// Gets or sets a list of additional details related to the error. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "details")] - public System.Collections.Generic.IList Details { get; set; } + [JsonProperty(PropertyName = "details")] + public IList Details { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskGetHeaders.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskGetHeaders.cs index b280933f2983..c904226b6de6 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskGetHeaders.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskGetHeaders.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class TaskGetHeaders /// /// Initializes a new instance of the TaskGetHeaders class. /// - public TaskGetHeaders() { } + public TaskGetHeaders() + { + CustomInit(); + } /// /// Initializes a new instance of the TaskGetHeaders class. @@ -44,19 +53,25 @@ public TaskGetHeaders() { } /// the request applied. public TaskGetHeaders(System.Guid? clientRequestId = default(System.Guid?), System.Guid? requestId = default(System.Guid?), string eTag = default(string), System.DateTime? lastModified = default(System.DateTime?), string dataServiceId = default(string)) { - this.ClientRequestId = clientRequestId; - this.RequestId = requestId; - this.ETag = eTag; - this.LastModified = lastModified; - this.DataServiceId = dataServiceId; + ClientRequestId = clientRequestId; + RequestId = requestId; + ETag = eTag; + LastModified = lastModified; + DataServiceId = dataServiceId; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the client-request-id provided by the client during /// the request. This will be returned only if the /// return-client-request-id parameter was set to true. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "client-request-id")] + [JsonProperty(PropertyName = "client-request-id")] public System.Guid? ClientRequestId { get; set; } /// @@ -68,7 +83,7 @@ public TaskGetHeaders() { } /// request was made, the Batch account against which the request was /// made, and the region that account resides in. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "request-id")] + [JsonProperty(PropertyName = "request-id")] public System.Guid? RequestId { get; set; } /// @@ -78,21 +93,21 @@ public TaskGetHeaders() { } /// the If-Modified-Since, If-Unmodified-Since, If-Match or /// If-None-Match headers. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "ETag")] + [JsonProperty(PropertyName = "ETag")] public string ETag { get; set; } /// /// Gets or sets the time at which the resource was last modified. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "Last-Modified")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "Last-Modified")] public System.DateTime? LastModified { get; set; } /// /// Gets or sets the OData ID of the resource to which the request /// applied. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "DataServiceId")] + [JsonProperty(PropertyName = "DataServiceId")] public string DataServiceId { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskGetOptions.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskGetOptions.cs index feb29bca767f..b4c6cab3ea4e 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskGetOptions.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskGetOptions.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class TaskGetOptions /// /// Initializes a new instance of the TaskGetOptions class. /// - public TaskGetOptions() { } + public TaskGetOptions() + { + CustomInit(); + } /// /// Initializes a new instance of the TaskGetOptions class. @@ -54,35 +63,41 @@ public TaskGetOptions() { } /// modified since the specified time. public TaskGetOptions(string select = default(string), string expand = default(string), int? timeout = default(int?), System.Guid? clientRequestId = default(System.Guid?), bool? returnClientRequestId = default(bool?), System.DateTime? ocpDate = default(System.DateTime?), string ifMatch = default(string), string ifNoneMatch = default(string), System.DateTime? ifModifiedSince = default(System.DateTime?), System.DateTime? ifUnmodifiedSince = default(System.DateTime?)) { - this.Select = select; - this.Expand = expand; - this.Timeout = timeout; - this.ClientRequestId = clientRequestId; - this.ReturnClientRequestId = returnClientRequestId; - this.OcpDate = ocpDate; - this.IfMatch = ifMatch; - this.IfNoneMatch = ifNoneMatch; - this.IfModifiedSince = ifModifiedSince; - this.IfUnmodifiedSince = ifUnmodifiedSince; + Select = select; + Expand = expand; + Timeout = timeout; + ClientRequestId = clientRequestId; + ReturnClientRequestId = returnClientRequestId; + OcpDate = ocpDate; + IfMatch = ifMatch; + IfNoneMatch = ifNoneMatch; + IfModifiedSince = ifModifiedSince; + IfUnmodifiedSince = ifUnmodifiedSince; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets an OData $select clause. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public string Select { get; set; } /// /// Gets or sets an OData $expand clause. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public string Expand { get; set; } /// /// Gets or sets the maximum time that the server can spend processing /// the request, in seconds. The default is 30 seconds. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public int? Timeout { get; set; } /// @@ -90,14 +105,14 @@ public TaskGetOptions() { } /// a GUID with no decoration such as curly braces, e.g. /// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public System.Guid? ClientRequestId { get; set; } /// /// Gets or sets whether the server should return the client-request-id /// in the response. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public bool? ReturnClientRequestId { get; set; } /// @@ -105,8 +120,8 @@ public TaskGetOptions() { } /// typically set this to the current system clock time; set it /// explicitly if you are calling the REST API directly. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? OcpDate { get; set; } /// @@ -115,7 +130,7 @@ public TaskGetOptions() { } /// if the resource's current ETag on the service exactly matches the /// value specified by the client. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public string IfMatch { get; set; } /// @@ -124,7 +139,7 @@ public TaskGetOptions() { } /// if the resource's current ETag on the service does not match the /// value specified by the client. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public string IfNoneMatch { get; set; } /// @@ -133,8 +148,8 @@ public TaskGetOptions() { } /// if the resource on the service has been modified since the /// specified time. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? IfModifiedSince { get; set; } /// @@ -143,8 +158,8 @@ public TaskGetOptions() { } /// if the resource on the service has not been modified since the /// specified time. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? IfUnmodifiedSince { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskIdRange.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskIdRange.cs index 6ddfa881b845..f3b1ce8bb836 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskIdRange.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskIdRange.cs @@ -8,6 +8,10 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; using System.Linq; /// @@ -25,7 +29,10 @@ public partial class TaskIdRange /// /// Initializes a new instance of the TaskIdRange class. /// - public TaskIdRange() { } + public TaskIdRange() + { + CustomInit(); + } /// /// Initializes a new instance of the TaskIdRange class. @@ -34,26 +41,32 @@ public TaskIdRange() { } /// The last task ID in the range. public TaskIdRange(int start, int end) { - this.Start = start; - this.End = end; + Start = start; + End = end; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the first task ID in the range. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "start")] + [JsonProperty(PropertyName = "start")] public int Start { get; set; } /// /// Gets or sets the last task ID in the range. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "end")] + [JsonProperty(PropertyName = "end")] public int End { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskInformation.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskInformation.cs index e4dfb8179a61..f7305a2814ea 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskInformation.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskInformation.cs @@ -8,6 +8,10 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +22,10 @@ public partial class TaskInformation /// /// Initializes a new instance of the TaskInformation class. /// - public TaskInformation() { } + public TaskInformation() + { + CustomInit(); + } /// /// Initializes a new instance of the TaskInformation class. @@ -34,37 +41,43 @@ public TaskInformation() { } /// task. public TaskInformation(TaskState taskState, string taskUrl = default(string), string jobId = default(string), string taskId = default(string), int? subtaskId = default(int?), TaskExecutionInformation executionInfo = default(TaskExecutionInformation)) { - this.TaskUrl = taskUrl; - this.JobId = jobId; - this.TaskId = taskId; - this.SubtaskId = subtaskId; - this.TaskState = taskState; - this.ExecutionInfo = executionInfo; + TaskUrl = taskUrl; + JobId = jobId; + TaskId = taskId; + SubtaskId = subtaskId; + TaskState = taskState; + ExecutionInfo = executionInfo; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the URL of the task. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "taskUrl")] + [JsonProperty(PropertyName = "taskUrl")] public string TaskUrl { get; set; } /// /// Gets or sets the ID of the job to which the task belongs. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "jobId")] + [JsonProperty(PropertyName = "jobId")] public string JobId { get; set; } /// /// Gets or sets the ID of the task. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "taskId")] + [JsonProperty(PropertyName = "taskId")] public string TaskId { get; set; } /// /// Gets or sets the ID of the subtask if the task is a multi-instance /// task. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "subtaskId")] + [JsonProperty(PropertyName = "subtaskId")] public int? SubtaskId { get; set; } /// @@ -74,26 +87,26 @@ public TaskInformation() { } /// Possible values include: 'active', 'preparing', 'running', /// 'completed' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "taskState")] + [JsonProperty(PropertyName = "taskState")] public TaskState TaskState { get; set; } /// /// Gets or sets information about the execution of the task. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "executionInfo")] + [JsonProperty(PropertyName = "executionInfo")] public TaskExecutionInformation ExecutionInfo { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (this.ExecutionInfo != null) + if (ExecutionInfo != null) { - this.ExecutionInfo.Validate(); + ExecutionInfo.Validate(); } } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskListHeaders.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskListHeaders.cs index 7aea9b1a6a13..978475f9b829 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskListHeaders.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskListHeaders.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class TaskListHeaders /// /// Initializes a new instance of the TaskListHeaders class. /// - public TaskListHeaders() { } + public TaskListHeaders() + { + CustomInit(); + } /// /// Initializes a new instance of the TaskListHeaders class. @@ -42,18 +51,24 @@ public TaskListHeaders() { } /// modified. public TaskListHeaders(System.Guid? clientRequestId = default(System.Guid?), System.Guid? requestId = default(System.Guid?), string eTag = default(string), System.DateTime? lastModified = default(System.DateTime?)) { - this.ClientRequestId = clientRequestId; - this.RequestId = requestId; - this.ETag = eTag; - this.LastModified = lastModified; + ClientRequestId = clientRequestId; + RequestId = requestId; + ETag = eTag; + LastModified = lastModified; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the client-request-id provided by the client during /// the request. This will be returned only if the /// return-client-request-id parameter was set to true. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "client-request-id")] + [JsonProperty(PropertyName = "client-request-id")] public System.Guid? ClientRequestId { get; set; } /// @@ -65,7 +80,7 @@ public TaskListHeaders() { } /// request was made, the Batch account against which the request was /// made, and the region that account resides in. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "request-id")] + [JsonProperty(PropertyName = "request-id")] public System.Guid? RequestId { get; set; } /// @@ -75,14 +90,14 @@ public TaskListHeaders() { } /// the If-Modified-Since, If-Unmodified-Since, If-Match or /// If-None-Match headers. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "ETag")] + [JsonProperty(PropertyName = "ETag")] public string ETag { get; set; } /// /// Gets or sets the time at which the resource was last modified. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "Last-Modified")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "Last-Modified")] public System.DateTime? LastModified { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskListNextOptions.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskListNextOptions.cs index fd54bae3aac8..eae836e6b8a5 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskListNextOptions.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskListNextOptions.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class TaskListNextOptions /// /// Initializes a new instance of the TaskListNextOptions class. /// - public TaskListNextOptions() { } + public TaskListNextOptions() + { + CustomInit(); + } /// /// Initializes a new instance of the TaskListNextOptions class. @@ -33,24 +42,30 @@ public TaskListNextOptions() { } /// it explicitly if you are calling the REST API directly. public TaskListNextOptions(System.Guid? clientRequestId = default(System.Guid?), bool? returnClientRequestId = default(bool?), System.DateTime? ocpDate = default(System.DateTime?)) { - this.ClientRequestId = clientRequestId; - this.ReturnClientRequestId = returnClientRequestId; - this.OcpDate = ocpDate; + ClientRequestId = clientRequestId; + ReturnClientRequestId = returnClientRequestId; + OcpDate = ocpDate; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the caller-generated request identity, in the form of /// a GUID with no decoration such as curly braces, e.g. /// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public System.Guid? ClientRequestId { get; set; } /// /// Gets or sets whether the server should return the client-request-id /// in the response. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public bool? ReturnClientRequestId { get; set; } /// @@ -58,8 +73,8 @@ public TaskListNextOptions() { } /// typically set this to the current system clock time; set it /// explicitly if you are calling the REST API directly. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? OcpDate { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskListOptions.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskListOptions.cs index 4d2ec22a047f..21fed56b7d0f 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskListOptions.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskListOptions.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class TaskListOptions /// /// Initializes a new instance of the TaskListOptions class. /// - public TaskListOptions() { } + public TaskListOptions() + { + CustomInit(); + } /// /// Initializes a new instance of the TaskListOptions class. @@ -41,46 +50,52 @@ public TaskListOptions() { } /// it explicitly if you are calling the REST API directly. public TaskListOptions(string filter = default(string), string select = default(string), string expand = default(string), int? maxResults = default(int?), int? timeout = default(int?), System.Guid? clientRequestId = default(System.Guid?), bool? returnClientRequestId = default(bool?), System.DateTime? ocpDate = default(System.DateTime?)) { - this.Filter = filter; - this.Select = select; - this.Expand = expand; - this.MaxResults = maxResults; - this.Timeout = timeout; - this.ClientRequestId = clientRequestId; - this.ReturnClientRequestId = returnClientRequestId; - this.OcpDate = ocpDate; + Filter = filter; + Select = select; + Expand = expand; + MaxResults = maxResults; + Timeout = timeout; + ClientRequestId = clientRequestId; + ReturnClientRequestId = returnClientRequestId; + OcpDate = ocpDate; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets an OData $filter clause. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public string Filter { get; set; } /// /// Gets or sets an OData $select clause. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public string Select { get; set; } /// /// Gets or sets an OData $expand clause. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public string Expand { get; set; } /// /// Gets or sets the maximum number of items to return in the response. /// A maximum of 1000 tasks can be returned. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public int? MaxResults { get; set; } /// /// Gets or sets the maximum time that the server can spend processing /// the request, in seconds. The default is 30 seconds. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public int? Timeout { get; set; } /// @@ -88,14 +103,14 @@ public TaskListOptions() { } /// a GUID with no decoration such as curly braces, e.g. /// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public System.Guid? ClientRequestId { get; set; } /// /// Gets or sets whether the server should return the client-request-id /// in the response. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public bool? ReturnClientRequestId { get; set; } /// @@ -103,8 +118,8 @@ public TaskListOptions() { } /// typically set this to the current system clock time; set it /// explicitly if you are calling the REST API directly. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? OcpDate { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskListSubtasksHeaders.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskListSubtasksHeaders.cs index f85370bffd70..bec6f58546cb 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskListSubtasksHeaders.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskListSubtasksHeaders.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class TaskListSubtasksHeaders /// /// Initializes a new instance of the TaskListSubtasksHeaders class. /// - public TaskListSubtasksHeaders() { } + public TaskListSubtasksHeaders() + { + CustomInit(); + } /// /// Initializes a new instance of the TaskListSubtasksHeaders class. @@ -42,18 +51,24 @@ public TaskListSubtasksHeaders() { } /// modified. public TaskListSubtasksHeaders(System.Guid? clientRequestId = default(System.Guid?), System.Guid? requestId = default(System.Guid?), string eTag = default(string), System.DateTime? lastModified = default(System.DateTime?)) { - this.ClientRequestId = clientRequestId; - this.RequestId = requestId; - this.ETag = eTag; - this.LastModified = lastModified; + ClientRequestId = clientRequestId; + RequestId = requestId; + ETag = eTag; + LastModified = lastModified; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the client-request-id provided by the client during /// the request. This will be returned only if the /// return-client-request-id parameter was set to true. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "client-request-id")] + [JsonProperty(PropertyName = "client-request-id")] public System.Guid? ClientRequestId { get; set; } /// @@ -65,7 +80,7 @@ public TaskListSubtasksHeaders() { } /// request was made, the Batch account against which the request was /// made, and the region that account resides in. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "request-id")] + [JsonProperty(PropertyName = "request-id")] public System.Guid? RequestId { get; set; } /// @@ -75,14 +90,14 @@ public TaskListSubtasksHeaders() { } /// the If-Modified-Since, If-Unmodified-Since, If-Match or /// If-None-Match headers. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "ETag")] + [JsonProperty(PropertyName = "ETag")] public string ETag { get; set; } /// /// Gets or sets the time at which the resource was last modified. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "Last-Modified")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "Last-Modified")] public System.DateTime? LastModified { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskListSubtasksOptions.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskListSubtasksOptions.cs index 198f0a2700ec..be90f1e14162 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskListSubtasksOptions.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskListSubtasksOptions.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class TaskListSubtasksOptions /// /// Initializes a new instance of the TaskListSubtasksOptions class. /// - public TaskListSubtasksOptions() { } + public TaskListSubtasksOptions() + { + CustomInit(); + } /// /// Initializes a new instance of the TaskListSubtasksOptions class. @@ -37,24 +46,30 @@ public TaskListSubtasksOptions() { } /// it explicitly if you are calling the REST API directly. public TaskListSubtasksOptions(string select = default(string), int? timeout = default(int?), System.Guid? clientRequestId = default(System.Guid?), bool? returnClientRequestId = default(bool?), System.DateTime? ocpDate = default(System.DateTime?)) { - this.Select = select; - this.Timeout = timeout; - this.ClientRequestId = clientRequestId; - this.ReturnClientRequestId = returnClientRequestId; - this.OcpDate = ocpDate; + Select = select; + Timeout = timeout; + ClientRequestId = clientRequestId; + ReturnClientRequestId = returnClientRequestId; + OcpDate = ocpDate; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets an OData $select clause. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public string Select { get; set; } /// /// Gets or sets the maximum time that the server can spend processing /// the request, in seconds. The default is 30 seconds. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public int? Timeout { get; set; } /// @@ -62,14 +77,14 @@ public TaskListSubtasksOptions() { } /// a GUID with no decoration such as curly braces, e.g. /// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public System.Guid? ClientRequestId { get; set; } /// /// Gets or sets whether the server should return the client-request-id /// in the response. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public bool? ReturnClientRequestId { get; set; } /// @@ -77,8 +92,8 @@ public TaskListSubtasksOptions() { } /// typically set this to the current system clock time; set it /// explicitly if you are calling the REST API directly. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? OcpDate { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskReactivateHeaders.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskReactivateHeaders.cs index 52bb01c389bb..e654f0c138c5 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskReactivateHeaders.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskReactivateHeaders.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class TaskReactivateHeaders /// /// Initializes a new instance of the TaskReactivateHeaders class. /// - public TaskReactivateHeaders() { } + public TaskReactivateHeaders() + { + CustomInit(); + } /// /// Initializes a new instance of the TaskReactivateHeaders class. @@ -44,19 +53,25 @@ public TaskReactivateHeaders() { } /// the request applied. public TaskReactivateHeaders(System.Guid? clientRequestId = default(System.Guid?), System.Guid? requestId = default(System.Guid?), string eTag = default(string), System.DateTime? lastModified = default(System.DateTime?), string dataServiceId = default(string)) { - this.ClientRequestId = clientRequestId; - this.RequestId = requestId; - this.ETag = eTag; - this.LastModified = lastModified; - this.DataServiceId = dataServiceId; + ClientRequestId = clientRequestId; + RequestId = requestId; + ETag = eTag; + LastModified = lastModified; + DataServiceId = dataServiceId; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the client-request-id provided by the client during /// the request. This will be returned only if the /// return-client-request-id parameter was set to true. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "client-request-id")] + [JsonProperty(PropertyName = "client-request-id")] public System.Guid? ClientRequestId { get; set; } /// @@ -68,7 +83,7 @@ public TaskReactivateHeaders() { } /// request was made, the Batch account against which the request was /// made, and the region that account resides in. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "request-id")] + [JsonProperty(PropertyName = "request-id")] public System.Guid? RequestId { get; set; } /// @@ -78,21 +93,21 @@ public TaskReactivateHeaders() { } /// the If-Modified-Since, If-Unmodified-Since, If-Match or /// If-None-Match headers. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "ETag")] + [JsonProperty(PropertyName = "ETag")] public string ETag { get; set; } /// /// Gets or sets the time at which the resource was last modified. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "Last-Modified")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "Last-Modified")] public System.DateTime? LastModified { get; set; } /// /// Gets or sets the OData ID of the resource to which the request /// applied. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "DataServiceId")] + [JsonProperty(PropertyName = "DataServiceId")] public string DataServiceId { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskReactivateOptions.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskReactivateOptions.cs index 92ca4b9b2d52..68ab90b9cdee 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskReactivateOptions.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskReactivateOptions.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class TaskReactivateOptions /// /// Initializes a new instance of the TaskReactivateOptions class. /// - public TaskReactivateOptions() { } + public TaskReactivateOptions() + { + CustomInit(); + } /// /// Initializes a new instance of the TaskReactivateOptions class. @@ -52,21 +61,27 @@ public TaskReactivateOptions() { } /// modified since the specified time. public TaskReactivateOptions(int? timeout = default(int?), System.Guid? clientRequestId = default(System.Guid?), bool? returnClientRequestId = default(bool?), System.DateTime? ocpDate = default(System.DateTime?), string ifMatch = default(string), string ifNoneMatch = default(string), System.DateTime? ifModifiedSince = default(System.DateTime?), System.DateTime? ifUnmodifiedSince = default(System.DateTime?)) { - this.Timeout = timeout; - this.ClientRequestId = clientRequestId; - this.ReturnClientRequestId = returnClientRequestId; - this.OcpDate = ocpDate; - this.IfMatch = ifMatch; - this.IfNoneMatch = ifNoneMatch; - this.IfModifiedSince = ifModifiedSince; - this.IfUnmodifiedSince = ifUnmodifiedSince; + Timeout = timeout; + ClientRequestId = clientRequestId; + ReturnClientRequestId = returnClientRequestId; + OcpDate = ocpDate; + IfMatch = ifMatch; + IfNoneMatch = ifNoneMatch; + IfModifiedSince = ifModifiedSince; + IfUnmodifiedSince = ifUnmodifiedSince; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the maximum time that the server can spend processing /// the request, in seconds. The default is 30 seconds. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public int? Timeout { get; set; } /// @@ -74,14 +89,14 @@ public TaskReactivateOptions() { } /// a GUID with no decoration such as curly braces, e.g. /// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public System.Guid? ClientRequestId { get; set; } /// /// Gets or sets whether the server should return the client-request-id /// in the response. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public bool? ReturnClientRequestId { get; set; } /// @@ -89,8 +104,8 @@ public TaskReactivateOptions() { } /// typically set this to the current system clock time; set it /// explicitly if you are calling the REST API directly. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? OcpDate { get; set; } /// @@ -99,7 +114,7 @@ public TaskReactivateOptions() { } /// if the resource's current ETag on the service exactly matches the /// value specified by the client. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public string IfMatch { get; set; } /// @@ -108,7 +123,7 @@ public TaskReactivateOptions() { } /// if the resource's current ETag on the service does not match the /// value specified by the client. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public string IfNoneMatch { get; set; } /// @@ -117,8 +132,8 @@ public TaskReactivateOptions() { } /// if the resource on the service has been modified since the /// specified time. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? IfModifiedSince { get; set; } /// @@ -127,8 +142,8 @@ public TaskReactivateOptions() { } /// if the resource on the service has not been modified since the /// specified time. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? IfUnmodifiedSince { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskSchedulingPolicy.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskSchedulingPolicy.cs index d94f659d9aec..11dfb38f7871 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskSchedulingPolicy.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskSchedulingPolicy.cs @@ -8,6 +8,10 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; using System.Linq; /// @@ -18,31 +22,53 @@ public partial class TaskSchedulingPolicy /// /// Initializes a new instance of the TaskSchedulingPolicy class. /// - public TaskSchedulingPolicy() { } + public TaskSchedulingPolicy() + { + CustomInit(); + } /// /// Initializes a new instance of the TaskSchedulingPolicy class. /// - /// How tasks should be distributed across - /// compute nodes. + /// How tasks are distributed across compute + /// nodes in a pool. Values are: + /// + /// pack - As many tasks as possible (maxTasksPerNode) should be + /// assigned to each node in the pool before any tasks are assigned to + /// the next node in the pool. + /// spread - Tasks should be assigned evenly across all nodes in the + /// pool. public TaskSchedulingPolicy(ComputeNodeFillType nodeFillType) { - this.NodeFillType = nodeFillType; + NodeFillType = nodeFillType; + CustomInit(); } /// - /// Gets or sets how tasks should be distributed across compute nodes. + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets how tasks are distributed across compute nodes in a + /// pool. Values are: + /// + /// pack - As many tasks as possible (maxTasksPerNode) should be + /// assigned to each node in the pool before any tasks are assigned to + /// the next node in the pool. + /// spread - Tasks should be assigned evenly across all nodes in the + /// pool. /// /// /// Possible values include: 'spread', 'pack' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "nodeFillType")] + [JsonProperty(PropertyName = "nodeFillType")] public ComputeNodeFillType NodeFillType { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskState.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskState.cs index c43acc0e8f05..4d2e5932005f 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskState.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskState.cs @@ -8,20 +8,64 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; /// /// Defines values for TaskState. /// - [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + [JsonConverter(typeof(StringEnumConverter))] public enum TaskState { - [System.Runtime.Serialization.EnumMember(Value = "active")] + [EnumMember(Value = "active")] Active, - [System.Runtime.Serialization.EnumMember(Value = "preparing")] + [EnumMember(Value = "preparing")] Preparing, - [System.Runtime.Serialization.EnumMember(Value = "running")] + [EnumMember(Value = "running")] Running, - [System.Runtime.Serialization.EnumMember(Value = "completed")] + [EnumMember(Value = "completed")] Completed } + internal static class TaskStateEnumExtension + { + internal static string ToSerializedValue(this TaskState? value) => + value == null ? null : ((TaskState)value).ToSerializedValue(); + + internal static string ToSerializedValue(this TaskState value) + { + switch( value ) + { + case TaskState.Active: + return "active"; + case TaskState.Preparing: + return "preparing"; + case TaskState.Running: + return "running"; + case TaskState.Completed: + return "completed"; + } + return null; + } + + internal static TaskState? ParseTaskState(this string value) + { + switch( value ) + { + case "active": + return TaskState.Active; + case "preparing": + return TaskState.Preparing; + case "running": + return TaskState.Running; + case "completed": + return TaskState.Completed; + } + return null; + } + } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskStatistics.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskStatistics.cs index fb820d45a566..03d7ef28b0b2 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskStatistics.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskStatistics.cs @@ -8,6 +8,11 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +23,10 @@ public partial class TaskStatistics /// /// Initializes a new instance of the TaskStatistics class. /// - public TaskStatistics() { } + public TaskStatistics() + { + CustomInit(); + } /// /// Initializes a new instance of the TaskStatistics class. @@ -52,30 +60,36 @@ public TaskStatistics() { } /// recent task execution.) public TaskStatistics(string url, System.DateTime startTime, System.DateTime lastUpdateTime, System.TimeSpan userCPUTime, System.TimeSpan kernelCPUTime, System.TimeSpan wallClockTime, long readIOps, long writeIOps, double readIOGiB, double writeIOGiB, System.TimeSpan waitTime) { - this.Url = url; - this.StartTime = startTime; - this.LastUpdateTime = lastUpdateTime; - this.UserCPUTime = userCPUTime; - this.KernelCPUTime = kernelCPUTime; - this.WallClockTime = wallClockTime; - this.ReadIOps = readIOps; - this.WriteIOps = writeIOps; - this.ReadIOGiB = readIOGiB; - this.WriteIOGiB = writeIOGiB; - this.WaitTime = waitTime; + Url = url; + StartTime = startTime; + LastUpdateTime = lastUpdateTime; + UserCPUTime = userCPUTime; + KernelCPUTime = kernelCPUTime; + WallClockTime = wallClockTime; + ReadIOps = readIOps; + WriteIOps = writeIOps; + ReadIOGiB = readIOGiB; + WriteIOGiB = writeIOGiB; + WaitTime = waitTime; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the URL of the statistics. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "url")] + [JsonProperty(PropertyName = "url")] public string Url { get; set; } /// /// Gets or sets the start time of the time range covered by the /// statistics. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "startTime")] + [JsonProperty(PropertyName = "startTime")] public System.DateTime StartTime { get; set; } /// @@ -83,21 +97,21 @@ public TaskStatistics(string url, System.DateTime startTime, System.DateTime las /// All statistics are limited to the range between startTime and /// lastUpdateTime. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "lastUpdateTime")] + [JsonProperty(PropertyName = "lastUpdateTime")] public System.DateTime LastUpdateTime { get; set; } /// /// Gets or sets the total user mode CPU time (summed across all cores /// and all compute nodes) consumed by the task. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "userCPUTime")] + [JsonProperty(PropertyName = "userCPUTime")] public System.TimeSpan UserCPUTime { get; set; } /// /// Gets or sets the total kernel mode CPU time (summed across all /// cores and all compute nodes) consumed by the task. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "kernelCPUTime")] + [JsonProperty(PropertyName = "kernelCPUTime")] public System.TimeSpan KernelCPUTime { get; set; } /// @@ -110,33 +124,33 @@ public TaskStatistics(string url, System.DateTime startTime, System.DateTime las /// If the task was retried, this includes the wall clock time of all /// the task retries. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "wallClockTime")] + [JsonProperty(PropertyName = "wallClockTime")] public System.TimeSpan WallClockTime { get; set; } /// /// Gets or sets the total number of disk read operations made by the /// task. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "readIOps")] + [JsonProperty(PropertyName = "readIOps")] public long ReadIOps { get; set; } /// /// Gets or sets the total number of disk write operations made by the /// task. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "writeIOps")] + [JsonProperty(PropertyName = "writeIOps")] public long WriteIOps { get; set; } /// /// Gets or sets the total gibibytes read from disk by the task. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "readIOGiB")] + [JsonProperty(PropertyName = "readIOGiB")] public double ReadIOGiB { get; set; } /// /// Gets or sets the total gibibytes written to disk by the task. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "writeIOGiB")] + [JsonProperty(PropertyName = "writeIOGiB")] public double WriteIOGiB { get; set; } /// @@ -146,20 +160,20 @@ public TaskStatistics(string url, System.DateTime startTime, System.DateTime las /// to failures, the wait time is the time to the most recent task /// execution.) /// - [Newtonsoft.Json.JsonProperty(PropertyName = "waitTime")] + [JsonProperty(PropertyName = "waitTime")] public System.TimeSpan WaitTime { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (this.Url == null) + if (Url == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Url"); + throw new ValidationException(ValidationRules.CannotBeNull, "Url"); } } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskTerminateHeaders.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskTerminateHeaders.cs index d867489f16c5..afba71299420 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskTerminateHeaders.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskTerminateHeaders.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class TaskTerminateHeaders /// /// Initializes a new instance of the TaskTerminateHeaders class. /// - public TaskTerminateHeaders() { } + public TaskTerminateHeaders() + { + CustomInit(); + } /// /// Initializes a new instance of the TaskTerminateHeaders class. @@ -44,19 +53,25 @@ public TaskTerminateHeaders() { } /// the request applied. public TaskTerminateHeaders(System.Guid? clientRequestId = default(System.Guid?), System.Guid? requestId = default(System.Guid?), string eTag = default(string), System.DateTime? lastModified = default(System.DateTime?), string dataServiceId = default(string)) { - this.ClientRequestId = clientRequestId; - this.RequestId = requestId; - this.ETag = eTag; - this.LastModified = lastModified; - this.DataServiceId = dataServiceId; + ClientRequestId = clientRequestId; + RequestId = requestId; + ETag = eTag; + LastModified = lastModified; + DataServiceId = dataServiceId; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the client-request-id provided by the client during /// the request. This will be returned only if the /// return-client-request-id parameter was set to true. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "client-request-id")] + [JsonProperty(PropertyName = "client-request-id")] public System.Guid? ClientRequestId { get; set; } /// @@ -68,7 +83,7 @@ public TaskTerminateHeaders() { } /// request was made, the Batch account against which the request was /// made, and the region that account resides in. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "request-id")] + [JsonProperty(PropertyName = "request-id")] public System.Guid? RequestId { get; set; } /// @@ -78,21 +93,21 @@ public TaskTerminateHeaders() { } /// the If-Modified-Since, If-Unmodified-Since, If-Match or /// If-None-Match headers. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "ETag")] + [JsonProperty(PropertyName = "ETag")] public string ETag { get; set; } /// /// Gets or sets the time at which the resource was last modified. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "Last-Modified")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "Last-Modified")] public System.DateTime? LastModified { get; set; } /// /// Gets or sets the OData ID of the resource to which the request /// applied. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "DataServiceId")] + [JsonProperty(PropertyName = "DataServiceId")] public string DataServiceId { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskTerminateOptions.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskTerminateOptions.cs index fbe01340202f..12ad8bacd0df 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskTerminateOptions.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskTerminateOptions.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class TaskTerminateOptions /// /// Initializes a new instance of the TaskTerminateOptions class. /// - public TaskTerminateOptions() { } + public TaskTerminateOptions() + { + CustomInit(); + } /// /// Initializes a new instance of the TaskTerminateOptions class. @@ -52,21 +61,27 @@ public TaskTerminateOptions() { } /// modified since the specified time. public TaskTerminateOptions(int? timeout = default(int?), System.Guid? clientRequestId = default(System.Guid?), bool? returnClientRequestId = default(bool?), System.DateTime? ocpDate = default(System.DateTime?), string ifMatch = default(string), string ifNoneMatch = default(string), System.DateTime? ifModifiedSince = default(System.DateTime?), System.DateTime? ifUnmodifiedSince = default(System.DateTime?)) { - this.Timeout = timeout; - this.ClientRequestId = clientRequestId; - this.ReturnClientRequestId = returnClientRequestId; - this.OcpDate = ocpDate; - this.IfMatch = ifMatch; - this.IfNoneMatch = ifNoneMatch; - this.IfModifiedSince = ifModifiedSince; - this.IfUnmodifiedSince = ifUnmodifiedSince; + Timeout = timeout; + ClientRequestId = clientRequestId; + ReturnClientRequestId = returnClientRequestId; + OcpDate = ocpDate; + IfMatch = ifMatch; + IfNoneMatch = ifNoneMatch; + IfModifiedSince = ifModifiedSince; + IfUnmodifiedSince = ifUnmodifiedSince; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the maximum time that the server can spend processing /// the request, in seconds. The default is 30 seconds. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public int? Timeout { get; set; } /// @@ -74,14 +89,14 @@ public TaskTerminateOptions() { } /// a GUID with no decoration such as curly braces, e.g. /// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public System.Guid? ClientRequestId { get; set; } /// /// Gets or sets whether the server should return the client-request-id /// in the response. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public bool? ReturnClientRequestId { get; set; } /// @@ -89,8 +104,8 @@ public TaskTerminateOptions() { } /// typically set this to the current system clock time; set it /// explicitly if you are calling the REST API directly. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? OcpDate { get; set; } /// @@ -99,7 +114,7 @@ public TaskTerminateOptions() { } /// if the resource's current ETag on the service exactly matches the /// value specified by the client. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public string IfMatch { get; set; } /// @@ -108,7 +123,7 @@ public TaskTerminateOptions() { } /// if the resource's current ETag on the service does not match the /// value specified by the client. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public string IfNoneMatch { get; set; } /// @@ -117,8 +132,8 @@ public TaskTerminateOptions() { } /// if the resource on the service has been modified since the /// specified time. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? IfModifiedSince { get; set; } /// @@ -127,8 +142,8 @@ public TaskTerminateOptions() { } /// if the resource on the service has not been modified since the /// specified time. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? IfUnmodifiedSince { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskUpdateHeaders.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskUpdateHeaders.cs index f9ff5eaa3906..867a1b0867f5 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskUpdateHeaders.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskUpdateHeaders.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class TaskUpdateHeaders /// /// Initializes a new instance of the TaskUpdateHeaders class. /// - public TaskUpdateHeaders() { } + public TaskUpdateHeaders() + { + CustomInit(); + } /// /// Initializes a new instance of the TaskUpdateHeaders class. @@ -44,19 +53,25 @@ public TaskUpdateHeaders() { } /// the request applied. public TaskUpdateHeaders(System.Guid? clientRequestId = default(System.Guid?), System.Guid? requestId = default(System.Guid?), string eTag = default(string), System.DateTime? lastModified = default(System.DateTime?), string dataServiceId = default(string)) { - this.ClientRequestId = clientRequestId; - this.RequestId = requestId; - this.ETag = eTag; - this.LastModified = lastModified; - this.DataServiceId = dataServiceId; + ClientRequestId = clientRequestId; + RequestId = requestId; + ETag = eTag; + LastModified = lastModified; + DataServiceId = dataServiceId; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the client-request-id provided by the client during /// the request. This will be returned only if the /// return-client-request-id parameter was set to true. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "client-request-id")] + [JsonProperty(PropertyName = "client-request-id")] public System.Guid? ClientRequestId { get; set; } /// @@ -68,7 +83,7 @@ public TaskUpdateHeaders() { } /// request was made, the Batch account against which the request was /// made, and the region that account resides in. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "request-id")] + [JsonProperty(PropertyName = "request-id")] public System.Guid? RequestId { get; set; } /// @@ -78,21 +93,21 @@ public TaskUpdateHeaders() { } /// the If-Modified-Since, If-Unmodified-Since, If-Match or /// If-None-Match headers. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "ETag")] + [JsonProperty(PropertyName = "ETag")] public string ETag { get; set; } /// /// Gets or sets the time at which the resource was last modified. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "Last-Modified")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "Last-Modified")] public System.DateTime? LastModified { get; set; } /// /// Gets or sets the OData ID of the resource to which the request /// applied. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "DataServiceId")] + [JsonProperty(PropertyName = "DataServiceId")] public string DataServiceId { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskUpdateOptions.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskUpdateOptions.cs index ccbebef62379..9a5dd7ede0df 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskUpdateOptions.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskUpdateOptions.cs @@ -8,6 +8,12 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +24,10 @@ public partial class TaskUpdateOptions /// /// Initializes a new instance of the TaskUpdateOptions class. /// - public TaskUpdateOptions() { } + public TaskUpdateOptions() + { + CustomInit(); + } /// /// Initializes a new instance of the TaskUpdateOptions class. @@ -52,21 +61,27 @@ public TaskUpdateOptions() { } /// modified since the specified time. public TaskUpdateOptions(int? timeout = default(int?), System.Guid? clientRequestId = default(System.Guid?), bool? returnClientRequestId = default(bool?), System.DateTime? ocpDate = default(System.DateTime?), string ifMatch = default(string), string ifNoneMatch = default(string), System.DateTime? ifModifiedSince = default(System.DateTime?), System.DateTime? ifUnmodifiedSince = default(System.DateTime?)) { - this.Timeout = timeout; - this.ClientRequestId = clientRequestId; - this.ReturnClientRequestId = returnClientRequestId; - this.OcpDate = ocpDate; - this.IfMatch = ifMatch; - this.IfNoneMatch = ifNoneMatch; - this.IfModifiedSince = ifModifiedSince; - this.IfUnmodifiedSince = ifUnmodifiedSince; + Timeout = timeout; + ClientRequestId = clientRequestId; + ReturnClientRequestId = returnClientRequestId; + OcpDate = ocpDate; + IfMatch = ifMatch; + IfNoneMatch = ifNoneMatch; + IfModifiedSince = ifModifiedSince; + IfUnmodifiedSince = ifUnmodifiedSince; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the maximum time that the server can spend processing /// the request, in seconds. The default is 30 seconds. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public int? Timeout { get; set; } /// @@ -74,14 +89,14 @@ public TaskUpdateOptions() { } /// a GUID with no decoration such as curly braces, e.g. /// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public System.Guid? ClientRequestId { get; set; } /// /// Gets or sets whether the server should return the client-request-id /// in the response. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public bool? ReturnClientRequestId { get; set; } /// @@ -89,8 +104,8 @@ public TaskUpdateOptions() { } /// typically set this to the current system clock time; set it /// explicitly if you are calling the REST API directly. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? OcpDate { get; set; } /// @@ -99,7 +114,7 @@ public TaskUpdateOptions() { } /// if the resource's current ETag on the service exactly matches the /// value specified by the client. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public string IfMatch { get; set; } /// @@ -108,7 +123,7 @@ public TaskUpdateOptions() { } /// if the resource's current ETag on the service does not match the /// value specified by the client. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonProperty(PropertyName = "")] public string IfNoneMatch { get; set; } /// @@ -117,8 +132,8 @@ public TaskUpdateOptions() { } /// if the resource on the service has been modified since the /// specified time. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? IfModifiedSince { get; set; } /// @@ -127,8 +142,8 @@ public TaskUpdateOptions() { } /// if the resource on the service has not been modified since the /// specified time. /// - [Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))] - [Newtonsoft.Json.JsonProperty(PropertyName = "")] + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "")] public System.DateTime? IfUnmodifiedSince { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskUpdateParameter.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskUpdateParameter.cs index 4c95589dfe63..3a7f1f365e25 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskUpdateParameter.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/TaskUpdateParameter.cs @@ -8,6 +8,10 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +22,10 @@ public partial class TaskUpdateParameter /// /// Initializes a new instance of the TaskUpdateParameter class. /// - public TaskUpdateParameter() { } + public TaskUpdateParameter() + { + CustomInit(); + } /// /// Initializes a new instance of the TaskUpdateParameter class. @@ -27,16 +34,24 @@ public TaskUpdateParameter() { } /// task. public TaskUpdateParameter(TaskConstraints constraints = default(TaskConstraints)) { - this.Constraints = constraints; + Constraints = constraints; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets constraints that apply to this task. /// /// - /// If omitted, the task is given the default constraints. + /// If omitted, the task is given the default constraints. For + /// multi-instance tasks, updating the retention time applies only to + /// the primary task and not subtasks. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "constraints")] + [JsonProperty(PropertyName = "constraints")] public TaskConstraints Constraints { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/UsageStatistics.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/UsageStatistics.cs index a5786d95efd1..4f31e2bdb467 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/UsageStatistics.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/UsageStatistics.cs @@ -8,6 +8,10 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +22,10 @@ public partial class UsageStatistics /// /// Initializes a new instance of the UsageStatistics class. /// - public UsageStatistics() { } + public UsageStatistics() + { + CustomInit(); + } /// /// Initializes a new instance of the UsageStatistics class. @@ -32,16 +39,22 @@ public UsageStatistics() { } /// the dedicated compute node cores being part of the pool. public UsageStatistics(System.DateTime startTime, System.DateTime lastUpdateTime, System.TimeSpan dedicatedCoreTime) { - this.StartTime = startTime; - this.LastUpdateTime = lastUpdateTime; - this.DedicatedCoreTime = dedicatedCoreTime; + StartTime = startTime; + LastUpdateTime = lastUpdateTime; + DedicatedCoreTime = dedicatedCoreTime; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the start time of the time range covered by the /// statistics. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "startTime")] + [JsonProperty(PropertyName = "startTime")] public System.DateTime StartTime { get; set; } /// @@ -49,20 +62,20 @@ public UsageStatistics(System.DateTime startTime, System.DateTime lastUpdateTime /// All statistics are limited to the range between startTime and /// lastUpdateTime. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "lastUpdateTime")] + [JsonProperty(PropertyName = "lastUpdateTime")] public System.DateTime LastUpdateTime { get; set; } /// /// Gets or sets the aggregated wall-clock time of the dedicated /// compute node cores being part of the pool. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "dedicatedCoreTime")] + [JsonProperty(PropertyName = "dedicatedCoreTime")] public System.TimeSpan DedicatedCoreTime { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/UserAccount.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/UserAccount.cs index ed142391c3e1..f449f210c636 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/UserAccount.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/UserAccount.cs @@ -8,6 +8,11 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Newtonsoft.Json; using System.Linq; /// @@ -19,7 +24,10 @@ public partial class UserAccount /// /// Initializes a new instance of the UserAccount class. /// - public UserAccount() { } + public UserAccount() + { + CustomInit(); + } /// /// Initializes a new instance of the UserAccount class. @@ -32,22 +40,28 @@ public UserAccount() { } /// configuration for the user account. public UserAccount(string name, string password, ElevationLevel? elevationLevel = default(ElevationLevel?), LinuxUserConfiguration linuxUserConfiguration = default(LinuxUserConfiguration)) { - this.Name = name; - this.Password = password; - this.ElevationLevel = elevationLevel; - this.LinuxUserConfiguration = linuxUserConfiguration; + Name = name; + Password = password; + ElevationLevel = elevationLevel; + LinuxUserConfiguration = linuxUserConfiguration; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the name of the user account. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// /// Gets or sets the password for the user account. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "password")] + [JsonProperty(PropertyName = "password")] public string Password { get; set; } /// @@ -59,7 +73,7 @@ public UserAccount() { } /// operates with full Administrator permissions. The default value is /// nonAdmin. Possible values include: 'nonAdmin', 'admin' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "elevationLevel")] + [JsonProperty(PropertyName = "elevationLevel")] public ElevationLevel? ElevationLevel { get; set; } /// @@ -70,24 +84,24 @@ public UserAccount() { } /// This property is ignored if specified on a Windows pool. If not /// specified, the user is created with the default options. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "linuxUserConfiguration")] + [JsonProperty(PropertyName = "linuxUserConfiguration")] public LinuxUserConfiguration LinuxUserConfiguration { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (this.Name == null) + if (Name == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Name"); + throw new ValidationException(ValidationRules.CannotBeNull, "Name"); } - if (this.Password == null) + if (Password == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Password"); + throw new ValidationException(ValidationRules.CannotBeNull, "Password"); } } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/UserIdentity.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/UserIdentity.cs index ceb616d5a15f..346618fb0b7d 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/UserIdentity.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/UserIdentity.cs @@ -8,6 +8,10 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; using System.Linq; /// @@ -21,7 +25,10 @@ public partial class UserIdentity /// /// Initializes a new instance of the UserIdentity class. /// - public UserIdentity() { } + public UserIdentity() + { + CustomInit(); + } /// /// Initializes a new instance of the UserIdentity class. @@ -32,10 +39,16 @@ public UserIdentity() { } /// run. public UserIdentity(string userName = default(string), AutoUserSpecification autoUser = default(AutoUserSpecification)) { - this.UserName = userName; - this.AutoUser = autoUser; + UserName = userName; + AutoUser = autoUser; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the name of the user identity under which the task is /// run. @@ -44,7 +57,7 @@ public UserIdentity() { } /// The userName and autoUser properties are mutually exclusive; you /// must specify one but not both. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "username")] + [JsonProperty(PropertyName = "username")] public string UserName { get; set; } /// @@ -54,7 +67,7 @@ public UserIdentity() { } /// The userName and autoUser properties are mutually exclusive; you /// must specify one but not both. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "autoUser")] + [JsonProperty(PropertyName = "autoUser")] public AutoUserSpecification AutoUser { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/VirtualMachineConfiguration.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/VirtualMachineConfiguration.cs index 7e1f328d37f0..bbbe0fdd297b 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/VirtualMachineConfiguration.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/VirtualMachineConfiguration.cs @@ -8,6 +8,11 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Microsoft.Rest; + using Newtonsoft.Json; using System.Linq; /// @@ -20,7 +25,10 @@ public partial class VirtualMachineConfiguration /// Initializes a new instance of the VirtualMachineConfiguration /// class. /// - public VirtualMachineConfiguration() { } + public VirtualMachineConfiguration() + { + CustomInit(); + } /// /// Initializes a new instance of the VirtualMachineConfiguration @@ -36,12 +44,18 @@ public VirtualMachineConfiguration() { } /// settings on the virtual machine. public VirtualMachineConfiguration(string nodeAgentSKUId, ImageReference imageReference = default(ImageReference), OSDisk osDisk = default(OSDisk), WindowsConfiguration windowsConfiguration = default(WindowsConfiguration)) { - this.ImageReference = imageReference; - this.OsDisk = osDisk; - this.NodeAgentSKUId = nodeAgentSKUId; - this.WindowsConfiguration = windowsConfiguration; + ImageReference = imageReference; + OsDisk = osDisk; + NodeAgentSKUId = nodeAgentSKUId; + WindowsConfiguration = windowsConfiguration; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets a reference to the Azure Virtual Machines Marketplace /// image to use. @@ -50,7 +64,7 @@ public VirtualMachineConfiguration() { } /// This property and osDisk are mutually exclusive and one of the /// properties must be specified. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "imageReference")] + [JsonProperty(PropertyName = "imageReference")] public ImageReference ImageReference { get; set; } /// @@ -62,7 +76,7 @@ public VirtualMachineConfiguration() { } /// 'UserSubscription'. This property and imageReference are mutually /// exclusive and one of the properties must be specified. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "osDisk")] + [JsonProperty(PropertyName = "osDisk")] public OSDisk OsDisk { get; set; } /// @@ -79,7 +93,7 @@ public VirtualMachineConfiguration() { } /// their list of verified image references, see the 'List supported /// node agent SKUs' operation. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "nodeAgentSKUId")] + [JsonProperty(PropertyName = "nodeAgentSKUId")] public string NodeAgentSKUId { get; set; } /// @@ -90,28 +104,28 @@ public VirtualMachineConfiguration() { } /// This property must not be specified if the imageReference or osDisk /// property specifies a Linux OS image. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "windowsConfiguration")] + [JsonProperty(PropertyName = "windowsConfiguration")] public WindowsConfiguration WindowsConfiguration { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (this.NodeAgentSKUId == null) + if (NodeAgentSKUId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "NodeAgentSKUId"); + throw new ValidationException(ValidationRules.CannotBeNull, "NodeAgentSKUId"); } - if (this.ImageReference != null) + if (ImageReference != null) { - this.ImageReference.Validate(); + ImageReference.Validate(); } - if (this.OsDisk != null) + if (OsDisk != null) { - this.OsDisk.Validate(); + OsDisk.Validate(); } } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/WindowsConfiguration.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/WindowsConfiguration.cs index bf5ac18f8f35..847a40013260 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/WindowsConfiguration.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/WindowsConfiguration.cs @@ -8,6 +8,10 @@ namespace Microsoft.Azure.Batch.Protocol.Models { + using Microsoft.Azure; + using Microsoft.Azure.Batch; + using Microsoft.Azure.Batch.Protocol; + using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +22,10 @@ public partial class WindowsConfiguration /// /// Initializes a new instance of the WindowsConfiguration class. /// - public WindowsConfiguration() { } + public WindowsConfiguration() + { + CustomInit(); + } /// /// Initializes a new instance of the WindowsConfiguration class. @@ -27,9 +34,15 @@ public WindowsConfiguration() { } /// enabled on the virtual machine. public WindowsConfiguration(bool? enableAutomaticUpdates = default(bool?)) { - this.EnableAutomaticUpdates = enableAutomaticUpdates; + EnableAutomaticUpdates = enableAutomaticUpdates; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets whether automatic updates are enabled on the virtual /// machine. @@ -37,7 +50,7 @@ public WindowsConfiguration() { } /// /// If omitted, the default value is true. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "enableAutomaticUpdates")] + [JsonProperty(PropertyName = "enableAutomaticUpdates")] public bool? EnableAutomaticUpdates { get; set; } } diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/PoolOperations.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/PoolOperations.cs index a71a603ff8b4..3b39846b3738 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/PoolOperations.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/PoolOperations.cs @@ -8,15 +8,23 @@ namespace Microsoft.Azure.Batch.Protocol { - 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; + using System.Threading; + using System.Threading.Tasks; /// /// PoolOperations operations. /// - internal partial class PoolOperations : Microsoft.Rest.IServiceOperations, IPoolOperations + internal partial class PoolOperations : IServiceOperations, IPoolOperations { /// /// Initializes a new instance of the PoolOperations class. @@ -33,7 +41,7 @@ internal PoolOperations(BatchServiceClient client) { throw new System.ArgumentNullException("client"); } - this.Client = client; + Client = client; } /// @@ -48,7 +56,10 @@ internal PoolOperations(BatchServiceClient client) /// /// If you do not specify a $filter clause including a poolId, the response /// includes all pools that existed in the account in the time range of the - /// returned aggregation intervals. + /// returned aggregation intervals. If you do not specify a $filter clause + /// including a startTime or endTime these filters default to the start and end + /// times of the last aggregation interval currently available; that is, only + /// the last aggregation interval is returned. /// /// /// Additional parameters for the operation @@ -62,10 +73,10 @@ internal PoolOperations(BatchServiceClient client) /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -74,11 +85,11 @@ internal PoolOperations(BatchServiceClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task,PoolListUsageMetricsHeaders>> ListUsageMetricsWithHttpMessagesAsync(PoolListUsageMetricsOptions poolListUsageMetricsOptions = default(PoolListUsageMetricsOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task,PoolListUsageMetricsHeaders>> ListUsageMetricsWithHttpMessagesAsync(PoolListUsageMetricsOptions poolListUsageMetricsOptions = default(PoolListUsageMetricsOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - 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"); } System.DateTime? startTime = default(System.DateTime?); if (poolListUsageMetricsOptions != null) @@ -121,12 +132,12 @@ internal PoolOperations(BatchServiceClient client) ocpDate = poolListUsageMetricsOptions.OcpDate; } // 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("startTime", startTime); tracingParameters.Add("endTime", endTime); tracingParameters.Add("filter", filter); @@ -136,23 +147,23 @@ internal PoolOperations(BatchServiceClient client) tracingParameters.Add("returnClientRequestId", returnClientRequestId); tracingParameters.Add("ocpDate", ocpDate); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListUsageMetrics", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListUsageMetrics", 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("/") ? "" : "/")), "poolusagemetrics").ToString(); - 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 (startTime != null) { - _queryParameters.Add(string.Format("starttime={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(startTime, this.Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("starttime={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(startTime, Client.SerializationSettings).Trim('"')))); } if (endTime != null) { - _queryParameters.Add(string.Format("endtime={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(endTime, this.Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("endtime={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(endTime, Client.SerializationSettings).Trim('"')))); } if (filter != null) { @@ -160,33 +171,33 @@ internal PoolOperations(BatchServiceClient client) } if (maxResults != null) { - _queryParameters.Add(string.Format("maxresults={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(maxResults, this.Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("maxresults={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(maxResults, Client.SerializationSettings).Trim('"')))); } if (timeout != null) { - _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(timeout, this.Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(timeout, Client.SerializationSettings).Trim('"')))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _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("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 (clientRequestId != null) { @@ -194,7 +205,7 @@ internal PoolOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(clientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("client-request-id", SafeJsonConvert.SerializeObject(clientRequestId, Client.SerializationSettings).Trim('"')); } if (returnClientRequestId != null) { @@ -202,7 +213,7 @@ internal PoolOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("return-client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(returnClientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", SafeJsonConvert.SerializeObject(returnClientRequestId, Client.SerializationSettings).Trim('"')); } if (ocpDate != null) { @@ -210,7 +221,7 @@ internal PoolOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("ocp-date"); } - _httpRequest.Headers.TryAddWithoutValidation("ocp-date", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ocpDate, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("ocp-date", SafeJsonConvert.SerializeObject(ocpDate, new DateTimeRfc1123JsonConverter()).Trim('"')); } @@ -229,23 +240,23 @@ internal PoolOperations(BatchServiceClient 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) @@ -254,21 +265,21 @@ internal PoolOperations(BatchServiceClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - BatchError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + BatchError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -278,7 +289,7 @@ internal PoolOperations(BatchServiceClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse,PoolListUsageMetricsHeaders>(); + var _result = new AzureOperationResponse,PoolListUsageMetricsHeaders>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("request-id")) @@ -291,34 +302,34 @@ internal PoolOperations(BatchServiceClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = 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); } } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(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 headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -343,10 +354,10 @@ internal PoolOperations(BatchServiceClient client) /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -355,11 +366,11 @@ internal PoolOperations(BatchServiceClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> GetAllLifetimeStatisticsWithHttpMessagesAsync(PoolGetAllLifetimeStatisticsOptions poolGetAllLifetimeStatisticsOptions = default(PoolGetAllLifetimeStatisticsOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> GetAllLifetimeStatisticsWithHttpMessagesAsync(PoolGetAllLifetimeStatisticsOptions poolGetAllLifetimeStatisticsOptions = default(PoolGetAllLifetimeStatisticsOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - 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"); } int? timeout = default(int?); if (poolGetAllLifetimeStatisticsOptions != null) @@ -382,52 +393,52 @@ internal PoolOperations(BatchServiceClient client) ocpDate = poolGetAllLifetimeStatisticsOptions.OcpDate; } // 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("timeout", timeout); tracingParameters.Add("clientRequestId", clientRequestId); tracingParameters.Add("returnClientRequestId", returnClientRequestId); tracingParameters.Add("ocpDate", ocpDate); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetAllLifetimeStatistics", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetAllLifetimeStatistics", 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("/") ? "" : "/")), "lifetimepoolstats").ToString(); - 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 (timeout != null) { - _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(timeout, this.Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(timeout, Client.SerializationSettings).Trim('"')))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _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("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 (clientRequestId != null) { @@ -435,7 +446,7 @@ internal PoolOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(clientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("client-request-id", SafeJsonConvert.SerializeObject(clientRequestId, Client.SerializationSettings).Trim('"')); } if (returnClientRequestId != null) { @@ -443,7 +454,7 @@ internal PoolOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("return-client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(returnClientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", SafeJsonConvert.SerializeObject(returnClientRequestId, Client.SerializationSettings).Trim('"')); } if (ocpDate != null) { @@ -451,7 +462,7 @@ internal PoolOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("ocp-date"); } - _httpRequest.Headers.TryAddWithoutValidation("ocp-date", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ocpDate, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("ocp-date", SafeJsonConvert.SerializeObject(ocpDate, new DateTimeRfc1123JsonConverter()).Trim('"')); } @@ -470,23 +481,23 @@ internal PoolOperations(BatchServiceClient 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) @@ -495,21 +506,21 @@ internal PoolOperations(BatchServiceClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - BatchError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + BatchError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -519,7 +530,7 @@ internal PoolOperations(BatchServiceClient 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("request-id")) @@ -532,34 +543,34 @@ internal PoolOperations(BatchServiceClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = 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); } } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(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 headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -587,7 +598,7 @@ internal PoolOperations(BatchServiceClient client) /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -596,19 +607,19 @@ internal PoolOperations(BatchServiceClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> AddWithHttpMessagesAsync(PoolAddParameter pool, PoolAddOptions poolAddOptions = default(PoolAddOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> AddWithHttpMessagesAsync(PoolAddParameter pool, PoolAddOptions poolAddOptions = default(PoolAddOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (pool == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "pool"); + throw new ValidationException(ValidationRules.CannotBeNull, "pool"); } if (pool != null) { pool.Validate(); } - 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"); } int? timeout = default(int?); if (poolAddOptions != null) @@ -631,53 +642,53 @@ internal PoolOperations(BatchServiceClient client) ocpDate = poolAddOptions.OcpDate; } // 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("pool", pool); tracingParameters.Add("timeout", timeout); tracingParameters.Add("clientRequestId", clientRequestId); tracingParameters.Add("returnClientRequestId", returnClientRequestId); tracingParameters.Add("ocpDate", ocpDate); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Add", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Add", 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("/") ? "" : "/")), "pools").ToString(); - 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 (timeout != null) { - _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(timeout, this.Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(timeout, Client.SerializationSettings).Trim('"')))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _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("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 (clientRequestId != null) { @@ -685,7 +696,7 @@ internal PoolOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(clientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("client-request-id", SafeJsonConvert.SerializeObject(clientRequestId, Client.SerializationSettings).Trim('"')); } if (returnClientRequestId != null) { @@ -693,7 +704,7 @@ internal PoolOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("return-client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(returnClientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", SafeJsonConvert.SerializeObject(returnClientRequestId, Client.SerializationSettings).Trim('"')); } if (ocpDate != null) { @@ -701,7 +712,7 @@ internal PoolOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("ocp-date"); } - _httpRequest.Headers.TryAddWithoutValidation("ocp-date", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ocpDate, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("ocp-date", SafeJsonConvert.SerializeObject(ocpDate, new DateTimeRfc1123JsonConverter()).Trim('"')); } @@ -721,28 +732,28 @@ internal PoolOperations(BatchServiceClient client) string _requestContent = null; if(pool != null) { - _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(pool, this.Client.SerializationSettings); - _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = SafeJsonConvert.SerializeObject(pool, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; odata=minimalmetadata; 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 != 201) @@ -751,21 +762,21 @@ internal PoolOperations(BatchServiceClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - BatchError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + BatchError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -775,7 +786,7 @@ internal PoolOperations(BatchServiceClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); + var _result = new AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("request-id")) @@ -784,20 +795,20 @@ internal PoolOperations(BatchServiceClient client) } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(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 headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -817,10 +828,10 @@ internal PoolOperations(BatchServiceClient client) /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -829,11 +840,11 @@ internal PoolOperations(BatchServiceClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task,PoolListHeaders>> ListWithHttpMessagesAsync(PoolListOptions poolListOptions = default(PoolListOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task,PoolListHeaders>> ListWithHttpMessagesAsync(PoolListOptions poolListOptions = default(PoolListOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - 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"); } string filter = default(string); if (poolListOptions != null) @@ -876,12 +887,12 @@ internal PoolOperations(BatchServiceClient client) ocpDate = poolListOptions.OcpDate; } // 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("filter", filter); tracingParameters.Add("select", select); tracingParameters.Add("expand", expand); @@ -891,15 +902,15 @@ internal PoolOperations(BatchServiceClient client) tracingParameters.Add("returnClientRequestId", returnClientRequestId); tracingParameters.Add("ocpDate", ocpDate); 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("/") ? "" : "/")), "pools").ToString(); - 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 (filter != null) { @@ -915,33 +926,33 @@ internal PoolOperations(BatchServiceClient client) } if (maxResults != null) { - _queryParameters.Add(string.Format("maxresults={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(maxResults, this.Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("maxresults={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(maxResults, Client.SerializationSettings).Trim('"')))); } if (timeout != null) { - _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(timeout, this.Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(timeout, Client.SerializationSettings).Trim('"')))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _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("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 (clientRequestId != null) { @@ -949,7 +960,7 @@ internal PoolOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(clientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("client-request-id", SafeJsonConvert.SerializeObject(clientRequestId, Client.SerializationSettings).Trim('"')); } if (returnClientRequestId != null) { @@ -957,7 +968,7 @@ internal PoolOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("return-client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(returnClientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", SafeJsonConvert.SerializeObject(returnClientRequestId, Client.SerializationSettings).Trim('"')); } if (ocpDate != null) { @@ -965,7 +976,7 @@ internal PoolOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("ocp-date"); } - _httpRequest.Headers.TryAddWithoutValidation("ocp-date", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ocpDate, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("ocp-date", SafeJsonConvert.SerializeObject(ocpDate, new DateTimeRfc1123JsonConverter()).Trim('"')); } @@ -984,23 +995,23 @@ internal PoolOperations(BatchServiceClient 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) @@ -1009,21 +1020,21 @@ internal PoolOperations(BatchServiceClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - BatchError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + BatchError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1033,7 +1044,7 @@ internal PoolOperations(BatchServiceClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse,PoolListHeaders>(); + var _result = new AzureOperationResponse,PoolListHeaders>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("request-id")) @@ -1046,34 +1057,34 @@ internal PoolOperations(BatchServiceClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = 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); } } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(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 headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -1110,7 +1121,7 @@ internal PoolOperations(BatchServiceClient client) /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1119,15 +1130,15 @@ internal PoolOperations(BatchServiceClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> DeleteWithHttpMessagesAsync(string poolId, PoolDeleteOptions poolDeleteOptions = default(PoolDeleteOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> DeleteWithHttpMessagesAsync(string poolId, PoolDeleteOptions poolDeleteOptions = default(PoolDeleteOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (poolId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "poolId"); + throw new ValidationException(ValidationRules.CannotBeNull, "poolId"); } - 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"); } int? timeout = default(int?); if (poolDeleteOptions != null) @@ -1170,12 +1181,12 @@ internal PoolOperations(BatchServiceClient client) ifUnmodifiedSince = poolDeleteOptions.IfUnmodifiedSince; } // 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("poolId", poolId); tracingParameters.Add("timeout", timeout); tracingParameters.Add("clientRequestId", clientRequestId); @@ -1186,42 +1197,42 @@ internal PoolOperations(BatchServiceClient client) tracingParameters.Add("ifModifiedSince", ifModifiedSince); tracingParameters.Add("ifUnmodifiedSince", ifUnmodifiedSince); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Delete", 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("/") ? "" : "/")), "pools/{poolId}").ToString(); _url = _url.Replace("{poolId}", System.Uri.EscapeDataString(poolId)); - 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 (timeout != null) { - _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(timeout, this.Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(timeout, Client.SerializationSettings).Trim('"')))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _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("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 (clientRequestId != null) { @@ -1229,7 +1240,7 @@ internal PoolOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(clientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("client-request-id", SafeJsonConvert.SerializeObject(clientRequestId, Client.SerializationSettings).Trim('"')); } if (returnClientRequestId != null) { @@ -1237,7 +1248,7 @@ internal PoolOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("return-client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(returnClientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", SafeJsonConvert.SerializeObject(returnClientRequestId, Client.SerializationSettings).Trim('"')); } if (ocpDate != null) { @@ -1245,7 +1256,7 @@ internal PoolOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("ocp-date"); } - _httpRequest.Headers.TryAddWithoutValidation("ocp-date", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ocpDate, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("ocp-date", SafeJsonConvert.SerializeObject(ocpDate, new DateTimeRfc1123JsonConverter()).Trim('"')); } if (ifMatch != null) { @@ -1269,7 +1280,7 @@ internal PoolOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("If-Modified-Since"); } - _httpRequest.Headers.TryAddWithoutValidation("If-Modified-Since", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ifModifiedSince, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("If-Modified-Since", SafeJsonConvert.SerializeObject(ifModifiedSince, new DateTimeRfc1123JsonConverter()).Trim('"')); } if (ifUnmodifiedSince != null) { @@ -1277,7 +1288,7 @@ internal PoolOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("If-Unmodified-Since"); } - _httpRequest.Headers.TryAddWithoutValidation("If-Unmodified-Since", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ifUnmodifiedSince, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("If-Unmodified-Since", SafeJsonConvert.SerializeObject(ifUnmodifiedSince, new DateTimeRfc1123JsonConverter()).Trim('"')); } @@ -1296,23 +1307,23 @@ internal PoolOperations(BatchServiceClient 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 != 202) @@ -1321,21 +1332,21 @@ internal PoolOperations(BatchServiceClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - BatchError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + BatchError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1345,7 +1356,7 @@ internal PoolOperations(BatchServiceClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); + var _result = new AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("request-id")) @@ -1354,20 +1365,20 @@ internal PoolOperations(BatchServiceClient client) } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(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 headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -1390,7 +1401,7 @@ internal PoolOperations(BatchServiceClient client) /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1399,15 +1410,15 @@ internal PoolOperations(BatchServiceClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> ExistsWithHttpMessagesAsync(string poolId, PoolExistsOptions poolExistsOptions = default(PoolExistsOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> ExistsWithHttpMessagesAsync(string poolId, PoolExistsOptions poolExistsOptions = default(PoolExistsOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (poolId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "poolId"); + throw new ValidationException(ValidationRules.CannotBeNull, "poolId"); } - 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"); } int? timeout = default(int?); if (poolExistsOptions != null) @@ -1450,12 +1461,12 @@ internal PoolOperations(BatchServiceClient client) ifUnmodifiedSince = poolExistsOptions.IfUnmodifiedSince; } // 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("poolId", poolId); tracingParameters.Add("timeout", timeout); tracingParameters.Add("clientRequestId", clientRequestId); @@ -1466,42 +1477,42 @@ internal PoolOperations(BatchServiceClient client) tracingParameters.Add("ifModifiedSince", ifModifiedSince); tracingParameters.Add("ifUnmodifiedSince", ifUnmodifiedSince); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Exists", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Exists", 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("/") ? "" : "/")), "pools/{poolId}").ToString(); _url = _url.Replace("{poolId}", System.Uri.EscapeDataString(poolId)); - 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 (timeout != null) { - _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(timeout, this.Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(timeout, Client.SerializationSettings).Trim('"')))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("HEAD"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("HEAD"); _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("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 (clientRequestId != null) { @@ -1509,7 +1520,7 @@ internal PoolOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(clientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("client-request-id", SafeJsonConvert.SerializeObject(clientRequestId, Client.SerializationSettings).Trim('"')); } if (returnClientRequestId != null) { @@ -1517,7 +1528,7 @@ internal PoolOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("return-client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(returnClientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", SafeJsonConvert.SerializeObject(returnClientRequestId, Client.SerializationSettings).Trim('"')); } if (ocpDate != null) { @@ -1525,7 +1536,7 @@ internal PoolOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("ocp-date"); } - _httpRequest.Headers.TryAddWithoutValidation("ocp-date", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ocpDate, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("ocp-date", SafeJsonConvert.SerializeObject(ocpDate, new DateTimeRfc1123JsonConverter()).Trim('"')); } if (ifMatch != null) { @@ -1549,7 +1560,7 @@ internal PoolOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("If-Modified-Since"); } - _httpRequest.Headers.TryAddWithoutValidation("If-Modified-Since", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ifModifiedSince, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("If-Modified-Since", SafeJsonConvert.SerializeObject(ifModifiedSince, new DateTimeRfc1123JsonConverter()).Trim('"')); } if (ifUnmodifiedSince != null) { @@ -1557,7 +1568,7 @@ internal PoolOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("If-Unmodified-Since"); } - _httpRequest.Headers.TryAddWithoutValidation("If-Unmodified-Since", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ifUnmodifiedSince, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("If-Unmodified-Since", SafeJsonConvert.SerializeObject(ifUnmodifiedSince, new DateTimeRfc1123JsonConverter()).Trim('"')); } @@ -1576,23 +1587,23 @@ internal PoolOperations(BatchServiceClient 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, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, 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 != 404) @@ -1601,21 +1612,21 @@ internal PoolOperations(BatchServiceClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - BatchError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + BatchError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1625,30 +1636,30 @@ internal PoolOperations(BatchServiceClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; - _result.Body = (_statusCode == System.Net.HttpStatusCode.OK); + _result.Body = _statusCode == System.Net.HttpStatusCode.OK; if (_httpResponse.Headers.Contains("request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("request-id").FirstOrDefault(); } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(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 headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -1671,10 +1682,10 @@ internal PoolOperations(BatchServiceClient client) /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1683,15 +1694,15 @@ internal PoolOperations(BatchServiceClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string poolId, PoolGetOptions poolGetOptions = default(PoolGetOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string poolId, PoolGetOptions poolGetOptions = default(PoolGetOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (poolId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "poolId"); + throw new ValidationException(ValidationRules.CannotBeNull, "poolId"); } - 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"); } string select = default(string); if (poolGetOptions != null) @@ -1744,12 +1755,12 @@ internal PoolOperations(BatchServiceClient client) ifUnmodifiedSince = poolGetOptions.IfUnmodifiedSince; } // 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("poolId", poolId); tracingParameters.Add("select", select); tracingParameters.Add("expand", expand); @@ -1762,16 +1773,16 @@ internal PoolOperations(BatchServiceClient client) tracingParameters.Add("ifModifiedSince", ifModifiedSince); tracingParameters.Add("ifUnmodifiedSince", ifUnmodifiedSince); 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("/") ? "" : "/")), "pools/{poolId}").ToString(); _url = _url.Replace("{poolId}", System.Uri.EscapeDataString(poolId)); - 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 (select != null) { @@ -1783,29 +1794,29 @@ internal PoolOperations(BatchServiceClient client) } if (timeout != null) { - _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(timeout, this.Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(timeout, Client.SerializationSettings).Trim('"')))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _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("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 (clientRequestId != null) { @@ -1813,7 +1824,7 @@ internal PoolOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(clientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("client-request-id", SafeJsonConvert.SerializeObject(clientRequestId, Client.SerializationSettings).Trim('"')); } if (returnClientRequestId != null) { @@ -1821,7 +1832,7 @@ internal PoolOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("return-client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(returnClientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", SafeJsonConvert.SerializeObject(returnClientRequestId, Client.SerializationSettings).Trim('"')); } if (ocpDate != null) { @@ -1829,7 +1840,7 @@ internal PoolOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("ocp-date"); } - _httpRequest.Headers.TryAddWithoutValidation("ocp-date", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ocpDate, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("ocp-date", SafeJsonConvert.SerializeObject(ocpDate, new DateTimeRfc1123JsonConverter()).Trim('"')); } if (ifMatch != null) { @@ -1853,7 +1864,7 @@ internal PoolOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("If-Modified-Since"); } - _httpRequest.Headers.TryAddWithoutValidation("If-Modified-Since", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ifModifiedSince, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("If-Modified-Since", SafeJsonConvert.SerializeObject(ifModifiedSince, new DateTimeRfc1123JsonConverter()).Trim('"')); } if (ifUnmodifiedSince != null) { @@ -1861,7 +1872,7 @@ internal PoolOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("If-Unmodified-Since"); } - _httpRequest.Headers.TryAddWithoutValidation("If-Unmodified-Since", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ifUnmodifiedSince, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("If-Unmodified-Since", SafeJsonConvert.SerializeObject(ifUnmodifiedSince, new DateTimeRfc1123JsonConverter()).Trim('"')); } @@ -1880,23 +1891,23 @@ internal PoolOperations(BatchServiceClient 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) @@ -1905,21 +1916,21 @@ internal PoolOperations(BatchServiceClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - BatchError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + BatchError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1929,7 +1940,7 @@ internal PoolOperations(BatchServiceClient 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("request-id")) @@ -1942,34 +1953,34 @@ internal PoolOperations(BatchServiceClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = 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); } } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(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 headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -2001,7 +2012,7 @@ internal PoolOperations(BatchServiceClient client) /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -2010,19 +2021,19 @@ internal PoolOperations(BatchServiceClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> PatchWithHttpMessagesAsync(string poolId, PoolPatchParameter poolPatchParameter, PoolPatchOptions poolPatchOptions = default(PoolPatchOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> PatchWithHttpMessagesAsync(string poolId, PoolPatchParameter poolPatchParameter, PoolPatchOptions poolPatchOptions = default(PoolPatchOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (poolId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "poolId"); + throw new ValidationException(ValidationRules.CannotBeNull, "poolId"); } if (poolPatchParameter == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "poolPatchParameter"); + throw new ValidationException(ValidationRules.CannotBeNull, "poolPatchParameter"); } - 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"); } int? timeout = default(int?); if (poolPatchOptions != null) @@ -2065,12 +2076,12 @@ internal PoolOperations(BatchServiceClient client) ifUnmodifiedSince = poolPatchOptions.IfUnmodifiedSince; } // 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("poolId", poolId); tracingParameters.Add("poolPatchParameter", poolPatchParameter); tracingParameters.Add("timeout", timeout); @@ -2082,42 +2093,42 @@ internal PoolOperations(BatchServiceClient client) tracingParameters.Add("ifModifiedSince", ifModifiedSince); tracingParameters.Add("ifUnmodifiedSince", ifUnmodifiedSince); 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("/") ? "" : "/")), "pools/{poolId}").ToString(); _url = _url.Replace("{poolId}", System.Uri.EscapeDataString(poolId)); - 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 (timeout != null) { - _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(timeout, this.Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(timeout, Client.SerializationSettings).Trim('"')))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _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("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 (clientRequestId != null) { @@ -2125,7 +2136,7 @@ internal PoolOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(clientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("client-request-id", SafeJsonConvert.SerializeObject(clientRequestId, Client.SerializationSettings).Trim('"')); } if (returnClientRequestId != null) { @@ -2133,7 +2144,7 @@ internal PoolOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("return-client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(returnClientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", SafeJsonConvert.SerializeObject(returnClientRequestId, Client.SerializationSettings).Trim('"')); } if (ocpDate != null) { @@ -2141,7 +2152,7 @@ internal PoolOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("ocp-date"); } - _httpRequest.Headers.TryAddWithoutValidation("ocp-date", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ocpDate, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("ocp-date", SafeJsonConvert.SerializeObject(ocpDate, new DateTimeRfc1123JsonConverter()).Trim('"')); } if (ifMatch != null) { @@ -2165,7 +2176,7 @@ internal PoolOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("If-Modified-Since"); } - _httpRequest.Headers.TryAddWithoutValidation("If-Modified-Since", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ifModifiedSince, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("If-Modified-Since", SafeJsonConvert.SerializeObject(ifModifiedSince, new DateTimeRfc1123JsonConverter()).Trim('"')); } if (ifUnmodifiedSince != null) { @@ -2173,7 +2184,7 @@ internal PoolOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("If-Unmodified-Since"); } - _httpRequest.Headers.TryAddWithoutValidation("If-Unmodified-Since", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ifUnmodifiedSince, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("If-Unmodified-Since", SafeJsonConvert.SerializeObject(ifUnmodifiedSince, new DateTimeRfc1123JsonConverter()).Trim('"')); } @@ -2193,28 +2204,28 @@ internal PoolOperations(BatchServiceClient client) string _requestContent = null; if(poolPatchParameter != null) { - _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(poolPatchParameter, this.Client.SerializationSettings); - _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = SafeJsonConvert.SerializeObject(poolPatchParameter, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; odata=minimalmetadata; 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) @@ -2223,21 +2234,21 @@ internal PoolOperations(BatchServiceClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - BatchError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + BatchError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2247,7 +2258,7 @@ internal PoolOperations(BatchServiceClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); + var _result = new AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("request-id")) @@ -2256,20 +2267,20 @@ internal PoolOperations(BatchServiceClient client) } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(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 headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -2292,7 +2303,7 @@ internal PoolOperations(BatchServiceClient client) /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -2301,15 +2312,15 @@ internal PoolOperations(BatchServiceClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> DisableAutoScaleWithHttpMessagesAsync(string poolId, PoolDisableAutoScaleOptions poolDisableAutoScaleOptions = default(PoolDisableAutoScaleOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> DisableAutoScaleWithHttpMessagesAsync(string poolId, PoolDisableAutoScaleOptions poolDisableAutoScaleOptions = default(PoolDisableAutoScaleOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (poolId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "poolId"); + throw new ValidationException(ValidationRules.CannotBeNull, "poolId"); } - 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"); } int? timeout = default(int?); if (poolDisableAutoScaleOptions != null) @@ -2332,54 +2343,54 @@ internal PoolOperations(BatchServiceClient client) ocpDate = poolDisableAutoScaleOptions.OcpDate; } // 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("poolId", poolId); tracingParameters.Add("timeout", timeout); tracingParameters.Add("clientRequestId", clientRequestId); tracingParameters.Add("returnClientRequestId", returnClientRequestId); tracingParameters.Add("ocpDate", ocpDate); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "DisableAutoScale", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DisableAutoScale", 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("/") ? "" : "/")), "pools/{poolId}/disableautoscale").ToString(); _url = _url.Replace("{poolId}", System.Uri.EscapeDataString(poolId)); - 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 (timeout != null) { - _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(timeout, this.Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(timeout, Client.SerializationSettings).Trim('"')))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _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("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 (clientRequestId != null) { @@ -2387,7 +2398,7 @@ internal PoolOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(clientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("client-request-id", SafeJsonConvert.SerializeObject(clientRequestId, Client.SerializationSettings).Trim('"')); } if (returnClientRequestId != null) { @@ -2395,7 +2406,7 @@ internal PoolOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("return-client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(returnClientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", SafeJsonConvert.SerializeObject(returnClientRequestId, Client.SerializationSettings).Trim('"')); } if (ocpDate != null) { @@ -2403,7 +2414,7 @@ internal PoolOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("ocp-date"); } - _httpRequest.Headers.TryAddWithoutValidation("ocp-date", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ocpDate, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("ocp-date", SafeJsonConvert.SerializeObject(ocpDate, new DateTimeRfc1123JsonConverter()).Trim('"')); } @@ -2422,23 +2433,23 @@ internal PoolOperations(BatchServiceClient 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) @@ -2447,21 +2458,21 @@ internal PoolOperations(BatchServiceClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - BatchError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + BatchError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2471,7 +2482,7 @@ internal PoolOperations(BatchServiceClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); + var _result = new AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("request-id")) @@ -2480,20 +2491,20 @@ internal PoolOperations(BatchServiceClient client) } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(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 headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -2527,7 +2538,7 @@ internal PoolOperations(BatchServiceClient client) /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -2536,19 +2547,19 @@ internal PoolOperations(BatchServiceClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> EnableAutoScaleWithHttpMessagesAsync(string poolId, PoolEnableAutoScaleParameter poolEnableAutoScaleParameter, PoolEnableAutoScaleOptions poolEnableAutoScaleOptions = default(PoolEnableAutoScaleOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> EnableAutoScaleWithHttpMessagesAsync(string poolId, PoolEnableAutoScaleParameter poolEnableAutoScaleParameter, PoolEnableAutoScaleOptions poolEnableAutoScaleOptions = default(PoolEnableAutoScaleOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (poolId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "poolId"); + throw new ValidationException(ValidationRules.CannotBeNull, "poolId"); } if (poolEnableAutoScaleParameter == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "poolEnableAutoScaleParameter"); + throw new ValidationException(ValidationRules.CannotBeNull, "poolEnableAutoScaleParameter"); } - 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"); } int? timeout = default(int?); if (poolEnableAutoScaleOptions != null) @@ -2591,12 +2602,12 @@ internal PoolOperations(BatchServiceClient client) ifUnmodifiedSince = poolEnableAutoScaleOptions.IfUnmodifiedSince; } // 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("poolId", poolId); tracingParameters.Add("poolEnableAutoScaleParameter", poolEnableAutoScaleParameter); tracingParameters.Add("timeout", timeout); @@ -2608,42 +2619,42 @@ internal PoolOperations(BatchServiceClient client) tracingParameters.Add("ifModifiedSince", ifModifiedSince); tracingParameters.Add("ifUnmodifiedSince", ifUnmodifiedSince); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "EnableAutoScale", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "EnableAutoScale", 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("/") ? "" : "/")), "pools/{poolId}/enableautoscale").ToString(); _url = _url.Replace("{poolId}", System.Uri.EscapeDataString(poolId)); - 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 (timeout != null) { - _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(timeout, this.Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(timeout, Client.SerializationSettings).Trim('"')))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _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("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 (clientRequestId != null) { @@ -2651,7 +2662,7 @@ internal PoolOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(clientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("client-request-id", SafeJsonConvert.SerializeObject(clientRequestId, Client.SerializationSettings).Trim('"')); } if (returnClientRequestId != null) { @@ -2659,7 +2670,7 @@ internal PoolOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("return-client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(returnClientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", SafeJsonConvert.SerializeObject(returnClientRequestId, Client.SerializationSettings).Trim('"')); } if (ocpDate != null) { @@ -2667,7 +2678,7 @@ internal PoolOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("ocp-date"); } - _httpRequest.Headers.TryAddWithoutValidation("ocp-date", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ocpDate, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("ocp-date", SafeJsonConvert.SerializeObject(ocpDate, new DateTimeRfc1123JsonConverter()).Trim('"')); } if (ifMatch != null) { @@ -2691,7 +2702,7 @@ internal PoolOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("If-Modified-Since"); } - _httpRequest.Headers.TryAddWithoutValidation("If-Modified-Since", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ifModifiedSince, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("If-Modified-Since", SafeJsonConvert.SerializeObject(ifModifiedSince, new DateTimeRfc1123JsonConverter()).Trim('"')); } if (ifUnmodifiedSince != null) { @@ -2699,7 +2710,7 @@ internal PoolOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("If-Unmodified-Since"); } - _httpRequest.Headers.TryAddWithoutValidation("If-Unmodified-Since", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ifUnmodifiedSince, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("If-Unmodified-Since", SafeJsonConvert.SerializeObject(ifUnmodifiedSince, new DateTimeRfc1123JsonConverter()).Trim('"')); } @@ -2719,28 +2730,28 @@ internal PoolOperations(BatchServiceClient client) string _requestContent = null; if(poolEnableAutoScaleParameter != null) { - _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(poolEnableAutoScaleParameter, this.Client.SerializationSettings); - _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = SafeJsonConvert.SerializeObject(poolEnableAutoScaleParameter, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; odata=minimalmetadata; 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) @@ -2749,21 +2760,21 @@ internal PoolOperations(BatchServiceClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - BatchError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + BatchError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2773,7 +2784,7 @@ internal PoolOperations(BatchServiceClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); + var _result = new AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("request-id")) @@ -2782,20 +2793,20 @@ internal PoolOperations(BatchServiceClient client) } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(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 headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -2805,7 +2816,8 @@ internal PoolOperations(BatchServiceClient client) /// /// /// This API is primarily for validating an autoscale formula, as it simply - /// returns the result without applying the formula to the pool. + /// returns the result without applying the formula to the pool. The pool must + /// have auto scaling enabled in order to evaluate a formula. /// /// /// The ID of the pool on which to evaluate the automatic scaling formula. @@ -2830,10 +2842,10 @@ internal PoolOperations(BatchServiceClient client) /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -2842,19 +2854,19 @@ internal PoolOperations(BatchServiceClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> EvaluateAutoScaleWithHttpMessagesAsync(string poolId, string autoScaleFormula, PoolEvaluateAutoScaleOptions poolEvaluateAutoScaleOptions = default(PoolEvaluateAutoScaleOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> EvaluateAutoScaleWithHttpMessagesAsync(string poolId, string autoScaleFormula, PoolEvaluateAutoScaleOptions poolEvaluateAutoScaleOptions = default(PoolEvaluateAutoScaleOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (poolId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "poolId"); + throw new ValidationException(ValidationRules.CannotBeNull, "poolId"); } - 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 (autoScaleFormula == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "autoScaleFormula"); + throw new ValidationException(ValidationRules.CannotBeNull, "autoScaleFormula"); } int? timeout = default(int?); if (poolEvaluateAutoScaleOptions != null) @@ -2882,12 +2894,12 @@ internal PoolOperations(BatchServiceClient client) poolEvaluateAutoScaleParameter.AutoScaleFormula = autoScaleFormula; } // 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("poolId", poolId); tracingParameters.Add("timeout", timeout); tracingParameters.Add("clientRequestId", clientRequestId); @@ -2895,42 +2907,42 @@ internal PoolOperations(BatchServiceClient client) tracingParameters.Add("ocpDate", ocpDate); tracingParameters.Add("poolEvaluateAutoScaleParameter", poolEvaluateAutoScaleParameter); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "EvaluateAutoScale", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "EvaluateAutoScale", 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("/") ? "" : "/")), "pools/{poolId}/evaluateautoscale").ToString(); _url = _url.Replace("{poolId}", System.Uri.EscapeDataString(poolId)); - 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 (timeout != null) { - _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(timeout, this.Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(timeout, Client.SerializationSettings).Trim('"')))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _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("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 (clientRequestId != null) { @@ -2938,7 +2950,7 @@ internal PoolOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(clientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("client-request-id", SafeJsonConvert.SerializeObject(clientRequestId, Client.SerializationSettings).Trim('"')); } if (returnClientRequestId != null) { @@ -2946,7 +2958,7 @@ internal PoolOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("return-client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(returnClientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", SafeJsonConvert.SerializeObject(returnClientRequestId, Client.SerializationSettings).Trim('"')); } if (ocpDate != null) { @@ -2954,7 +2966,7 @@ internal PoolOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("ocp-date"); } - _httpRequest.Headers.TryAddWithoutValidation("ocp-date", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ocpDate, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("ocp-date", SafeJsonConvert.SerializeObject(ocpDate, new DateTimeRfc1123JsonConverter()).Trim('"')); } @@ -2974,28 +2986,28 @@ internal PoolOperations(BatchServiceClient client) string _requestContent = null; if(poolEvaluateAutoScaleParameter != null) { - _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(poolEvaluateAutoScaleParameter, this.Client.SerializationSettings); - _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = SafeJsonConvert.SerializeObject(poolEvaluateAutoScaleParameter, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; odata=minimalmetadata; 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) @@ -3004,21 +3016,21 @@ internal PoolOperations(BatchServiceClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - BatchError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + BatchError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -3028,7 +3040,7 @@ internal PoolOperations(BatchServiceClient 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("request-id")) @@ -3041,34 +3053,34 @@ internal PoolOperations(BatchServiceClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = 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); } } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(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 headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -3103,7 +3115,7 @@ internal PoolOperations(BatchServiceClient client) /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -3112,19 +3124,19 @@ internal PoolOperations(BatchServiceClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> ResizeWithHttpMessagesAsync(string poolId, PoolResizeParameter poolResizeParameter, PoolResizeOptions poolResizeOptions = default(PoolResizeOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> ResizeWithHttpMessagesAsync(string poolId, PoolResizeParameter poolResizeParameter, PoolResizeOptions poolResizeOptions = default(PoolResizeOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (poolId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "poolId"); + throw new ValidationException(ValidationRules.CannotBeNull, "poolId"); } if (poolResizeParameter == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "poolResizeParameter"); + throw new ValidationException(ValidationRules.CannotBeNull, "poolResizeParameter"); } - 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"); } int? timeout = default(int?); if (poolResizeOptions != null) @@ -3167,12 +3179,12 @@ internal PoolOperations(BatchServiceClient client) ifUnmodifiedSince = poolResizeOptions.IfUnmodifiedSince; } // 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("poolId", poolId); tracingParameters.Add("poolResizeParameter", poolResizeParameter); tracingParameters.Add("timeout", timeout); @@ -3184,42 +3196,42 @@ internal PoolOperations(BatchServiceClient client) tracingParameters.Add("ifModifiedSince", ifModifiedSince); tracingParameters.Add("ifUnmodifiedSince", ifUnmodifiedSince); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Resize", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Resize", 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("/") ? "" : "/")), "pools/{poolId}/resize").ToString(); _url = _url.Replace("{poolId}", System.Uri.EscapeDataString(poolId)); - 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 (timeout != null) { - _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(timeout, this.Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(timeout, Client.SerializationSettings).Trim('"')))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _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("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 (clientRequestId != null) { @@ -3227,7 +3239,7 @@ internal PoolOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(clientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("client-request-id", SafeJsonConvert.SerializeObject(clientRequestId, Client.SerializationSettings).Trim('"')); } if (returnClientRequestId != null) { @@ -3235,7 +3247,7 @@ internal PoolOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("return-client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(returnClientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", SafeJsonConvert.SerializeObject(returnClientRequestId, Client.SerializationSettings).Trim('"')); } if (ocpDate != null) { @@ -3243,7 +3255,7 @@ internal PoolOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("ocp-date"); } - _httpRequest.Headers.TryAddWithoutValidation("ocp-date", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ocpDate, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("ocp-date", SafeJsonConvert.SerializeObject(ocpDate, new DateTimeRfc1123JsonConverter()).Trim('"')); } if (ifMatch != null) { @@ -3267,7 +3279,7 @@ internal PoolOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("If-Modified-Since"); } - _httpRequest.Headers.TryAddWithoutValidation("If-Modified-Since", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ifModifiedSince, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("If-Modified-Since", SafeJsonConvert.SerializeObject(ifModifiedSince, new DateTimeRfc1123JsonConverter()).Trim('"')); } if (ifUnmodifiedSince != null) { @@ -3275,7 +3287,7 @@ internal PoolOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("If-Unmodified-Since"); } - _httpRequest.Headers.TryAddWithoutValidation("If-Unmodified-Since", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ifUnmodifiedSince, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("If-Unmodified-Since", SafeJsonConvert.SerializeObject(ifUnmodifiedSince, new DateTimeRfc1123JsonConverter()).Trim('"')); } @@ -3295,28 +3307,28 @@ internal PoolOperations(BatchServiceClient client) string _requestContent = null; if(poolResizeParameter != null) { - _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(poolResizeParameter, this.Client.SerializationSettings); - _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = SafeJsonConvert.SerializeObject(poolResizeParameter, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; odata=minimalmetadata; 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 != 202) @@ -3325,21 +3337,21 @@ internal PoolOperations(BatchServiceClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - BatchError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + BatchError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -3349,7 +3361,7 @@ internal PoolOperations(BatchServiceClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); + var _result = new AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("request-id")) @@ -3358,20 +3370,20 @@ internal PoolOperations(BatchServiceClient client) } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(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 headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -3382,9 +3394,12 @@ internal PoolOperations(BatchServiceClient client) /// /// This does not restore the pool to its previous state before the resize /// operation: it only stops any further changes being made, and the pool - /// maintains its current state. A resize operation need not be an explicit - /// resize pool request; this API can also be used to halt the initial sizing - /// of the pool when it is created. + /// maintains its current state. After stopping, the pool stabilizes at the + /// number of nodes it was at when the stop operation was done. During the stop + /// operation, the pool allocation state changes first to stopping and then to + /// steady. A resize operation need not be an explicit resize pool request; + /// this API can also be used to halt the initial sizing of the pool when it is + /// created. /// /// /// The ID of the pool whose resizing you want to stop. @@ -3401,7 +3416,7 @@ internal PoolOperations(BatchServiceClient client) /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -3410,15 +3425,15 @@ internal PoolOperations(BatchServiceClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> StopResizeWithHttpMessagesAsync(string poolId, PoolStopResizeOptions poolStopResizeOptions = default(PoolStopResizeOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> StopResizeWithHttpMessagesAsync(string poolId, PoolStopResizeOptions poolStopResizeOptions = default(PoolStopResizeOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (poolId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "poolId"); + throw new ValidationException(ValidationRules.CannotBeNull, "poolId"); } - 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"); } int? timeout = default(int?); if (poolStopResizeOptions != null) @@ -3461,12 +3476,12 @@ internal PoolOperations(BatchServiceClient client) ifUnmodifiedSince = poolStopResizeOptions.IfUnmodifiedSince; } // 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("poolId", poolId); tracingParameters.Add("timeout", timeout); tracingParameters.Add("clientRequestId", clientRequestId); @@ -3477,42 +3492,42 @@ internal PoolOperations(BatchServiceClient client) tracingParameters.Add("ifModifiedSince", ifModifiedSince); tracingParameters.Add("ifUnmodifiedSince", ifUnmodifiedSince); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "StopResize", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "StopResize", 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("/") ? "" : "/")), "pools/{poolId}/stopresize").ToString(); _url = _url.Replace("{poolId}", System.Uri.EscapeDataString(poolId)); - 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 (timeout != null) { - _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(timeout, this.Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(timeout, Client.SerializationSettings).Trim('"')))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _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("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 (clientRequestId != null) { @@ -3520,7 +3535,7 @@ internal PoolOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(clientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("client-request-id", SafeJsonConvert.SerializeObject(clientRequestId, Client.SerializationSettings).Trim('"')); } if (returnClientRequestId != null) { @@ -3528,7 +3543,7 @@ internal PoolOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("return-client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(returnClientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", SafeJsonConvert.SerializeObject(returnClientRequestId, Client.SerializationSettings).Trim('"')); } if (ocpDate != null) { @@ -3536,7 +3551,7 @@ internal PoolOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("ocp-date"); } - _httpRequest.Headers.TryAddWithoutValidation("ocp-date", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ocpDate, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("ocp-date", SafeJsonConvert.SerializeObject(ocpDate, new DateTimeRfc1123JsonConverter()).Trim('"')); } if (ifMatch != null) { @@ -3560,7 +3575,7 @@ internal PoolOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("If-Modified-Since"); } - _httpRequest.Headers.TryAddWithoutValidation("If-Modified-Since", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ifModifiedSince, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("If-Modified-Since", SafeJsonConvert.SerializeObject(ifModifiedSince, new DateTimeRfc1123JsonConverter()).Trim('"')); } if (ifUnmodifiedSince != null) { @@ -3568,7 +3583,7 @@ internal PoolOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("If-Unmodified-Since"); } - _httpRequest.Headers.TryAddWithoutValidation("If-Unmodified-Since", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ifUnmodifiedSince, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("If-Unmodified-Since", SafeJsonConvert.SerializeObject(ifUnmodifiedSince, new DateTimeRfc1123JsonConverter()).Trim('"')); } @@ -3587,23 +3602,23 @@ internal PoolOperations(BatchServiceClient 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 != 202) @@ -3612,21 +3627,21 @@ internal PoolOperations(BatchServiceClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - BatchError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + BatchError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -3636,7 +3651,7 @@ internal PoolOperations(BatchServiceClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); + var _result = new AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("request-id")) @@ -3645,20 +3660,20 @@ internal PoolOperations(BatchServiceClient client) } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(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 headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -3690,7 +3705,7 @@ internal PoolOperations(BatchServiceClient client) /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -3699,23 +3714,23 @@ internal PoolOperations(BatchServiceClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> UpdatePropertiesWithHttpMessagesAsync(string poolId, PoolUpdatePropertiesParameter poolUpdatePropertiesParameter, PoolUpdatePropertiesOptions poolUpdatePropertiesOptions = default(PoolUpdatePropertiesOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> UpdatePropertiesWithHttpMessagesAsync(string poolId, PoolUpdatePropertiesParameter poolUpdatePropertiesParameter, PoolUpdatePropertiesOptions poolUpdatePropertiesOptions = default(PoolUpdatePropertiesOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (poolId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "poolId"); + throw new ValidationException(ValidationRules.CannotBeNull, "poolId"); } if (poolUpdatePropertiesParameter == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "poolUpdatePropertiesParameter"); + throw new ValidationException(ValidationRules.CannotBeNull, "poolUpdatePropertiesParameter"); } if (poolUpdatePropertiesParameter != null) { poolUpdatePropertiesParameter.Validate(); } - 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"); } int? timeout = default(int?); if (poolUpdatePropertiesOptions != null) @@ -3738,12 +3753,12 @@ internal PoolOperations(BatchServiceClient client) ocpDate = poolUpdatePropertiesOptions.OcpDate; } // 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("poolId", poolId); tracingParameters.Add("poolUpdatePropertiesParameter", poolUpdatePropertiesParameter); tracingParameters.Add("timeout", timeout); @@ -3751,42 +3766,42 @@ internal PoolOperations(BatchServiceClient client) tracingParameters.Add("returnClientRequestId", returnClientRequestId); tracingParameters.Add("ocpDate", ocpDate); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "UpdateProperties", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateProperties", 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("/") ? "" : "/")), "pools/{poolId}/updateproperties").ToString(); _url = _url.Replace("{poolId}", System.Uri.EscapeDataString(poolId)); - 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 (timeout != null) { - _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(timeout, this.Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(timeout, Client.SerializationSettings).Trim('"')))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _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("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 (clientRequestId != null) { @@ -3794,7 +3809,7 @@ internal PoolOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(clientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("client-request-id", SafeJsonConvert.SerializeObject(clientRequestId, Client.SerializationSettings).Trim('"')); } if (returnClientRequestId != null) { @@ -3802,7 +3817,7 @@ internal PoolOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("return-client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(returnClientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", SafeJsonConvert.SerializeObject(returnClientRequestId, Client.SerializationSettings).Trim('"')); } if (ocpDate != null) { @@ -3810,7 +3825,7 @@ internal PoolOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("ocp-date"); } - _httpRequest.Headers.TryAddWithoutValidation("ocp-date", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ocpDate, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("ocp-date", SafeJsonConvert.SerializeObject(ocpDate, new DateTimeRfc1123JsonConverter()).Trim('"')); } @@ -3830,28 +3845,28 @@ internal PoolOperations(BatchServiceClient client) string _requestContent = null; if(poolUpdatePropertiesParameter != null) { - _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(poolUpdatePropertiesParameter, this.Client.SerializationSettings); - _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = SafeJsonConvert.SerializeObject(poolUpdatePropertiesParameter, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; odata=minimalmetadata; 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 != 204) @@ -3860,21 +3875,21 @@ internal PoolOperations(BatchServiceClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - BatchError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + BatchError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -3884,7 +3899,7 @@ internal PoolOperations(BatchServiceClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); + var _result = new AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("request-id")) @@ -3893,20 +3908,20 @@ internal PoolOperations(BatchServiceClient client) } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(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 headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -3925,7 +3940,12 @@ internal PoolOperations(BatchServiceClient client) /// it does not guarantee to do this (particularly on small pools); therefore, /// the pool may be temporarily unavailable to run tasks. When this operation /// runs, the pool state changes to upgrading. When all compute nodes have - /// finished upgrading, the pool state returns to active. + /// finished upgrading, the pool state returns to active. While the upgrade is + /// in progress, the pool's currentOSVersion reflects the OS version that nodes + /// are upgrading from, and targetOSVersion reflects the OS version that nodes + /// are upgrading to. Once the upgrade is complete, currentOSVersion is updated + /// to reflect the OS version now running on all nodes. This operation can only + /// be invoked on pools created with the cloudServiceConfiguration property. /// /// /// The ID of the pool to upgrade. @@ -3946,7 +3966,7 @@ internal PoolOperations(BatchServiceClient client) /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -3955,19 +3975,19 @@ internal PoolOperations(BatchServiceClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> UpgradeOSWithHttpMessagesAsync(string poolId, string targetOSVersion, PoolUpgradeOSOptions poolUpgradeOSOptions = default(PoolUpgradeOSOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> UpgradeOSWithHttpMessagesAsync(string poolId, string targetOSVersion, PoolUpgradeOSOptions poolUpgradeOSOptions = default(PoolUpgradeOSOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (poolId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "poolId"); + throw new ValidationException(ValidationRules.CannotBeNull, "poolId"); } - 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 (targetOSVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "targetOSVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "targetOSVersion"); } int? timeout = default(int?); if (poolUpgradeOSOptions != null) @@ -4015,12 +4035,12 @@ internal PoolOperations(BatchServiceClient client) poolUpgradeOSParameter.TargetOSVersion = targetOSVersion; } // 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("poolId", poolId); tracingParameters.Add("timeout", timeout); tracingParameters.Add("clientRequestId", clientRequestId); @@ -4032,42 +4052,42 @@ internal PoolOperations(BatchServiceClient client) tracingParameters.Add("ifUnmodifiedSince", ifUnmodifiedSince); tracingParameters.Add("poolUpgradeOSParameter", poolUpgradeOSParameter); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "UpgradeOS", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpgradeOS", 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("/") ? "" : "/")), "pools/{poolId}/upgradeos").ToString(); _url = _url.Replace("{poolId}", System.Uri.EscapeDataString(poolId)); - 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 (timeout != null) { - _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(timeout, this.Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(timeout, Client.SerializationSettings).Trim('"')))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _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("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 (clientRequestId != null) { @@ -4075,7 +4095,7 @@ internal PoolOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(clientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("client-request-id", SafeJsonConvert.SerializeObject(clientRequestId, Client.SerializationSettings).Trim('"')); } if (returnClientRequestId != null) { @@ -4083,7 +4103,7 @@ internal PoolOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("return-client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(returnClientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", SafeJsonConvert.SerializeObject(returnClientRequestId, Client.SerializationSettings).Trim('"')); } if (ocpDate != null) { @@ -4091,7 +4111,7 @@ internal PoolOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("ocp-date"); } - _httpRequest.Headers.TryAddWithoutValidation("ocp-date", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ocpDate, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("ocp-date", SafeJsonConvert.SerializeObject(ocpDate, new DateTimeRfc1123JsonConverter()).Trim('"')); } if (ifMatch != null) { @@ -4115,7 +4135,7 @@ internal PoolOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("If-Modified-Since"); } - _httpRequest.Headers.TryAddWithoutValidation("If-Modified-Since", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ifModifiedSince, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("If-Modified-Since", SafeJsonConvert.SerializeObject(ifModifiedSince, new DateTimeRfc1123JsonConverter()).Trim('"')); } if (ifUnmodifiedSince != null) { @@ -4123,7 +4143,7 @@ internal PoolOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("If-Unmodified-Since"); } - _httpRequest.Headers.TryAddWithoutValidation("If-Unmodified-Since", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ifUnmodifiedSince, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("If-Unmodified-Since", SafeJsonConvert.SerializeObject(ifUnmodifiedSince, new DateTimeRfc1123JsonConverter()).Trim('"')); } @@ -4143,28 +4163,28 @@ internal PoolOperations(BatchServiceClient client) string _requestContent = null; if(poolUpgradeOSParameter != null) { - _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(poolUpgradeOSParameter, this.Client.SerializationSettings); - _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = SafeJsonConvert.SerializeObject(poolUpgradeOSParameter, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; odata=minimalmetadata; 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 != 202) @@ -4173,21 +4193,21 @@ internal PoolOperations(BatchServiceClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - BatchError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + BatchError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -4197,7 +4217,7 @@ internal PoolOperations(BatchServiceClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); + var _result = new AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("request-id")) @@ -4206,20 +4226,20 @@ internal PoolOperations(BatchServiceClient client) } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(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 headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -4250,7 +4270,7 @@ internal PoolOperations(BatchServiceClient client) /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -4259,23 +4279,23 @@ internal PoolOperations(BatchServiceClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> RemoveNodesWithHttpMessagesAsync(string poolId, NodeRemoveParameter nodeRemoveParameter, PoolRemoveNodesOptions poolRemoveNodesOptions = default(PoolRemoveNodesOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> RemoveNodesWithHttpMessagesAsync(string poolId, NodeRemoveParameter nodeRemoveParameter, PoolRemoveNodesOptions poolRemoveNodesOptions = default(PoolRemoveNodesOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (poolId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "poolId"); + throw new ValidationException(ValidationRules.CannotBeNull, "poolId"); } if (nodeRemoveParameter == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nodeRemoveParameter"); + throw new ValidationException(ValidationRules.CannotBeNull, "nodeRemoveParameter"); } if (nodeRemoveParameter != null) { nodeRemoveParameter.Validate(); } - 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"); } int? timeout = default(int?); if (poolRemoveNodesOptions != null) @@ -4318,12 +4338,12 @@ internal PoolOperations(BatchServiceClient client) ifUnmodifiedSince = poolRemoveNodesOptions.IfUnmodifiedSince; } // 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("poolId", poolId); tracingParameters.Add("nodeRemoveParameter", nodeRemoveParameter); tracingParameters.Add("timeout", timeout); @@ -4335,42 +4355,42 @@ internal PoolOperations(BatchServiceClient client) tracingParameters.Add("ifModifiedSince", ifModifiedSince); tracingParameters.Add("ifUnmodifiedSince", ifUnmodifiedSince); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "RemoveNodes", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "RemoveNodes", 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("/") ? "" : "/")), "pools/{poolId}/removenodes").ToString(); _url = _url.Replace("{poolId}", System.Uri.EscapeDataString(poolId)); - 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 (timeout != null) { - _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(timeout, this.Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(timeout, Client.SerializationSettings).Trim('"')))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _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("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 (clientRequestId != null) { @@ -4378,7 +4398,7 @@ internal PoolOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(clientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("client-request-id", SafeJsonConvert.SerializeObject(clientRequestId, Client.SerializationSettings).Trim('"')); } if (returnClientRequestId != null) { @@ -4386,7 +4406,7 @@ internal PoolOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("return-client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(returnClientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", SafeJsonConvert.SerializeObject(returnClientRequestId, Client.SerializationSettings).Trim('"')); } if (ocpDate != null) { @@ -4394,7 +4414,7 @@ internal PoolOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("ocp-date"); } - _httpRequest.Headers.TryAddWithoutValidation("ocp-date", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ocpDate, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("ocp-date", SafeJsonConvert.SerializeObject(ocpDate, new DateTimeRfc1123JsonConverter()).Trim('"')); } if (ifMatch != null) { @@ -4418,7 +4438,7 @@ internal PoolOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("If-Modified-Since"); } - _httpRequest.Headers.TryAddWithoutValidation("If-Modified-Since", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ifModifiedSince, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("If-Modified-Since", SafeJsonConvert.SerializeObject(ifModifiedSince, new DateTimeRfc1123JsonConverter()).Trim('"')); } if (ifUnmodifiedSince != null) { @@ -4426,7 +4446,7 @@ internal PoolOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("If-Unmodified-Since"); } - _httpRequest.Headers.TryAddWithoutValidation("If-Unmodified-Since", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ifUnmodifiedSince, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("If-Unmodified-Since", SafeJsonConvert.SerializeObject(ifUnmodifiedSince, new DateTimeRfc1123JsonConverter()).Trim('"')); } @@ -4446,28 +4466,28 @@ internal PoolOperations(BatchServiceClient client) string _requestContent = null; if(nodeRemoveParameter != null) { - _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(nodeRemoveParameter, this.Client.SerializationSettings); - _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = SafeJsonConvert.SerializeObject(nodeRemoveParameter, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; odata=minimalmetadata; 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 != 202) @@ -4476,21 +4496,21 @@ internal PoolOperations(BatchServiceClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - BatchError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + BatchError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -4500,7 +4520,7 @@ internal PoolOperations(BatchServiceClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); + var _result = new AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("request-id")) @@ -4509,20 +4529,20 @@ internal PoolOperations(BatchServiceClient client) } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(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 headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -4534,7 +4554,10 @@ internal PoolOperations(BatchServiceClient client) /// /// If you do not specify a $filter clause including a poolId, the response /// includes all pools that existed in the account in the time range of the - /// returned aggregation intervals. + /// returned aggregation intervals. If you do not specify a $filter clause + /// including a startTime or endTime these filters default to the start and end + /// times of the last aggregation interval currently available; that is, only + /// the last aggregation interval is returned. /// /// /// The NextLink from the previous successful call to List operation. @@ -4551,10 +4574,10 @@ internal PoolOperations(BatchServiceClient client) /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -4563,11 +4586,11 @@ internal PoolOperations(BatchServiceClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task,PoolListUsageMetricsHeaders>> ListUsageMetricsNextWithHttpMessagesAsync(string nextPageLink, PoolListUsageMetricsNextOptions poolListUsageMetricsNextOptions = default(PoolListUsageMetricsNextOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task,PoolListUsageMetricsHeaders>> ListUsageMetricsNextWithHttpMessagesAsync(string nextPageLink, PoolListUsageMetricsNextOptions poolListUsageMetricsNextOptions = default(PoolListUsageMetricsNextOptions), 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"); } System.Guid? clientRequestId = default(System.Guid?); if (poolListUsageMetricsNextOptions != null) @@ -4585,44 +4608,44 @@ internal PoolOperations(BatchServiceClient client) ocpDate = poolListUsageMetricsNextOptions.OcpDate; } // 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("clientRequestId", clientRequestId); tracingParameters.Add("returnClientRequestId", returnClientRequestId); tracingParameters.Add("ocpDate", ocpDate); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListUsageMetricsNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListUsageMetricsNext", 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 += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _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("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 (clientRequestId != null) { @@ -4630,7 +4653,7 @@ internal PoolOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(clientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("client-request-id", SafeJsonConvert.SerializeObject(clientRequestId, Client.SerializationSettings).Trim('"')); } if (returnClientRequestId != null) { @@ -4638,7 +4661,7 @@ internal PoolOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("return-client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(returnClientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", SafeJsonConvert.SerializeObject(returnClientRequestId, Client.SerializationSettings).Trim('"')); } if (ocpDate != null) { @@ -4646,7 +4669,7 @@ internal PoolOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("ocp-date"); } - _httpRequest.Headers.TryAddWithoutValidation("ocp-date", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ocpDate, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("ocp-date", SafeJsonConvert.SerializeObject(ocpDate, new DateTimeRfc1123JsonConverter()).Trim('"')); } @@ -4665,23 +4688,23 @@ internal PoolOperations(BatchServiceClient 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) @@ -4690,21 +4713,21 @@ internal PoolOperations(BatchServiceClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - BatchError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + BatchError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -4714,7 +4737,7 @@ internal PoolOperations(BatchServiceClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse,PoolListUsageMetricsHeaders>(); + var _result = new AzureOperationResponse,PoolListUsageMetricsHeaders>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("request-id")) @@ -4727,34 +4750,34 @@ internal PoolOperations(BatchServiceClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = 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); } } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(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 headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -4777,10 +4800,10 @@ internal PoolOperations(BatchServiceClient client) /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -4789,11 +4812,11 @@ internal PoolOperations(BatchServiceClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task,PoolListHeaders>> ListNextWithHttpMessagesAsync(string nextPageLink, PoolListNextOptions poolListNextOptions = default(PoolListNextOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task,PoolListHeaders>> ListNextWithHttpMessagesAsync(string nextPageLink, PoolListNextOptions poolListNextOptions = default(PoolListNextOptions), 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"); } System.Guid? clientRequestId = default(System.Guid?); if (poolListNextOptions != null) @@ -4811,44 +4834,44 @@ internal PoolOperations(BatchServiceClient client) ocpDate = poolListNextOptions.OcpDate; } // 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("clientRequestId", clientRequestId); tracingParameters.Add("returnClientRequestId", returnClientRequestId); tracingParameters.Add("ocpDate", ocpDate); 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 += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _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("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 (clientRequestId != null) { @@ -4856,7 +4879,7 @@ internal PoolOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(clientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("client-request-id", SafeJsonConvert.SerializeObject(clientRequestId, Client.SerializationSettings).Trim('"')); } if (returnClientRequestId != null) { @@ -4864,7 +4887,7 @@ internal PoolOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("return-client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(returnClientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", SafeJsonConvert.SerializeObject(returnClientRequestId, Client.SerializationSettings).Trim('"')); } if (ocpDate != null) { @@ -4872,7 +4895,7 @@ internal PoolOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("ocp-date"); } - _httpRequest.Headers.TryAddWithoutValidation("ocp-date", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ocpDate, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("ocp-date", SafeJsonConvert.SerializeObject(ocpDate, new DateTimeRfc1123JsonConverter()).Trim('"')); } @@ -4891,23 +4914,23 @@ internal PoolOperations(BatchServiceClient 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) @@ -4916,21 +4939,21 @@ internal PoolOperations(BatchServiceClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - BatchError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + BatchError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -4940,7 +4963,7 @@ internal PoolOperations(BatchServiceClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse,PoolListHeaders>(); + var _result = new AzureOperationResponse,PoolListHeaders>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("request-id")) @@ -4953,37 +4976,37 @@ internal PoolOperations(BatchServiceClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = 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); } } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(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 headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } } -} +} \ No newline at end of file diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/PoolOperationsExtensions.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/PoolOperationsExtensions.cs index ddc60bc92419..9334963268d3 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/PoolOperationsExtensions.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/PoolOperationsExtensions.cs @@ -8,8 +8,11 @@ namespace Microsoft.Azure.Batch.Protocol { + using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; + using System.Threading; + using System.Threading.Tasks; /// /// Extension methods for PoolOperations. @@ -23,7 +26,10 @@ public static partial class PoolOperationsExtensions /// /// If you do not specify a $filter clause including a poolId, the response /// includes all pools that existed in the account in the time range of the - /// returned aggregation intervals. + /// returned aggregation intervals. If you do not specify a $filter clause + /// including a startTime or endTime these filters default to the start and end + /// times of the last aggregation interval currently available; that is, only + /// the last aggregation interval is returned. /// /// /// The operations group for this extension method. @@ -31,9 +37,9 @@ public static partial class PoolOperationsExtensions /// /// Additional parameters for the operation /// - public static Microsoft.Rest.Azure.IPage ListUsageMetrics(this IPoolOperations operations, PoolListUsageMetricsOptions poolListUsageMetricsOptions = default(PoolListUsageMetricsOptions)) + public static IPage ListUsageMetrics(this IPoolOperations operations, PoolListUsageMetricsOptions poolListUsageMetricsOptions = default(PoolListUsageMetricsOptions)) { - return ((IPoolOperations)operations).ListUsageMetricsAsync(poolListUsageMetricsOptions).GetAwaiter().GetResult(); + return operations.ListUsageMetricsAsync(poolListUsageMetricsOptions).GetAwaiter().GetResult(); } /// @@ -43,7 +49,10 @@ public static partial class PoolOperationsExtensions /// /// If you do not specify a $filter clause including a poolId, the response /// includes all pools that existed in the account in the time range of the - /// returned aggregation intervals. + /// returned aggregation intervals. If you do not specify a $filter clause + /// including a startTime or endTime these filters default to the start and end + /// times of the last aggregation interval currently available; that is, only + /// the last aggregation interval is returned. /// /// /// The operations group for this extension method. @@ -54,7 +63,7 @@ public static partial class PoolOperationsExtensions /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListUsageMetricsAsync(this IPoolOperations operations, PoolListUsageMetricsOptions poolListUsageMetricsOptions = default(PoolListUsageMetricsOptions), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task> ListUsageMetricsAsync(this IPoolOperations operations, PoolListUsageMetricsOptions poolListUsageMetricsOptions = default(PoolListUsageMetricsOptions), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListUsageMetricsWithHttpMessagesAsync(poolListUsageMetricsOptions, null, cancellationToken).ConfigureAwait(false)) { @@ -78,7 +87,7 @@ public static partial class PoolOperationsExtensions /// public static PoolStatistics GetAllLifetimeStatistics(this IPoolOperations operations, PoolGetAllLifetimeStatisticsOptions poolGetAllLifetimeStatisticsOptions = default(PoolGetAllLifetimeStatisticsOptions)) { - return ((IPoolOperations)operations).GetAllLifetimeStatisticsAsync(poolGetAllLifetimeStatisticsOptions).GetAwaiter().GetResult(); + return operations.GetAllLifetimeStatisticsAsync(poolGetAllLifetimeStatisticsOptions).GetAwaiter().GetResult(); } /// @@ -98,7 +107,7 @@ public static partial class PoolOperationsExtensions /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task GetAllLifetimeStatisticsAsync(this IPoolOperations operations, PoolGetAllLifetimeStatisticsOptions poolGetAllLifetimeStatisticsOptions = default(PoolGetAllLifetimeStatisticsOptions), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task GetAllLifetimeStatisticsAsync(this IPoolOperations operations, PoolGetAllLifetimeStatisticsOptions poolGetAllLifetimeStatisticsOptions = default(PoolGetAllLifetimeStatisticsOptions), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.GetAllLifetimeStatisticsWithHttpMessagesAsync(poolGetAllLifetimeStatisticsOptions, null, cancellationToken).ConfigureAwait(false)) { @@ -125,7 +134,7 @@ public static partial class PoolOperationsExtensions /// public static PoolAddHeaders Add(this IPoolOperations operations, PoolAddParameter pool, PoolAddOptions poolAddOptions = default(PoolAddOptions)) { - return ((IPoolOperations)operations).AddAsync(pool, poolAddOptions).GetAwaiter().GetResult(); + return operations.AddAsync(pool, poolAddOptions).GetAwaiter().GetResult(); } /// @@ -148,7 +157,7 @@ public static partial class PoolOperationsExtensions /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task AddAsync(this IPoolOperations operations, PoolAddParameter pool, PoolAddOptions poolAddOptions = default(PoolAddOptions), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task AddAsync(this IPoolOperations operations, PoolAddParameter pool, PoolAddOptions poolAddOptions = default(PoolAddOptions), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.AddWithHttpMessagesAsync(pool, poolAddOptions, null, cancellationToken).ConfigureAwait(false)) { @@ -165,9 +174,9 @@ public static partial class PoolOperationsExtensions /// /// Additional parameters for the operation /// - public static Microsoft.Rest.Azure.IPage List(this IPoolOperations operations, PoolListOptions poolListOptions = default(PoolListOptions)) + public static IPage List(this IPoolOperations operations, PoolListOptions poolListOptions = default(PoolListOptions)) { - return ((IPoolOperations)operations).ListAsync(poolListOptions).GetAwaiter().GetResult(); + return operations.ListAsync(poolListOptions).GetAwaiter().GetResult(); } /// @@ -182,7 +191,7 @@ public static partial class PoolOperationsExtensions /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListAsync(this IPoolOperations operations, PoolListOptions poolListOptions = default(PoolListOptions), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task> ListAsync(this IPoolOperations operations, PoolListOptions poolListOptions = default(PoolListOptions), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListWithHttpMessagesAsync(poolListOptions, null, cancellationToken).ConfigureAwait(false)) { @@ -218,7 +227,7 @@ public static partial class PoolOperationsExtensions /// public static PoolDeleteHeaders Delete(this IPoolOperations operations, string poolId, PoolDeleteOptions poolDeleteOptions = default(PoolDeleteOptions)) { - return ((IPoolOperations)operations).DeleteAsync(poolId, poolDeleteOptions).GetAwaiter().GetResult(); + return operations.DeleteAsync(poolId, poolDeleteOptions).GetAwaiter().GetResult(); } /// @@ -250,7 +259,7 @@ public static partial class PoolOperationsExtensions /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task DeleteAsync(this IPoolOperations operations, string poolId, PoolDeleteOptions poolDeleteOptions = default(PoolDeleteOptions), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task DeleteAsync(this IPoolOperations operations, string poolId, PoolDeleteOptions poolDeleteOptions = default(PoolDeleteOptions), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.DeleteWithHttpMessagesAsync(poolId, poolDeleteOptions, null, cancellationToken).ConfigureAwait(false)) { @@ -272,7 +281,7 @@ public static partial class PoolOperationsExtensions /// public static bool Exists(this IPoolOperations operations, string poolId, PoolExistsOptions poolExistsOptions = default(PoolExistsOptions)) { - return ((IPoolOperations)operations).ExistsAsync(poolId, poolExistsOptions).GetAwaiter().GetResult(); + return operations.ExistsAsync(poolId, poolExistsOptions).GetAwaiter().GetResult(); } /// @@ -290,7 +299,7 @@ public static partial class PoolOperationsExtensions /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task ExistsAsync(this IPoolOperations operations, string poolId, PoolExistsOptions poolExistsOptions = default(PoolExistsOptions), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task ExistsAsync(this IPoolOperations operations, string poolId, PoolExistsOptions poolExistsOptions = default(PoolExistsOptions), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ExistsWithHttpMessagesAsync(poolId, poolExistsOptions, null, cancellationToken).ConfigureAwait(false)) { @@ -312,7 +321,7 @@ public static partial class PoolOperationsExtensions /// public static CloudPool Get(this IPoolOperations operations, string poolId, PoolGetOptions poolGetOptions = default(PoolGetOptions)) { - return ((IPoolOperations)operations).GetAsync(poolId, poolGetOptions).GetAwaiter().GetResult(); + return operations.GetAsync(poolId, poolGetOptions).GetAwaiter().GetResult(); } /// @@ -330,7 +339,7 @@ public static partial class PoolOperationsExtensions /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task GetAsync(this IPoolOperations operations, string poolId, PoolGetOptions poolGetOptions = default(PoolGetOptions), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task GetAsync(this IPoolOperations operations, string poolId, PoolGetOptions poolGetOptions = default(PoolGetOptions), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.GetWithHttpMessagesAsync(poolId, poolGetOptions, null, cancellationToken).ConfigureAwait(false)) { @@ -361,7 +370,7 @@ public static partial class PoolOperationsExtensions /// public static PoolPatchHeaders Patch(this IPoolOperations operations, string poolId, PoolPatchParameter poolPatchParameter, PoolPatchOptions poolPatchOptions = default(PoolPatchOptions)) { - return ((IPoolOperations)operations).PatchAsync(poolId, poolPatchParameter, poolPatchOptions).GetAwaiter().GetResult(); + return operations.PatchAsync(poolId, poolPatchParameter, poolPatchOptions).GetAwaiter().GetResult(); } /// @@ -388,7 +397,7 @@ public static partial class PoolOperationsExtensions /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task PatchAsync(this IPoolOperations operations, string poolId, PoolPatchParameter poolPatchParameter, PoolPatchOptions poolPatchOptions = default(PoolPatchOptions), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task PatchAsync(this IPoolOperations operations, string poolId, PoolPatchParameter poolPatchParameter, PoolPatchOptions poolPatchOptions = default(PoolPatchOptions), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.PatchWithHttpMessagesAsync(poolId, poolPatchParameter, poolPatchOptions, null, cancellationToken).ConfigureAwait(false)) { @@ -410,7 +419,7 @@ public static partial class PoolOperationsExtensions /// public static PoolDisableAutoScaleHeaders DisableAutoScale(this IPoolOperations operations, string poolId, PoolDisableAutoScaleOptions poolDisableAutoScaleOptions = default(PoolDisableAutoScaleOptions)) { - return ((IPoolOperations)operations).DisableAutoScaleAsync(poolId, poolDisableAutoScaleOptions).GetAwaiter().GetResult(); + return operations.DisableAutoScaleAsync(poolId, poolDisableAutoScaleOptions).GetAwaiter().GetResult(); } /// @@ -428,7 +437,7 @@ public static partial class PoolOperationsExtensions /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task DisableAutoScaleAsync(this IPoolOperations operations, string poolId, PoolDisableAutoScaleOptions poolDisableAutoScaleOptions = default(PoolDisableAutoScaleOptions), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task DisableAutoScaleAsync(this IPoolOperations operations, string poolId, PoolDisableAutoScaleOptions poolDisableAutoScaleOptions = default(PoolDisableAutoScaleOptions), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.DisableAutoScaleWithHttpMessagesAsync(poolId, poolDisableAutoScaleOptions, null, cancellationToken).ConfigureAwait(false)) { @@ -461,7 +470,7 @@ public static partial class PoolOperationsExtensions /// public static PoolEnableAutoScaleHeaders EnableAutoScale(this IPoolOperations operations, string poolId, PoolEnableAutoScaleParameter poolEnableAutoScaleParameter, PoolEnableAutoScaleOptions poolEnableAutoScaleOptions = default(PoolEnableAutoScaleOptions)) { - return ((IPoolOperations)operations).EnableAutoScaleAsync(poolId, poolEnableAutoScaleParameter, poolEnableAutoScaleOptions).GetAwaiter().GetResult(); + return operations.EnableAutoScaleAsync(poolId, poolEnableAutoScaleParameter, poolEnableAutoScaleOptions).GetAwaiter().GetResult(); } /// @@ -490,7 +499,7 @@ public static partial class PoolOperationsExtensions /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task EnableAutoScaleAsync(this IPoolOperations operations, string poolId, PoolEnableAutoScaleParameter poolEnableAutoScaleParameter, PoolEnableAutoScaleOptions poolEnableAutoScaleOptions = default(PoolEnableAutoScaleOptions), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task EnableAutoScaleAsync(this IPoolOperations operations, string poolId, PoolEnableAutoScaleParameter poolEnableAutoScaleParameter, PoolEnableAutoScaleOptions poolEnableAutoScaleOptions = default(PoolEnableAutoScaleOptions), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.EnableAutoScaleWithHttpMessagesAsync(poolId, poolEnableAutoScaleParameter, poolEnableAutoScaleOptions, null, cancellationToken).ConfigureAwait(false)) { @@ -503,7 +512,8 @@ public static partial class PoolOperationsExtensions /// /// /// This API is primarily for validating an autoscale formula, as it simply - /// returns the result without applying the formula to the pool. + /// returns the result without applying the formula to the pool. The pool must + /// have auto scaling enabled in order to evaluate a formula. /// /// /// The operations group for this extension method. @@ -524,7 +534,7 @@ public static partial class PoolOperationsExtensions /// public static AutoScaleRun EvaluateAutoScale(this IPoolOperations operations, string poolId, string autoScaleFormula, PoolEvaluateAutoScaleOptions poolEvaluateAutoScaleOptions = default(PoolEvaluateAutoScaleOptions)) { - return ((IPoolOperations)operations).EvaluateAutoScaleAsync(poolId, autoScaleFormula, poolEvaluateAutoScaleOptions).GetAwaiter().GetResult(); + return operations.EvaluateAutoScaleAsync(poolId, autoScaleFormula, poolEvaluateAutoScaleOptions).GetAwaiter().GetResult(); } /// @@ -532,7 +542,8 @@ public static partial class PoolOperationsExtensions /// /// /// This API is primarily for validating an autoscale formula, as it simply - /// returns the result without applying the formula to the pool. + /// returns the result without applying the formula to the pool. The pool must + /// have auto scaling enabled in order to evaluate a formula. /// /// /// The operations group for this extension method. @@ -554,7 +565,7 @@ public static partial class PoolOperationsExtensions /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task EvaluateAutoScaleAsync(this IPoolOperations operations, string poolId, string autoScaleFormula, PoolEvaluateAutoScaleOptions poolEvaluateAutoScaleOptions = default(PoolEvaluateAutoScaleOptions), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task EvaluateAutoScaleAsync(this IPoolOperations operations, string poolId, string autoScaleFormula, PoolEvaluateAutoScaleOptions poolEvaluateAutoScaleOptions = default(PoolEvaluateAutoScaleOptions), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.EvaluateAutoScaleWithHttpMessagesAsync(poolId, autoScaleFormula, poolEvaluateAutoScaleOptions, null, cancellationToken).ConfigureAwait(false)) { @@ -588,7 +599,7 @@ public static partial class PoolOperationsExtensions /// public static PoolResizeHeaders Resize(this IPoolOperations operations, string poolId, PoolResizeParameter poolResizeParameter, PoolResizeOptions poolResizeOptions = default(PoolResizeOptions)) { - return ((IPoolOperations)operations).ResizeAsync(poolId, poolResizeParameter, poolResizeOptions).GetAwaiter().GetResult(); + return operations.ResizeAsync(poolId, poolResizeParameter, poolResizeOptions).GetAwaiter().GetResult(); } /// @@ -618,7 +629,7 @@ public static partial class PoolOperationsExtensions /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task ResizeAsync(this IPoolOperations operations, string poolId, PoolResizeParameter poolResizeParameter, PoolResizeOptions poolResizeOptions = default(PoolResizeOptions), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task ResizeAsync(this IPoolOperations operations, string poolId, PoolResizeParameter poolResizeParameter, PoolResizeOptions poolResizeOptions = default(PoolResizeOptions), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ResizeWithHttpMessagesAsync(poolId, poolResizeParameter, poolResizeOptions, null, cancellationToken).ConfigureAwait(false)) { @@ -632,9 +643,12 @@ public static partial class PoolOperationsExtensions /// /// This does not restore the pool to its previous state before the resize /// operation: it only stops any further changes being made, and the pool - /// maintains its current state. A resize operation need not be an explicit - /// resize pool request; this API can also be used to halt the initial sizing - /// of the pool when it is created. + /// maintains its current state. After stopping, the pool stabilizes at the + /// number of nodes it was at when the stop operation was done. During the stop + /// operation, the pool allocation state changes first to stopping and then to + /// steady. A resize operation need not be an explicit resize pool request; + /// this API can also be used to halt the initial sizing of the pool when it is + /// created. /// /// /// The operations group for this extension method. @@ -647,7 +661,7 @@ public static partial class PoolOperationsExtensions /// public static PoolStopResizeHeaders StopResize(this IPoolOperations operations, string poolId, PoolStopResizeOptions poolStopResizeOptions = default(PoolStopResizeOptions)) { - return ((IPoolOperations)operations).StopResizeAsync(poolId, poolStopResizeOptions).GetAwaiter().GetResult(); + return operations.StopResizeAsync(poolId, poolStopResizeOptions).GetAwaiter().GetResult(); } /// @@ -656,9 +670,12 @@ public static partial class PoolOperationsExtensions /// /// This does not restore the pool to its previous state before the resize /// operation: it only stops any further changes being made, and the pool - /// maintains its current state. A resize operation need not be an explicit - /// resize pool request; this API can also be used to halt the initial sizing - /// of the pool when it is created. + /// maintains its current state. After stopping, the pool stabilizes at the + /// number of nodes it was at when the stop operation was done. During the stop + /// operation, the pool allocation state changes first to stopping and then to + /// steady. A resize operation need not be an explicit resize pool request; + /// this API can also be used to halt the initial sizing of the pool when it is + /// created. /// /// /// The operations group for this extension method. @@ -672,7 +689,7 @@ public static partial class PoolOperationsExtensions /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task StopResizeAsync(this IPoolOperations operations, string poolId, PoolStopResizeOptions poolStopResizeOptions = default(PoolStopResizeOptions), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task StopResizeAsync(this IPoolOperations operations, string poolId, PoolStopResizeOptions poolStopResizeOptions = default(PoolStopResizeOptions), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.StopResizeWithHttpMessagesAsync(poolId, poolStopResizeOptions, null, cancellationToken).ConfigureAwait(false)) { @@ -703,7 +720,7 @@ public static partial class PoolOperationsExtensions /// public static PoolUpdatePropertiesHeaders UpdateProperties(this IPoolOperations operations, string poolId, PoolUpdatePropertiesParameter poolUpdatePropertiesParameter, PoolUpdatePropertiesOptions poolUpdatePropertiesOptions = default(PoolUpdatePropertiesOptions)) { - return ((IPoolOperations)operations).UpdatePropertiesAsync(poolId, poolUpdatePropertiesParameter, poolUpdatePropertiesOptions).GetAwaiter().GetResult(); + return operations.UpdatePropertiesAsync(poolId, poolUpdatePropertiesParameter, poolUpdatePropertiesOptions).GetAwaiter().GetResult(); } /// @@ -730,7 +747,7 @@ public static partial class PoolOperationsExtensions /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task UpdatePropertiesAsync(this IPoolOperations operations, string poolId, PoolUpdatePropertiesParameter poolUpdatePropertiesParameter, PoolUpdatePropertiesOptions poolUpdatePropertiesOptions = default(PoolUpdatePropertiesOptions), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task UpdatePropertiesAsync(this IPoolOperations operations, string poolId, PoolUpdatePropertiesParameter poolUpdatePropertiesParameter, PoolUpdatePropertiesOptions poolUpdatePropertiesOptions = default(PoolUpdatePropertiesOptions), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.UpdatePropertiesWithHttpMessagesAsync(poolId, poolUpdatePropertiesParameter, poolUpdatePropertiesOptions, null, cancellationToken).ConfigureAwait(false)) { @@ -752,7 +769,12 @@ public static partial class PoolOperationsExtensions /// it does not guarantee to do this (particularly on small pools); therefore, /// the pool may be temporarily unavailable to run tasks. When this operation /// runs, the pool state changes to upgrading. When all compute nodes have - /// finished upgrading, the pool state returns to active. + /// finished upgrading, the pool state returns to active. While the upgrade is + /// in progress, the pool's currentOSVersion reflects the OS version that nodes + /// are upgrading from, and targetOSVersion reflects the OS version that nodes + /// are upgrading to. Once the upgrade is complete, currentOSVersion is updated + /// to reflect the OS version now running on all nodes. This operation can only + /// be invoked on pools created with the cloudServiceConfiguration property. /// /// /// The operations group for this extension method. @@ -769,7 +791,7 @@ public static partial class PoolOperationsExtensions /// public static PoolUpgradeOSHeaders UpgradeOS(this IPoolOperations operations, string poolId, string targetOSVersion, PoolUpgradeOSOptions poolUpgradeOSOptions = default(PoolUpgradeOSOptions)) { - return ((IPoolOperations)operations).UpgradeOSAsync(poolId, targetOSVersion, poolUpgradeOSOptions).GetAwaiter().GetResult(); + return operations.UpgradeOSAsync(poolId, targetOSVersion, poolUpgradeOSOptions).GetAwaiter().GetResult(); } /// @@ -786,7 +808,12 @@ public static partial class PoolOperationsExtensions /// it does not guarantee to do this (particularly on small pools); therefore, /// the pool may be temporarily unavailable to run tasks. When this operation /// runs, the pool state changes to upgrading. When all compute nodes have - /// finished upgrading, the pool state returns to active. + /// finished upgrading, the pool state returns to active. While the upgrade is + /// in progress, the pool's currentOSVersion reflects the OS version that nodes + /// are upgrading from, and targetOSVersion reflects the OS version that nodes + /// are upgrading to. Once the upgrade is complete, currentOSVersion is updated + /// to reflect the OS version now running on all nodes. This operation can only + /// be invoked on pools created with the cloudServiceConfiguration property. /// /// /// The operations group for this extension method. @@ -804,7 +831,7 @@ public static partial class PoolOperationsExtensions /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task UpgradeOSAsync(this IPoolOperations operations, string poolId, string targetOSVersion, PoolUpgradeOSOptions poolUpgradeOSOptions = default(PoolUpgradeOSOptions), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task UpgradeOSAsync(this IPoolOperations operations, string poolId, string targetOSVersion, PoolUpgradeOSOptions poolUpgradeOSOptions = default(PoolUpgradeOSOptions), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.UpgradeOSWithHttpMessagesAsync(poolId, targetOSVersion, poolUpgradeOSOptions, null, cancellationToken).ConfigureAwait(false)) { @@ -834,7 +861,7 @@ public static partial class PoolOperationsExtensions /// public static PoolRemoveNodesHeaders RemoveNodes(this IPoolOperations operations, string poolId, NodeRemoveParameter nodeRemoveParameter, PoolRemoveNodesOptions poolRemoveNodesOptions = default(PoolRemoveNodesOptions)) { - return ((IPoolOperations)operations).RemoveNodesAsync(poolId, nodeRemoveParameter, poolRemoveNodesOptions).GetAwaiter().GetResult(); + return operations.RemoveNodesAsync(poolId, nodeRemoveParameter, poolRemoveNodesOptions).GetAwaiter().GetResult(); } /// @@ -860,7 +887,7 @@ public static partial class PoolOperationsExtensions /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task RemoveNodesAsync(this IPoolOperations operations, string poolId, NodeRemoveParameter nodeRemoveParameter, PoolRemoveNodesOptions poolRemoveNodesOptions = default(PoolRemoveNodesOptions), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task RemoveNodesAsync(this IPoolOperations operations, string poolId, NodeRemoveParameter nodeRemoveParameter, PoolRemoveNodesOptions poolRemoveNodesOptions = default(PoolRemoveNodesOptions), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.RemoveNodesWithHttpMessagesAsync(poolId, nodeRemoveParameter, poolRemoveNodesOptions, null, cancellationToken).ConfigureAwait(false)) { @@ -875,7 +902,10 @@ public static partial class PoolOperationsExtensions /// /// If you do not specify a $filter clause including a poolId, the response /// includes all pools that existed in the account in the time range of the - /// returned aggregation intervals. + /// returned aggregation intervals. If you do not specify a $filter clause + /// including a startTime or endTime these filters default to the start and end + /// times of the last aggregation interval currently available; that is, only + /// the last aggregation interval is returned. /// /// /// The operations group for this extension method. @@ -886,9 +916,9 @@ public static partial class PoolOperationsExtensions /// /// Additional parameters for the operation /// - public static Microsoft.Rest.Azure.IPage ListUsageMetricsNext(this IPoolOperations operations, string nextPageLink, PoolListUsageMetricsNextOptions poolListUsageMetricsNextOptions = default(PoolListUsageMetricsNextOptions)) + public static IPage ListUsageMetricsNext(this IPoolOperations operations, string nextPageLink, PoolListUsageMetricsNextOptions poolListUsageMetricsNextOptions = default(PoolListUsageMetricsNextOptions)) { - return ((IPoolOperations)operations).ListUsageMetricsNextAsync(nextPageLink, poolListUsageMetricsNextOptions).GetAwaiter().GetResult(); + return operations.ListUsageMetricsNextAsync(nextPageLink, poolListUsageMetricsNextOptions).GetAwaiter().GetResult(); } /// @@ -898,7 +928,10 @@ public static partial class PoolOperationsExtensions /// /// If you do not specify a $filter clause including a poolId, the response /// includes all pools that existed in the account in the time range of the - /// returned aggregation intervals. + /// returned aggregation intervals. If you do not specify a $filter clause + /// including a startTime or endTime these filters default to the start and end + /// times of the last aggregation interval currently available; that is, only + /// the last aggregation interval is returned. /// /// /// The operations group for this extension method. @@ -912,7 +945,7 @@ public static partial class PoolOperationsExtensions /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListUsageMetricsNextAsync(this IPoolOperations operations, string nextPageLink, PoolListUsageMetricsNextOptions poolListUsageMetricsNextOptions = default(PoolListUsageMetricsNextOptions), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task> ListUsageMetricsNextAsync(this IPoolOperations operations, string nextPageLink, PoolListUsageMetricsNextOptions poolListUsageMetricsNextOptions = default(PoolListUsageMetricsNextOptions), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListUsageMetricsNextWithHttpMessagesAsync(nextPageLink, poolListUsageMetricsNextOptions, null, cancellationToken).ConfigureAwait(false)) { @@ -932,9 +965,9 @@ public static partial class PoolOperationsExtensions /// /// Additional parameters for the operation /// - public static Microsoft.Rest.Azure.IPage ListNext(this IPoolOperations operations, string nextPageLink, PoolListNextOptions poolListNextOptions = default(PoolListNextOptions)) + public static IPage ListNext(this IPoolOperations operations, string nextPageLink, PoolListNextOptions poolListNextOptions = default(PoolListNextOptions)) { - return ((IPoolOperations)operations).ListNextAsync(nextPageLink, poolListNextOptions).GetAwaiter().GetResult(); + return operations.ListNextAsync(nextPageLink, poolListNextOptions).GetAwaiter().GetResult(); } /// @@ -952,7 +985,7 @@ public static partial class PoolOperationsExtensions /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListNextAsync(this IPoolOperations operations, string nextPageLink, PoolListNextOptions poolListNextOptions = default(PoolListNextOptions), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task> ListNextAsync(this IPoolOperations operations, string nextPageLink, PoolListNextOptions poolListNextOptions = default(PoolListNextOptions), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, poolListNextOptions, null, cancellationToken).ConfigureAwait(false)) { @@ -961,4 +994,4 @@ public static partial class PoolOperationsExtensions } } -} +} \ No newline at end of file diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/TaskOperations.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/TaskOperations.cs index 8740c3b00db7..5e147c757a92 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/TaskOperations.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/TaskOperations.cs @@ -8,15 +8,23 @@ namespace Microsoft.Azure.Batch.Protocol { - 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; + using System.Threading; + using System.Threading.Tasks; /// /// TaskOperations operations. /// - internal partial class TaskOperations : Microsoft.Rest.IServiceOperations, ITaskOperations + internal partial class TaskOperations : IServiceOperations, ITaskOperations { /// /// Initializes a new instance of the TaskOperations class. @@ -33,7 +41,7 @@ internal TaskOperations(BatchServiceClient client) { throw new System.ArgumentNullException("client"); } - this.Client = client; + Client = client; } /// @@ -62,7 +70,7 @@ internal TaskOperations(BatchServiceClient client) /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -71,23 +79,23 @@ internal TaskOperations(BatchServiceClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> AddWithHttpMessagesAsync(string jobId, TaskAddParameter task, TaskAddOptions taskAddOptions = default(TaskAddOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> AddWithHttpMessagesAsync(string jobId, TaskAddParameter task, TaskAddOptions taskAddOptions = default(TaskAddOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (jobId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "jobId"); + throw new ValidationException(ValidationRules.CannotBeNull, "jobId"); } if (task == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "task"); + throw new ValidationException(ValidationRules.CannotBeNull, "task"); } if (task != null) { task.Validate(); } - 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"); } int? timeout = default(int?); if (taskAddOptions != null) @@ -110,12 +118,12 @@ internal TaskOperations(BatchServiceClient client) ocpDate = taskAddOptions.OcpDate; } // 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("jobId", jobId); tracingParameters.Add("task", task); tracingParameters.Add("timeout", timeout); @@ -123,42 +131,42 @@ internal TaskOperations(BatchServiceClient client) tracingParameters.Add("returnClientRequestId", returnClientRequestId); tracingParameters.Add("ocpDate", ocpDate); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Add", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Add", 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("/") ? "" : "/")), "jobs/{jobId}/tasks").ToString(); _url = _url.Replace("{jobId}", System.Uri.EscapeDataString(jobId)); - 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 (timeout != null) { - _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(timeout, this.Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(timeout, Client.SerializationSettings).Trim('"')))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _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("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 (clientRequestId != null) { @@ -166,7 +174,7 @@ internal TaskOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(clientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("client-request-id", SafeJsonConvert.SerializeObject(clientRequestId, Client.SerializationSettings).Trim('"')); } if (returnClientRequestId != null) { @@ -174,7 +182,7 @@ internal TaskOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("return-client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(returnClientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", SafeJsonConvert.SerializeObject(returnClientRequestId, Client.SerializationSettings).Trim('"')); } if (ocpDate != null) { @@ -182,7 +190,7 @@ internal TaskOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("ocp-date"); } - _httpRequest.Headers.TryAddWithoutValidation("ocp-date", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ocpDate, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("ocp-date", SafeJsonConvert.SerializeObject(ocpDate, new DateTimeRfc1123JsonConverter()).Trim('"')); } @@ -202,28 +210,28 @@ internal TaskOperations(BatchServiceClient client) string _requestContent = null; if(task != null) { - _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(task, this.Client.SerializationSettings); - _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = SafeJsonConvert.SerializeObject(task, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; odata=minimalmetadata; 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 != 201) @@ -232,21 +240,21 @@ internal TaskOperations(BatchServiceClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - BatchError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + BatchError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -256,7 +264,7 @@ internal TaskOperations(BatchServiceClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); + var _result = new AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("request-id")) @@ -265,20 +273,20 @@ internal TaskOperations(BatchServiceClient client) } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(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 headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -306,10 +314,10 @@ internal TaskOperations(BatchServiceClient client) /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -318,15 +326,15 @@ internal TaskOperations(BatchServiceClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task,TaskListHeaders>> ListWithHttpMessagesAsync(string jobId, TaskListOptions taskListOptions = default(TaskListOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task,TaskListHeaders>> ListWithHttpMessagesAsync(string jobId, TaskListOptions taskListOptions = default(TaskListOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (jobId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "jobId"); + throw new ValidationException(ValidationRules.CannotBeNull, "jobId"); } - 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"); } string filter = default(string); if (taskListOptions != null) @@ -369,12 +377,12 @@ internal TaskOperations(BatchServiceClient client) ocpDate = taskListOptions.OcpDate; } // 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("jobId", jobId); tracingParameters.Add("filter", filter); tracingParameters.Add("select", select); @@ -385,16 +393,16 @@ internal TaskOperations(BatchServiceClient client) tracingParameters.Add("returnClientRequestId", returnClientRequestId); tracingParameters.Add("ocpDate", ocpDate); 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("/") ? "" : "/")), "jobs/{jobId}/tasks").ToString(); _url = _url.Replace("{jobId}", System.Uri.EscapeDataString(jobId)); - 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 (filter != null) { @@ -410,33 +418,33 @@ internal TaskOperations(BatchServiceClient client) } if (maxResults != null) { - _queryParameters.Add(string.Format("maxresults={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(maxResults, this.Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("maxresults={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(maxResults, Client.SerializationSettings).Trim('"')))); } if (timeout != null) { - _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(timeout, this.Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(timeout, Client.SerializationSettings).Trim('"')))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _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("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 (clientRequestId != null) { @@ -444,7 +452,7 @@ internal TaskOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(clientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("client-request-id", SafeJsonConvert.SerializeObject(clientRequestId, Client.SerializationSettings).Trim('"')); } if (returnClientRequestId != null) { @@ -452,7 +460,7 @@ internal TaskOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("return-client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(returnClientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", SafeJsonConvert.SerializeObject(returnClientRequestId, Client.SerializationSettings).Trim('"')); } if (ocpDate != null) { @@ -460,7 +468,7 @@ internal TaskOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("ocp-date"); } - _httpRequest.Headers.TryAddWithoutValidation("ocp-date", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ocpDate, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("ocp-date", SafeJsonConvert.SerializeObject(ocpDate, new DateTimeRfc1123JsonConverter()).Trim('"')); } @@ -479,23 +487,23 @@ internal TaskOperations(BatchServiceClient 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) @@ -504,21 +512,21 @@ internal TaskOperations(BatchServiceClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - BatchError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + BatchError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -528,7 +536,7 @@ internal TaskOperations(BatchServiceClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse,TaskListHeaders>(); + var _result = new AzureOperationResponse,TaskListHeaders>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("request-id")) @@ -541,34 +549,34 @@ internal TaskOperations(BatchServiceClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = 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); } } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(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 headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -583,15 +591,22 @@ internal TaskOperations(BatchServiceClient client) /// the request, the request may have been partially or fully processed, or not /// at all. In such cases, the user should re-issue the request. Note that it /// is up to the user to correctly handle failures when re-issuing a request. - /// For example, you should use the same task ids during a retry so that if the + /// For example, you should use the same task IDs during a retry so that if the /// prior operation succeeded, the retry will not create extra tasks - /// unexpectedly. + /// unexpectedly. If the response contains any tasks which failed to add, a + /// client can retry the request. In a retry, it is most efficient to resubmit + /// only tasks that failed to add, and to omit tasks that were successfully + /// added on the first attempt. /// /// /// The ID of the job to which the task collection is to be added. /// /// - /// The collection of tasks to add. + /// The collection of tasks to add. The total serialized size of this + /// collection must be less than 4MB. If it is greater than 4MB (for example if + /// each task has 100's of resource files or environment variables), the + /// request will fail with code 'RequestBodyTooLarge' and should be retried + /// again with fewer tasks. /// /// /// Additional parameters for the operation @@ -605,10 +620,10 @@ internal TaskOperations(BatchServiceClient client) /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -617,25 +632,25 @@ internal TaskOperations(BatchServiceClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> AddCollectionWithHttpMessagesAsync(string jobId, System.Collections.Generic.IList value, TaskAddCollectionOptions taskAddCollectionOptions = default(TaskAddCollectionOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> AddCollectionWithHttpMessagesAsync(string jobId, IList value, TaskAddCollectionOptions taskAddCollectionOptions = default(TaskAddCollectionOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (jobId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "jobId"); + throw new ValidationException(ValidationRules.CannotBeNull, "jobId"); } - 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 (value == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "value"); + throw new ValidationException(ValidationRules.CannotBeNull, "value"); } if (value != null) { if (value.Count > 100) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxItems, "value", 100); + throw new ValidationException(ValidationRules.MaxItems, "value", 100); } foreach (var element in value) { @@ -671,12 +686,12 @@ internal TaskOperations(BatchServiceClient client) taskCollection.Value = value; } // 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("jobId", jobId); tracingParameters.Add("timeout", timeout); tracingParameters.Add("clientRequestId", clientRequestId); @@ -684,42 +699,42 @@ internal TaskOperations(BatchServiceClient client) tracingParameters.Add("ocpDate", ocpDate); tracingParameters.Add("taskCollection", taskCollection); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "AddCollection", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "AddCollection", 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("/") ? "" : "/")), "jobs/{jobId}/addtaskcollection").ToString(); _url = _url.Replace("{jobId}", System.Uri.EscapeDataString(jobId)); - 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 (timeout != null) { - _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(timeout, this.Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(timeout, Client.SerializationSettings).Trim('"')))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _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("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 (clientRequestId != null) { @@ -727,7 +742,7 @@ internal TaskOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(clientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("client-request-id", SafeJsonConvert.SerializeObject(clientRequestId, Client.SerializationSettings).Trim('"')); } if (returnClientRequestId != null) { @@ -735,7 +750,7 @@ internal TaskOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("return-client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(returnClientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", SafeJsonConvert.SerializeObject(returnClientRequestId, Client.SerializationSettings).Trim('"')); } if (ocpDate != null) { @@ -743,7 +758,7 @@ internal TaskOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("ocp-date"); } - _httpRequest.Headers.TryAddWithoutValidation("ocp-date", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ocpDate, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("ocp-date", SafeJsonConvert.SerializeObject(ocpDate, new DateTimeRfc1123JsonConverter()).Trim('"')); } @@ -763,28 +778,28 @@ internal TaskOperations(BatchServiceClient client) string _requestContent = null; if(taskCollection != null) { - _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(taskCollection, this.Client.SerializationSettings); - _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = SafeJsonConvert.SerializeObject(taskCollection, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; odata=minimalmetadata; 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) @@ -793,21 +808,21 @@ internal TaskOperations(BatchServiceClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - BatchError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + BatchError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -817,7 +832,7 @@ internal TaskOperations(BatchServiceClient 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("request-id")) @@ -830,34 +845,34 @@ internal TaskOperations(BatchServiceClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = 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); } } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(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 headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -890,7 +905,7 @@ internal TaskOperations(BatchServiceClient client) /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -899,19 +914,19 @@ internal TaskOperations(BatchServiceClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> DeleteWithHttpMessagesAsync(string jobId, string taskId, TaskDeleteOptions taskDeleteOptions = default(TaskDeleteOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> DeleteWithHttpMessagesAsync(string jobId, string taskId, TaskDeleteOptions taskDeleteOptions = default(TaskDeleteOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (jobId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "jobId"); + throw new ValidationException(ValidationRules.CannotBeNull, "jobId"); } if (taskId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "taskId"); + throw new ValidationException(ValidationRules.CannotBeNull, "taskId"); } - 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"); } int? timeout = default(int?); if (taskDeleteOptions != null) @@ -954,12 +969,12 @@ internal TaskOperations(BatchServiceClient client) ifUnmodifiedSince = taskDeleteOptions.IfUnmodifiedSince; } // 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("jobId", jobId); tracingParameters.Add("taskId", taskId); tracingParameters.Add("timeout", timeout); @@ -971,43 +986,43 @@ internal TaskOperations(BatchServiceClient client) tracingParameters.Add("ifModifiedSince", ifModifiedSince); tracingParameters.Add("ifUnmodifiedSince", ifUnmodifiedSince); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Delete", 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("/") ? "" : "/")), "jobs/{jobId}/tasks/{taskId}").ToString(); _url = _url.Replace("{jobId}", System.Uri.EscapeDataString(jobId)); _url = _url.Replace("{taskId}", System.Uri.EscapeDataString(taskId)); - 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 (timeout != null) { - _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(timeout, this.Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(timeout, Client.SerializationSettings).Trim('"')))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _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("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 (clientRequestId != null) { @@ -1015,7 +1030,7 @@ internal TaskOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(clientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("client-request-id", SafeJsonConvert.SerializeObject(clientRequestId, Client.SerializationSettings).Trim('"')); } if (returnClientRequestId != null) { @@ -1023,7 +1038,7 @@ internal TaskOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("return-client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(returnClientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", SafeJsonConvert.SerializeObject(returnClientRequestId, Client.SerializationSettings).Trim('"')); } if (ocpDate != null) { @@ -1031,7 +1046,7 @@ internal TaskOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("ocp-date"); } - _httpRequest.Headers.TryAddWithoutValidation("ocp-date", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ocpDate, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("ocp-date", SafeJsonConvert.SerializeObject(ocpDate, new DateTimeRfc1123JsonConverter()).Trim('"')); } if (ifMatch != null) { @@ -1055,7 +1070,7 @@ internal TaskOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("If-Modified-Since"); } - _httpRequest.Headers.TryAddWithoutValidation("If-Modified-Since", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ifModifiedSince, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("If-Modified-Since", SafeJsonConvert.SerializeObject(ifModifiedSince, new DateTimeRfc1123JsonConverter()).Trim('"')); } if (ifUnmodifiedSince != null) { @@ -1063,7 +1078,7 @@ internal TaskOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("If-Unmodified-Since"); } - _httpRequest.Headers.TryAddWithoutValidation("If-Unmodified-Since", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ifUnmodifiedSince, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("If-Unmodified-Since", SafeJsonConvert.SerializeObject(ifUnmodifiedSince, new DateTimeRfc1123JsonConverter()).Trim('"')); } @@ -1082,23 +1097,23 @@ internal TaskOperations(BatchServiceClient 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) @@ -1107,21 +1122,21 @@ internal TaskOperations(BatchServiceClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - BatchError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + BatchError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1131,7 +1146,7 @@ internal TaskOperations(BatchServiceClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); + var _result = new AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("request-id")) @@ -1140,20 +1155,20 @@ internal TaskOperations(BatchServiceClient client) } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(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 headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -1184,10 +1199,10 @@ internal TaskOperations(BatchServiceClient client) /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1196,19 +1211,19 @@ internal TaskOperations(BatchServiceClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string jobId, string taskId, TaskGetOptions taskGetOptions = default(TaskGetOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string jobId, string taskId, TaskGetOptions taskGetOptions = default(TaskGetOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (jobId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "jobId"); + throw new ValidationException(ValidationRules.CannotBeNull, "jobId"); } if (taskId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "taskId"); + throw new ValidationException(ValidationRules.CannotBeNull, "taskId"); } - 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"); } string select = default(string); if (taskGetOptions != null) @@ -1261,12 +1276,12 @@ internal TaskOperations(BatchServiceClient client) ifUnmodifiedSince = taskGetOptions.IfUnmodifiedSince; } // 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("jobId", jobId); tracingParameters.Add("taskId", taskId); tracingParameters.Add("select", select); @@ -1280,17 +1295,17 @@ internal TaskOperations(BatchServiceClient client) tracingParameters.Add("ifModifiedSince", ifModifiedSince); tracingParameters.Add("ifUnmodifiedSince", ifUnmodifiedSince); 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("/") ? "" : "/")), "jobs/{jobId}/tasks/{taskId}").ToString(); _url = _url.Replace("{jobId}", System.Uri.EscapeDataString(jobId)); _url = _url.Replace("{taskId}", System.Uri.EscapeDataString(taskId)); - 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 (select != null) { @@ -1302,29 +1317,29 @@ internal TaskOperations(BatchServiceClient client) } if (timeout != null) { - _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(timeout, this.Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(timeout, Client.SerializationSettings).Trim('"')))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _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("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 (clientRequestId != null) { @@ -1332,7 +1347,7 @@ internal TaskOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(clientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("client-request-id", SafeJsonConvert.SerializeObject(clientRequestId, Client.SerializationSettings).Trim('"')); } if (returnClientRequestId != null) { @@ -1340,7 +1355,7 @@ internal TaskOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("return-client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(returnClientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", SafeJsonConvert.SerializeObject(returnClientRequestId, Client.SerializationSettings).Trim('"')); } if (ocpDate != null) { @@ -1348,7 +1363,7 @@ internal TaskOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("ocp-date"); } - _httpRequest.Headers.TryAddWithoutValidation("ocp-date", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ocpDate, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("ocp-date", SafeJsonConvert.SerializeObject(ocpDate, new DateTimeRfc1123JsonConverter()).Trim('"')); } if (ifMatch != null) { @@ -1372,7 +1387,7 @@ internal TaskOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("If-Modified-Since"); } - _httpRequest.Headers.TryAddWithoutValidation("If-Modified-Since", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ifModifiedSince, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("If-Modified-Since", SafeJsonConvert.SerializeObject(ifModifiedSince, new DateTimeRfc1123JsonConverter()).Trim('"')); } if (ifUnmodifiedSince != null) { @@ -1380,7 +1395,7 @@ internal TaskOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("If-Unmodified-Since"); } - _httpRequest.Headers.TryAddWithoutValidation("If-Unmodified-Since", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ifUnmodifiedSince, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("If-Unmodified-Since", SafeJsonConvert.SerializeObject(ifUnmodifiedSince, new DateTimeRfc1123JsonConverter()).Trim('"')); } @@ -1399,23 +1414,23 @@ internal TaskOperations(BatchServiceClient 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) @@ -1424,21 +1439,21 @@ internal TaskOperations(BatchServiceClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - BatchError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + BatchError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1448,7 +1463,7 @@ internal TaskOperations(BatchServiceClient 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("request-id")) @@ -1461,34 +1476,34 @@ internal TaskOperations(BatchServiceClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = 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); } } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(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 headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -1504,7 +1519,8 @@ internal TaskOperations(BatchServiceClient client) /// /// /// Constraints that apply to this task. If omitted, the task is given the - /// default constraints. + /// default constraints. For multi-instance tasks, updating the retention time + /// applies only to the primary task and not subtasks. /// /// /// Additional parameters for the operation @@ -1518,7 +1534,7 @@ internal TaskOperations(BatchServiceClient client) /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1527,19 +1543,19 @@ internal TaskOperations(BatchServiceClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string jobId, string taskId, TaskConstraints constraints = default(TaskConstraints), TaskUpdateOptions taskUpdateOptions = default(TaskUpdateOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> UpdateWithHttpMessagesAsync(string jobId, string taskId, TaskConstraints constraints = default(TaskConstraints), TaskUpdateOptions taskUpdateOptions = default(TaskUpdateOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (jobId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "jobId"); + throw new ValidationException(ValidationRules.CannotBeNull, "jobId"); } if (taskId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "taskId"); + throw new ValidationException(ValidationRules.CannotBeNull, "taskId"); } - 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"); } int? timeout = default(int?); if (taskUpdateOptions != null) @@ -1587,12 +1603,12 @@ internal TaskOperations(BatchServiceClient client) taskUpdateParameter.Constraints = constraints; } // 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("jobId", jobId); tracingParameters.Add("taskId", taskId); tracingParameters.Add("timeout", timeout); @@ -1605,43 +1621,43 @@ internal TaskOperations(BatchServiceClient client) tracingParameters.Add("ifUnmodifiedSince", ifUnmodifiedSince); tracingParameters.Add("taskUpdateParameter", taskUpdateParameter); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Update", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Update", 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("/") ? "" : "/")), "jobs/{jobId}/tasks/{taskId}").ToString(); _url = _url.Replace("{jobId}", System.Uri.EscapeDataString(jobId)); _url = _url.Replace("{taskId}", System.Uri.EscapeDataString(taskId)); - 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 (timeout != null) { - _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(timeout, this.Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(timeout, Client.SerializationSettings).Trim('"')))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _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("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 (clientRequestId != null) { @@ -1649,7 +1665,7 @@ internal TaskOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(clientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("client-request-id", SafeJsonConvert.SerializeObject(clientRequestId, Client.SerializationSettings).Trim('"')); } if (returnClientRequestId != null) { @@ -1657,7 +1673,7 @@ internal TaskOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("return-client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(returnClientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", SafeJsonConvert.SerializeObject(returnClientRequestId, Client.SerializationSettings).Trim('"')); } if (ocpDate != null) { @@ -1665,7 +1681,7 @@ internal TaskOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("ocp-date"); } - _httpRequest.Headers.TryAddWithoutValidation("ocp-date", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ocpDate, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("ocp-date", SafeJsonConvert.SerializeObject(ocpDate, new DateTimeRfc1123JsonConverter()).Trim('"')); } if (ifMatch != null) { @@ -1689,7 +1705,7 @@ internal TaskOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("If-Modified-Since"); } - _httpRequest.Headers.TryAddWithoutValidation("If-Modified-Since", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ifModifiedSince, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("If-Modified-Since", SafeJsonConvert.SerializeObject(ifModifiedSince, new DateTimeRfc1123JsonConverter()).Trim('"')); } if (ifUnmodifiedSince != null) { @@ -1697,7 +1713,7 @@ internal TaskOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("If-Unmodified-Since"); } - _httpRequest.Headers.TryAddWithoutValidation("If-Unmodified-Since", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ifUnmodifiedSince, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("If-Unmodified-Since", SafeJsonConvert.SerializeObject(ifUnmodifiedSince, new DateTimeRfc1123JsonConverter()).Trim('"')); } @@ -1717,28 +1733,28 @@ internal TaskOperations(BatchServiceClient client) string _requestContent = null; if(taskUpdateParameter != null) { - _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(taskUpdateParameter, this.Client.SerializationSettings); - _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = SafeJsonConvert.SerializeObject(taskUpdateParameter, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; odata=minimalmetadata; 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) @@ -1747,21 +1763,21 @@ internal TaskOperations(BatchServiceClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - BatchError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + BatchError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1771,7 +1787,7 @@ internal TaskOperations(BatchServiceClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); + var _result = new AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("request-id")) @@ -1780,20 +1796,20 @@ internal TaskOperations(BatchServiceClient client) } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(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 headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -1824,10 +1840,10 @@ internal TaskOperations(BatchServiceClient client) /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1836,19 +1852,19 @@ internal TaskOperations(BatchServiceClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> ListSubtasksWithHttpMessagesAsync(string jobId, string taskId, TaskListSubtasksOptions taskListSubtasksOptions = default(TaskListSubtasksOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> ListSubtasksWithHttpMessagesAsync(string jobId, string taskId, TaskListSubtasksOptions taskListSubtasksOptions = default(TaskListSubtasksOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (jobId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "jobId"); + throw new ValidationException(ValidationRules.CannotBeNull, "jobId"); } if (taskId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "taskId"); + throw new ValidationException(ValidationRules.CannotBeNull, "taskId"); } - 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"); } string select = default(string); if (taskListSubtasksOptions != null) @@ -1876,12 +1892,12 @@ internal TaskOperations(BatchServiceClient client) ocpDate = taskListSubtasksOptions.OcpDate; } // 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("jobId", jobId); tracingParameters.Add("taskId", taskId); tracingParameters.Add("select", select); @@ -1890,17 +1906,17 @@ internal TaskOperations(BatchServiceClient client) tracingParameters.Add("returnClientRequestId", returnClientRequestId); tracingParameters.Add("ocpDate", ocpDate); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListSubtasks", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListSubtasks", 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("/") ? "" : "/")), "jobs/{jobId}/tasks/{taskId}/subtasksinfo").ToString(); _url = _url.Replace("{jobId}", System.Uri.EscapeDataString(jobId)); _url = _url.Replace("{taskId}", System.Uri.EscapeDataString(taskId)); - 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 (select != null) { @@ -1908,29 +1924,29 @@ internal TaskOperations(BatchServiceClient client) } if (timeout != null) { - _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(timeout, this.Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(timeout, Client.SerializationSettings).Trim('"')))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _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("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 (clientRequestId != null) { @@ -1938,7 +1954,7 @@ internal TaskOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(clientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("client-request-id", SafeJsonConvert.SerializeObject(clientRequestId, Client.SerializationSettings).Trim('"')); } if (returnClientRequestId != null) { @@ -1946,7 +1962,7 @@ internal TaskOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("return-client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(returnClientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", SafeJsonConvert.SerializeObject(returnClientRequestId, Client.SerializationSettings).Trim('"')); } if (ocpDate != null) { @@ -1954,7 +1970,7 @@ internal TaskOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("ocp-date"); } - _httpRequest.Headers.TryAddWithoutValidation("ocp-date", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ocpDate, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("ocp-date", SafeJsonConvert.SerializeObject(ocpDate, new DateTimeRfc1123JsonConverter()).Trim('"')); } @@ -1973,23 +1989,23 @@ internal TaskOperations(BatchServiceClient 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) @@ -1998,21 +2014,21 @@ internal TaskOperations(BatchServiceClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - BatchError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + BatchError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2022,7 +2038,7 @@ internal TaskOperations(BatchServiceClient 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("request-id")) @@ -2035,34 +2051,34 @@ internal TaskOperations(BatchServiceClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = 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); } } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(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 headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -2094,7 +2110,7 @@ internal TaskOperations(BatchServiceClient client) /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -2103,19 +2119,19 @@ internal TaskOperations(BatchServiceClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> TerminateWithHttpMessagesAsync(string jobId, string taskId, TaskTerminateOptions taskTerminateOptions = default(TaskTerminateOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> TerminateWithHttpMessagesAsync(string jobId, string taskId, TaskTerminateOptions taskTerminateOptions = default(TaskTerminateOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (jobId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "jobId"); + throw new ValidationException(ValidationRules.CannotBeNull, "jobId"); } if (taskId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "taskId"); + throw new ValidationException(ValidationRules.CannotBeNull, "taskId"); } - 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"); } int? timeout = default(int?); if (taskTerminateOptions != null) @@ -2158,12 +2174,12 @@ internal TaskOperations(BatchServiceClient client) ifUnmodifiedSince = taskTerminateOptions.IfUnmodifiedSince; } // 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("jobId", jobId); tracingParameters.Add("taskId", taskId); tracingParameters.Add("timeout", timeout); @@ -2175,43 +2191,43 @@ internal TaskOperations(BatchServiceClient client) tracingParameters.Add("ifModifiedSince", ifModifiedSince); tracingParameters.Add("ifUnmodifiedSince", ifUnmodifiedSince); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Terminate", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Terminate", 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("/") ? "" : "/")), "jobs/{jobId}/tasks/{taskId}/terminate").ToString(); _url = _url.Replace("{jobId}", System.Uri.EscapeDataString(jobId)); _url = _url.Replace("{taskId}", System.Uri.EscapeDataString(taskId)); - 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 (timeout != null) { - _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(timeout, this.Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(timeout, Client.SerializationSettings).Trim('"')))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _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("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 (clientRequestId != null) { @@ -2219,7 +2235,7 @@ internal TaskOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(clientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("client-request-id", SafeJsonConvert.SerializeObject(clientRequestId, Client.SerializationSettings).Trim('"')); } if (returnClientRequestId != null) { @@ -2227,7 +2243,7 @@ internal TaskOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("return-client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(returnClientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", SafeJsonConvert.SerializeObject(returnClientRequestId, Client.SerializationSettings).Trim('"')); } if (ocpDate != null) { @@ -2235,7 +2251,7 @@ internal TaskOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("ocp-date"); } - _httpRequest.Headers.TryAddWithoutValidation("ocp-date", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ocpDate, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("ocp-date", SafeJsonConvert.SerializeObject(ocpDate, new DateTimeRfc1123JsonConverter()).Trim('"')); } if (ifMatch != null) { @@ -2259,7 +2275,7 @@ internal TaskOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("If-Modified-Since"); } - _httpRequest.Headers.TryAddWithoutValidation("If-Modified-Since", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ifModifiedSince, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("If-Modified-Since", SafeJsonConvert.SerializeObject(ifModifiedSince, new DateTimeRfc1123JsonConverter()).Trim('"')); } if (ifUnmodifiedSince != null) { @@ -2267,7 +2283,7 @@ internal TaskOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("If-Unmodified-Since"); } - _httpRequest.Headers.TryAddWithoutValidation("If-Unmodified-Since", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ifUnmodifiedSince, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("If-Unmodified-Since", SafeJsonConvert.SerializeObject(ifUnmodifiedSince, new DateTimeRfc1123JsonConverter()).Trim('"')); } @@ -2286,23 +2302,23 @@ internal TaskOperations(BatchServiceClient 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 != 204) @@ -2311,21 +2327,21 @@ internal TaskOperations(BatchServiceClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - BatchError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + BatchError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2335,7 +2351,7 @@ internal TaskOperations(BatchServiceClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); + var _result = new AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("request-id")) @@ -2344,35 +2360,37 @@ internal TaskOperations(BatchServiceClient client) } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(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 headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// Reactivates the specified task. + /// Reactivates a task, allowing it to run again even if its retry count has + /// been exhausted. /// /// /// Reactivation makes a task eligible to be retried again up to its maximum /// retry count. The task's state is changed to active. As the task is no - /// longer in the completed state, any previous exit code or scheduling error - /// is no longer available after reactivation. This will fail for tasks that - /// are not completed or that previously completed successfully (with an exit - /// code of 0). Additionally, this will fail if the job has completed (or is - /// terminating or deleting). + /// longer in the completed state, any previous exit code or failure + /// information is no longer available after reactivation. Each time a task is + /// reactivated, its retry count is reset to 0. Reactivation will fail for + /// tasks that are not completed or that previously completed successfully + /// (with an exit code of 0). Additionally, it will fail if the job has + /// completed (or is terminating or deleting). /// /// /// The ID of the job containing the task. @@ -2392,7 +2410,7 @@ internal TaskOperations(BatchServiceClient client) /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -2401,19 +2419,19 @@ internal TaskOperations(BatchServiceClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> ReactivateWithHttpMessagesAsync(string jobId, string taskId, TaskReactivateOptions taskReactivateOptions = default(TaskReactivateOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> ReactivateWithHttpMessagesAsync(string jobId, string taskId, TaskReactivateOptions taskReactivateOptions = default(TaskReactivateOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (jobId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "jobId"); + throw new ValidationException(ValidationRules.CannotBeNull, "jobId"); } if (taskId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "taskId"); + throw new ValidationException(ValidationRules.CannotBeNull, "taskId"); } - 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"); } int? timeout = default(int?); if (taskReactivateOptions != null) @@ -2456,12 +2474,12 @@ internal TaskOperations(BatchServiceClient client) ifUnmodifiedSince = taskReactivateOptions.IfUnmodifiedSince; } // 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("jobId", jobId); tracingParameters.Add("taskId", taskId); tracingParameters.Add("timeout", timeout); @@ -2473,43 +2491,43 @@ internal TaskOperations(BatchServiceClient client) tracingParameters.Add("ifModifiedSince", ifModifiedSince); tracingParameters.Add("ifUnmodifiedSince", ifUnmodifiedSince); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Reactivate", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Reactivate", 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("/") ? "" : "/")), "jobs/{jobId}/tasks/{taskId}/reactivate").ToString(); _url = _url.Replace("{jobId}", System.Uri.EscapeDataString(jobId)); _url = _url.Replace("{taskId}", System.Uri.EscapeDataString(taskId)); - 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 (timeout != null) { - _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(timeout, this.Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(timeout, Client.SerializationSettings).Trim('"')))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _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("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 (clientRequestId != null) { @@ -2517,7 +2535,7 @@ internal TaskOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(clientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("client-request-id", SafeJsonConvert.SerializeObject(clientRequestId, Client.SerializationSettings).Trim('"')); } if (returnClientRequestId != null) { @@ -2525,7 +2543,7 @@ internal TaskOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("return-client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(returnClientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", SafeJsonConvert.SerializeObject(returnClientRequestId, Client.SerializationSettings).Trim('"')); } if (ocpDate != null) { @@ -2533,7 +2551,7 @@ internal TaskOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("ocp-date"); } - _httpRequest.Headers.TryAddWithoutValidation("ocp-date", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ocpDate, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("ocp-date", SafeJsonConvert.SerializeObject(ocpDate, new DateTimeRfc1123JsonConverter()).Trim('"')); } if (ifMatch != null) { @@ -2557,7 +2575,7 @@ internal TaskOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("If-Modified-Since"); } - _httpRequest.Headers.TryAddWithoutValidation("If-Modified-Since", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ifModifiedSince, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("If-Modified-Since", SafeJsonConvert.SerializeObject(ifModifiedSince, new DateTimeRfc1123JsonConverter()).Trim('"')); } if (ifUnmodifiedSince != null) { @@ -2565,7 +2583,7 @@ internal TaskOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("If-Unmodified-Since"); } - _httpRequest.Headers.TryAddWithoutValidation("If-Unmodified-Since", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ifUnmodifiedSince, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("If-Unmodified-Since", SafeJsonConvert.SerializeObject(ifUnmodifiedSince, new DateTimeRfc1123JsonConverter()).Trim('"')); } @@ -2584,23 +2602,23 @@ internal TaskOperations(BatchServiceClient 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 != 204) @@ -2609,21 +2627,21 @@ internal TaskOperations(BatchServiceClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - BatchError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + BatchError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2633,7 +2651,7 @@ internal TaskOperations(BatchServiceClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); + var _result = new AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("request-id")) @@ -2642,20 +2660,20 @@ internal TaskOperations(BatchServiceClient client) } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(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 headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -2683,10 +2701,10 @@ internal TaskOperations(BatchServiceClient client) /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -2695,11 +2713,11 @@ internal TaskOperations(BatchServiceClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task,TaskListHeaders>> ListNextWithHttpMessagesAsync(string nextPageLink, TaskListNextOptions taskListNextOptions = default(TaskListNextOptions), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task,TaskListHeaders>> ListNextWithHttpMessagesAsync(string nextPageLink, TaskListNextOptions taskListNextOptions = default(TaskListNextOptions), 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"); } System.Guid? clientRequestId = default(System.Guid?); if (taskListNextOptions != null) @@ -2717,44 +2735,44 @@ internal TaskOperations(BatchServiceClient client) ocpDate = taskListNextOptions.OcpDate; } // 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("clientRequestId", clientRequestId); tracingParameters.Add("returnClientRequestId", returnClientRequestId); tracingParameters.Add("ocpDate", ocpDate); 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 += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _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("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 (clientRequestId != null) { @@ -2762,7 +2780,7 @@ internal TaskOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(clientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("client-request-id", SafeJsonConvert.SerializeObject(clientRequestId, Client.SerializationSettings).Trim('"')); } if (returnClientRequestId != null) { @@ -2770,7 +2788,7 @@ internal TaskOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("return-client-request-id"); } - _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(returnClientRequestId, this.Client.SerializationSettings).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", SafeJsonConvert.SerializeObject(returnClientRequestId, Client.SerializationSettings).Trim('"')); } if (ocpDate != null) { @@ -2778,7 +2796,7 @@ internal TaskOperations(BatchServiceClient client) { _httpRequest.Headers.Remove("ocp-date"); } - _httpRequest.Headers.TryAddWithoutValidation("ocp-date", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ocpDate, new Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter()).Trim('"')); + _httpRequest.Headers.TryAddWithoutValidation("ocp-date", SafeJsonConvert.SerializeObject(ocpDate, new DateTimeRfc1123JsonConverter()).Trim('"')); } @@ -2797,23 +2815,23 @@ internal TaskOperations(BatchServiceClient 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) @@ -2822,21 +2840,21 @@ internal TaskOperations(BatchServiceClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - BatchError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + BatchError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2846,7 +2864,7 @@ internal TaskOperations(BatchServiceClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse,TaskListHeaders>(); + var _result = new AzureOperationResponse,TaskListHeaders>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("request-id")) @@ -2859,37 +2877,37 @@ internal TaskOperations(BatchServiceClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = 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); } } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(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 headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } } -} +} \ No newline at end of file diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/TaskOperationsExtensions.cs b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/TaskOperationsExtensions.cs index bee1509edd20..f84196ee8ac1 100644 --- a/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/TaskOperationsExtensions.cs +++ b/src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/TaskOperationsExtensions.cs @@ -8,8 +8,13 @@ namespace Microsoft.Azure.Batch.Protocol { + 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 TaskOperations. @@ -33,7 +38,7 @@ public static partial class TaskOperationsExtensions /// public static TaskAddHeaders Add(this ITaskOperations operations, string jobId, TaskAddParameter task, TaskAddOptions taskAddOptions = default(TaskAddOptions)) { - return ((ITaskOperations)operations).AddAsync(jobId, task, taskAddOptions).GetAwaiter().GetResult(); + return operations.AddAsync(jobId, task, taskAddOptions).GetAwaiter().GetResult(); } /// @@ -54,7 +59,7 @@ public static partial class TaskOperationsExtensions /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task AddAsync(this ITaskOperations operations, string jobId, TaskAddParameter task, TaskAddOptions taskAddOptions = default(TaskAddOptions), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task AddAsync(this ITaskOperations operations, string jobId, TaskAddParameter task, TaskAddOptions taskAddOptions = default(TaskAddOptions), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.AddWithHttpMessagesAsync(jobId, task, taskAddOptions, null, cancellationToken).ConfigureAwait(false)) { @@ -79,9 +84,9 @@ public static partial class TaskOperationsExtensions /// /// Additional parameters for the operation /// - public static Microsoft.Rest.Azure.IPage List(this ITaskOperations operations, string jobId, TaskListOptions taskListOptions = default(TaskListOptions)) + public static IPage List(this ITaskOperations operations, string jobId, TaskListOptions taskListOptions = default(TaskListOptions)) { - return ((ITaskOperations)operations).ListAsync(jobId, taskListOptions).GetAwaiter().GetResult(); + return operations.ListAsync(jobId, taskListOptions).GetAwaiter().GetResult(); } /// @@ -104,7 +109,7 @@ public static partial class TaskOperationsExtensions /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListAsync(this ITaskOperations operations, string jobId, TaskListOptions taskListOptions = default(TaskListOptions), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task> ListAsync(this ITaskOperations operations, string jobId, TaskListOptions taskListOptions = default(TaskListOptions), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListWithHttpMessagesAsync(jobId, taskListOptions, null, cancellationToken).ConfigureAwait(false)) { @@ -122,9 +127,12 @@ public static partial class TaskOperationsExtensions /// the request, the request may have been partially or fully processed, or not /// at all. In such cases, the user should re-issue the request. Note that it /// is up to the user to correctly handle failures when re-issuing a request. - /// For example, you should use the same task ids during a retry so that if the + /// For example, you should use the same task IDs during a retry so that if the /// prior operation succeeded, the retry will not create extra tasks - /// unexpectedly. + /// unexpectedly. If the response contains any tasks which failed to add, a + /// client can retry the request. In a retry, it is most efficient to resubmit + /// only tasks that failed to add, and to omit tasks that were successfully + /// added on the first attempt. /// /// /// The operations group for this extension method. @@ -133,14 +141,18 @@ public static partial class TaskOperationsExtensions /// The ID of the job to which the task collection is to be added. /// /// - /// The collection of tasks to add. + /// The collection of tasks to add. The total serialized size of this + /// collection must be less than 4MB. If it is greater than 4MB (for example if + /// each task has 100's of resource files or environment variables), the + /// request will fail with code 'RequestBodyTooLarge' and should be retried + /// again with fewer tasks. /// /// /// Additional parameters for the operation /// - public static TaskAddCollectionResult AddCollection(this ITaskOperations operations, string jobId, System.Collections.Generic.IList value, TaskAddCollectionOptions taskAddCollectionOptions = default(TaskAddCollectionOptions)) + public static TaskAddCollectionResult AddCollection(this ITaskOperations operations, string jobId, IList value, TaskAddCollectionOptions taskAddCollectionOptions = default(TaskAddCollectionOptions)) { - return ((ITaskOperations)operations).AddCollectionAsync(jobId, value, taskAddCollectionOptions).GetAwaiter().GetResult(); + return operations.AddCollectionAsync(jobId, value, taskAddCollectionOptions).GetAwaiter().GetResult(); } /// @@ -153,9 +165,12 @@ public static partial class TaskOperationsExtensions /// the request, the request may have been partially or fully processed, or not /// at all. In such cases, the user should re-issue the request. Note that it /// is up to the user to correctly handle failures when re-issuing a request. - /// For example, you should use the same task ids during a retry so that if the + /// For example, you should use the same task IDs during a retry so that if the /// prior operation succeeded, the retry will not create extra tasks - /// unexpectedly. + /// unexpectedly. If the response contains any tasks which failed to add, a + /// client can retry the request. In a retry, it is most efficient to resubmit + /// only tasks that failed to add, and to omit tasks that were successfully + /// added on the first attempt. /// /// /// The operations group for this extension method. @@ -164,7 +179,11 @@ public static partial class TaskOperationsExtensions /// The ID of the job to which the task collection is to be added. /// /// - /// The collection of tasks to add. + /// The collection of tasks to add. The total serialized size of this + /// collection must be less than 4MB. If it is greater than 4MB (for example if + /// each task has 100's of resource files or environment variables), the + /// request will fail with code 'RequestBodyTooLarge' and should be retried + /// again with fewer tasks. /// /// /// Additional parameters for the operation @@ -172,7 +191,7 @@ public static partial class TaskOperationsExtensions /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task AddCollectionAsync(this ITaskOperations operations, string jobId, System.Collections.Generic.IList value, TaskAddCollectionOptions taskAddCollectionOptions = default(TaskAddCollectionOptions), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task AddCollectionAsync(this ITaskOperations operations, string jobId, IList value, TaskAddCollectionOptions taskAddCollectionOptions = default(TaskAddCollectionOptions), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.AddCollectionWithHttpMessagesAsync(jobId, value, taskAddCollectionOptions, null, cancellationToken).ConfigureAwait(false)) { @@ -204,7 +223,7 @@ public static partial class TaskOperationsExtensions /// public static TaskDeleteHeaders Delete(this ITaskOperations operations, string jobId, string taskId, TaskDeleteOptions taskDeleteOptions = default(TaskDeleteOptions)) { - return ((ITaskOperations)operations).DeleteAsync(jobId, taskId, taskDeleteOptions).GetAwaiter().GetResult(); + return operations.DeleteAsync(jobId, taskId, taskDeleteOptions).GetAwaiter().GetResult(); } /// @@ -232,7 +251,7 @@ public static partial class TaskOperationsExtensions /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task DeleteAsync(this ITaskOperations operations, string jobId, string taskId, TaskDeleteOptions taskDeleteOptions = default(TaskDeleteOptions), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task DeleteAsync(this ITaskOperations operations, string jobId, string taskId, TaskDeleteOptions taskDeleteOptions = default(TaskDeleteOptions), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.DeleteWithHttpMessagesAsync(jobId, taskId, taskDeleteOptions, null, cancellationToken).ConfigureAwait(false)) { @@ -262,7 +281,7 @@ public static partial class TaskOperationsExtensions /// public static CloudTask Get(this ITaskOperations operations, string jobId, string taskId, TaskGetOptions taskGetOptions = default(TaskGetOptions)) { - return ((ITaskOperations)operations).GetAsync(jobId, taskId, taskGetOptions).GetAwaiter().GetResult(); + return operations.GetAsync(jobId, taskId, taskGetOptions).GetAwaiter().GetResult(); } /// @@ -288,7 +307,7 @@ public static partial class TaskOperationsExtensions /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task GetAsync(this ITaskOperations operations, string jobId, string taskId, TaskGetOptions taskGetOptions = default(TaskGetOptions), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task GetAsync(this ITaskOperations operations, string jobId, string taskId, TaskGetOptions taskGetOptions = default(TaskGetOptions), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.GetWithHttpMessagesAsync(jobId, taskId, taskGetOptions, null, cancellationToken).ConfigureAwait(false)) { @@ -310,14 +329,15 @@ public static partial class TaskOperationsExtensions /// /// /// Constraints that apply to this task. If omitted, the task is given the - /// default constraints. + /// default constraints. For multi-instance tasks, updating the retention time + /// applies only to the primary task and not subtasks. /// /// /// Additional parameters for the operation /// public static TaskUpdateHeaders Update(this ITaskOperations operations, string jobId, string taskId, TaskConstraints constraints = default(TaskConstraints), TaskUpdateOptions taskUpdateOptions = default(TaskUpdateOptions)) { - return ((ITaskOperations)operations).UpdateAsync(jobId, taskId, constraints, taskUpdateOptions).GetAwaiter().GetResult(); + return operations.UpdateAsync(jobId, taskId, constraints, taskUpdateOptions).GetAwaiter().GetResult(); } /// @@ -334,7 +354,8 @@ public static partial class TaskOperationsExtensions /// /// /// Constraints that apply to this task. If omitted, the task is given the - /// default constraints. + /// default constraints. For multi-instance tasks, updating the retention time + /// applies only to the primary task and not subtasks. /// /// /// Additional parameters for the operation @@ -342,7 +363,7 @@ public static partial class TaskOperationsExtensions /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task UpdateAsync(this ITaskOperations operations, string jobId, string taskId, TaskConstraints constraints = default(TaskConstraints), TaskUpdateOptions taskUpdateOptions = default(TaskUpdateOptions), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task UpdateAsync(this ITaskOperations operations, string jobId, string taskId, TaskConstraints constraints = default(TaskConstraints), TaskUpdateOptions taskUpdateOptions = default(TaskUpdateOptions), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.UpdateWithHttpMessagesAsync(jobId, taskId, constraints, taskUpdateOptions, null, cancellationToken).ConfigureAwait(false)) { @@ -372,7 +393,7 @@ public static partial class TaskOperationsExtensions /// public static CloudTaskListSubtasksResult ListSubtasks(this ITaskOperations operations, string jobId, string taskId, TaskListSubtasksOptions taskListSubtasksOptions = default(TaskListSubtasksOptions)) { - return ((ITaskOperations)operations).ListSubtasksAsync(jobId, taskId, taskListSubtasksOptions).GetAwaiter().GetResult(); + return operations.ListSubtasksAsync(jobId, taskId, taskListSubtasksOptions).GetAwaiter().GetResult(); } /// @@ -398,7 +419,7 @@ public static partial class TaskOperationsExtensions /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task ListSubtasksAsync(this ITaskOperations operations, string jobId, string taskId, TaskListSubtasksOptions taskListSubtasksOptions = default(TaskListSubtasksOptions), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task ListSubtasksAsync(this ITaskOperations operations, string jobId, string taskId, TaskListSubtasksOptions taskListSubtasksOptions = default(TaskListSubtasksOptions), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListSubtasksWithHttpMessagesAsync(jobId, taskId, taskListSubtasksOptions, null, cancellationToken).ConfigureAwait(false)) { @@ -429,7 +450,7 @@ public static partial class TaskOperationsExtensions /// public static TaskTerminateHeaders Terminate(this ITaskOperations operations, string jobId, string taskId, TaskTerminateOptions taskTerminateOptions = default(TaskTerminateOptions)) { - return ((ITaskOperations)operations).TerminateAsync(jobId, taskId, taskTerminateOptions).GetAwaiter().GetResult(); + return operations.TerminateAsync(jobId, taskId, taskTerminateOptions).GetAwaiter().GetResult(); } /// @@ -456,7 +477,7 @@ public static partial class TaskOperationsExtensions /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task TerminateAsync(this ITaskOperations operations, string jobId, string taskId, TaskTerminateOptions taskTerminateOptions = default(TaskTerminateOptions), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task TerminateAsync(this ITaskOperations operations, string jobId, string taskId, TaskTerminateOptions taskTerminateOptions = default(TaskTerminateOptions), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.TerminateWithHttpMessagesAsync(jobId, taskId, taskTerminateOptions, null, cancellationToken).ConfigureAwait(false)) { @@ -465,16 +486,18 @@ public static partial class TaskOperationsExtensions } /// - /// Reactivates the specified task. + /// Reactivates a task, allowing it to run again even if its retry count has + /// been exhausted. /// /// /// Reactivation makes a task eligible to be retried again up to its maximum /// retry count. The task's state is changed to active. As the task is no - /// longer in the completed state, any previous exit code or scheduling error - /// is no longer available after reactivation. This will fail for tasks that - /// are not completed or that previously completed successfully (with an exit - /// code of 0). Additionally, this will fail if the job has completed (or is - /// terminating or deleting). + /// longer in the completed state, any previous exit code or failure + /// information is no longer available after reactivation. Each time a task is + /// reactivated, its retry count is reset to 0. Reactivation will fail for + /// tasks that are not completed or that previously completed successfully + /// (with an exit code of 0). Additionally, it will fail if the job has + /// completed (or is terminating or deleting). /// /// /// The operations group for this extension method. @@ -490,20 +513,22 @@ public static partial class TaskOperationsExtensions /// public static TaskReactivateHeaders Reactivate(this ITaskOperations operations, string jobId, string taskId, TaskReactivateOptions taskReactivateOptions = default(TaskReactivateOptions)) { - return ((ITaskOperations)operations).ReactivateAsync(jobId, taskId, taskReactivateOptions).GetAwaiter().GetResult(); + return operations.ReactivateAsync(jobId, taskId, taskReactivateOptions).GetAwaiter().GetResult(); } /// - /// Reactivates the specified task. + /// Reactivates a task, allowing it to run again even if its retry count has + /// been exhausted. /// /// /// Reactivation makes a task eligible to be retried again up to its maximum /// retry count. The task's state is changed to active. As the task is no - /// longer in the completed state, any previous exit code or scheduling error - /// is no longer available after reactivation. This will fail for tasks that - /// are not completed or that previously completed successfully (with an exit - /// code of 0). Additionally, this will fail if the job has completed (or is - /// terminating or deleting). + /// longer in the completed state, any previous exit code or failure + /// information is no longer available after reactivation. Each time a task is + /// reactivated, its retry count is reset to 0. Reactivation will fail for + /// tasks that are not completed or that previously completed successfully + /// (with an exit code of 0). Additionally, it will fail if the job has + /// completed (or is terminating or deleting). /// /// /// The operations group for this extension method. @@ -520,7 +545,7 @@ public static partial class TaskOperationsExtensions /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task ReactivateAsync(this ITaskOperations operations, string jobId, string taskId, TaskReactivateOptions taskReactivateOptions = default(TaskReactivateOptions), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task ReactivateAsync(this ITaskOperations operations, string jobId, string taskId, TaskReactivateOptions taskReactivateOptions = default(TaskReactivateOptions), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ReactivateWithHttpMessagesAsync(jobId, taskId, taskReactivateOptions, null, cancellationToken).ConfigureAwait(false)) { @@ -545,9 +570,9 @@ public static partial class TaskOperationsExtensions /// /// Additional parameters for the operation /// - public static Microsoft.Rest.Azure.IPage ListNext(this ITaskOperations operations, string nextPageLink, TaskListNextOptions taskListNextOptions = default(TaskListNextOptions)) + public static IPage ListNext(this ITaskOperations operations, string nextPageLink, TaskListNextOptions taskListNextOptions = default(TaskListNextOptions)) { - return ((ITaskOperations)operations).ListNextAsync(nextPageLink, taskListNextOptions).GetAwaiter().GetResult(); + return operations.ListNextAsync(nextPageLink, taskListNextOptions).GetAwaiter().GetResult(); } /// @@ -570,7 +595,7 @@ public static partial class TaskOperationsExtensions /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListNextAsync(this ITaskOperations operations, string nextPageLink, TaskListNextOptions taskListNextOptions = default(TaskListNextOptions), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task> ListNextAsync(this ITaskOperations operations, string nextPageLink, TaskListNextOptions taskListNextOptions = default(TaskListNextOptions), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, taskListNextOptions, null, cancellationToken).ConfigureAwait(false)) { @@ -579,4 +604,4 @@ public static partial class TaskOperationsExtensions } } -} +} \ No newline at end of file diff --git a/src/SDKs/Batch/DataPlane/fixup.ps1 b/src/SDKs/Batch/DataPlane/fixup.ps1 new file mode 100644 index 000000000000..c666469dae0f --- /dev/null +++ b/src/SDKs/Batch/DataPlane/fixup.ps1 @@ -0,0 +1,8 @@ +foreach($f in (Get-ChildItem ".\Azure.Batch\GeneratedProtocol" -Filter *Operations.cs) + (Get-ChildItem ".\Azure.Batch\GeneratedProtocol" -Filter *OperationsExtensions.cs)) +{ + # (Get-Content $f.FullName -Raw).replace('using Microsoft.Azure;`n', '').replace('using Microsoft.Azure.Batch;`n', '') | Set-Content $f.FullName + $text = [string]::Join("`n", (Get-Content $f.FullName)) + $text = [regex]::Replace($text, " *using Microsoft.Azure;`n", "", "Singleline") + $text = [regex]::Replace($text, " *using Microsoft.Azure.Batch;`n", "", "Singleline") + [IO.File]::WriteAllText($f.FullName, $text) +} diff --git a/src/SDKs/Batch/DataPlane/generate.cmd b/src/SDKs/Batch/DataPlane/generate.cmd index 5bf1c285c79c..6f9b058cedba 100644 --- a/src/SDKs/Batch/DataPlane/generate.cmd +++ b/src/SDKs/Batch/DataPlane/generate.cmd @@ -5,3 +5,6 @@ @echo off call %~dp0..\..\..\..\tools\generate.cmd batch/data-plane %* + +:: This is a stop-gap until https://github.com/Azure/autorest/issues/2558 is fixed +powershell .\fixup.ps1 diff --git a/src/SDKs/_metadata/batch_data-plane.txt b/src/SDKs/_metadata/batch_data-plane.txt new file mode 100644 index 000000000000..1c9225c9b9c1 --- /dev/null +++ b/src/SDKs/_metadata/batch_data-plane.txt @@ -0,0 +1,10 @@ +2017-08-31 16:55:15 UTC + +1) azure-rest-api-specs repository information +GitHub user: Azure +Branch: current +Commit: 21a810b65e7faed64040acf6cb0435ced80e6005 + +2) AutoRest information +Requested version: latest +Latest version: 1.2.2