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