diff --git a/src/Resources/ResourceManager/ResourceManager.csproj b/src/Resources/ResourceManager/ResourceManager.csproj
index 32786542f6d6..a6ccd8aeed9b 100644
--- a/src/Resources/ResourceManager/ResourceManager.csproj
+++ b/src/Resources/ResourceManager/ResourceManager.csproj
@@ -17,7 +17,7 @@
-
+
diff --git a/src/Resources/ResourceManager/SdkModels/DeploymentStacks/PSDeploymentStack.cs b/src/Resources/ResourceManager/SdkModels/DeploymentStacks/PSDeploymentStack.cs
index 3f30da8f0dd2..3de1e2340f63 100644
--- a/src/Resources/ResourceManager/SdkModels/DeploymentStacks/PSDeploymentStack.cs
+++ b/src/Resources/ResourceManager/SdkModels/DeploymentStacks/PSDeploymentStack.cs
@@ -89,7 +89,7 @@ internal PSDeploymentStack(DeploymentStack deploymentStack)
this.provisioningState = deploymentStack.ProvisioningState;
this.deploymentScope = deploymentStack.DeploymentScope;
this.description = deploymentStack.Description;
- this.resources = deploymentStack.ResourcesProperty;
+ this.resources = deploymentStack.Resources;
this.denySettings = deploymentStack.DenySettings;
this.detachedResources = deploymentStack.DetachedResources;
this.deletedResources = deploymentStack.DeletedResources;
diff --git a/src/Resources/Resources.Sdk/Customizations/Models/GenericResource.cs b/src/Resources/Resources.Management.Sdk/Customizations/Models/GenericResource.cs
similarity index 100%
rename from src/Resources/Resources.Sdk/Customizations/Models/GenericResource.cs
rename to src/Resources/Resources.Management.Sdk/Customizations/Models/GenericResource.cs
diff --git a/src/Resources/Resources.Sdk/Customizations/Models/GenericResourceExpanded.cs b/src/Resources/Resources.Management.Sdk/Customizations/Models/GenericResourceExpanded.cs
similarity index 100%
rename from src/Resources/Resources.Sdk/Customizations/Models/GenericResourceExpanded.cs
rename to src/Resources/Resources.Management.Sdk/Customizations/Models/GenericResourceExpanded.cs
diff --git a/src/Resources/Resources.Sdk/Customizations/Models/WhatIfChange.cs b/src/Resources/Resources.Management.Sdk/Customizations/Models/WhatIfChange.cs
similarity index 100%
rename from src/Resources/Resources.Sdk/Customizations/Models/WhatIfChange.cs
rename to src/Resources/Resources.Management.Sdk/Customizations/Models/WhatIfChange.cs
diff --git a/src/Resources/Resources.Sdk/Generated/DeploymentOperations.cs b/src/Resources/Resources.Management.Sdk/Generated/DeploymentOperations.cs
similarity index 56%
rename from src/Resources/Resources.Sdk/Generated/DeploymentOperations.cs
rename to src/Resources/Resources.Management.Sdk/Generated/DeploymentOperations.cs
index 49f47efc6998..dfe9de2b7824 100644
--- a/src/Resources/Resources.Sdk/Generated/DeploymentOperations.cs
+++ b/src/Resources/Resources.Management.Sdk/Generated/DeploymentOperations.cs
@@ -1,31 +1,19 @@
-//
// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for
-// license information.
-//
+// Licensed under the MIT License. See License.txt in the project root for license information.
// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is
-// regenerated.
-//
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
namespace Microsoft.Azure.Management.Resources
{
+ using System.Linq;
using Microsoft.Rest;
using Microsoft.Rest.Azure;
using Models;
- using Newtonsoft.Json;
- using System.Collections;
- using System.Collections.Generic;
- using System.Linq;
- using System.Net;
- using System.Net.Http;
- using System.Threading;
- using System.Threading.Tasks;
///
/// DeploymentOperations operations.
///
- internal partial class DeploymentOperations : IServiceOperations, IDeploymentOperations
+ internal partial class DeploymentOperations : Microsoft.Rest.IServiceOperations, IDeploymentOperations
{
///
/// Initializes a new instance of the DeploymentOperations class.
@@ -36,13 +24,13 @@ internal partial class DeploymentOperations : IServiceOperations
/// Thrown when a required parameter is null
///
- internal DeploymentOperations(ResourceManagementClient client)
+ internal DeploymentOperations (ResourceManagementClient client)
{
- if (client == null)
+ if (client == null)
{
throw new System.ArgumentNullException("client");
}
- Client = client;
+ this.Client = client;
}
///
@@ -68,13 +56,13 @@ internal DeploymentOperations(ResourceManagementClient client)
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
- ///
+ ///
/// Thrown when unable to deserialize the response
///
- ///
+ ///
/// Thrown when a required parameter is null
///
///
@@ -83,87 +71,97 @@ internal DeploymentOperations(ResourceManagementClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task> GetAtScopeWithHttpMessagesAsync(string scope, string deploymentName, string operationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async System.Threading.Tasks.Task> GetAtScopeWithHttpMessagesAsync(string scope, string deploymentName, string operationId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
+
+
+
+
if (scope == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "scope");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "scope");
}
+
if (deploymentName == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "deploymentName");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "deploymentName");
}
if (deploymentName != null)
{
if (deploymentName.Length > 64)
{
- throw new ValidationException(ValidationRules.MaxLength, "deploymentName", 64);
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "deploymentName", 64);
}
if (deploymentName.Length < 1)
{
- throw new ValidationException(ValidationRules.MinLength, "deploymentName", 1);
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "deploymentName", 1);
}
if (!System.Text.RegularExpressions.Regex.IsMatch(deploymentName, "^[-\\w\\._\\(\\)]+$"))
{
- throw new ValidationException(ValidationRules.Pattern, "deploymentName", "^[-\\w\\._\\(\\)]+$");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "deploymentName", "^[-\\w\\._\\(\\)]+$");
}
}
if (operationId == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "operationId");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "operationId");
}
- if (Client.ApiVersion == null)
+
+ if (this.Client.ApiVersion == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion");
}
+
// Tracing
- bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled;
string _invocationId = null;
if (_shouldTrace)
{
- _invocationId = ServiceClientTracing.NextInvocationId.ToString();
- Dictionary tracingParameters = new Dictionary();
+ _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString();
+ System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary();
tracingParameters.Add("scope", scope);
tracingParameters.Add("deploymentName", deploymentName);
tracingParameters.Add("operationId", operationId);
+
+
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "GetAtScope", tracingParameters);
+ Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetAtScope", tracingParameters);
}
// Construct URL
- var _baseUrl = Client.BaseUri.AbsoluteUri;
+
+ var _baseUrl = this.Client.BaseUri.AbsoluteUri;
var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "{scope}/providers/Microsoft.Resources/deployments/{deploymentName}/operations/{operationId}").ToString();
_url = _url.Replace("{scope}", scope);
_url = _url.Replace("{deploymentName}", System.Uri.EscapeDataString(deploymentName));
_url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId));
- List _queryParameters = new List();
- if (Client.ApiVersion != null)
+
+ System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List();
+ if (this.Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
_url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
}
// Create HTTP transport objects
- var _httpRequest = new HttpRequestMessage();
- HttpResponseMessage _httpResponse = null;
- _httpRequest.Method = new HttpMethod("GET");
+ var _httpRequest = new System.Net.Http.HttpRequestMessage();
+ System.Net.Http.HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new System.Net.Http.HttpMethod("GET");
_httpRequest.RequestUri = new System.Uri(_url);
// Set Headers
- if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value)
{
_httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
}
- if (Client.AcceptLanguage != null)
+ if (this.Client.AcceptLanguage != null)
{
if (_httpRequest.Headers.Contains("accept-language"))
{
_httpRequest.Headers.Remove("accept-language");
}
- _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage);
}
-
if (customHeaders != null)
{
foreach(var _header in customHeaders)
@@ -175,55 +173,56 @@ internal DeploymentOperations(ResourceManagementClient client)
_httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
}
}
-
// Serialize Request
string _requestContent = null;
// Set Credentials
- if (Client.Credentials != null)
+ if (this.Client.Credentials != null)
{
cancellationToken.ThrowIfCancellationRequested();
- await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
}
// Send Request
if (_shouldTrace)
{
- ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
}
cancellationToken.ThrowIfCancellationRequested();
- _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
if (_shouldTrace)
{
- ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
}
- HttpStatusCode _statusCode = _httpResponse.StatusCode;
+
+ System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode;
cancellationToken.ThrowIfCancellationRequested();
string _responseContent = null;
+
if ((int)_statusCode != 200)
{
- var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
{
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
if (_errorBody != null)
{
- ex = new CloudException(_errorBody.Message);
+ ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
- catch (JsonException)
+ catch (Newtonsoft.Json.JsonException)
{
// Ignore the exception
}
- ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
- ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent);
if (_httpResponse.Headers.Contains("x-ms-request-id"))
{
ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
}
if (_shouldTrace)
{
- ServiceClientTracing.Error(_invocationId, ex);
+ Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex);
}
_httpRequest.Dispose();
if (_httpResponse != null)
@@ -233,9 +232,10 @@ internal DeploymentOperations(ResourceManagementClient client)
throw ex;
}
// Create Result
- var _result = new AzureOperationResponse();
+ var _result = new Microsoft.Rest.Azure.AzureOperationResponse();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
+
if (_httpResponse.Headers.Contains("x-ms-request-id"))
{
_result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
@@ -246,25 +246,29 @@ internal DeploymentOperations(ResourceManagementClient client)
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
}
- catch (JsonException ex)
+ catch (Newtonsoft.Json.JsonException ex)
{
_httpRequest.Dispose();
if (_httpResponse != null)
{
_httpResponse.Dispose();
}
- throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex);
}
}
if (_shouldTrace)
{
- ServiceClientTracing.Exit(_invocationId, _result);
+ Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result);
}
return _result;
- }
+
+
+
+
+ }
///
/// Gets all deployments operations for a deployment.
///
@@ -283,13 +287,13 @@ internal DeploymentOperations(ResourceManagementClient client)
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
- ///
+ ///
/// Thrown when unable to deserialize the response
///
- ///
+ ///
/// Thrown when a required parameter is null
///
///
@@ -298,86 +302,96 @@ internal DeploymentOperations(ResourceManagementClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task>> ListAtScopeWithHttpMessagesAsync(string scope, string deploymentName, int? top = default(int?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async System.Threading.Tasks.Task>> ListAtScopeWithHttpMessagesAsync(string scope, string deploymentName, int? top = default(int?), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
+
+
+
+
if (scope == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "scope");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "scope");
}
+
if (deploymentName == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "deploymentName");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "deploymentName");
}
if (deploymentName != null)
{
if (deploymentName.Length > 64)
{
- throw new ValidationException(ValidationRules.MaxLength, "deploymentName", 64);
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "deploymentName", 64);
}
if (deploymentName.Length < 1)
{
- throw new ValidationException(ValidationRules.MinLength, "deploymentName", 1);
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "deploymentName", 1);
}
if (!System.Text.RegularExpressions.Regex.IsMatch(deploymentName, "^[-\\w\\._\\(\\)]+$"))
{
- throw new ValidationException(ValidationRules.Pattern, "deploymentName", "^[-\\w\\._\\(\\)]+$");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "deploymentName", "^[-\\w\\._\\(\\)]+$");
}
}
- if (Client.ApiVersion == null)
+
+ if (this.Client.ApiVersion == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion");
}
+
// Tracing
- bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled;
string _invocationId = null;
if (_shouldTrace)
{
- _invocationId = ServiceClientTracing.NextInvocationId.ToString();
- Dictionary tracingParameters = new Dictionary();
+ _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString();
+ System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary();
tracingParameters.Add("scope", scope);
tracingParameters.Add("deploymentName", deploymentName);
tracingParameters.Add("top", top);
+
+
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "ListAtScope", tracingParameters);
+ Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAtScope", tracingParameters);
}
// Construct URL
- var _baseUrl = Client.BaseUri.AbsoluteUri;
+
+ var _baseUrl = this.Client.BaseUri.AbsoluteUri;
var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "{scope}/providers/Microsoft.Resources/deployments/{deploymentName}/operations").ToString();
_url = _url.Replace("{scope}", scope);
_url = _url.Replace("{deploymentName}", System.Uri.EscapeDataString(deploymentName));
- List _queryParameters = new List();
+
+ System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List();
if (top != null)
{
- _queryParameters.Add(string.Format("$top={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(top, Client.SerializationSettings).Trim('"'))));
+ _queryParameters.Add(string.Format("$top={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(top, this.Client.SerializationSettings).Trim('"'))));
}
- if (Client.ApiVersion != null)
+ if (this.Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
_url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
}
// Create HTTP transport objects
- var _httpRequest = new HttpRequestMessage();
- HttpResponseMessage _httpResponse = null;
- _httpRequest.Method = new HttpMethod("GET");
+ var _httpRequest = new System.Net.Http.HttpRequestMessage();
+ System.Net.Http.HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new System.Net.Http.HttpMethod("GET");
_httpRequest.RequestUri = new System.Uri(_url);
// Set Headers
- if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value)
{
_httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
}
- if (Client.AcceptLanguage != null)
+ if (this.Client.AcceptLanguage != null)
{
if (_httpRequest.Headers.Contains("accept-language"))
{
_httpRequest.Headers.Remove("accept-language");
}
- _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage);
}
-
if (customHeaders != null)
{
foreach(var _header in customHeaders)
@@ -389,55 +403,56 @@ internal DeploymentOperations(ResourceManagementClient client)
_httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
}
}
-
// Serialize Request
string _requestContent = null;
// Set Credentials
- if (Client.Credentials != null)
+ if (this.Client.Credentials != null)
{
cancellationToken.ThrowIfCancellationRequested();
- await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
}
// Send Request
if (_shouldTrace)
{
- ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
}
cancellationToken.ThrowIfCancellationRequested();
- _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
if (_shouldTrace)
{
- ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
}
- HttpStatusCode _statusCode = _httpResponse.StatusCode;
+
+ System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode;
cancellationToken.ThrowIfCancellationRequested();
string _responseContent = null;
+
if ((int)_statusCode != 200)
{
- var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
{
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
if (_errorBody != null)
{
- ex = new CloudException(_errorBody.Message);
+ ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
- catch (JsonException)
+ catch (Newtonsoft.Json.JsonException)
{
// Ignore the exception
}
- ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
- ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent);
if (_httpResponse.Headers.Contains("x-ms-request-id"))
{
ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
}
if (_shouldTrace)
{
- ServiceClientTracing.Error(_invocationId, ex);
+ Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex);
}
_httpRequest.Dispose();
if (_httpResponse != null)
@@ -447,9 +462,10 @@ internal DeploymentOperations(ResourceManagementClient client)
throw ex;
}
// Create Result
- var _result = new AzureOperationResponse>();
+ var _result = new Microsoft.Rest.Azure.AzureOperationResponse>();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
+
if (_httpResponse.Headers.Contains("x-ms-request-id"))
{
_result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
@@ -460,25 +476,29 @@ internal DeploymentOperations(ResourceManagementClient client)
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
+ _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings);
}
- catch (JsonException ex)
+ catch (Newtonsoft.Json.JsonException ex)
{
_httpRequest.Dispose();
if (_httpResponse != null)
{
_httpResponse.Dispose();
}
- throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex);
}
}
if (_shouldTrace)
{
- ServiceClientTracing.Exit(_invocationId, _result);
+ Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result);
}
return _result;
- }
+
+
+
+
+ }
///
/// Gets a deployments operation.
///
@@ -494,13 +514,13 @@ internal DeploymentOperations(ResourceManagementClient client)
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
- ///
+ ///
/// Thrown when unable to deserialize the response
///
- ///
+ ///
/// Thrown when a required parameter is null
///
///
@@ -509,81 +529,90 @@ internal DeploymentOperations(ResourceManagementClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task> GetAtTenantScopeWithHttpMessagesAsync(string deploymentName, string operationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async System.Threading.Tasks.Task> GetAtTenantScopeWithHttpMessagesAsync(string deploymentName, string operationId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
+
+
+
+
if (deploymentName == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "deploymentName");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "deploymentName");
}
if (deploymentName != null)
{
if (deploymentName.Length > 64)
{
- throw new ValidationException(ValidationRules.MaxLength, "deploymentName", 64);
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "deploymentName", 64);
}
if (deploymentName.Length < 1)
{
- throw new ValidationException(ValidationRules.MinLength, "deploymentName", 1);
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "deploymentName", 1);
}
if (!System.Text.RegularExpressions.Regex.IsMatch(deploymentName, "^[-\\w\\._\\(\\)]+$"))
{
- throw new ValidationException(ValidationRules.Pattern, "deploymentName", "^[-\\w\\._\\(\\)]+$");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "deploymentName", "^[-\\w\\._\\(\\)]+$");
}
}
if (operationId == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "operationId");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "operationId");
}
- if (Client.ApiVersion == null)
+
+ if (this.Client.ApiVersion == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion");
}
+
// Tracing
- bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled;
string _invocationId = null;
if (_shouldTrace)
{
- _invocationId = ServiceClientTracing.NextInvocationId.ToString();
- Dictionary tracingParameters = new Dictionary();
+ _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString();
+ System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary();
tracingParameters.Add("deploymentName", deploymentName);
tracingParameters.Add("operationId", operationId);
+
+
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "GetAtTenantScope", tracingParameters);
+ Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetAtTenantScope", tracingParameters);
}
// Construct URL
- var _baseUrl = Client.BaseUri.AbsoluteUri;
+
+ var _baseUrl = this.Client.BaseUri.AbsoluteUri;
var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Resources/deployments/{deploymentName}/operations/{operationId}").ToString();
_url = _url.Replace("{deploymentName}", System.Uri.EscapeDataString(deploymentName));
_url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId));
- List _queryParameters = new List();
- if (Client.ApiVersion != null)
+
+ System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List();
+ if (this.Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
_url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
}
// Create HTTP transport objects
- var _httpRequest = new HttpRequestMessage();
- HttpResponseMessage _httpResponse = null;
- _httpRequest.Method = new HttpMethod("GET");
+ var _httpRequest = new System.Net.Http.HttpRequestMessage();
+ System.Net.Http.HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new System.Net.Http.HttpMethod("GET");
_httpRequest.RequestUri = new System.Uri(_url);
// Set Headers
- if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value)
{
_httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
}
- if (Client.AcceptLanguage != null)
+ if (this.Client.AcceptLanguage != null)
{
if (_httpRequest.Headers.Contains("accept-language"))
{
_httpRequest.Headers.Remove("accept-language");
}
- _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage);
}
-
if (customHeaders != null)
{
foreach(var _header in customHeaders)
@@ -595,55 +624,56 @@ internal DeploymentOperations(ResourceManagementClient client)
_httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
}
}
-
// Serialize Request
string _requestContent = null;
// Set Credentials
- if (Client.Credentials != null)
+ if (this.Client.Credentials != null)
{
cancellationToken.ThrowIfCancellationRequested();
- await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
}
// Send Request
if (_shouldTrace)
{
- ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
}
cancellationToken.ThrowIfCancellationRequested();
- _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
if (_shouldTrace)
{
- ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
}
- HttpStatusCode _statusCode = _httpResponse.StatusCode;
+
+ System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode;
cancellationToken.ThrowIfCancellationRequested();
string _responseContent = null;
+
if ((int)_statusCode != 200)
{
- var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
{
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
if (_errorBody != null)
{
- ex = new CloudException(_errorBody.Message);
+ ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
- catch (JsonException)
+ catch (Newtonsoft.Json.JsonException)
{
// Ignore the exception
}
- ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
- ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent);
if (_httpResponse.Headers.Contains("x-ms-request-id"))
{
ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
}
if (_shouldTrace)
{
- ServiceClientTracing.Error(_invocationId, ex);
+ Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex);
}
_httpRequest.Dispose();
if (_httpResponse != null)
@@ -653,9 +683,10 @@ internal DeploymentOperations(ResourceManagementClient client)
throw ex;
}
// Create Result
- var _result = new AzureOperationResponse();
+ var _result = new Microsoft.Rest.Azure.AzureOperationResponse();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
+
if (_httpResponse.Headers.Contains("x-ms-request-id"))
{
_result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
@@ -666,25 +697,29 @@ internal DeploymentOperations(ResourceManagementClient client)
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
}
- catch (JsonException ex)
+ catch (Newtonsoft.Json.JsonException ex)
{
_httpRequest.Dispose();
if (_httpResponse != null)
{
_httpResponse.Dispose();
}
- throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex);
}
}
if (_shouldTrace)
{
- ServiceClientTracing.Exit(_invocationId, _result);
+ Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result);
}
return _result;
- }
+
+
+
+
+ }
///
/// Gets all deployments operations for a deployment.
///
@@ -700,13 +735,13 @@ internal DeploymentOperations(ResourceManagementClient client)
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
- ///
+ ///
/// Thrown when unable to deserialize the response
///
- ///
+ ///
/// Thrown when a required parameter is null
///
///
@@ -715,80 +750,89 @@ internal DeploymentOperations(ResourceManagementClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task>> ListAtTenantScopeWithHttpMessagesAsync(string deploymentName, int? top = default(int?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async System.Threading.Tasks.Task>> ListAtTenantScopeWithHttpMessagesAsync(string deploymentName, int? top = default(int?), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
+
+
+
+
if (deploymentName == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "deploymentName");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "deploymentName");
}
if (deploymentName != null)
{
if (deploymentName.Length > 64)
{
- throw new ValidationException(ValidationRules.MaxLength, "deploymentName", 64);
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "deploymentName", 64);
}
if (deploymentName.Length < 1)
{
- throw new ValidationException(ValidationRules.MinLength, "deploymentName", 1);
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "deploymentName", 1);
}
if (!System.Text.RegularExpressions.Regex.IsMatch(deploymentName, "^[-\\w\\._\\(\\)]+$"))
{
- throw new ValidationException(ValidationRules.Pattern, "deploymentName", "^[-\\w\\._\\(\\)]+$");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "deploymentName", "^[-\\w\\._\\(\\)]+$");
}
}
- if (Client.ApiVersion == null)
+
+ if (this.Client.ApiVersion == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion");
}
+
// Tracing
- bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled;
string _invocationId = null;
if (_shouldTrace)
{
- _invocationId = ServiceClientTracing.NextInvocationId.ToString();
- Dictionary tracingParameters = new Dictionary();
+ _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString();
+ System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary();
tracingParameters.Add("deploymentName", deploymentName);
tracingParameters.Add("top", top);
+
+
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "ListAtTenantScope", tracingParameters);
+ Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAtTenantScope", tracingParameters);
}
// Construct URL
- var _baseUrl = Client.BaseUri.AbsoluteUri;
+
+ var _baseUrl = this.Client.BaseUri.AbsoluteUri;
var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Resources/deployments/{deploymentName}/operations").ToString();
_url = _url.Replace("{deploymentName}", System.Uri.EscapeDataString(deploymentName));
- List _queryParameters = new List();
+
+ System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List();
if (top != null)
{
- _queryParameters.Add(string.Format("$top={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(top, Client.SerializationSettings).Trim('"'))));
+ _queryParameters.Add(string.Format("$top={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(top, this.Client.SerializationSettings).Trim('"'))));
}
- if (Client.ApiVersion != null)
+ if (this.Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
_url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
}
// Create HTTP transport objects
- var _httpRequest = new HttpRequestMessage();
- HttpResponseMessage _httpResponse = null;
- _httpRequest.Method = new HttpMethod("GET");
+ var _httpRequest = new System.Net.Http.HttpRequestMessage();
+ System.Net.Http.HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new System.Net.Http.HttpMethod("GET");
_httpRequest.RequestUri = new System.Uri(_url);
// Set Headers
- if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value)
{
_httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
}
- if (Client.AcceptLanguage != null)
+ if (this.Client.AcceptLanguage != null)
{
if (_httpRequest.Headers.Contains("accept-language"))
{
_httpRequest.Headers.Remove("accept-language");
}
- _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage);
}
-
if (customHeaders != null)
{
foreach(var _header in customHeaders)
@@ -800,55 +844,56 @@ internal DeploymentOperations(ResourceManagementClient client)
_httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
}
}
-
// Serialize Request
string _requestContent = null;
// Set Credentials
- if (Client.Credentials != null)
+ if (this.Client.Credentials != null)
{
cancellationToken.ThrowIfCancellationRequested();
- await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
}
// Send Request
if (_shouldTrace)
{
- ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
}
cancellationToken.ThrowIfCancellationRequested();
- _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
if (_shouldTrace)
{
- ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
}
- HttpStatusCode _statusCode = _httpResponse.StatusCode;
+
+ System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode;
cancellationToken.ThrowIfCancellationRequested();
string _responseContent = null;
+
if ((int)_statusCode != 200)
{
- var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
{
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
if (_errorBody != null)
{
- ex = new CloudException(_errorBody.Message);
+ ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
- catch (JsonException)
+ catch (Newtonsoft.Json.JsonException)
{
// Ignore the exception
}
- ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
- ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent);
if (_httpResponse.Headers.Contains("x-ms-request-id"))
{
ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
}
if (_shouldTrace)
{
- ServiceClientTracing.Error(_invocationId, ex);
+ Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex);
}
_httpRequest.Dispose();
if (_httpResponse != null)
@@ -858,9 +903,10 @@ internal DeploymentOperations(ResourceManagementClient client)
throw ex;
}
// Create Result
- var _result = new AzureOperationResponse>();
+ var _result = new Microsoft.Rest.Azure.AzureOperationResponse>();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
+
if (_httpResponse.Headers.Contains("x-ms-request-id"))
{
_result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
@@ -871,25 +917,29 @@ internal DeploymentOperations(ResourceManagementClient client)
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
+ _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings);
}
- catch (JsonException ex)
+ catch (Newtonsoft.Json.JsonException ex)
{
_httpRequest.Dispose();
if (_httpResponse != null)
{
_httpResponse.Dispose();
}
- throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex);
}
}
if (_shouldTrace)
{
- ServiceClientTracing.Exit(_invocationId, _result);
+ Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result);
}
return _result;
- }
+
+
+
+
+ }
///
/// Gets a deployments operation.
///
@@ -908,13 +958,13 @@ internal DeploymentOperations(ResourceManagementClient client)
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
- ///
+ ///
/// Thrown when unable to deserialize the response
///
- ///
+ ///
/// Thrown when a required parameter is null
///
///
@@ -923,98 +973,107 @@ internal DeploymentOperations(ResourceManagementClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task> GetAtManagementGroupScopeWithHttpMessagesAsync(string groupId, string deploymentName, string operationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async System.Threading.Tasks.Task> GetAtManagementGroupScopeWithHttpMessagesAsync(string groupId, string deploymentName, string operationId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
+
+
+
+
if (groupId == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "groupId");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "groupId");
}
if (groupId != null)
{
if (groupId.Length > 90)
{
- throw new ValidationException(ValidationRules.MaxLength, "groupId", 90);
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "groupId", 90);
}
if (groupId.Length < 1)
{
- throw new ValidationException(ValidationRules.MinLength, "groupId", 1);
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "groupId", 1);
}
}
if (deploymentName == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "deploymentName");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "deploymentName");
}
if (deploymentName != null)
{
if (deploymentName.Length > 64)
{
- throw new ValidationException(ValidationRules.MaxLength, "deploymentName", 64);
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "deploymentName", 64);
}
if (deploymentName.Length < 1)
{
- throw new ValidationException(ValidationRules.MinLength, "deploymentName", 1);
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "deploymentName", 1);
}
if (!System.Text.RegularExpressions.Regex.IsMatch(deploymentName, "^[-\\w\\._\\(\\)]+$"))
{
- throw new ValidationException(ValidationRules.Pattern, "deploymentName", "^[-\\w\\._\\(\\)]+$");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "deploymentName", "^[-\\w\\._\\(\\)]+$");
}
}
if (operationId == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "operationId");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "operationId");
}
- if (Client.ApiVersion == null)
+
+ if (this.Client.ApiVersion == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion");
}
+
// Tracing
- bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled;
string _invocationId = null;
if (_shouldTrace)
{
- _invocationId = ServiceClientTracing.NextInvocationId.ToString();
- Dictionary tracingParameters = new Dictionary();
+ _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString();
+ System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary();
tracingParameters.Add("groupId", groupId);
tracingParameters.Add("deploymentName", deploymentName);
tracingParameters.Add("operationId", operationId);
+
+
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "GetAtManagementGroupScope", tracingParameters);
+ Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetAtManagementGroupScope", tracingParameters);
}
// Construct URL
- var _baseUrl = Client.BaseUri.AbsoluteUri;
+
+ var _baseUrl = this.Client.BaseUri.AbsoluteUri;
var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}/operations/{operationId}").ToString();
_url = _url.Replace("{groupId}", System.Uri.EscapeDataString(groupId));
_url = _url.Replace("{deploymentName}", System.Uri.EscapeDataString(deploymentName));
_url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId));
- List _queryParameters = new List();
- if (Client.ApiVersion != null)
+
+ System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List();
+ if (this.Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
_url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
}
// Create HTTP transport objects
- var _httpRequest = new HttpRequestMessage();
- HttpResponseMessage _httpResponse = null;
- _httpRequest.Method = new HttpMethod("GET");
+ var _httpRequest = new System.Net.Http.HttpRequestMessage();
+ System.Net.Http.HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new System.Net.Http.HttpMethod("GET");
_httpRequest.RequestUri = new System.Uri(_url);
// Set Headers
- if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value)
{
_httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
}
- if (Client.AcceptLanguage != null)
+ if (this.Client.AcceptLanguage != null)
{
if (_httpRequest.Headers.Contains("accept-language"))
{
_httpRequest.Headers.Remove("accept-language");
}
- _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage);
}
-
if (customHeaders != null)
{
foreach(var _header in customHeaders)
@@ -1026,55 +1085,56 @@ internal DeploymentOperations(ResourceManagementClient client)
_httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
}
}
-
// Serialize Request
string _requestContent = null;
// Set Credentials
- if (Client.Credentials != null)
+ if (this.Client.Credentials != null)
{
cancellationToken.ThrowIfCancellationRequested();
- await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
}
// Send Request
if (_shouldTrace)
{
- ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
}
cancellationToken.ThrowIfCancellationRequested();
- _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
if (_shouldTrace)
{
- ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
}
- HttpStatusCode _statusCode = _httpResponse.StatusCode;
+
+ System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode;
cancellationToken.ThrowIfCancellationRequested();
string _responseContent = null;
+
if ((int)_statusCode != 200)
{
- var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
{
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
if (_errorBody != null)
{
- ex = new CloudException(_errorBody.Message);
+ ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
- catch (JsonException)
+ catch (Newtonsoft.Json.JsonException)
{
// Ignore the exception
}
- ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
- ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent);
if (_httpResponse.Headers.Contains("x-ms-request-id"))
{
ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
}
if (_shouldTrace)
{
- ServiceClientTracing.Error(_invocationId, ex);
+ Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex);
}
_httpRequest.Dispose();
if (_httpResponse != null)
@@ -1084,9 +1144,10 @@ internal DeploymentOperations(ResourceManagementClient client)
throw ex;
}
// Create Result
- var _result = new AzureOperationResponse();
+ var _result = new Microsoft.Rest.Azure.AzureOperationResponse();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
+
if (_httpResponse.Headers.Contains("x-ms-request-id"))
{
_result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
@@ -1097,25 +1158,29 @@ internal DeploymentOperations(ResourceManagementClient client)
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
}
- catch (JsonException ex)
+ catch (Newtonsoft.Json.JsonException ex)
{
_httpRequest.Dispose();
if (_httpResponse != null)
{
_httpResponse.Dispose();
}
- throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex);
}
}
if (_shouldTrace)
{
- ServiceClientTracing.Exit(_invocationId, _result);
+ Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result);
}
return _result;
- }
+
+
+
+
+ }
///
/// Gets all deployments operations for a deployment.
///
@@ -1134,13 +1199,13 @@ internal DeploymentOperations(ResourceManagementClient client)
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
- ///
+ ///
/// Thrown when unable to deserialize the response
///
- ///
+ ///
/// Thrown when a required parameter is null
///
///
@@ -1149,97 +1214,106 @@ internal DeploymentOperations(ResourceManagementClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task>> ListAtManagementGroupScopeWithHttpMessagesAsync(string groupId, string deploymentName, int? top = default(int?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async System.Threading.Tasks.Task>> ListAtManagementGroupScopeWithHttpMessagesAsync(string groupId, string deploymentName, int? top = default(int?), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
+
+
+
+
if (groupId == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "groupId");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "groupId");
}
if (groupId != null)
{
if (groupId.Length > 90)
{
- throw new ValidationException(ValidationRules.MaxLength, "groupId", 90);
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "groupId", 90);
}
if (groupId.Length < 1)
{
- throw new ValidationException(ValidationRules.MinLength, "groupId", 1);
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "groupId", 1);
}
}
if (deploymentName == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "deploymentName");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "deploymentName");
}
if (deploymentName != null)
{
if (deploymentName.Length > 64)
{
- throw new ValidationException(ValidationRules.MaxLength, "deploymentName", 64);
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "deploymentName", 64);
}
if (deploymentName.Length < 1)
{
- throw new ValidationException(ValidationRules.MinLength, "deploymentName", 1);
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "deploymentName", 1);
}
if (!System.Text.RegularExpressions.Regex.IsMatch(deploymentName, "^[-\\w\\._\\(\\)]+$"))
{
- throw new ValidationException(ValidationRules.Pattern, "deploymentName", "^[-\\w\\._\\(\\)]+$");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "deploymentName", "^[-\\w\\._\\(\\)]+$");
}
}
- if (Client.ApiVersion == null)
+
+ if (this.Client.ApiVersion == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion");
}
+
// Tracing
- bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled;
string _invocationId = null;
if (_shouldTrace)
{
- _invocationId = ServiceClientTracing.NextInvocationId.ToString();
- Dictionary tracingParameters = new Dictionary();
+ _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString();
+ System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary();
tracingParameters.Add("groupId", groupId);
tracingParameters.Add("deploymentName", deploymentName);
tracingParameters.Add("top", top);
+
+
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "ListAtManagementGroupScope", tracingParameters);
+ Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAtManagementGroupScope", tracingParameters);
}
// Construct URL
- var _baseUrl = Client.BaseUri.AbsoluteUri;
+
+ var _baseUrl = this.Client.BaseUri.AbsoluteUri;
var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}/operations").ToString();
_url = _url.Replace("{groupId}", System.Uri.EscapeDataString(groupId));
_url = _url.Replace("{deploymentName}", System.Uri.EscapeDataString(deploymentName));
- List _queryParameters = new List();
+
+ System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List();
if (top != null)
{
- _queryParameters.Add(string.Format("$top={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(top, Client.SerializationSettings).Trim('"'))));
+ _queryParameters.Add(string.Format("$top={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(top, this.Client.SerializationSettings).Trim('"'))));
}
- if (Client.ApiVersion != null)
+ if (this.Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
_url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
}
// Create HTTP transport objects
- var _httpRequest = new HttpRequestMessage();
- HttpResponseMessage _httpResponse = null;
- _httpRequest.Method = new HttpMethod("GET");
+ var _httpRequest = new System.Net.Http.HttpRequestMessage();
+ System.Net.Http.HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new System.Net.Http.HttpMethod("GET");
_httpRequest.RequestUri = new System.Uri(_url);
// Set Headers
- if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value)
{
_httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
}
- if (Client.AcceptLanguage != null)
+ if (this.Client.AcceptLanguage != null)
{
if (_httpRequest.Headers.Contains("accept-language"))
{
_httpRequest.Headers.Remove("accept-language");
}
- _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage);
}
-
if (customHeaders != null)
{
foreach(var _header in customHeaders)
@@ -1251,55 +1325,56 @@ internal DeploymentOperations(ResourceManagementClient client)
_httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
}
}
-
// Serialize Request
string _requestContent = null;
// Set Credentials
- if (Client.Credentials != null)
+ if (this.Client.Credentials != null)
{
cancellationToken.ThrowIfCancellationRequested();
- await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
}
// Send Request
if (_shouldTrace)
{
- ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
}
cancellationToken.ThrowIfCancellationRequested();
- _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
if (_shouldTrace)
{
- ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
}
- HttpStatusCode _statusCode = _httpResponse.StatusCode;
+
+ System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode;
cancellationToken.ThrowIfCancellationRequested();
string _responseContent = null;
+
if ((int)_statusCode != 200)
{
- var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
{
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
if (_errorBody != null)
{
- ex = new CloudException(_errorBody.Message);
+ ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
- catch (JsonException)
+ catch (Newtonsoft.Json.JsonException)
{
// Ignore the exception
}
- ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
- ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent);
if (_httpResponse.Headers.Contains("x-ms-request-id"))
{
ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
}
if (_shouldTrace)
{
- ServiceClientTracing.Error(_invocationId, ex);
+ Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex);
}
_httpRequest.Dispose();
if (_httpResponse != null)
@@ -1309,9 +1384,10 @@ internal DeploymentOperations(ResourceManagementClient client)
throw ex;
}
// Create Result
- var _result = new AzureOperationResponse>();
+ var _result = new Microsoft.Rest.Azure.AzureOperationResponse>();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
+
if (_httpResponse.Headers.Contains("x-ms-request-id"))
{
_result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
@@ -1322,25 +1398,29 @@ internal DeploymentOperations(ResourceManagementClient client)
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
+ _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings);
}
- catch (JsonException ex)
+ catch (Newtonsoft.Json.JsonException ex)
{
_httpRequest.Dispose();
if (_httpResponse != null)
{
_httpResponse.Dispose();
}
- throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex);
}
}
if (_shouldTrace)
{
- ServiceClientTracing.Exit(_invocationId, _result);
+ Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result);
}
return _result;
- }
+
+
+
+
+ }
///
/// Gets a deployments operation.
///
@@ -1356,13 +1436,13 @@ internal DeploymentOperations(ResourceManagementClient client)
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
- ///
+ ///
/// Thrown when unable to deserialize the response
///
- ///
+ ///
/// Thrown when a required parameter is null
///
///
@@ -1371,86 +1451,96 @@ internal DeploymentOperations(ResourceManagementClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task> GetAtSubscriptionScopeWithHttpMessagesAsync(string deploymentName, string operationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async System.Threading.Tasks.Task> GetAtSubscriptionScopeWithHttpMessagesAsync(string deploymentName, string operationId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
+
+
+
+
if (deploymentName == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "deploymentName");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "deploymentName");
}
if (deploymentName != null)
{
if (deploymentName.Length > 64)
{
- throw new ValidationException(ValidationRules.MaxLength, "deploymentName", 64);
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "deploymentName", 64);
}
if (deploymentName.Length < 1)
{
- throw new ValidationException(ValidationRules.MinLength, "deploymentName", 1);
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "deploymentName", 1);
}
if (!System.Text.RegularExpressions.Regex.IsMatch(deploymentName, "^[-\\w\\._\\(\\)]+$"))
{
- throw new ValidationException(ValidationRules.Pattern, "deploymentName", "^[-\\w\\._\\(\\)]+$");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "deploymentName", "^[-\\w\\._\\(\\)]+$");
}
}
if (operationId == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "operationId");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "operationId");
}
- if (Client.ApiVersion == null)
+
+ if (this.Client.ApiVersion == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion");
}
- if (Client.SubscriptionId == null)
+
+ if (this.Client.SubscriptionId == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
+
// Tracing
- bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled;
string _invocationId = null;
if (_shouldTrace)
{
- _invocationId = ServiceClientTracing.NextInvocationId.ToString();
- Dictionary tracingParameters = new Dictionary();
+ _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString();
+ System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary();
tracingParameters.Add("deploymentName", deploymentName);
tracingParameters.Add("operationId", operationId);
+
+
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "GetAtSubscriptionScope", tracingParameters);
+ Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetAtSubscriptionScope", tracingParameters);
}
// Construct URL
- var _baseUrl = Client.BaseUri.AbsoluteUri;
+
+ var _baseUrl = this.Client.BaseUri.AbsoluteUri;
var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/operations/{operationId}").ToString();
_url = _url.Replace("{deploymentName}", System.Uri.EscapeDataString(deploymentName));
_url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId));
- _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
- List _queryParameters = new List();
- if (Client.ApiVersion != null)
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId));
+
+ System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List();
+ if (this.Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
_url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
}
// Create HTTP transport objects
- var _httpRequest = new HttpRequestMessage();
- HttpResponseMessage _httpResponse = null;
- _httpRequest.Method = new HttpMethod("GET");
+ var _httpRequest = new System.Net.Http.HttpRequestMessage();
+ System.Net.Http.HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new System.Net.Http.HttpMethod("GET");
_httpRequest.RequestUri = new System.Uri(_url);
// Set Headers
- if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value)
{
_httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
}
- if (Client.AcceptLanguage != null)
+ if (this.Client.AcceptLanguage != null)
{
if (_httpRequest.Headers.Contains("accept-language"))
{
_httpRequest.Headers.Remove("accept-language");
}
- _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage);
}
-
if (customHeaders != null)
{
foreach(var _header in customHeaders)
@@ -1462,55 +1552,56 @@ internal DeploymentOperations(ResourceManagementClient client)
_httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
}
}
-
// Serialize Request
string _requestContent = null;
// Set Credentials
- if (Client.Credentials != null)
+ if (this.Client.Credentials != null)
{
cancellationToken.ThrowIfCancellationRequested();
- await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
}
// Send Request
if (_shouldTrace)
{
- ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
}
cancellationToken.ThrowIfCancellationRequested();
- _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
if (_shouldTrace)
{
- ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
}
- HttpStatusCode _statusCode = _httpResponse.StatusCode;
+
+ System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode;
cancellationToken.ThrowIfCancellationRequested();
string _responseContent = null;
+
if ((int)_statusCode != 200)
{
- var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
{
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
if (_errorBody != null)
{
- ex = new CloudException(_errorBody.Message);
+ ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
- catch (JsonException)
+ catch (Newtonsoft.Json.JsonException)
{
// Ignore the exception
}
- ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
- ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent);
if (_httpResponse.Headers.Contains("x-ms-request-id"))
{
ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
}
if (_shouldTrace)
{
- ServiceClientTracing.Error(_invocationId, ex);
+ Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex);
}
_httpRequest.Dispose();
if (_httpResponse != null)
@@ -1520,9 +1611,10 @@ internal DeploymentOperations(ResourceManagementClient client)
throw ex;
}
// Create Result
- var _result = new AzureOperationResponse();
+ var _result = new Microsoft.Rest.Azure.AzureOperationResponse();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
+
if (_httpResponse.Headers.Contains("x-ms-request-id"))
{
_result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
@@ -1533,25 +1625,29 @@ internal DeploymentOperations(ResourceManagementClient client)
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
}
- catch (JsonException ex)
+ catch (Newtonsoft.Json.JsonException ex)
{
_httpRequest.Dispose();
if (_httpResponse != null)
{
_httpResponse.Dispose();
}
- throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex);
}
}
if (_shouldTrace)
{
- ServiceClientTracing.Exit(_invocationId, _result);
+ Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result);
}
return _result;
- }
+
+
+
+
+ }
///
/// Gets all deployments operations for a deployment.
///
@@ -1567,13 +1663,13 @@ internal DeploymentOperations(ResourceManagementClient client)
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
- ///
+ ///
/// Thrown when unable to deserialize the response
///
- ///
+ ///
/// Thrown when a required parameter is null
///
///
@@ -1582,85 +1678,95 @@ internal DeploymentOperations(ResourceManagementClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task>> ListAtSubscriptionScopeWithHttpMessagesAsync(string deploymentName, int? top = default(int?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async System.Threading.Tasks.Task>> ListAtSubscriptionScopeWithHttpMessagesAsync(string deploymentName, int? top = default(int?), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
+
+
+
+
if (deploymentName == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "deploymentName");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "deploymentName");
}
if (deploymentName != null)
{
if (deploymentName.Length > 64)
{
- throw new ValidationException(ValidationRules.MaxLength, "deploymentName", 64);
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "deploymentName", 64);
}
if (deploymentName.Length < 1)
{
- throw new ValidationException(ValidationRules.MinLength, "deploymentName", 1);
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "deploymentName", 1);
}
if (!System.Text.RegularExpressions.Regex.IsMatch(deploymentName, "^[-\\w\\._\\(\\)]+$"))
{
- throw new ValidationException(ValidationRules.Pattern, "deploymentName", "^[-\\w\\._\\(\\)]+$");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "deploymentName", "^[-\\w\\._\\(\\)]+$");
}
}
- if (Client.ApiVersion == null)
+
+ if (this.Client.ApiVersion == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion");
}
- if (Client.SubscriptionId == null)
+
+ if (this.Client.SubscriptionId == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
+
// Tracing
- bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled;
string _invocationId = null;
if (_shouldTrace)
{
- _invocationId = ServiceClientTracing.NextInvocationId.ToString();
- Dictionary tracingParameters = new Dictionary();
+ _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString();
+ System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary();
tracingParameters.Add("deploymentName", deploymentName);
tracingParameters.Add("top", top);
+
+
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "ListAtSubscriptionScope", tracingParameters);
+ Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAtSubscriptionScope", tracingParameters);
}
// Construct URL
- var _baseUrl = Client.BaseUri.AbsoluteUri;
+
+ var _baseUrl = this.Client.BaseUri.AbsoluteUri;
var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/operations").ToString();
_url = _url.Replace("{deploymentName}", System.Uri.EscapeDataString(deploymentName));
- _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
- List _queryParameters = new List();
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId));
+
+ System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List();
if (top != null)
{
- _queryParameters.Add(string.Format("$top={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(top, Client.SerializationSettings).Trim('"'))));
+ _queryParameters.Add(string.Format("$top={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(top, this.Client.SerializationSettings).Trim('"'))));
}
- if (Client.ApiVersion != null)
+ if (this.Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
_url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
}
// Create HTTP transport objects
- var _httpRequest = new HttpRequestMessage();
- HttpResponseMessage _httpResponse = null;
- _httpRequest.Method = new HttpMethod("GET");
+ var _httpRequest = new System.Net.Http.HttpRequestMessage();
+ System.Net.Http.HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new System.Net.Http.HttpMethod("GET");
_httpRequest.RequestUri = new System.Uri(_url);
// Set Headers
- if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value)
{
_httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
}
- if (Client.AcceptLanguage != null)
+ if (this.Client.AcceptLanguage != null)
{
if (_httpRequest.Headers.Contains("accept-language"))
{
_httpRequest.Headers.Remove("accept-language");
}
- _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage);
}
-
if (customHeaders != null)
{
foreach(var _header in customHeaders)
@@ -1672,55 +1778,56 @@ internal DeploymentOperations(ResourceManagementClient client)
_httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
}
}
-
// Serialize Request
string _requestContent = null;
// Set Credentials
- if (Client.Credentials != null)
+ if (this.Client.Credentials != null)
{
cancellationToken.ThrowIfCancellationRequested();
- await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
}
// Send Request
if (_shouldTrace)
{
- ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
}
cancellationToken.ThrowIfCancellationRequested();
- _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
if (_shouldTrace)
{
- ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
}
- HttpStatusCode _statusCode = _httpResponse.StatusCode;
+
+ System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode;
cancellationToken.ThrowIfCancellationRequested();
string _responseContent = null;
+
if ((int)_statusCode != 200)
{
- var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
{
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
if (_errorBody != null)
{
- ex = new CloudException(_errorBody.Message);
+ ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
- catch (JsonException)
+ catch (Newtonsoft.Json.JsonException)
{
// Ignore the exception
}
- ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
- ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent);
if (_httpResponse.Headers.Contains("x-ms-request-id"))
{
ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
}
if (_shouldTrace)
{
- ServiceClientTracing.Error(_invocationId, ex);
+ Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex);
}
_httpRequest.Dispose();
if (_httpResponse != null)
@@ -1730,9 +1837,10 @@ internal DeploymentOperations(ResourceManagementClient client)
throw ex;
}
// Create Result
- var _result = new AzureOperationResponse>();
+ var _result = new Microsoft.Rest.Azure.AzureOperationResponse>();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
+
if (_httpResponse.Headers.Contains("x-ms-request-id"))
{
_result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
@@ -1743,25 +1851,29 @@ internal DeploymentOperations(ResourceManagementClient client)
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
+ _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings);
}
- catch (JsonException ex)
+ catch (Newtonsoft.Json.JsonException ex)
{
_httpRequest.Dispose();
if (_httpResponse != null)
{
_httpResponse.Dispose();
}
- throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex);
}
}
if (_shouldTrace)
{
- ServiceClientTracing.Exit(_invocationId, _result);
+ Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result);
}
return _result;
- }
+
+
+
+
+ }
///
/// Gets a deployments operation.
///
@@ -1780,13 +1892,13 @@ internal DeploymentOperations(ResourceManagementClient client)
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
- ///
+ ///
/// Thrown when unable to deserialize the response
///
- ///
+ ///
/// Thrown when a required parameter is null
///
///
@@ -1795,107 +1907,117 @@ internal DeploymentOperations(ResourceManagementClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string deploymentName, string operationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string deploymentName, string operationId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
+
+
+
+
if (resourceGroupName == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName");
}
if (resourceGroupName != null)
{
if (resourceGroupName.Length > 90)
{
- throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90);
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90);
}
if (resourceGroupName.Length < 1)
{
- throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1);
}
if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
{
- throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
}
}
if (deploymentName == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "deploymentName");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "deploymentName");
}
if (deploymentName != null)
{
if (deploymentName.Length > 64)
{
- throw new ValidationException(ValidationRules.MaxLength, "deploymentName", 64);
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "deploymentName", 64);
}
if (deploymentName.Length < 1)
{
- throw new ValidationException(ValidationRules.MinLength, "deploymentName", 1);
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "deploymentName", 1);
}
if (!System.Text.RegularExpressions.Regex.IsMatch(deploymentName, "^[-\\w\\._\\(\\)]+$"))
{
- throw new ValidationException(ValidationRules.Pattern, "deploymentName", "^[-\\w\\._\\(\\)]+$");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "deploymentName", "^[-\\w\\._\\(\\)]+$");
}
}
if (operationId == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "operationId");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "operationId");
}
- if (Client.ApiVersion == null)
+
+ if (this.Client.ApiVersion == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion");
}
- if (Client.SubscriptionId == null)
+
+ if (this.Client.SubscriptionId == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
+
// Tracing
- bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled;
string _invocationId = null;
if (_shouldTrace)
{
- _invocationId = ServiceClientTracing.NextInvocationId.ToString();
- Dictionary tracingParameters = new Dictionary();
+ _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString();
+ System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary();
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("deploymentName", deploymentName);
tracingParameters.Add("operationId", operationId);
+
+
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters);
+ Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters);
}
// Construct URL
- var _baseUrl = Client.BaseUri.AbsoluteUri;
+
+ var _baseUrl = this.Client.BaseUri.AbsoluteUri;
var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/deployments/{deploymentName}/operations/{operationId}").ToString();
_url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
_url = _url.Replace("{deploymentName}", System.Uri.EscapeDataString(deploymentName));
_url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId));
- _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
- List _queryParameters = new List();
- if (Client.ApiVersion != null)
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId));
+
+ System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List();
+ if (this.Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
_url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
}
// Create HTTP transport objects
- var _httpRequest = new HttpRequestMessage();
- HttpResponseMessage _httpResponse = null;
- _httpRequest.Method = new HttpMethod("GET");
+ var _httpRequest = new System.Net.Http.HttpRequestMessage();
+ System.Net.Http.HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new System.Net.Http.HttpMethod("GET");
_httpRequest.RequestUri = new System.Uri(_url);
// Set Headers
- if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value)
{
_httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
}
- if (Client.AcceptLanguage != null)
+ if (this.Client.AcceptLanguage != null)
{
if (_httpRequest.Headers.Contains("accept-language"))
{
_httpRequest.Headers.Remove("accept-language");
}
- _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage);
}
-
if (customHeaders != null)
{
foreach(var _header in customHeaders)
@@ -1907,55 +2029,56 @@ internal DeploymentOperations(ResourceManagementClient client)
_httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
}
}
-
// Serialize Request
string _requestContent = null;
// Set Credentials
- if (Client.Credentials != null)
+ if (this.Client.Credentials != null)
{
cancellationToken.ThrowIfCancellationRequested();
- await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
}
// Send Request
if (_shouldTrace)
{
- ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
}
cancellationToken.ThrowIfCancellationRequested();
- _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
if (_shouldTrace)
{
- ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
}
- HttpStatusCode _statusCode = _httpResponse.StatusCode;
+
+ System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode;
cancellationToken.ThrowIfCancellationRequested();
string _responseContent = null;
+
if ((int)_statusCode != 200)
{
- var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
{
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
if (_errorBody != null)
{
- ex = new CloudException(_errorBody.Message);
+ ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
- catch (JsonException)
+ catch (Newtonsoft.Json.JsonException)
{
// Ignore the exception
}
- ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
- ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent);
if (_httpResponse.Headers.Contains("x-ms-request-id"))
{
ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
}
if (_shouldTrace)
{
- ServiceClientTracing.Error(_invocationId, ex);
+ Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex);
}
_httpRequest.Dispose();
if (_httpResponse != null)
@@ -1965,9 +2088,10 @@ internal DeploymentOperations(ResourceManagementClient client)
throw ex;
}
// Create Result
- var _result = new AzureOperationResponse();
+ var _result = new Microsoft.Rest.Azure.AzureOperationResponse();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
+
if (_httpResponse.Headers.Contains("x-ms-request-id"))
{
_result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
@@ -1978,25 +2102,29 @@ internal DeploymentOperations(ResourceManagementClient client)
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
}
- catch (JsonException ex)
+ catch (Newtonsoft.Json.JsonException ex)
{
_httpRequest.Dispose();
if (_httpResponse != null)
{
_httpResponse.Dispose();
}
- throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex);
}
}
if (_shouldTrace)
{
- ServiceClientTracing.Exit(_invocationId, _result);
+ Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result);
}
return _result;
- }
+
+
+
+
+ }
///
/// Gets all deployments operations for a deployment.
///
@@ -2015,13 +2143,13 @@ internal DeploymentOperations(ResourceManagementClient client)
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
- ///
+ ///
/// Thrown when unable to deserialize the response
///
- ///
+ ///
/// Thrown when a required parameter is null
///
///
@@ -2030,106 +2158,116 @@ internal DeploymentOperations(ResourceManagementClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string deploymentName, int? top = default(int?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string deploymentName, int? top = default(int?), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
+
+
+
+
if (resourceGroupName == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName");
}
if (resourceGroupName != null)
{
if (resourceGroupName.Length > 90)
{
- throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90);
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90);
}
if (resourceGroupName.Length < 1)
{
- throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1);
}
if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
{
- throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
}
}
if (deploymentName == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "deploymentName");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "deploymentName");
}
if (deploymentName != null)
{
if (deploymentName.Length > 64)
{
- throw new ValidationException(ValidationRules.MaxLength, "deploymentName", 64);
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "deploymentName", 64);
}
if (deploymentName.Length < 1)
{
- throw new ValidationException(ValidationRules.MinLength, "deploymentName", 1);
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "deploymentName", 1);
}
if (!System.Text.RegularExpressions.Regex.IsMatch(deploymentName, "^[-\\w\\._\\(\\)]+$"))
{
- throw new ValidationException(ValidationRules.Pattern, "deploymentName", "^[-\\w\\._\\(\\)]+$");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "deploymentName", "^[-\\w\\._\\(\\)]+$");
}
}
- if (Client.ApiVersion == null)
+
+ if (this.Client.ApiVersion == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion");
}
- if (Client.SubscriptionId == null)
+
+ if (this.Client.SubscriptionId == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
+
// Tracing
- bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled;
string _invocationId = null;
if (_shouldTrace)
{
- _invocationId = ServiceClientTracing.NextInvocationId.ToString();
- Dictionary tracingParameters = new Dictionary();
+ _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString();
+ System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary();
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("deploymentName", deploymentName);
tracingParameters.Add("top", top);
+
+
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters);
+ Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters);
}
// Construct URL
- var _baseUrl = Client.BaseUri.AbsoluteUri;
+
+ var _baseUrl = this.Client.BaseUri.AbsoluteUri;
var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/deployments/{deploymentName}/operations").ToString();
_url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
_url = _url.Replace("{deploymentName}", System.Uri.EscapeDataString(deploymentName));
- _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
- List _queryParameters = new List();
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId));
+
+ System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List();
if (top != null)
{
- _queryParameters.Add(string.Format("$top={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(top, Client.SerializationSettings).Trim('"'))));
+ _queryParameters.Add(string.Format("$top={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(top, this.Client.SerializationSettings).Trim('"'))));
}
- if (Client.ApiVersion != null)
+ if (this.Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
_url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
}
// Create HTTP transport objects
- var _httpRequest = new HttpRequestMessage();
- HttpResponseMessage _httpResponse = null;
- _httpRequest.Method = new HttpMethod("GET");
+ var _httpRequest = new System.Net.Http.HttpRequestMessage();
+ System.Net.Http.HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new System.Net.Http.HttpMethod("GET");
_httpRequest.RequestUri = new System.Uri(_url);
// Set Headers
- if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value)
{
_httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
}
- if (Client.AcceptLanguage != null)
+ if (this.Client.AcceptLanguage != null)
{
if (_httpRequest.Headers.Contains("accept-language"))
{
_httpRequest.Headers.Remove("accept-language");
}
- _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage);
}
-
if (customHeaders != null)
{
foreach(var _header in customHeaders)
@@ -2141,55 +2279,56 @@ internal DeploymentOperations(ResourceManagementClient client)
_httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
}
}
-
// Serialize Request
string _requestContent = null;
// Set Credentials
- if (Client.Credentials != null)
+ if (this.Client.Credentials != null)
{
cancellationToken.ThrowIfCancellationRequested();
- await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
}
// Send Request
if (_shouldTrace)
{
- ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
}
cancellationToken.ThrowIfCancellationRequested();
- _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
if (_shouldTrace)
{
- ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
}
- HttpStatusCode _statusCode = _httpResponse.StatusCode;
+
+ System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode;
cancellationToken.ThrowIfCancellationRequested();
string _responseContent = null;
+
if ((int)_statusCode != 200)
{
- var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
{
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
if (_errorBody != null)
{
- ex = new CloudException(_errorBody.Message);
+ ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
- catch (JsonException)
+ catch (Newtonsoft.Json.JsonException)
{
// Ignore the exception
}
- ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
- ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent);
if (_httpResponse.Headers.Contains("x-ms-request-id"))
{
ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
}
if (_shouldTrace)
{
- ServiceClientTracing.Error(_invocationId, ex);
+ Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex);
}
_httpRequest.Dispose();
if (_httpResponse != null)
@@ -2199,9 +2338,10 @@ internal DeploymentOperations(ResourceManagementClient client)
throw ex;
}
// Create Result
- var _result = new AzureOperationResponse>();
+ var _result = new Microsoft.Rest.Azure.AzureOperationResponse>();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
+
if (_httpResponse.Headers.Contains("x-ms-request-id"))
{
_result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
@@ -2212,25 +2352,29 @@ internal DeploymentOperations(ResourceManagementClient client)
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
+ _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings);
}
- catch (JsonException ex)
+ catch (Newtonsoft.Json.JsonException ex)
{
_httpRequest.Dispose();
if (_httpResponse != null)
{
_httpResponse.Dispose();
}
- throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex);
}
}
if (_shouldTrace)
{
- ServiceClientTracing.Exit(_invocationId, _result);
+ Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result);
}
return _result;
- }
+
+
+
+
+ }
///
/// Gets all deployments operations for a deployment.
///
@@ -2243,13 +2387,13 @@ internal DeploymentOperations(ResourceManagementClient client)
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
- ///
+ ///
/// Thrown when unable to deserialize the response
///
- ///
+ ///
/// Thrown when a required parameter is null
///
///
@@ -2258,51 +2402,54 @@ internal DeploymentOperations(ResourceManagementClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task>> ListAtScopeNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async System.Threading.Tasks.Task>> ListAtScopeNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
+
if (nextPageLink == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink");
}
// Tracing
- bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled;
string _invocationId = null;
if (_shouldTrace)
{
- _invocationId = ServiceClientTracing.NextInvocationId.ToString();
- Dictionary tracingParameters = new Dictionary();
+ _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString();
+ System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary();
tracingParameters.Add("nextPageLink", nextPageLink);
+
+
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "ListAtScopeNext", tracingParameters);
+ Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAtScopeNext", tracingParameters);
}
// Construct URL
string _url = "{nextLink}";
_url = _url.Replace("{nextLink}", nextPageLink);
- List _queryParameters = new List();
+
+ System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List();
if (_queryParameters.Count > 0)
{
_url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
}
// Create HTTP transport objects
- var _httpRequest = new HttpRequestMessage();
- HttpResponseMessage _httpResponse = null;
- _httpRequest.Method = new HttpMethod("GET");
+ var _httpRequest = new System.Net.Http.HttpRequestMessage();
+ System.Net.Http.HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new System.Net.Http.HttpMethod("GET");
_httpRequest.RequestUri = new System.Uri(_url);
// Set Headers
- if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value)
{
_httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
}
- if (Client.AcceptLanguage != null)
+ if (this.Client.AcceptLanguage != null)
{
if (_httpRequest.Headers.Contains("accept-language"))
{
_httpRequest.Headers.Remove("accept-language");
}
- _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage);
}
-
if (customHeaders != null)
{
foreach(var _header in customHeaders)
@@ -2314,55 +2461,56 @@ internal DeploymentOperations(ResourceManagementClient client)
_httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
}
}
-
// Serialize Request
string _requestContent = null;
// Set Credentials
- if (Client.Credentials != null)
+ if (this.Client.Credentials != null)
{
cancellationToken.ThrowIfCancellationRequested();
- await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
}
// Send Request
if (_shouldTrace)
{
- ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
}
cancellationToken.ThrowIfCancellationRequested();
- _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
if (_shouldTrace)
{
- ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
}
- HttpStatusCode _statusCode = _httpResponse.StatusCode;
+
+ System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode;
cancellationToken.ThrowIfCancellationRequested();
string _responseContent = null;
+
if ((int)_statusCode != 200)
{
- var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
{
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
if (_errorBody != null)
{
- ex = new CloudException(_errorBody.Message);
+ ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
- catch (JsonException)
+ catch (Newtonsoft.Json.JsonException)
{
// Ignore the exception
}
- ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
- ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent);
if (_httpResponse.Headers.Contains("x-ms-request-id"))
{
ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
}
if (_shouldTrace)
{
- ServiceClientTracing.Error(_invocationId, ex);
+ Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex);
}
_httpRequest.Dispose();
if (_httpResponse != null)
@@ -2372,9 +2520,10 @@ internal DeploymentOperations(ResourceManagementClient client)
throw ex;
}
// Create Result
- var _result = new AzureOperationResponse>();
+ var _result = new Microsoft.Rest.Azure.AzureOperationResponse>();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
+
if (_httpResponse.Headers.Contains("x-ms-request-id"))
{
_result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
@@ -2385,25 +2534,29 @@ internal DeploymentOperations(ResourceManagementClient client)
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
+ _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings);
}
- catch (JsonException ex)
+ catch (Newtonsoft.Json.JsonException ex)
{
_httpRequest.Dispose();
if (_httpResponse != null)
{
_httpResponse.Dispose();
}
- throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex);
}
}
if (_shouldTrace)
{
- ServiceClientTracing.Exit(_invocationId, _result);
+ Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result);
}
return _result;
- }
+
+
+
+
+ }
///
/// Gets all deployments operations for a deployment.
///
@@ -2416,13 +2569,13 @@ internal DeploymentOperations(ResourceManagementClient client)
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
- ///
+ ///
/// Thrown when unable to deserialize the response
///
- ///
+ ///
/// Thrown when a required parameter is null
///
///
@@ -2431,51 +2584,54 @@ internal DeploymentOperations(ResourceManagementClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task>> ListAtTenantScopeNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async System.Threading.Tasks.Task