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>> ListAtTenantScopeNextWithHttpMessagesAsync(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, "ListAtTenantScopeNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAtTenantScopeNext", 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) @@ -2487,55 +2643,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) @@ -2545,9 +2702,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(); @@ -2558,25 +2716,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. /// @@ -2589,13 +2751,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 /// /// @@ -2604,51 +2766,54 @@ internal DeploymentOperations(ResourceManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListAtManagementGroupScopeNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListAtManagementGroupScopeNextWithHttpMessagesAsync(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, "ListAtManagementGroupScopeNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAtManagementGroupScopeNext", 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) @@ -2660,55 +2825,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) @@ -2718,9 +2884,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(); @@ -2731,25 +2898,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. /// @@ -2762,13 +2933,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 /// /// @@ -2777,51 +2948,54 @@ internal DeploymentOperations(ResourceManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListAtSubscriptionScopeNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListAtSubscriptionScopeNextWithHttpMessagesAsync(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, "ListAtSubscriptionScopeNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAtSubscriptionScopeNext", 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) @@ -2833,55 +3007,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) @@ -2891,9 +3066,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(); @@ -2904,25 +3080,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. /// @@ -2935,13 +3115,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 /// /// @@ -2950,51 +3130,54 @@ internal DeploymentOperations(ResourceManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(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, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", 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) @@ -3006,55 +3189,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) @@ -3064,9 +3248,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(); @@ -3077,24 +3262,28 @@ 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; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Management.Sdk/Generated/DeploymentOperationsExtensions.cs b/src/Resources/Resources.Management.Sdk/Generated/DeploymentOperationsExtensions.cs new file mode 100644 index 000000000000..76f300630e16 --- /dev/null +++ b/src/Resources/Resources.Management.Sdk/Generated/DeploymentOperationsExtensions.cs @@ -0,0 +1,607 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.Management.Resources +{ + using Microsoft.Rest.Azure; + using Models; + + /// + /// Extension methods for DeploymentOperations + /// + public static partial class DeploymentOperationsExtensions + { + /// + /// Gets a deployments operation. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource scope. + /// + /// + /// The name of the deployment. + /// + /// + /// The ID of the operation to get. + /// + public static DeploymentOperation GetAtScope(this IDeploymentOperations operations, string scope, string deploymentName, string operationId) + { + return ((IDeploymentOperations)operations).GetAtScopeAsync(scope, deploymentName, operationId).GetAwaiter().GetResult(); + } + + /// + /// Gets a deployments operation. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource scope. + /// + /// + /// The name of the deployment. + /// + /// + /// The ID of the operation to get. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAtScopeAsync(this IDeploymentOperations operations, string scope, string deploymentName, string operationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetAtScopeWithHttpMessagesAsync(scope, deploymentName, operationId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets all deployments operations for a deployment. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource scope. + /// + /// + /// The name of the deployment. + /// + /// + /// The number of results to return. + /// + public static Microsoft.Rest.Azure.IPage ListAtScope(this IDeploymentOperations operations, string scope, string deploymentName, int? top = default(int?)) + { + return ((IDeploymentOperations)operations).ListAtScopeAsync(scope, deploymentName, top).GetAwaiter().GetResult(); + } + + /// + /// Gets all deployments operations for a deployment. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource scope. + /// + /// + /// The name of the deployment. + /// + /// + /// The number of results to return. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAtScopeAsync(this IDeploymentOperations operations, string scope, string deploymentName, int? top = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListAtScopeWithHttpMessagesAsync(scope, deploymentName, top, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets a deployments operation. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the deployment. + /// + /// + /// The ID of the operation to get. + /// + public static DeploymentOperation GetAtTenantScope(this IDeploymentOperations operations, string deploymentName, string operationId) + { + return ((IDeploymentOperations)operations).GetAtTenantScopeAsync(deploymentName, operationId).GetAwaiter().GetResult(); + } + + /// + /// Gets a deployments operation. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the deployment. + /// + /// + /// The ID of the operation to get. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAtTenantScopeAsync(this IDeploymentOperations operations, string deploymentName, string operationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetAtTenantScopeWithHttpMessagesAsync(deploymentName, operationId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets all deployments operations for a deployment. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the deployment. + /// + /// + /// The number of results to return. + /// + public static Microsoft.Rest.Azure.IPage ListAtTenantScope(this IDeploymentOperations operations, string deploymentName, int? top = default(int?)) + { + return ((IDeploymentOperations)operations).ListAtTenantScopeAsync(deploymentName, top).GetAwaiter().GetResult(); + } + + /// + /// Gets all deployments operations for a deployment. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the deployment. + /// + /// + /// The number of results to return. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAtTenantScopeAsync(this IDeploymentOperations operations, string deploymentName, int? top = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListAtTenantScopeWithHttpMessagesAsync(deploymentName, top, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets a deployments operation. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The management group ID. + /// + /// + /// The name of the deployment. + /// + /// + /// The ID of the operation to get. + /// + public static DeploymentOperation GetAtManagementGroupScope(this IDeploymentOperations operations, string groupId, string deploymentName, string operationId) + { + return ((IDeploymentOperations)operations).GetAtManagementGroupScopeAsync(groupId, deploymentName, operationId).GetAwaiter().GetResult(); + } + + /// + /// Gets a deployments operation. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The management group ID. + /// + /// + /// The name of the deployment. + /// + /// + /// The ID of the operation to get. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAtManagementGroupScopeAsync(this IDeploymentOperations operations, string groupId, string deploymentName, string operationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetAtManagementGroupScopeWithHttpMessagesAsync(groupId, deploymentName, operationId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets all deployments operations for a deployment. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The management group ID. + /// + /// + /// The name of the deployment. + /// + /// + /// The number of results to return. + /// + public static Microsoft.Rest.Azure.IPage ListAtManagementGroupScope(this IDeploymentOperations operations, string groupId, string deploymentName, int? top = default(int?)) + { + return ((IDeploymentOperations)operations).ListAtManagementGroupScopeAsync(groupId, deploymentName, top).GetAwaiter().GetResult(); + } + + /// + /// Gets all deployments operations for a deployment. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The management group ID. + /// + /// + /// The name of the deployment. + /// + /// + /// The number of results to return. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAtManagementGroupScopeAsync(this IDeploymentOperations operations, string groupId, string deploymentName, int? top = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListAtManagementGroupScopeWithHttpMessagesAsync(groupId, deploymentName, top, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets a deployments operation. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the deployment. + /// + /// + /// The ID of the operation to get. + /// + public static DeploymentOperation GetAtSubscriptionScope(this IDeploymentOperations operations, string deploymentName, string operationId) + { + return ((IDeploymentOperations)operations).GetAtSubscriptionScopeAsync(deploymentName, operationId).GetAwaiter().GetResult(); + } + + /// + /// Gets a deployments operation. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the deployment. + /// + /// + /// The ID of the operation to get. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAtSubscriptionScopeAsync(this IDeploymentOperations operations, string deploymentName, string operationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetAtSubscriptionScopeWithHttpMessagesAsync(deploymentName, operationId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets all deployments operations for a deployment. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the deployment. + /// + /// + /// The number of results to return. + /// + public static Microsoft.Rest.Azure.IPage ListAtSubscriptionScope(this IDeploymentOperations operations, string deploymentName, int? top = default(int?)) + { + return ((IDeploymentOperations)operations).ListAtSubscriptionScopeAsync(deploymentName, top).GetAwaiter().GetResult(); + } + + /// + /// Gets all deployments operations for a deployment. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the deployment. + /// + /// + /// The number of results to return. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAtSubscriptionScopeAsync(this IDeploymentOperations operations, string deploymentName, int? top = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListAtSubscriptionScopeWithHttpMessagesAsync(deploymentName, top, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets a deployments operation. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the deployment. + /// + /// + /// The ID of the operation to get. + /// + public static DeploymentOperation Get(this IDeploymentOperations operations, string resourceGroupName, string deploymentName, string operationId) + { + return ((IDeploymentOperations)operations).GetAsync(resourceGroupName, deploymentName, operationId).GetAwaiter().GetResult(); + } + + /// + /// Gets a deployments operation. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the deployment. + /// + /// + /// The ID of the operation to get. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IDeploymentOperations operations, string resourceGroupName, string deploymentName, string operationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, deploymentName, operationId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets all deployments operations for a deployment. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the deployment. + /// + /// + /// The number of results to return. + /// + public static Microsoft.Rest.Azure.IPage List(this IDeploymentOperations operations, string resourceGroupName, string deploymentName, int? top = default(int?)) + { + return ((IDeploymentOperations)operations).ListAsync(resourceGroupName, deploymentName, top).GetAwaiter().GetResult(); + } + + /// + /// Gets all deployments operations for a deployment. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the deployment. + /// + /// + /// The number of results to return. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IDeploymentOperations operations, string resourceGroupName, string deploymentName, int? top = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, deploymentName, top, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets all deployments operations for a deployment. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListAtScopeNext(this IDeploymentOperations operations, string nextPageLink) + { + return ((IDeploymentOperations)operations).ListAtScopeNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets all deployments operations for a deployment. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAtScopeNextAsync(this IDeploymentOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListAtScopeNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets all deployments operations for a deployment. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListAtTenantScopeNext(this IDeploymentOperations operations, string nextPageLink) + { + return ((IDeploymentOperations)operations).ListAtTenantScopeNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets all deployments operations for a deployment. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAtTenantScopeNextAsync(this IDeploymentOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListAtTenantScopeNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets all deployments operations for a deployment. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListAtManagementGroupScopeNext(this IDeploymentOperations operations, string nextPageLink) + { + return ((IDeploymentOperations)operations).ListAtManagementGroupScopeNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets all deployments operations for a deployment. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAtManagementGroupScopeNextAsync(this IDeploymentOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListAtManagementGroupScopeNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets all deployments operations for a deployment. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListAtSubscriptionScopeNext(this IDeploymentOperations operations, string nextPageLink) + { + return ((IDeploymentOperations)operations).ListAtSubscriptionScopeNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets all deployments operations for a deployment. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAtSubscriptionScopeNextAsync(this IDeploymentOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListAtSubscriptionScopeNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets all deployments operations for a deployment. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IDeploymentOperations operations, string nextPageLink) + { + return ((IDeploymentOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets all deployments operations for a deployment. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IDeploymentOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + } +} diff --git a/src/Resources/Resources.Sdk/Generated/DeploymentScriptsClient.cs b/src/Resources/Resources.Management.Sdk/Generated/DeploymentScriptsClient.cs similarity index 63% rename from src/Resources/Resources.Sdk/Generated/DeploymentScriptsClient.cs rename to src/Resources/Resources.Management.Sdk/Generated/DeploymentScriptsClient.cs index 8d55d0a86216..50d562c880fb 100644 --- a/src/Resources/Resources.Sdk/Generated/DeploymentScriptsClient.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/DeploymentScriptsClient.cs @@ -1,85 +1,70 @@ -// // 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 Microsoft.Rest.Serialization; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; /// /// The APIs listed in this specification can be used to manage Deployment /// Scripts resource through the Azure Resource Manager. /// - public partial class DeploymentScriptsClient : ServiceClient, IDeploymentScriptsClient, IAzureClient + public partial class DeploymentScriptsClient : Microsoft.Rest.ServiceClient, IDeploymentScriptsClient, IAzureClient { /// /// The base URI of the service. /// public System.Uri BaseUri { get; set; } - /// /// Gets or sets json serialization settings. /// - public JsonSerializerSettings SerializationSettings { get; private set; } - + public Newtonsoft.Json.JsonSerializerSettings SerializationSettings { get; private set; } /// /// Gets or sets json deserialization settings. /// - public JsonSerializerSettings DeserializationSettings { get; private set; } - + public Newtonsoft.Json.JsonSerializerSettings DeserializationSettings { get; private set; } /// /// Credentials needed for the client to connect to Azure. /// - public ServiceClientCredentials Credentials { get; private set; } + public Microsoft.Rest.ServiceClientCredentials Credentials { get; private set; } /// - /// Subscription Id which forms part of the URI for every service call. + /// The API version to use for this operation. /// - public string SubscriptionId { get; set; } + public string ApiVersion { get; private set; } /// - /// Client Api version. + /// Subscription Id which forms part of the URI for every service call. /// - public string ApiVersion { get; private set; } + public string SubscriptionId { get; set;} /// /// The preferred language for the response. /// - public string AcceptLanguage { get; set; } + public string AcceptLanguage { get; set;} /// - /// The retry timeout in seconds for Long Running Operations. Default value is - /// 30. + /// The retry timeout in seconds for Long Running Operations. Default + /// /// value is 30. /// - public int? LongRunningOperationRetryTimeout { get; set; } + public int? LongRunningOperationRetryTimeout { get; set;} /// - /// Whether a unique x-ms-client-request-id should be generated. When set to - /// true a unique x-ms-client-request-id value is generated and included in - /// each request. Default is true. + /// Whether a unique x-ms-client-request-id should be generated. When + /// /// set to true a unique x-ms-client-request-id value is generated and + /// /// included in each request. Default is true. /// - public bool? GenerateClientRequestId { get; set; } + public bool? GenerateClientRequestId { get; set;} /// - /// Gets the IDeploymentScriptsOperations. + /// Gets the IDeploymentScriptsOperations /// public virtual IDeploymentScriptsOperations DeploymentScripts { get; private set; } - /// /// Initializes a new instance of the DeploymentScriptsClient class. /// @@ -88,24 +73,22 @@ public partial class DeploymentScriptsClient : ServiceClient /// /// True: will dispose the provided httpClient on calling DeploymentScriptsClient.Dispose(). False: will not dispose provided httpClient - protected DeploymentScriptsClient(HttpClient httpClient, bool disposeHttpClient) : base(httpClient, disposeHttpClient) + protected DeploymentScriptsClient(System.Net.Http.HttpClient httpClient, bool disposeHttpClient) : base(httpClient, disposeHttpClient) { - Initialize(); + this.Initialize(); } - /// /// Initializes a new instance of the DeploymentScriptsClient class. /// /// /// Optional. The delegating handlers to add to the http client pipeline. /// - protected DeploymentScriptsClient(params DelegatingHandler[] handlers) : base(handlers) + protected DeploymentScriptsClient(params System.Net.Http.DelegatingHandler[] handlers) : base(handlers) { - Initialize(); + this.Initialize(); } - /// - /// Initializes a new instance of the DeploymentScriptsClient class. + /// Initializes a new instance of the DeploymentScriptsClient class. /// /// /// Optional. The http client handler used to handle http transport. @@ -113,11 +96,10 @@ protected DeploymentScriptsClient(params DelegatingHandler[] handlers) : base(ha /// /// Optional. The delegating handlers to add to the http client pipeline. /// - protected DeploymentScriptsClient(HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : base(rootHandler, handlers) + protected DeploymentScriptsClient(System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : base(rootHandler, handlers) { - Initialize(); + this.Initialize(); } - /// /// Initializes a new instance of the DeploymentScriptsClient class. /// @@ -130,15 +112,14 @@ protected DeploymentScriptsClient(HttpClientHandler rootHandler, params Delegati /// /// Thrown when a required parameter is null /// - protected DeploymentScriptsClient(System.Uri baseUri, params DelegatingHandler[] handlers) : this(handlers) + protected DeploymentScriptsClient(System.Uri baseUri, params System.Net.Http.DelegatingHandler[] handlers) : this(handlers) { if (baseUri == null) { throw new System.ArgumentNullException("baseUri"); } - BaseUri = baseUri; + this.BaseUri = baseUri; } - /// /// Initializes a new instance of the DeploymentScriptsClient class. /// @@ -154,15 +135,15 @@ protected DeploymentScriptsClient(System.Uri baseUri, params DelegatingHandler[] /// /// Thrown when a required parameter is null /// - protected DeploymentScriptsClient(System.Uri baseUri, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + protected DeploymentScriptsClient(System.Uri baseUri, System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : this(rootHandler, handlers) { if (baseUri == null) { throw new System.ArgumentNullException("baseUri"); } - BaseUri = baseUri; + + this.BaseUri = baseUri; } - /// /// Initializes a new instance of the DeploymentScriptsClient class. /// @@ -175,23 +156,23 @@ protected DeploymentScriptsClient(System.Uri baseUri, HttpClientHandler rootHand /// /// Thrown when a required parameter is null /// - public DeploymentScriptsClient(ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers) + public DeploymentScriptsClient(Microsoft.Rest.ServiceClientCredentials credentials, params System.Net.Http.DelegatingHandler[] handlers) : this(handlers) { if (credentials == null) { throw new System.ArgumentNullException("credentials"); } - Credentials = credentials; - if (Credentials != null) + this.Credentials = credentials; + if (this.Credentials != null) { - Credentials.InitializeServiceClient(this); + this.Credentials.InitializeServiceClient(this); } + } - /// /// Initializes a new instance of the DeploymentScriptsClient class. /// - /// + /// /// Required. Credentials needed for the client to connect to Azure. /// /// @@ -202,23 +183,23 @@ public DeploymentScriptsClient(ServiceClientCredentials credentials, params Dele /// /// Thrown when a required parameter is null /// - public DeploymentScriptsClient(ServiceClientCredentials credentials, HttpClient httpClient, bool disposeHttpClient) : this(httpClient, disposeHttpClient) + public DeploymentScriptsClient(Microsoft.Rest.ServiceClientCredentials credentials, System.Net.Http.HttpClient httpClient, bool disposeHttpClient) : this(httpClient, disposeHttpClient) { if (credentials == null) { throw new System.ArgumentNullException("credentials"); } - Credentials = credentials; - if (Credentials != null) + this.Credentials = credentials; + if (this.Credentials != null) { - Credentials.InitializeServiceClient(this); + this.Credentials.InitializeServiceClient(this); } + } - /// /// Initializes a new instance of the DeploymentScriptsClient class. /// - /// + /// /// Required. Credentials needed for the client to connect to Azure. /// /// @@ -230,26 +211,26 @@ public DeploymentScriptsClient(ServiceClientCredentials credentials, HttpClient /// /// Thrown when a required parameter is null /// - public DeploymentScriptsClient(ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + public DeploymentScriptsClient(Microsoft.Rest.ServiceClientCredentials credentials, System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : this(rootHandler, handlers) { if (credentials == null) { throw new System.ArgumentNullException("credentials"); } - Credentials = credentials; - if (Credentials != null) + this.Credentials = credentials; + if (this.Credentials != null) { - Credentials.InitializeServiceClient(this); + this.Credentials.InitializeServiceClient(this); } + } - /// /// Initializes a new instance of the DeploymentScriptsClient class. /// /// /// Optional. The base URI of the service. /// - /// + /// /// Required. Credentials needed for the client to connect to Azure. /// /// @@ -258,7 +239,7 @@ public DeploymentScriptsClient(ServiceClientCredentials credentials, HttpClientH /// /// Thrown when a required parameter is null /// - public DeploymentScriptsClient(System.Uri baseUri, ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers) + public DeploymentScriptsClient(System.Uri baseUri, Microsoft.Rest.ServiceClientCredentials credentials, params System.Net.Http.DelegatingHandler[] handlers) : this(handlers) { if (baseUri == null) { @@ -268,33 +249,30 @@ public DeploymentScriptsClient(System.Uri baseUri, ServiceClientCredentials cred { throw new System.ArgumentNullException("credentials"); } - BaseUri = baseUri; - Credentials = credentials; - if (Credentials != null) + this.BaseUri = baseUri; + this.Credentials = credentials; + if (this.Credentials != null) { - Credentials.InitializeServiceClient(this); + this.Credentials.InitializeServiceClient(this); } + } - /// /// Initializes a new instance of the DeploymentScriptsClient class. /// /// /// Optional. The base URI of the service. /// - /// + /// /// Required. Credentials needed for the client to connect to Azure. /// /// /// Optional. The http client handler used to handle http transport. /// - /// - /// Optional. The delegating handlers to add to the http client pipeline. - /// /// /// Thrown when a required parameter is null /// - public DeploymentScriptsClient(System.Uri baseUri, ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + public DeploymentScriptsClient(System.Uri baseUri, Microsoft.Rest.ServiceClientCredentials credentials, System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : this(rootHandler, handlers) { if (baseUri == null) { @@ -304,60 +282,61 @@ public DeploymentScriptsClient(System.Uri baseUri, ServiceClientCredentials cred { throw new System.ArgumentNullException("credentials"); } - BaseUri = baseUri; - Credentials = credentials; - if (Credentials != null) + this.BaseUri = baseUri; + this.Credentials = credentials; + if (this.Credentials != null) { - Credentials.InitializeServiceClient(this); + this.Credentials.InitializeServiceClient(this); } + } - /// /// An optional partial-method to perform custom initialization. /// partial void CustomInitialize(); + /// /// Initializes client properties. /// private void Initialize() { - DeploymentScripts = new DeploymentScriptsOperations(this); - BaseUri = new System.Uri("https://management.azure.com"); - ApiVersion = "2020-10-01"; - AcceptLanguage = "en-US"; - LongRunningOperationRetryTimeout = 30; - GenerateClientRequestId = true; - SerializationSettings = new JsonSerializerSettings + this.DeploymentScripts = new DeploymentScriptsOperations(this); + this.BaseUri = new System.Uri("https://management.azure.com"); + this.ApiVersion = "2020-10-01"; + this.AcceptLanguage = "en-US"; + this.LongRunningOperationRetryTimeout = 30; + this.GenerateClientRequestId = true; + SerializationSettings = new Newtonsoft.Json.JsonSerializerSettings { Formatting = Newtonsoft.Json.Formatting.Indented, DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, - ContractResolver = new ReadOnlyJsonContractResolver(), - Converters = new List + ContractResolver = new Microsoft.Rest.Serialization.ReadOnlyJsonContractResolver(), + Converters = new System.Collections.Generic.List { - new Iso8601TimeSpanConverter() + new Microsoft.Rest.Serialization.Iso8601TimeSpanConverter() } }; - SerializationSettings.Converters.Add(new TransformationJsonConverter()); - DeserializationSettings = new JsonSerializerSettings + SerializationSettings.Converters.Add(new Microsoft.Rest.Serialization.TransformationJsonConverter()); + DeserializationSettings = new Newtonsoft.Json.JsonSerializerSettings { DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, - ContractResolver = new ReadOnlyJsonContractResolver(), - Converters = new List + ContractResolver = new Microsoft.Rest.Serialization.ReadOnlyJsonContractResolver(), + Converters = new System.Collections.Generic.List { - new Iso8601TimeSpanConverter() + new Microsoft.Rest.Serialization.Iso8601TimeSpanConverter() } }; - SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("kind")); - DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("kind")); + SerializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicSerializeJsonConverter("kind")); + DeserializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicDeserializeJsonConverter("kind")); CustomInitialize(); - DeserializationSettings.Converters.Add(new TransformationJsonConverter()); - DeserializationSettings.Converters.Add(new CloudErrorJsonConverter()); + DeserializationSettings.Converters.Add(new Microsoft.Rest.Serialization.TransformationJsonConverter()); + DeserializationSettings.Converters.Add(new Microsoft.Rest.Azure.CloudErrorJsonConverter()); } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/DeploymentScriptsOperations.cs b/src/Resources/Resources.Management.Sdk/Generated/DeploymentScriptsOperations.cs similarity index 57% rename from src/Resources/Resources.Sdk/Generated/DeploymentScriptsOperations.cs rename to src/Resources/Resources.Management.Sdk/Generated/DeploymentScriptsOperations.cs index ee37aaf6edaf..34c29274acbb 100644 --- a/src/Resources/Resources.Sdk/Generated/DeploymentScriptsOperations.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/DeploymentScriptsOperations.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; /// /// DeploymentScriptsOperations operations. /// - internal partial class DeploymentScriptsOperations : IServiceOperations, IDeploymentScriptsOperations + internal partial class DeploymentScriptsOperations : Microsoft.Rest.IServiceOperations, IDeploymentScriptsOperations { /// /// Initializes a new instance of the DeploymentScriptsOperations class. @@ -36,13 +24,13 @@ internal partial class DeploymentScriptsOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal DeploymentScriptsOperations(DeploymentScriptsClient client) + internal DeploymentScriptsOperations (DeploymentScriptsClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -63,16 +51,16 @@ internal DeploymentScriptsOperations(DeploymentScriptsClient client) /// Deployment script supplied to the operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateWithHttpMessagesAsync(string resourceGroupName, string scriptName, DeploymentScript deploymentScript, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateWithHttpMessagesAsync(string resourceGroupName, string scriptName, DeploymentScript deploymentScript, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateWithHttpMessagesAsync(resourceGroupName, scriptName, deploymentScript, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateWithHttpMessagesAsync(resourceGroupName, scriptName, deploymentScript, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -93,13 +81,13 @@ internal DeploymentScriptsOperations(DeploymentScriptsClient 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 /// /// @@ -108,94 +96,103 @@ internal DeploymentScriptsOperations(DeploymentScriptsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string scriptName, DeploymentScriptUpdateParameter deploymentScript = default(DeploymentScriptUpdateParameter), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string scriptName, DeploymentScriptUpdateParameter deploymentScript = default(DeploymentScriptUpdateParameter), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - 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"); } + 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 (scriptName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "scriptName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "scriptName"); } if (scriptName != null) { if (scriptName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "scriptName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "scriptName", 90); } if (scriptName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "scriptName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "scriptName", 1); } } - 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("resourceGroupName", resourceGroupName); tracingParameters.Add("scriptName", scriptName); + tracingParameters.Add("deploymentScript", deploymentScript); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Update", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Update", 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}/providers/Microsoft.Resources/deploymentScripts/{scriptName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{scriptName}", System.Uri.EscapeDataString(scriptName)); - 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("PATCH"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); _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) @@ -207,56 +204,57 @@ internal DeploymentScriptsOperations(DeploymentScriptsClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(deploymentScript != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(deploymentScript, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(deploymentScript, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + 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 DeploymentScriptsErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DeploymentScriptsError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + DeploymentScriptsError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -266,9 +264,10 @@ internal DeploymentScriptsOperations(DeploymentScriptsClient 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(); @@ -279,25 +278,29 @@ internal DeploymentScriptsOperations(DeploymentScriptsClient 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 deployment script with a given name. /// @@ -313,13 +316,13 @@ internal DeploymentScriptsOperations(DeploymentScriptsClient 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 /// /// @@ -328,93 +331,102 @@ internal DeploymentScriptsOperations(DeploymentScriptsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string scriptName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string scriptName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - 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"); } + 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 (scriptName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "scriptName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "scriptName"); } if (scriptName != null) { if (scriptName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "scriptName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "scriptName", 90); } if (scriptName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "scriptName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "scriptName", 1); } } - 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("resourceGroupName", resourceGroupName); tracingParameters.Add("scriptName", scriptName); + + 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}/providers/Microsoft.Resources/deploymentScripts/{scriptName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{scriptName}", System.Uri.EscapeDataString(scriptName)); - 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) @@ -426,50 +438,51 @@ internal DeploymentScriptsOperations(DeploymentScriptsClient 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 DeploymentScriptsErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DeploymentScriptsError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + DeploymentScriptsError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -479,9 +492,10 @@ internal DeploymentScriptsOperations(DeploymentScriptsClient 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(); @@ -492,25 +506,29 @@ internal DeploymentScriptsOperations(DeploymentScriptsClient 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; - } + + + + + } /// /// Deletes a deployment script. When operation completes, status code 200 /// returned without content. @@ -527,10 +545,10 @@ internal DeploymentScriptsOperations(DeploymentScriptsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -539,93 +557,102 @@ internal DeploymentScriptsOperations(DeploymentScriptsClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string scriptName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string scriptName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - 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"); } + 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 (scriptName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "scriptName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "scriptName"); } if (scriptName != null) { if (scriptName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "scriptName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "scriptName", 90); } if (scriptName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "scriptName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "scriptName", 1); } } - 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("resourceGroupName", resourceGroupName); tracingParameters.Add("scriptName", scriptName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Delete", 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}/providers/Microsoft.Resources/deploymentScripts/{scriptName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{scriptName}", System.Uri.EscapeDataString(scriptName)); - 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("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _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) @@ -637,50 +664,51 @@ internal DeploymentScriptsOperations(DeploymentScriptsClient 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 && (int)_statusCode != 204) { var ex = new DeploymentScriptsErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DeploymentScriptsError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + DeploymentScriptsError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -690,20 +718,25 @@ internal DeploymentScriptsOperations(DeploymentScriptsClient 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(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Lists all deployment scripts for a given subscription. /// @@ -713,13 +746,13 @@ internal DeploymentScriptsOperations(DeploymentScriptsClient 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 /// /// @@ -728,59 +761,68 @@ internal DeploymentScriptsOperations(DeploymentScriptsClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListBySubscriptionWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListBySubscriptionWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - 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"); } - 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("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListBySubscription", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListBySubscription", 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/deploymentScripts").ToString(); - _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) @@ -792,50 +834,51 @@ internal DeploymentScriptsOperations(DeploymentScriptsClient 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 DeploymentScriptsErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DeploymentScriptsError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + DeploymentScriptsError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -845,9 +888,10 @@ internal DeploymentScriptsOperations(DeploymentScriptsClient 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(); @@ -858,25 +902,29 @@ internal DeploymentScriptsOperations(DeploymentScriptsClient 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 deployment script logs for a given deployment script name. /// @@ -892,13 +940,13 @@ internal DeploymentScriptsOperations(DeploymentScriptsClient 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 /// /// @@ -907,93 +955,102 @@ internal DeploymentScriptsOperations(DeploymentScriptsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetLogsWithHttpMessagesAsync(string resourceGroupName, string scriptName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetLogsWithHttpMessagesAsync(string resourceGroupName, string scriptName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - 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"); } + 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 (scriptName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "scriptName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "scriptName"); } if (scriptName != null) { if (scriptName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "scriptName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "scriptName", 90); } if (scriptName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "scriptName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "scriptName", 1); } } - 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("resourceGroupName", resourceGroupName); tracingParameters.Add("scriptName", scriptName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetLogs", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetLogs", 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}/providers/Microsoft.Resources/deploymentScripts/{scriptName}/logs").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{scriptName}", System.Uri.EscapeDataString(scriptName)); - 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) @@ -1005,50 +1062,51 @@ internal DeploymentScriptsOperations(DeploymentScriptsClient 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 DeploymentScriptsErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DeploymentScriptsError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + DeploymentScriptsError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1058,9 +1116,10 @@ internal DeploymentScriptsOperations(DeploymentScriptsClient 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(); @@ -1071,25 +1130,29 @@ internal DeploymentScriptsOperations(DeploymentScriptsClient 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 deployment script logs for a given deployment script name. /// @@ -1101,7 +1164,7 @@ internal DeploymentScriptsOperations(DeploymentScriptsClient client) /// /// /// The number of lines to show from the tail of the deployment script log. - /// Valid value is a positive number up to 1000. If 'tail' is not provided, all + /// Valid value is a positive number up to 1000. If 'tail' is not provided, all /// available logs are shown up to container instance log capacity of 4mb. /// /// @@ -1110,13 +1173,13 @@ internal DeploymentScriptsOperations(DeploymentScriptsClient 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 /// /// @@ -1125,98 +1188,108 @@ internal DeploymentScriptsOperations(DeploymentScriptsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetLogsDefaultWithHttpMessagesAsync(string resourceGroupName, string scriptName, int? tail = default(int?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetLogsDefaultWithHttpMessagesAsync(string resourceGroupName, string scriptName, int? tail = default(int?), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - 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"); } + 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 (scriptName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "scriptName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "scriptName"); } if (scriptName != null) { if (scriptName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "scriptName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "scriptName", 90); } if (scriptName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "scriptName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "scriptName", 1); } } - 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("resourceGroupName", resourceGroupName); tracingParameters.Add("scriptName", scriptName); tracingParameters.Add("tail", tail); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetLogsDefault", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetLogsDefault", 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}/providers/Microsoft.Resources/deploymentScripts/{scriptName}/logs/default").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{scriptName}", System.Uri.EscapeDataString(scriptName)); - 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 (tail != null) { - _queryParameters.Add(string.Format("tail={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(tail, Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("tail={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(tail, this.Client.SerializationSettings).Trim('"')))); } 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) @@ -1228,50 +1301,51 @@ internal DeploymentScriptsOperations(DeploymentScriptsClient 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 DeploymentScriptsErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DeploymentScriptsError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + DeploymentScriptsError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1281,9 +1355,10 @@ internal DeploymentScriptsOperations(DeploymentScriptsClient 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(); @@ -1294,25 +1369,29 @@ internal DeploymentScriptsOperations(DeploymentScriptsClient 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; - } + + + + + } /// /// Lists deployments scripts. /// @@ -1325,13 +1404,13 @@ internal DeploymentScriptsOperations(DeploymentScriptsClient 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 /// /// @@ -1340,76 +1419,85 @@ internal DeploymentScriptsOperations(DeploymentScriptsClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - 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"); } + 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 (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("resourceGroupName", resourceGroupName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", 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}/providers/Microsoft.Resources/deploymentScripts").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - 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) @@ -1421,50 +1509,51 @@ internal DeploymentScriptsOperations(DeploymentScriptsClient 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 DeploymentScriptsErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DeploymentScriptsError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + DeploymentScriptsError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1474,9 +1563,10 @@ internal DeploymentScriptsOperations(DeploymentScriptsClient 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(); @@ -1487,25 +1577,29 @@ internal DeploymentScriptsOperations(DeploymentScriptsClient 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; - } + + + + + } /// /// Creates a deployment script. /// @@ -1524,13 +1618,13 @@ internal DeploymentScriptsOperations(DeploymentScriptsClient 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 /// /// @@ -1539,102 +1633,111 @@ internal DeploymentScriptsOperations(DeploymentScriptsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateWithHttpMessagesAsync(string resourceGroupName, string scriptName, DeploymentScript deploymentScript, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateWithHttpMessagesAsync(string resourceGroupName, string scriptName, DeploymentScript deploymentScript, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (deploymentScript == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "deploymentScript"); + } + if (deploymentScript != null) + { + deploymentScript.Validate(); + } + 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"); } + 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 (scriptName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "scriptName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "scriptName"); } if (scriptName != null) { if (scriptName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "scriptName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "scriptName", 90); } if (scriptName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "scriptName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "scriptName", 1); } } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (deploymentScript == null) + if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "deploymentScript"); - } - if (deploymentScript != null) - { - deploymentScript.Validate(); + 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("resourceGroupName", resourceGroupName); tracingParameters.Add("scriptName", scriptName); + tracingParameters.Add("deploymentScript", deploymentScript); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreate", 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}/providers/Microsoft.Resources/deploymentScripts/{scriptName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{scriptName}", System.Uri.EscapeDataString(scriptName)); - 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("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _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) @@ -1646,56 +1749,57 @@ internal DeploymentScriptsOperations(DeploymentScriptsClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(deploymentScript != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(deploymentScript, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(deploymentScript, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + 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 && (int)_statusCode != 201) { var ex = new DeploymentScriptsErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DeploymentScriptsError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + DeploymentScriptsError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1705,9 +1809,10 @@ internal DeploymentScriptsOperations(DeploymentScriptsClient 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(); @@ -1718,16 +1823,16 @@ internal DeploymentScriptsOperations(DeploymentScriptsClient 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); } } // Deserialize Response @@ -1736,25 +1841,29 @@ internal DeploymentScriptsOperations(DeploymentScriptsClient 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; - } + + + + + } /// /// Lists all deployment scripts for a given subscription. /// @@ -1767,13 +1876,13 @@ internal DeploymentScriptsOperations(DeploymentScriptsClient 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 /// /// @@ -1782,51 +1891,54 @@ internal DeploymentScriptsOperations(DeploymentScriptsClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListBySubscriptionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListBySubscriptionNextWithHttpMessagesAsync(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, "ListBySubscriptionNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListBySubscriptionNext", 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) @@ -1838,50 +1950,51 @@ internal DeploymentScriptsOperations(DeploymentScriptsClient 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 DeploymentScriptsErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DeploymentScriptsError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + DeploymentScriptsError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1891,9 +2004,10 @@ internal DeploymentScriptsOperations(DeploymentScriptsClient 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(); @@ -1904,25 +2018,29 @@ internal DeploymentScriptsOperations(DeploymentScriptsClient 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; - } + + + + + } /// /// Lists deployments scripts. /// @@ -1935,13 +2053,13 @@ internal DeploymentScriptsOperations(DeploymentScriptsClient 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 /// /// @@ -1950,51 +2068,54 @@ internal DeploymentScriptsOperations(DeploymentScriptsClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByResourceGroupNextWithHttpMessagesAsync(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, "ListByResourceGroupNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", 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) @@ -2006,50 +2127,51 @@ internal DeploymentScriptsOperations(DeploymentScriptsClient 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 DeploymentScriptsErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DeploymentScriptsError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + DeploymentScriptsError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2059,9 +2181,10 @@ internal DeploymentScriptsOperations(DeploymentScriptsClient 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(); @@ -2072,24 +2195,28 @@ internal DeploymentScriptsOperations(DeploymentScriptsClient 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; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Management.Sdk/Generated/DeploymentScriptsOperationsExtensions.cs b/src/Resources/Resources.Management.Sdk/Generated/DeploymentScriptsOperationsExtensions.cs new file mode 100644 index 000000000000..9f23c66fed39 --- /dev/null +++ b/src/Resources/Resources.Management.Sdk/Generated/DeploymentScriptsOperationsExtensions.cs @@ -0,0 +1,424 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.Management.Resources +{ + using Microsoft.Rest.Azure; + using Models; + + /// + /// Extension methods for DeploymentScriptsOperations + /// + public static partial class DeploymentScriptsOperationsExtensions + { + /// + /// Creates a deployment script. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the deployment script. + /// + public static DeploymentScript Create(this IDeploymentScriptsOperations operations, string resourceGroupName, string scriptName, DeploymentScript deploymentScript) + { + return ((IDeploymentScriptsOperations)operations).CreateAsync(resourceGroupName, scriptName, deploymentScript).GetAwaiter().GetResult(); + } + + /// + /// Creates a deployment script. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the deployment script. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateAsync(this IDeploymentScriptsOperations operations, string resourceGroupName, string scriptName, DeploymentScript deploymentScript, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateWithHttpMessagesAsync(resourceGroupName, scriptName, deploymentScript, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Updates deployment script tags with specified values. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the deployment script. + /// + public static DeploymentScript Update(this IDeploymentScriptsOperations operations, string resourceGroupName, string scriptName, DeploymentScriptUpdateParameter deploymentScript = default(DeploymentScriptUpdateParameter)) + { + return ((IDeploymentScriptsOperations)operations).UpdateAsync(resourceGroupName, scriptName, deploymentScript).GetAwaiter().GetResult(); + } + + /// + /// Updates deployment script tags with specified values. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the deployment script. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UpdateAsync(this IDeploymentScriptsOperations operations, string resourceGroupName, string scriptName, DeploymentScriptUpdateParameter deploymentScript = default(DeploymentScriptUpdateParameter), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, scriptName, deploymentScript, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets a deployment script with a given name. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the deployment script. + /// + public static DeploymentScript Get(this IDeploymentScriptsOperations operations, string resourceGroupName, string scriptName) + { + return ((IDeploymentScriptsOperations)operations).GetAsync(resourceGroupName, scriptName).GetAwaiter().GetResult(); + } + + /// + /// Gets a deployment script with a given name. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the deployment script. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IDeploymentScriptsOperations operations, string resourceGroupName, string scriptName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, scriptName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Deletes a deployment script. When operation completes, status code 200 + /// returned without content. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the deployment script. + /// + public static void Delete(this IDeploymentScriptsOperations operations, string resourceGroupName, string scriptName) + { + ((IDeploymentScriptsOperations)operations).DeleteAsync(resourceGroupName, scriptName).GetAwaiter().GetResult(); + } + + /// + /// Deletes a deployment script. When operation completes, status code 200 + /// returned without content. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the deployment script. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IDeploymentScriptsOperations operations, string resourceGroupName, string scriptName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, scriptName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Lists all deployment scripts for a given subscription. + /// + /// + /// The operations group for this extension method. + /// + public static Microsoft.Rest.Azure.IPage ListBySubscription(this IDeploymentScriptsOperations operations) + { + return ((IDeploymentScriptsOperations)operations).ListBySubscriptionAsync().GetAwaiter().GetResult(); + } + + /// + /// Lists all deployment scripts for a given subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListBySubscriptionAsync(this IDeploymentScriptsOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListBySubscriptionWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets deployment script logs for a given deployment script name. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the deployment script. + /// + public static ScriptLogsList GetLogs(this IDeploymentScriptsOperations operations, string resourceGroupName, string scriptName) + { + return ((IDeploymentScriptsOperations)operations).GetLogsAsync(resourceGroupName, scriptName).GetAwaiter().GetResult(); + } + + /// + /// Gets deployment script logs for a given deployment script name. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the deployment script. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetLogsAsync(this IDeploymentScriptsOperations operations, string resourceGroupName, string scriptName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetLogsWithHttpMessagesAsync(resourceGroupName, scriptName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets deployment script logs for a given deployment script name. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the deployment script. + /// + /// + /// The number of lines to show from the tail of the deployment script log. + /// Valid value is a positive number up to 1000. If 'tail' is not provided, all + /// available logs are shown up to container instance log capacity of 4mb. + /// + public static ScriptLog GetLogsDefault(this IDeploymentScriptsOperations operations, string resourceGroupName, string scriptName, int? tail = default(int?)) + { + return ((IDeploymentScriptsOperations)operations).GetLogsDefaultAsync(resourceGroupName, scriptName, tail).GetAwaiter().GetResult(); + } + + /// + /// Gets deployment script logs for a given deployment script name. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the deployment script. + /// + /// + /// The number of lines to show from the tail of the deployment script log. + /// Valid value is a positive number up to 1000. If 'tail' is not provided, all + /// available logs are shown up to container instance log capacity of 4mb. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetLogsDefaultAsync(this IDeploymentScriptsOperations operations, string resourceGroupName, string scriptName, int? tail = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetLogsDefaultWithHttpMessagesAsync(resourceGroupName, scriptName, tail, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Lists deployments scripts. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + public static Microsoft.Rest.Azure.IPage ListByResourceGroup(this IDeploymentScriptsOperations operations, string resourceGroupName) + { + return ((IDeploymentScriptsOperations)operations).ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Lists deployments scripts. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByResourceGroupAsync(this IDeploymentScriptsOperations operations, string resourceGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Creates a deployment script. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the deployment script. + /// + public static DeploymentScript BeginCreate(this IDeploymentScriptsOperations operations, string resourceGroupName, string scriptName, DeploymentScript deploymentScript) + { + return ((IDeploymentScriptsOperations)operations).BeginCreateAsync(resourceGroupName, scriptName, deploymentScript).GetAwaiter().GetResult(); + } + + /// + /// Creates a deployment script. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the deployment script. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateAsync(this IDeploymentScriptsOperations operations, string resourceGroupName, string scriptName, DeploymentScript deploymentScript, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateWithHttpMessagesAsync(resourceGroupName, scriptName, deploymentScript, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Lists all deployment scripts for a given subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListBySubscriptionNext(this IDeploymentScriptsOperations operations, string nextPageLink) + { + return ((IDeploymentScriptsOperations)operations).ListBySubscriptionNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists all deployment scripts for a given subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListBySubscriptionNextAsync(this IDeploymentScriptsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListBySubscriptionNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Lists deployments scripts. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListByResourceGroupNext(this IDeploymentScriptsOperations operations, string nextPageLink) + { + return ((IDeploymentScriptsOperations)operations).ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists deployments scripts. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByResourceGroupNextAsync(this IDeploymentScriptsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + } +} diff --git a/src/Resources/Resources.Sdk/Generated/DeploymentStacksClient.cs b/src/Resources/Resources.Management.Sdk/Generated/DeploymentStacksClient.cs similarity index 65% rename from src/Resources/Resources.Sdk/Generated/DeploymentStacksClient.cs rename to src/Resources/Resources.Management.Sdk/Generated/DeploymentStacksClient.cs index 8904b247023f..e38665bc444a 100644 --- a/src/Resources/Resources.Sdk/Generated/DeploymentStacksClient.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/DeploymentStacksClient.cs @@ -1,51 +1,37 @@ -// // 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 Microsoft.Rest.Serialization; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; /// /// The APIs listed in this specification can be used to manage deployment /// stack resources through the Azure Resource Manager. /// - public partial class DeploymentStacksClient : ServiceClient, IDeploymentStacksClient, IAzureClient + public partial class DeploymentStacksClient : Microsoft.Rest.ServiceClient, IDeploymentStacksClient, IAzureClient { /// /// The base URI of the service. /// public System.Uri BaseUri { get; set; } - /// /// Gets or sets json serialization settings. /// - public JsonSerializerSettings SerializationSettings { get; private set; } - + public Newtonsoft.Json.JsonSerializerSettings SerializationSettings { get; private set; } /// /// Gets or sets json deserialization settings. /// - public JsonSerializerSettings DeserializationSettings { get; private set; } - + public Newtonsoft.Json.JsonSerializerSettings DeserializationSettings { get; private set; } /// /// Credentials needed for the client to connect to Azure. /// - public ServiceClientCredentials Credentials { get; private set; } + public Microsoft.Rest.ServiceClientCredentials Credentials { get; private set; } /// /// The API version to use for this operation. @@ -55,31 +41,30 @@ public partial class DeploymentStacksClient : ServiceClient /// The ID of the target subscription. /// - public string SubscriptionId { get; set; } + public string SubscriptionId { get; set;} /// /// The preferred language for the response. /// - public string AcceptLanguage { get; set; } + public string AcceptLanguage { get; set;} /// - /// The retry timeout in seconds for Long Running Operations. Default value is - /// 30. + /// The retry timeout in seconds for Long Running Operations. Default + /// /// value is 30. /// - public int? LongRunningOperationRetryTimeout { get; set; } + public int? LongRunningOperationRetryTimeout { get; set;} /// - /// Whether a unique x-ms-client-request-id should be generated. When set to - /// true a unique x-ms-client-request-id value is generated and included in - /// each request. Default is true. + /// Whether a unique x-ms-client-request-id should be generated. When + /// /// set to true a unique x-ms-client-request-id value is generated and + /// /// included in each request. Default is true. /// - public bool? GenerateClientRequestId { get; set; } + public bool? GenerateClientRequestId { get; set;} /// - /// Gets the IDeploymentStacksOperations. + /// Gets the IDeploymentStacksOperations /// public virtual IDeploymentStacksOperations DeploymentStacks { get; private set; } - /// /// Initializes a new instance of the DeploymentStacksClient class. /// @@ -88,24 +73,22 @@ public partial class DeploymentStacksClient : ServiceClient /// /// True: will dispose the provided httpClient on calling DeploymentStacksClient.Dispose(). False: will not dispose provided httpClient - protected DeploymentStacksClient(HttpClient httpClient, bool disposeHttpClient) : base(httpClient, disposeHttpClient) + protected DeploymentStacksClient(System.Net.Http.HttpClient httpClient, bool disposeHttpClient) : base(httpClient, disposeHttpClient) { - Initialize(); + this.Initialize(); } - /// /// Initializes a new instance of the DeploymentStacksClient class. /// /// /// Optional. The delegating handlers to add to the http client pipeline. /// - protected DeploymentStacksClient(params DelegatingHandler[] handlers) : base(handlers) + protected DeploymentStacksClient(params System.Net.Http.DelegatingHandler[] handlers) : base(handlers) { - Initialize(); + this.Initialize(); } - /// - /// Initializes a new instance of the DeploymentStacksClient class. + /// Initializes a new instance of the DeploymentStacksClient class. /// /// /// Optional. The http client handler used to handle http transport. @@ -113,11 +96,10 @@ protected DeploymentStacksClient(params DelegatingHandler[] handlers) : base(han /// /// Optional. The delegating handlers to add to the http client pipeline. /// - protected DeploymentStacksClient(HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : base(rootHandler, handlers) + protected DeploymentStacksClient(System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : base(rootHandler, handlers) { - Initialize(); + this.Initialize(); } - /// /// Initializes a new instance of the DeploymentStacksClient class. /// @@ -130,15 +112,14 @@ protected DeploymentStacksClient(HttpClientHandler rootHandler, params Delegatin /// /// Thrown when a required parameter is null /// - protected DeploymentStacksClient(System.Uri baseUri, params DelegatingHandler[] handlers) : this(handlers) + protected DeploymentStacksClient(System.Uri baseUri, params System.Net.Http.DelegatingHandler[] handlers) : this(handlers) { if (baseUri == null) { throw new System.ArgumentNullException("baseUri"); } - BaseUri = baseUri; + this.BaseUri = baseUri; } - /// /// Initializes a new instance of the DeploymentStacksClient class. /// @@ -154,15 +135,15 @@ protected DeploymentStacksClient(System.Uri baseUri, params DelegatingHandler[] /// /// Thrown when a required parameter is null /// - protected DeploymentStacksClient(System.Uri baseUri, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + protected DeploymentStacksClient(System.Uri baseUri, System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : this(rootHandler, handlers) { if (baseUri == null) { throw new System.ArgumentNullException("baseUri"); } - BaseUri = baseUri; + + this.BaseUri = baseUri; } - /// /// Initializes a new instance of the DeploymentStacksClient class. /// @@ -175,23 +156,23 @@ protected DeploymentStacksClient(System.Uri baseUri, HttpClientHandler rootHandl /// /// Thrown when a required parameter is null /// - public DeploymentStacksClient(ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers) + public DeploymentStacksClient(Microsoft.Rest.ServiceClientCredentials credentials, params System.Net.Http.DelegatingHandler[] handlers) : this(handlers) { if (credentials == null) { throw new System.ArgumentNullException("credentials"); } - Credentials = credentials; - if (Credentials != null) + this.Credentials = credentials; + if (this.Credentials != null) { - Credentials.InitializeServiceClient(this); + this.Credentials.InitializeServiceClient(this); } + } - /// /// Initializes a new instance of the DeploymentStacksClient class. /// - /// + /// /// Required. Credentials needed for the client to connect to Azure. /// /// @@ -202,23 +183,23 @@ public DeploymentStacksClient(ServiceClientCredentials credentials, params Deleg /// /// Thrown when a required parameter is null /// - public DeploymentStacksClient(ServiceClientCredentials credentials, HttpClient httpClient, bool disposeHttpClient) : this(httpClient, disposeHttpClient) + public DeploymentStacksClient(Microsoft.Rest.ServiceClientCredentials credentials, System.Net.Http.HttpClient httpClient, bool disposeHttpClient) : this(httpClient, disposeHttpClient) { if (credentials == null) { throw new System.ArgumentNullException("credentials"); } - Credentials = credentials; - if (Credentials != null) + this.Credentials = credentials; + if (this.Credentials != null) { - Credentials.InitializeServiceClient(this); + this.Credentials.InitializeServiceClient(this); } + } - /// /// Initializes a new instance of the DeploymentStacksClient class. /// - /// + /// /// Required. Credentials needed for the client to connect to Azure. /// /// @@ -230,26 +211,26 @@ public DeploymentStacksClient(ServiceClientCredentials credentials, HttpClient h /// /// Thrown when a required parameter is null /// - public DeploymentStacksClient(ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + public DeploymentStacksClient(Microsoft.Rest.ServiceClientCredentials credentials, System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : this(rootHandler, handlers) { if (credentials == null) { throw new System.ArgumentNullException("credentials"); } - Credentials = credentials; - if (Credentials != null) + this.Credentials = credentials; + if (this.Credentials != null) { - Credentials.InitializeServiceClient(this); + this.Credentials.InitializeServiceClient(this); } + } - /// /// Initializes a new instance of the DeploymentStacksClient class. /// /// /// Optional. The base URI of the service. /// - /// + /// /// Required. Credentials needed for the client to connect to Azure. /// /// @@ -258,7 +239,7 @@ public DeploymentStacksClient(ServiceClientCredentials credentials, HttpClientHa /// /// Thrown when a required parameter is null /// - public DeploymentStacksClient(System.Uri baseUri, ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers) + public DeploymentStacksClient(System.Uri baseUri, Microsoft.Rest.ServiceClientCredentials credentials, params System.Net.Http.DelegatingHandler[] handlers) : this(handlers) { if (baseUri == null) { @@ -268,33 +249,30 @@ public DeploymentStacksClient(System.Uri baseUri, ServiceClientCredentials crede { throw new System.ArgumentNullException("credentials"); } - BaseUri = baseUri; - Credentials = credentials; - if (Credentials != null) + this.BaseUri = baseUri; + this.Credentials = credentials; + if (this.Credentials != null) { - Credentials.InitializeServiceClient(this); + this.Credentials.InitializeServiceClient(this); } + } - /// /// Initializes a new instance of the DeploymentStacksClient class. /// /// /// Optional. The base URI of the service. /// - /// + /// /// Required. Credentials needed for the client to connect to Azure. /// /// /// Optional. The http client handler used to handle http transport. /// - /// - /// Optional. The delegating handlers to add to the http client pipeline. - /// /// /// Thrown when a required parameter is null /// - public DeploymentStacksClient(System.Uri baseUri, ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + public DeploymentStacksClient(System.Uri baseUri, Microsoft.Rest.ServiceClientCredentials credentials, System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : this(rootHandler, handlers) { if (baseUri == null) { @@ -304,58 +282,59 @@ public DeploymentStacksClient(System.Uri baseUri, ServiceClientCredentials crede { throw new System.ArgumentNullException("credentials"); } - BaseUri = baseUri; - Credentials = credentials; - if (Credentials != null) + this.BaseUri = baseUri; + this.Credentials = credentials; + if (this.Credentials != null) { - Credentials.InitializeServiceClient(this); + this.Credentials.InitializeServiceClient(this); } + } - /// /// An optional partial-method to perform custom initialization. /// partial void CustomInitialize(); + /// /// Initializes client properties. /// private void Initialize() { - DeploymentStacks = new DeploymentStacksOperations(this); - BaseUri = new System.Uri("https://management.azure.com"); - ApiVersion = "2022-08-01-preview"; - AcceptLanguage = "en-US"; - LongRunningOperationRetryTimeout = 30; - GenerateClientRequestId = true; - SerializationSettings = new JsonSerializerSettings + this.DeploymentStacks = new DeploymentStacksOperations(this); + this.BaseUri = new System.Uri("https://management.azure.com"); + this.ApiVersion = "2022-08-01-preview"; + this.AcceptLanguage = "en-US"; + this.LongRunningOperationRetryTimeout = 30; + this.GenerateClientRequestId = true; + SerializationSettings = new Newtonsoft.Json.JsonSerializerSettings { Formatting = Newtonsoft.Json.Formatting.Indented, DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, - ContractResolver = new ReadOnlyJsonContractResolver(), - Converters = new List + ContractResolver = new Microsoft.Rest.Serialization.ReadOnlyJsonContractResolver(), + Converters = new System.Collections.Generic.List { - new Iso8601TimeSpanConverter() + new Microsoft.Rest.Serialization.Iso8601TimeSpanConverter() } }; - SerializationSettings.Converters.Add(new TransformationJsonConverter()); - DeserializationSettings = new JsonSerializerSettings + SerializationSettings.Converters.Add(new Microsoft.Rest.Serialization.TransformationJsonConverter()); + DeserializationSettings = new Newtonsoft.Json.JsonSerializerSettings { DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, - ContractResolver = new ReadOnlyJsonContractResolver(), - Converters = new List + ContractResolver = new Microsoft.Rest.Serialization.ReadOnlyJsonContractResolver(), + Converters = new System.Collections.Generic.List { - new Iso8601TimeSpanConverter() + new Microsoft.Rest.Serialization.Iso8601TimeSpanConverter() } }; CustomInitialize(); - DeserializationSettings.Converters.Add(new TransformationJsonConverter()); - DeserializationSettings.Converters.Add(new CloudErrorJsonConverter()); + DeserializationSettings.Converters.Add(new Microsoft.Rest.Serialization.TransformationJsonConverter()); + DeserializationSettings.Converters.Add(new Microsoft.Rest.Azure.CloudErrorJsonConverter()); } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/DeploymentStacksOperations.cs b/src/Resources/Resources.Management.Sdk/Generated/DeploymentStacksOperations.cs similarity index 56% rename from src/Resources/Resources.Sdk/Generated/DeploymentStacksOperations.cs rename to src/Resources/Resources.Management.Sdk/Generated/DeploymentStacksOperations.cs index b93d51b74b2c..6a3666048323 100644 --- a/src/Resources/Resources.Sdk/Generated/DeploymentStacksOperations.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/DeploymentStacksOperations.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; /// /// DeploymentStacksOperations operations. /// - internal partial class DeploymentStacksOperations : IServiceOperations, IDeploymentStacksOperations + internal partial class DeploymentStacksOperations : Microsoft.Rest.IServiceOperations, IDeploymentStacksOperations { /// /// Initializes a new instance of the DeploymentStacksOperations class. @@ -36,13 +24,13 @@ internal partial class DeploymentStacksOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal DeploymentStacksOperations(DeploymentStacksClient client) + internal DeploymentStacksOperations (DeploymentStacksClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -62,13 +50,13 @@ internal DeploymentStacksOperations(DeploymentStacksClient 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 /// /// @@ -77,90 +65,91 @@ internal DeploymentStacksOperations(DeploymentStacksClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListAtResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListAtResourceGroupWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - 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"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } 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 (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) + if (this.Client.ApiVersion == null) { - if (Client.ApiVersion.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); - } + 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("resourceGroupName", resourceGroupName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAtResourceGroup", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAtResourceGroup", 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}/providers/Microsoft.Resources/deploymentStacks").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - 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) @@ -172,50 +161,51 @@ internal DeploymentStacksOperations(DeploymentStacksClient 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 DeploymentStacksErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DeploymentStacksError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + DeploymentStacksError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -225,9 +215,10 @@ internal DeploymentStacksOperations(DeploymentStacksClient 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(); @@ -238,25 +229,29 @@ internal DeploymentStacksOperations(DeploymentStacksClient 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; - } + + + + + } /// /// Lists all the Deployment Stacks within the specified subscription. /// @@ -266,13 +261,13 @@ internal DeploymentStacksOperations(DeploymentStacksClient 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 /// /// @@ -281,73 +276,74 @@ internal DeploymentStacksOperations(DeploymentStacksClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListAtSubscriptionWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListAtSubscriptionWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - 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"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } - if (Client.ApiVersion == null) + if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) - { - if (Client.ApiVersion.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); - } + 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("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAtSubscription", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAtSubscription", 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/deploymentStacks").ToString(); - _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) @@ -359,50 +355,51 @@ internal DeploymentStacksOperations(DeploymentStacksClient 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 DeploymentStacksErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DeploymentStacksError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + DeploymentStacksError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -412,9 +409,10 @@ internal DeploymentStacksOperations(DeploymentStacksClient 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(); @@ -425,25 +423,29 @@ internal DeploymentStacksOperations(DeploymentStacksClient 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; - } + + + + + } /// /// Lists all the Deployment Stacks within the specified management group. /// @@ -456,13 +458,13 @@ internal DeploymentStacksOperations(DeploymentStacksClient 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 /// /// @@ -471,82 +473,83 @@ internal DeploymentStacksOperations(DeploymentStacksClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListAtManagementGroupWithHttpMessagesAsync(string managementGroupId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListAtManagementGroupWithHttpMessagesAsync(string managementGroupId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (managementGroupId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "managementGroupId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "managementGroupId"); } if (managementGroupId != null) { if (managementGroupId.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "managementGroupId", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "managementGroupId", 90); } if (managementGroupId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "managementGroupId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "managementGroupId", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(managementGroupId, "^[-\\w\\._\\(\\)]+$")) { - throw new ValidationException(ValidationRules.Pattern, "managementGroupId", "^[-\\w\\._\\(\\)]+$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "managementGroupId", "^[-\\w\\._\\(\\)]+$"); } } - if (Client.ApiVersion == null) + if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) - { - if (Client.ApiVersion.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); - } + 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("managementGroupId", managementGroupId); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAtManagementGroup", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAtManagementGroup", 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/{managementGroupId}/providers/Microsoft.Resources/deploymentStacks").ToString(); _url = _url.Replace("{managementGroupId}", System.Uri.EscapeDataString(managementGroupId)); - 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) @@ -558,50 +561,51 @@ internal DeploymentStacksOperations(DeploymentStacksClient 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 DeploymentStacksErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DeploymentStacksError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + DeploymentStacksError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -611,9 +615,10 @@ internal DeploymentStacksOperations(DeploymentStacksClient 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(); @@ -624,25 +629,29 @@ internal DeploymentStacksOperations(DeploymentStacksClient 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; - } + + + + + } /// /// Creates or updates a Deployment Stack. /// @@ -656,16 +665,16 @@ internal DeploymentStacksOperations(DeploymentStacksClient client) /// Deployment Stack supplied to the operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateAtResourceGroupWithHttpMessagesAsync(string resourceGroupName, string deploymentStackName, DeploymentStack deploymentStack, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateAtResourceGroupWithHttpMessagesAsync(string resourceGroupName, string deploymentStackName, DeploymentStack deploymentStack, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateAtResourceGroupWithHttpMessagesAsync(resourceGroupName, deploymentStackName, deploymentStack, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateAtResourceGroupWithHttpMessagesAsync(resourceGroupName, deploymentStackName, deploymentStack, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -683,13 +692,13 @@ internal DeploymentStacksOperations(DeploymentStacksClient 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 /// /// @@ -698,111 +707,112 @@ internal DeploymentStacksOperations(DeploymentStacksClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetAtResourceGroupWithHttpMessagesAsync(string resourceGroupName, string deploymentStackName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetAtResourceGroupWithHttpMessagesAsync(string resourceGroupName, string deploymentStackName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - 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"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } 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 (deploymentStackName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "deploymentStackName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "deploymentStackName"); } if (deploymentStackName != null) { if (deploymentStackName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "deploymentStackName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "deploymentStackName", 90); } if (deploymentStackName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "deploymentStackName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "deploymentStackName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(deploymentStackName, "^[-\\w\\._\\(\\)]+$")) { - throw new ValidationException(ValidationRules.Pattern, "deploymentStackName", "^[-\\w\\._\\(\\)]+$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "deploymentStackName", "^[-\\w\\._\\(\\)]+$"); } } - if (Client.ApiVersion == null) + if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) - { - if (Client.ApiVersion.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); - } + 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("resourceGroupName", resourceGroupName); tracingParameters.Add("deploymentStackName", deploymentStackName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetAtResourceGroup", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetAtResourceGroup", 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}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{deploymentStackName}", System.Uri.EscapeDataString(deploymentStackName)); - 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) @@ -814,50 +824,51 @@ internal DeploymentStacksOperations(DeploymentStacksClient 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 DeploymentStacksErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DeploymentStacksError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + DeploymentStacksError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -867,9 +878,10 @@ internal DeploymentStacksOperations(DeploymentStacksClient 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(); @@ -880,28 +892,31 @@ internal DeploymentStacksOperations(DeploymentStacksClient 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; - } + + + + + } /// - /// Deletes a Deployment Stack by name. When operation completes, status code - /// 200 returned without content. + /// Deletes a Deployment Stack by name. When operation completes, status code 200 returned without content. /// /// /// The name of the resource group. The name is case insensitive. @@ -910,24 +925,22 @@ internal DeploymentStacksOperations(DeploymentStacksClient client) /// Name of the deployment stack. /// /// - /// Flag to indicate delete rather than detach for the resources. Possible - /// values include: 'delete', 'detach' + /// Flag to indicate delete rather than detach for the resources. /// /// /// Flag to indicate delete rather than detach for the resource groups. - /// Possible values include: 'delete', 'detach' /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> DeleteAtResourceGroupWithHttpMessagesAsync(string resourceGroupName, string deploymentStackName, string unmanageActionResources = default(string), string unmanageActionResourceGroups = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> DeleteAtResourceGroupWithHttpMessagesAsync(string resourceGroupName, string deploymentStackName, string unmanageActionResources = default(string), string unmanageActionResourceGroups = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationHeaderResponse _response = await BeginDeleteAtResourceGroupWithHttpMessagesAsync(resourceGroupName, deploymentStackName, unmanageActionResources, unmanageActionResourceGroups, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationHeaderResponse _response = await BeginDeleteAtResourceGroupWithHttpMessagesAsync(resourceGroupName, deploymentStackName, unmanageActionResources, unmanageActionResourceGroups, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -940,16 +953,16 @@ internal DeploymentStacksOperations(DeploymentStacksClient client) /// Deployment Stack supplied to the operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateAtSubscriptionWithHttpMessagesAsync(string deploymentStackName, DeploymentStack deploymentStack, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateAtSubscriptionWithHttpMessagesAsync(string deploymentStackName, DeploymentStack deploymentStack, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateAtSubscriptionWithHttpMessagesAsync(deploymentStackName, deploymentStack, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateAtSubscriptionWithHttpMessagesAsync(deploymentStackName, deploymentStack, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -964,13 +977,13 @@ internal DeploymentStacksOperations(DeploymentStacksClient 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 /// /// @@ -979,94 +992,95 @@ internal DeploymentStacksOperations(DeploymentStacksClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetAtSubscriptionWithHttpMessagesAsync(string deploymentStackName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetAtSubscriptionWithHttpMessagesAsync(string deploymentStackName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - 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"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (deploymentStackName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "deploymentStackName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "deploymentStackName"); } if (deploymentStackName != null) { if (deploymentStackName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "deploymentStackName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "deploymentStackName", 90); } if (deploymentStackName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "deploymentStackName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "deploymentStackName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(deploymentStackName, "^[-\\w\\._\\(\\)]+$")) { - throw new ValidationException(ValidationRules.Pattern, "deploymentStackName", "^[-\\w\\._\\(\\)]+$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "deploymentStackName", "^[-\\w\\._\\(\\)]+$"); } } - if (Client.ApiVersion == null) + if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) - { - if (Client.ApiVersion.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); - } + 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("deploymentStackName", deploymentStackName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetAtSubscription", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetAtSubscription", 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/deploymentStacks/{deploymentStackName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{deploymentStackName}", System.Uri.EscapeDataString(deploymentStackName)); - 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) @@ -1078,50 +1092,51 @@ internal DeploymentStacksOperations(DeploymentStacksClient 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 DeploymentStacksErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DeploymentStacksError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + DeploymentStacksError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1131,9 +1146,10 @@ internal DeploymentStacksOperations(DeploymentStacksClient 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(); @@ -1144,51 +1160,52 @@ internal DeploymentStacksOperations(DeploymentStacksClient 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; - } + + + + + } /// - /// Deletes a Deployment Stack by name. When operation completes, status code - /// 200 returned without content. + /// Deletes a Deployment Stack by name. When operation completes, status code 200 returned without content. /// /// /// Name of the deployment stack. /// /// - /// Flag to indicate delete rather than detach for the resources. Possible - /// values include: 'delete', 'detach' + /// Flag to indicate delete rather than detach for the resources. /// /// /// Flag to indicate delete rather than detach for the resource groups. - /// Possible values include: 'delete', 'detach' /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> DeleteAtSubscriptionWithHttpMessagesAsync(string deploymentStackName, string unmanageActionResources = default(string), string unmanageActionResourceGroups = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> DeleteAtSubscriptionWithHttpMessagesAsync(string deploymentStackName, string unmanageActionResources = default(string), string unmanageActionResourceGroups = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationHeaderResponse _response = await BeginDeleteAtSubscriptionWithHttpMessagesAsync(deploymentStackName, unmanageActionResources, unmanageActionResourceGroups, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationHeaderResponse _response = await BeginDeleteAtSubscriptionWithHttpMessagesAsync(deploymentStackName, unmanageActionResources, unmanageActionResourceGroups, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -1204,16 +1221,16 @@ internal DeploymentStacksOperations(DeploymentStacksClient client) /// Deployment Stack supplied to the operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateAtManagementGroupWithHttpMessagesAsync(string managementGroupId, string deploymentStackName, DeploymentStack deploymentStack, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateAtManagementGroupWithHttpMessagesAsync(string managementGroupId, string deploymentStackName, DeploymentStack deploymentStack, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateAtManagementGroupWithHttpMessagesAsync(managementGroupId, deploymentStackName, deploymentStack, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateAtManagementGroupWithHttpMessagesAsync(managementGroupId, deploymentStackName, deploymentStack, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -1231,13 +1248,13 @@ internal DeploymentStacksOperations(DeploymentStacksClient 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 /// /// @@ -1246,103 +1263,104 @@ internal DeploymentStacksOperations(DeploymentStacksClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetAtManagementGroupWithHttpMessagesAsync(string managementGroupId, string deploymentStackName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetAtManagementGroupWithHttpMessagesAsync(string managementGroupId, string deploymentStackName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (managementGroupId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "managementGroupId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "managementGroupId"); } if (managementGroupId != null) { if (managementGroupId.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "managementGroupId", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "managementGroupId", 90); } if (managementGroupId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "managementGroupId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "managementGroupId", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(managementGroupId, "^[-\\w\\._\\(\\)]+$")) { - throw new ValidationException(ValidationRules.Pattern, "managementGroupId", "^[-\\w\\._\\(\\)]+$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "managementGroupId", "^[-\\w\\._\\(\\)]+$"); } } if (deploymentStackName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "deploymentStackName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "deploymentStackName"); } if (deploymentStackName != null) { if (deploymentStackName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "deploymentStackName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "deploymentStackName", 90); } if (deploymentStackName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "deploymentStackName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "deploymentStackName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(deploymentStackName, "^[-\\w\\._\\(\\)]+$")) { - throw new ValidationException(ValidationRules.Pattern, "deploymentStackName", "^[-\\w\\._\\(\\)]+$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "deploymentStackName", "^[-\\w\\._\\(\\)]+$"); } } - if (Client.ApiVersion == null) + if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) - { - if (Client.ApiVersion.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); - } + 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("managementGroupId", managementGroupId); tracingParameters.Add("deploymentStackName", deploymentStackName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetAtManagementGroup", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetAtManagementGroup", 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/{managementGroupId}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName}").ToString(); _url = _url.Replace("{managementGroupId}", System.Uri.EscapeDataString(managementGroupId)); _url = _url.Replace("{deploymentStackName}", System.Uri.EscapeDataString(deploymentStackName)); - 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) @@ -1354,50 +1372,51 @@ internal DeploymentStacksOperations(DeploymentStacksClient 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 DeploymentStacksErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DeploymentStacksError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + DeploymentStacksError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1407,9 +1426,10 @@ internal DeploymentStacksOperations(DeploymentStacksClient 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(); @@ -1420,28 +1440,31 @@ internal DeploymentStacksOperations(DeploymentStacksClient 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; - } + + + + + } /// - /// Deletes a Deployment Stack by name. When operation completes, status code - /// 200 returned without content. + /// Deletes a Deployment Stack by name. When operation completes, status code 200 returned without content. /// /// /// Management Group. @@ -1450,28 +1473,25 @@ internal DeploymentStacksOperations(DeploymentStacksClient client) /// Name of the deployment stack. /// /// - /// Flag to indicate delete rather than detach for the resources. Possible - /// values include: 'delete', 'detach' + /// Flag to indicate delete rather than detach for the resources. /// /// /// Flag to indicate delete rather than detach for the resource groups. - /// Possible values include: 'delete', 'detach' /// /// /// Flag to indicate delete rather than detach for the management groups. - /// Possible values include: 'delete', 'detach' /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> DeleteAtManagementGroupWithHttpMessagesAsync(string managementGroupId, string deploymentStackName, string unmanageActionResources = default(string), string unmanageActionResourceGroups = default(string), string unmanageActionManagementGroups = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> DeleteAtManagementGroupWithHttpMessagesAsync(string managementGroupId, string deploymentStackName, string unmanageActionResources = default(string), string unmanageActionResourceGroups = default(string), string unmanageActionManagementGroups = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationHeaderResponse _response = await BeginDeleteAtManagementGroupWithHttpMessagesAsync(managementGroupId, deploymentStackName, unmanageActionResources, unmanageActionResourceGroups, unmanageActionManagementGroups, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationHeaderResponse _response = await BeginDeleteAtManagementGroupWithHttpMessagesAsync(managementGroupId, deploymentStackName, unmanageActionResources, unmanageActionResourceGroups, unmanageActionManagementGroups, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -1489,13 +1509,13 @@ internal DeploymentStacksOperations(DeploymentStacksClient 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 /// /// @@ -1504,111 +1524,112 @@ internal DeploymentStacksOperations(DeploymentStacksClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ExportTemplateAtResourceGroupWithHttpMessagesAsync(string resourceGroupName, string deploymentStackName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> ExportTemplateAtResourceGroupWithHttpMessagesAsync(string resourceGroupName, string deploymentStackName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - 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"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } 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 (deploymentStackName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "deploymentStackName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "deploymentStackName"); } if (deploymentStackName != null) { if (deploymentStackName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "deploymentStackName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "deploymentStackName", 90); } if (deploymentStackName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "deploymentStackName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "deploymentStackName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(deploymentStackName, "^[-\\w\\._\\(\\)]+$")) { - throw new ValidationException(ValidationRules.Pattern, "deploymentStackName", "^[-\\w\\._\\(\\)]+$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "deploymentStackName", "^[-\\w\\._\\(\\)]+$"); } } - if (Client.ApiVersion == null) + if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) - { - if (Client.ApiVersion.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); - } + 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("resourceGroupName", resourceGroupName); tracingParameters.Add("deploymentStackName", deploymentStackName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ExportTemplateAtResourceGroup", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ExportTemplateAtResourceGroup", 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}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName}/exportTemplate").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{deploymentStackName}", System.Uri.EscapeDataString(deploymentStackName)); - 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("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _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) @@ -1620,50 +1641,51 @@ internal DeploymentStacksOperations(DeploymentStacksClient 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 DeploymentStacksErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DeploymentStacksError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + DeploymentStacksError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1673,9 +1695,10 @@ internal DeploymentStacksOperations(DeploymentStacksClient 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(); @@ -1686,25 +1709,29 @@ internal DeploymentStacksOperations(DeploymentStacksClient 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; - } + + + + + } /// /// Exports the template used to create the deployment stack. /// @@ -1717,13 +1744,13 @@ internal DeploymentStacksOperations(DeploymentStacksClient 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 /// /// @@ -1732,94 +1759,95 @@ internal DeploymentStacksOperations(DeploymentStacksClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ExportTemplateAtSubscriptionWithHttpMessagesAsync(string deploymentStackName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> ExportTemplateAtSubscriptionWithHttpMessagesAsync(string deploymentStackName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - 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"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (deploymentStackName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "deploymentStackName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "deploymentStackName"); } if (deploymentStackName != null) { if (deploymentStackName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "deploymentStackName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "deploymentStackName", 90); } if (deploymentStackName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "deploymentStackName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "deploymentStackName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(deploymentStackName, "^[-\\w\\._\\(\\)]+$")) { - throw new ValidationException(ValidationRules.Pattern, "deploymentStackName", "^[-\\w\\._\\(\\)]+$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "deploymentStackName", "^[-\\w\\._\\(\\)]+$"); } } - if (Client.ApiVersion == null) + if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) - { - if (Client.ApiVersion.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); - } + 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("deploymentStackName", deploymentStackName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ExportTemplateAtSubscription", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ExportTemplateAtSubscription", 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/deploymentStacks/{deploymentStackName}/exportTemplate").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{deploymentStackName}", System.Uri.EscapeDataString(deploymentStackName)); - 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("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _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) @@ -1831,50 +1859,51 @@ internal DeploymentStacksOperations(DeploymentStacksClient 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 DeploymentStacksErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DeploymentStacksError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + DeploymentStacksError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1884,9 +1913,10 @@ internal DeploymentStacksOperations(DeploymentStacksClient 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(); @@ -1897,25 +1927,29 @@ internal DeploymentStacksOperations(DeploymentStacksClient 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; - } + + + + + } /// /// Exports the template used to create the deployment stack. /// @@ -1931,13 +1965,13 @@ internal DeploymentStacksOperations(DeploymentStacksClient 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 /// /// @@ -1946,103 +1980,104 @@ internal DeploymentStacksOperations(DeploymentStacksClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ExportTemplateAtManagementGroupWithHttpMessagesAsync(string managementGroupId, string deploymentStackName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> ExportTemplateAtManagementGroupWithHttpMessagesAsync(string managementGroupId, string deploymentStackName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (managementGroupId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "managementGroupId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "managementGroupId"); } if (managementGroupId != null) { if (managementGroupId.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "managementGroupId", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "managementGroupId", 90); } if (managementGroupId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "managementGroupId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "managementGroupId", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(managementGroupId, "^[-\\w\\._\\(\\)]+$")) { - throw new ValidationException(ValidationRules.Pattern, "managementGroupId", "^[-\\w\\._\\(\\)]+$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "managementGroupId", "^[-\\w\\._\\(\\)]+$"); } } if (deploymentStackName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "deploymentStackName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "deploymentStackName"); } if (deploymentStackName != null) { if (deploymentStackName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "deploymentStackName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "deploymentStackName", 90); } if (deploymentStackName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "deploymentStackName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "deploymentStackName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(deploymentStackName, "^[-\\w\\._\\(\\)]+$")) { - throw new ValidationException(ValidationRules.Pattern, "deploymentStackName", "^[-\\w\\._\\(\\)]+$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "deploymentStackName", "^[-\\w\\._\\(\\)]+$"); } } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) + if (this.Client.ApiVersion == null) { - if (Client.ApiVersion.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); - } + 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("managementGroupId", managementGroupId); tracingParameters.Add("deploymentStackName", deploymentStackName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ExportTemplateAtManagementGroup", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ExportTemplateAtManagementGroup", 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/{managementGroupId}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName}/exportTemplate").ToString(); _url = _url.Replace("{managementGroupId}", System.Uri.EscapeDataString(managementGroupId)); _url = _url.Replace("{deploymentStackName}", System.Uri.EscapeDataString(deploymentStackName)); - 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("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _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) @@ -2054,50 +2089,51 @@ internal DeploymentStacksOperations(DeploymentStacksClient 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 DeploymentStacksErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DeploymentStacksError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + DeploymentStacksError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2107,9 +2143,10 @@ internal DeploymentStacksOperations(DeploymentStacksClient 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(); @@ -2120,25 +2157,29 @@ internal DeploymentStacksOperations(DeploymentStacksClient 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; - } + + + + + } /// /// Creates or updates a Deployment Stack. /// @@ -2157,13 +2198,13 @@ internal DeploymentStacksOperations(DeploymentStacksClient 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 /// /// @@ -2172,120 +2213,121 @@ internal DeploymentStacksOperations(DeploymentStacksClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateAtResourceGroupWithHttpMessagesAsync(string resourceGroupName, string deploymentStackName, DeploymentStack deploymentStack, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateAtResourceGroupWithHttpMessagesAsync(string resourceGroupName, string deploymentStackName, DeploymentStack deploymentStack, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (deploymentStack == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "deploymentStack"); + } + if (deploymentStack != null) + { + deploymentStack.Validate(); + } + 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"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } 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 (deploymentStackName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "deploymentStackName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "deploymentStackName"); } if (deploymentStackName != null) { if (deploymentStackName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "deploymentStackName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "deploymentStackName", 90); } if (deploymentStackName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "deploymentStackName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "deploymentStackName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(deploymentStackName, "^[-\\w\\._\\(\\)]+$")) { - throw new ValidationException(ValidationRules.Pattern, "deploymentStackName", "^[-\\w\\._\\(\\)]+$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "deploymentStackName", "^[-\\w\\._\\(\\)]+$"); } } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) - { - if (Client.ApiVersion.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); - } - } - if (deploymentStack == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "deploymentStack"); - } - if (deploymentStack != null) + if (this.Client.ApiVersion == null) { - deploymentStack.Validate(); + 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("resourceGroupName", resourceGroupName); tracingParameters.Add("deploymentStackName", deploymentStackName); + tracingParameters.Add("deploymentStack", deploymentStack); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdateAtResourceGroup", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdateAtResourceGroup", 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}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{deploymentStackName}", System.Uri.EscapeDataString(deploymentStackName)); - 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("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _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) @@ -2297,56 +2339,57 @@ internal DeploymentStacksOperations(DeploymentStacksClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(deploymentStack != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(deploymentStack, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(deploymentStack, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + 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 && (int)_statusCode != 201) { var ex = new DeploymentStacksErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DeploymentStacksError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + DeploymentStacksError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2356,9 +2399,10 @@ internal DeploymentStacksOperations(DeploymentStacksClient 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(); @@ -2369,16 +2413,16 @@ internal DeploymentStacksOperations(DeploymentStacksClient 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); } } // Deserialize Response @@ -2387,25 +2431,29 @@ internal DeploymentStacksOperations(DeploymentStacksClient 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; - } + + + + + } /// /// Deletes a Deployment Stack by name. When operation completes, status code /// 200 returned without content. @@ -2417,12 +2465,10 @@ internal DeploymentStacksOperations(DeploymentStacksClient client) /// Name of the deployment stack. /// /// - /// Flag to indicate delete rather than detach for the resources. Possible - /// values include: 'delete', 'detach' + /// Flag to indicate delete rather than detach for the resources. /// /// /// Flag to indicate delete rather than detach for the resource groups. - /// Possible values include: 'delete', 'detach' /// /// /// Headers that will be added to request. @@ -2430,10 +2476,10 @@ internal DeploymentStacksOperations(DeploymentStacksClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -2442,85 +2488,89 @@ internal DeploymentStacksOperations(DeploymentStacksClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginDeleteAtResourceGroupWithHttpMessagesAsync(string resourceGroupName, string deploymentStackName, string unmanageActionResources = default(string), string unmanageActionResourceGroups = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginDeleteAtResourceGroupWithHttpMessagesAsync(string resourceGroupName, string deploymentStackName, string unmanageActionResources = default(string), string unmanageActionResourceGroups = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - 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"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } 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 (deploymentStackName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "deploymentStackName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "deploymentStackName"); } if (deploymentStackName != null) { if (deploymentStackName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "deploymentStackName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "deploymentStackName", 90); } if (deploymentStackName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "deploymentStackName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "deploymentStackName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(deploymentStackName, "^[-\\w\\._\\(\\)]+$")) { - throw new ValidationException(ValidationRules.Pattern, "deploymentStackName", "^[-\\w\\._\\(\\)]+$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "deploymentStackName", "^[-\\w\\._\\(\\)]+$"); } } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) + + + if (this.Client.ApiVersion == null) { - if (Client.ApiVersion.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); - } + 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("resourceGroupName", resourceGroupName); tracingParameters.Add("deploymentStackName", deploymentStackName); tracingParameters.Add("unmanageActionResources", unmanageActionResources); tracingParameters.Add("unmanageActionResourceGroups", unmanageActionResourceGroups); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDeleteAtResourceGroup", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDeleteAtResourceGroup", 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}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{deploymentStackName}", System.Uri.EscapeDataString(deploymentStackName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (unmanageActionResources != null) { _queryParameters.Add(string.Format("unmanageAction.Resources={0}", System.Uri.EscapeDataString(unmanageActionResources))); @@ -2529,34 +2579,33 @@ internal DeploymentStacksOperations(DeploymentStacksClient client) { _queryParameters.Add(string.Format("unmanageAction.ResourceGroups={0}", System.Uri.EscapeDataString(unmanageActionResourceGroups))); } - 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("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _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) @@ -2568,50 +2617,51 @@ internal DeploymentStacksOperations(DeploymentStacksClient 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 && (int)_statusCode != 202 && (int)_statusCode != 204) { var ex = new DeploymentStacksErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DeploymentStacksError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + DeploymentStacksError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2621,33 +2671,38 @@ internal DeploymentStacksOperations(DeploymentStacksClient client) throw ex; } // Create Result - var _result = new AzureOperationHeaderResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(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 headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Creates or updates a Deployment Stack. /// @@ -2663,13 +2718,13 @@ internal DeploymentStacksOperations(DeploymentStacksClient 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 /// /// @@ -2678,103 +2733,104 @@ internal DeploymentStacksOperations(DeploymentStacksClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateAtSubscriptionWithHttpMessagesAsync(string deploymentStackName, DeploymentStack deploymentStack, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateAtSubscriptionWithHttpMessagesAsync(string deploymentStackName, DeploymentStack deploymentStack, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (deploymentStack == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "deploymentStack"); + } + if (deploymentStack != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + deploymentStack.Validate(); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId == null) { - if (Client.SubscriptionId.Length < 1) + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (deploymentStackName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "deploymentStackName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "deploymentStackName"); } if (deploymentStackName != null) { if (deploymentStackName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "deploymentStackName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "deploymentStackName", 90); } if (deploymentStackName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "deploymentStackName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "deploymentStackName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(deploymentStackName, "^[-\\w\\._\\(\\)]+$")) { - throw new ValidationException(ValidationRules.Pattern, "deploymentStackName", "^[-\\w\\._\\(\\)]+$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "deploymentStackName", "^[-\\w\\._\\(\\)]+$"); } } - if (Client.ApiVersion == null) + if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) - { - if (Client.ApiVersion.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); - } - } - if (deploymentStack == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "deploymentStack"); - } - if (deploymentStack != null) - { - deploymentStack.Validate(); + 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("deploymentStackName", deploymentStackName); + tracingParameters.Add("deploymentStack", deploymentStack); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdateAtSubscription", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdateAtSubscription", 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/deploymentStacks/{deploymentStackName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{deploymentStackName}", System.Uri.EscapeDataString(deploymentStackName)); - 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("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _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) @@ -2786,56 +2842,57 @@ internal DeploymentStacksOperations(DeploymentStacksClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(deploymentStack != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(deploymentStack, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(deploymentStack, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + 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 && (int)_statusCode != 201) { var ex = new DeploymentStacksErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DeploymentStacksError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + DeploymentStacksError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2845,9 +2902,10 @@ internal DeploymentStacksOperations(DeploymentStacksClient 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(); @@ -2858,16 +2916,16 @@ internal DeploymentStacksOperations(DeploymentStacksClient 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); } } // Deserialize Response @@ -2876,25 +2934,29 @@ internal DeploymentStacksOperations(DeploymentStacksClient 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; - } + + + + + } /// /// Deletes a Deployment Stack by name. When operation completes, status code /// 200 returned without content. @@ -2903,12 +2965,10 @@ internal DeploymentStacksOperations(DeploymentStacksClient client) /// Name of the deployment stack. /// /// - /// Flag to indicate delete rather than detach for the resources. Possible - /// values include: 'delete', 'detach' + /// Flag to indicate delete rather than detach for the resources. /// /// /// Flag to indicate delete rather than detach for the resource groups. - /// Possible values include: 'delete', 'detach' /// /// /// Headers that will be added to request. @@ -2916,10 +2976,10 @@ internal DeploymentStacksOperations(DeploymentStacksClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -2928,68 +2988,72 @@ internal DeploymentStacksOperations(DeploymentStacksClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginDeleteAtSubscriptionWithHttpMessagesAsync(string deploymentStackName, string unmanageActionResources = default(string), string unmanageActionResourceGroups = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginDeleteAtSubscriptionWithHttpMessagesAsync(string deploymentStackName, string unmanageActionResources = default(string), string unmanageActionResourceGroups = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - 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"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (deploymentStackName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "deploymentStackName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "deploymentStackName"); } if (deploymentStackName != null) { if (deploymentStackName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "deploymentStackName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "deploymentStackName", 90); } if (deploymentStackName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "deploymentStackName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "deploymentStackName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(deploymentStackName, "^[-\\w\\._\\(\\)]+$")) { - throw new ValidationException(ValidationRules.Pattern, "deploymentStackName", "^[-\\w\\._\\(\\)]+$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "deploymentStackName", "^[-\\w\\._\\(\\)]+$"); } } - if (Client.ApiVersion == null) + + + if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) - { - if (Client.ApiVersion.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); - } + 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("deploymentStackName", deploymentStackName); tracingParameters.Add("unmanageActionResources", unmanageActionResources); tracingParameters.Add("unmanageActionResourceGroups", unmanageActionResourceGroups); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDeleteAtSubscription", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDeleteAtSubscription", 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/deploymentStacks/{deploymentStackName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{deploymentStackName}", System.Uri.EscapeDataString(deploymentStackName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (unmanageActionResources != null) { _queryParameters.Add(string.Format("unmanageAction.Resources={0}", System.Uri.EscapeDataString(unmanageActionResources))); @@ -2998,34 +3062,33 @@ internal DeploymentStacksOperations(DeploymentStacksClient client) { _queryParameters.Add(string.Format("unmanageAction.ResourceGroups={0}", System.Uri.EscapeDataString(unmanageActionResourceGroups))); } - 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("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _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) @@ -3037,50 +3100,51 @@ internal DeploymentStacksOperations(DeploymentStacksClient 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 && (int)_statusCode != 202 && (int)_statusCode != 204) { var ex = new DeploymentStacksErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DeploymentStacksError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + DeploymentStacksError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -3090,33 +3154,38 @@ internal DeploymentStacksOperations(DeploymentStacksClient client) throw ex; } // Create Result - var _result = new AzureOperationHeaderResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(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 headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Creates or updates a Deployment Stack. /// @@ -3135,13 +3204,13 @@ internal DeploymentStacksOperations(DeploymentStacksClient 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 /// /// @@ -3150,112 +3219,113 @@ internal DeploymentStacksOperations(DeploymentStacksClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateAtManagementGroupWithHttpMessagesAsync(string managementGroupId, string deploymentStackName, DeploymentStack deploymentStack, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateAtManagementGroupWithHttpMessagesAsync(string managementGroupId, string deploymentStackName, DeploymentStack deploymentStack, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + + if (deploymentStack == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "deploymentStack"); + } + if (deploymentStack != null) + { + deploymentStack.Validate(); + } if (managementGroupId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "managementGroupId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "managementGroupId"); } if (managementGroupId != null) { if (managementGroupId.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "managementGroupId", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "managementGroupId", 90); } if (managementGroupId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "managementGroupId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "managementGroupId", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(managementGroupId, "^[-\\w\\._\\(\\)]+$")) { - throw new ValidationException(ValidationRules.Pattern, "managementGroupId", "^[-\\w\\._\\(\\)]+$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "managementGroupId", "^[-\\w\\._\\(\\)]+$"); } } if (deploymentStackName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "deploymentStackName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "deploymentStackName"); } if (deploymentStackName != null) { if (deploymentStackName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "deploymentStackName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "deploymentStackName", 90); } if (deploymentStackName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "deploymentStackName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "deploymentStackName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(deploymentStackName, "^[-\\w\\._\\(\\)]+$")) { - throw new ValidationException(ValidationRules.Pattern, "deploymentStackName", "^[-\\w\\._\\(\\)]+$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "deploymentStackName", "^[-\\w\\._\\(\\)]+$"); } } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) - { - if (Client.ApiVersion.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); - } - } - if (deploymentStack == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "deploymentStack"); - } - if (deploymentStack != null) + if (this.Client.ApiVersion == null) { - deploymentStack.Validate(); + 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("managementGroupId", managementGroupId); tracingParameters.Add("deploymentStackName", deploymentStackName); + tracingParameters.Add("deploymentStack", deploymentStack); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdateAtManagementGroup", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdateAtManagementGroup", 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/{managementGroupId}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName}").ToString(); _url = _url.Replace("{managementGroupId}", System.Uri.EscapeDataString(managementGroupId)); _url = _url.Replace("{deploymentStackName}", System.Uri.EscapeDataString(deploymentStackName)); - 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("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _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) @@ -3267,56 +3337,57 @@ internal DeploymentStacksOperations(DeploymentStacksClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(deploymentStack != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(deploymentStack, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(deploymentStack, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + 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 && (int)_statusCode != 201) { var ex = new DeploymentStacksErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DeploymentStacksError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + DeploymentStacksError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -3326,9 +3397,10 @@ internal DeploymentStacksOperations(DeploymentStacksClient 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(); @@ -3339,16 +3411,16 @@ internal DeploymentStacksOperations(DeploymentStacksClient 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); } } // Deserialize Response @@ -3357,25 +3429,29 @@ internal DeploymentStacksOperations(DeploymentStacksClient 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; - } + + + + + } /// /// Deletes a Deployment Stack by name. When operation completes, status code /// 200 returned without content. @@ -3387,16 +3463,13 @@ internal DeploymentStacksOperations(DeploymentStacksClient client) /// Name of the deployment stack. /// /// - /// Flag to indicate delete rather than detach for the resources. Possible - /// values include: 'delete', 'detach' + /// Flag to indicate delete rather than detach for the resources. /// /// /// Flag to indicate delete rather than detach for the resource groups. - /// Possible values include: 'delete', 'detach' /// /// /// Flag to indicate delete rather than detach for the management groups. - /// Possible values include: 'delete', 'detach' /// /// /// Headers that will be added to request. @@ -3404,10 +3477,10 @@ internal DeploymentStacksOperations(DeploymentStacksClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -3416,78 +3489,83 @@ internal DeploymentStacksOperations(DeploymentStacksClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginDeleteAtManagementGroupWithHttpMessagesAsync(string managementGroupId, string deploymentStackName, string unmanageActionResources = default(string), string unmanageActionResourceGroups = default(string), string unmanageActionManagementGroups = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginDeleteAtManagementGroupWithHttpMessagesAsync(string managementGroupId, string deploymentStackName, string unmanageActionResources = default(string), string unmanageActionResourceGroups = default(string), string unmanageActionManagementGroups = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (managementGroupId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "managementGroupId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "managementGroupId"); } if (managementGroupId != null) { if (managementGroupId.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "managementGroupId", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "managementGroupId", 90); } if (managementGroupId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "managementGroupId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "managementGroupId", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(managementGroupId, "^[-\\w\\._\\(\\)]+$")) { - throw new ValidationException(ValidationRules.Pattern, "managementGroupId", "^[-\\w\\._\\(\\)]+$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "managementGroupId", "^[-\\w\\._\\(\\)]+$"); } } if (deploymentStackName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "deploymentStackName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "deploymentStackName"); } if (deploymentStackName != null) { if (deploymentStackName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "deploymentStackName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "deploymentStackName", 90); } if (deploymentStackName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "deploymentStackName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "deploymentStackName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(deploymentStackName, "^[-\\w\\._\\(\\)]+$")) { - throw new ValidationException(ValidationRules.Pattern, "deploymentStackName", "^[-\\w\\._\\(\\)]+$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "deploymentStackName", "^[-\\w\\._\\(\\)]+$"); } } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) + + + + if (this.Client.ApiVersion == null) { - if (Client.ApiVersion.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); - } + 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("managementGroupId", managementGroupId); tracingParameters.Add("deploymentStackName", deploymentStackName); tracingParameters.Add("unmanageActionResources", unmanageActionResources); tracingParameters.Add("unmanageActionResourceGroups", unmanageActionResourceGroups); tracingParameters.Add("unmanageActionManagementGroups", unmanageActionManagementGroups); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDeleteAtManagementGroup", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDeleteAtManagementGroup", 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/{managementGroupId}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName}").ToString(); _url = _url.Replace("{managementGroupId}", System.Uri.EscapeDataString(managementGroupId)); _url = _url.Replace("{deploymentStackName}", System.Uri.EscapeDataString(deploymentStackName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (unmanageActionResources != null) { _queryParameters.Add(string.Format("unmanageAction.Resources={0}", System.Uri.EscapeDataString(unmanageActionResources))); @@ -3500,34 +3578,33 @@ internal DeploymentStacksOperations(DeploymentStacksClient client) { _queryParameters.Add(string.Format("unmanageAction.ManagementGroups={0}", System.Uri.EscapeDataString(unmanageActionManagementGroups))); } - 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("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _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) @@ -3539,50 +3616,51 @@ internal DeploymentStacksOperations(DeploymentStacksClient 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 && (int)_statusCode != 202 && (int)_statusCode != 204) { var ex = new DeploymentStacksErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DeploymentStacksError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + DeploymentStacksError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -3592,33 +3670,38 @@ internal DeploymentStacksOperations(DeploymentStacksClient client) throw ex; } // Create Result - var _result = new AzureOperationHeaderResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(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 headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Lists all the Deployment Stacks within the specified resource group. /// @@ -3631,13 +3714,13 @@ internal DeploymentStacksOperations(DeploymentStacksClient 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 /// /// @@ -3646,51 +3729,54 @@ internal DeploymentStacksOperations(DeploymentStacksClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListAtResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListAtResourceGroupNextWithHttpMessagesAsync(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, "ListAtResourceGroupNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAtResourceGroupNext", 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) @@ -3702,50 +3788,51 @@ internal DeploymentStacksOperations(DeploymentStacksClient 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 DeploymentStacksErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DeploymentStacksError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + DeploymentStacksError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -3755,9 +3842,10 @@ internal DeploymentStacksOperations(DeploymentStacksClient 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(); @@ -3768,25 +3856,29 @@ internal DeploymentStacksOperations(DeploymentStacksClient 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; - } + + + + + } /// /// Lists all the Deployment Stacks within the specified subscription. /// @@ -3799,13 +3891,13 @@ internal DeploymentStacksOperations(DeploymentStacksClient 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 /// /// @@ -3814,51 +3906,54 @@ internal DeploymentStacksOperations(DeploymentStacksClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListAtSubscriptionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListAtSubscriptionNextWithHttpMessagesAsync(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, "ListAtSubscriptionNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAtSubscriptionNext", 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) @@ -3870,50 +3965,51 @@ internal DeploymentStacksOperations(DeploymentStacksClient 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 DeploymentStacksErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DeploymentStacksError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + DeploymentStacksError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -3923,9 +4019,10 @@ internal DeploymentStacksOperations(DeploymentStacksClient 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(); @@ -3936,25 +4033,29 @@ internal DeploymentStacksOperations(DeploymentStacksClient 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; - } + + + + + } /// /// Lists all the Deployment Stacks within the specified management group. /// @@ -3967,13 +4068,13 @@ internal DeploymentStacksOperations(DeploymentStacksClient 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 /// /// @@ -3982,51 +4083,54 @@ internal DeploymentStacksOperations(DeploymentStacksClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListAtManagementGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListAtManagementGroupNextWithHttpMessagesAsync(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, "ListAtManagementGroupNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAtManagementGroupNext", 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) @@ -4038,50 +4142,51 @@ internal DeploymentStacksOperations(DeploymentStacksClient 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 DeploymentStacksErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DeploymentStacksError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + DeploymentStacksError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -4091,9 +4196,10 @@ internal DeploymentStacksOperations(DeploymentStacksClient 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(); @@ -4104,24 +4210,28 @@ internal DeploymentStacksOperations(DeploymentStacksClient 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; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Management.Sdk/Generated/DeploymentStacksOperationsExtensions.cs b/src/Resources/Resources.Management.Sdk/Generated/DeploymentStacksOperationsExtensions.cs new file mode 100644 index 000000000000..936ce6f432be --- /dev/null +++ b/src/Resources/Resources.Management.Sdk/Generated/DeploymentStacksOperationsExtensions.cs @@ -0,0 +1,970 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.Management.Resources +{ + using Microsoft.Rest.Azure; + using Models; + + /// + /// Extension methods for DeploymentStacksOperations + /// + public static partial class DeploymentStacksOperationsExtensions + { + /// + /// Lists all the Deployment Stacks within the specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + public static Microsoft.Rest.Azure.IPage ListAtResourceGroup(this IDeploymentStacksOperations operations, string resourceGroupName) + { + return ((IDeploymentStacksOperations)operations).ListAtResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Lists all the Deployment Stacks within the specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAtResourceGroupAsync(this IDeploymentStacksOperations operations, string resourceGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListAtResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Lists all the Deployment Stacks within the specified subscription. + /// + /// + /// The operations group for this extension method. + /// + public static Microsoft.Rest.Azure.IPage ListAtSubscription(this IDeploymentStacksOperations operations) + { + return ((IDeploymentStacksOperations)operations).ListAtSubscriptionAsync().GetAwaiter().GetResult(); + } + + /// + /// Lists all the Deployment Stacks within the specified subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAtSubscriptionAsync(this IDeploymentStacksOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListAtSubscriptionWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Lists all the Deployment Stacks within the specified management group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Management Group. + /// + public static Microsoft.Rest.Azure.IPage ListAtManagementGroup(this IDeploymentStacksOperations operations, string managementGroupId) + { + return ((IDeploymentStacksOperations)operations).ListAtManagementGroupAsync(managementGroupId).GetAwaiter().GetResult(); + } + + /// + /// Lists all the Deployment Stacks within the specified management group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Management Group. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAtManagementGroupAsync(this IDeploymentStacksOperations operations, string managementGroupId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListAtManagementGroupWithHttpMessagesAsync(managementGroupId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Creates or updates a Deployment Stack. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the deployment stack. + /// + public static DeploymentStack CreateOrUpdateAtResourceGroup(this IDeploymentStacksOperations operations, string resourceGroupName, string deploymentStackName, DeploymentStack deploymentStack) + { + return ((IDeploymentStacksOperations)operations).CreateOrUpdateAtResourceGroupAsync(resourceGroupName, deploymentStackName, deploymentStack).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates a Deployment Stack. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the deployment stack. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAtResourceGroupAsync(this IDeploymentStacksOperations operations, string resourceGroupName, string deploymentStackName, DeploymentStack deploymentStack, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateAtResourceGroupWithHttpMessagesAsync(resourceGroupName, deploymentStackName, deploymentStack, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets a Deployment Stack with a given name. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the deployment stack. + /// + public static DeploymentStack GetAtResourceGroup(this IDeploymentStacksOperations operations, string resourceGroupName, string deploymentStackName) + { + return ((IDeploymentStacksOperations)operations).GetAtResourceGroupAsync(resourceGroupName, deploymentStackName).GetAwaiter().GetResult(); + } + + /// + /// Gets a Deployment Stack with a given name. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the deployment stack. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAtResourceGroupAsync(this IDeploymentStacksOperations operations, string resourceGroupName, string deploymentStackName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetAtResourceGroupWithHttpMessagesAsync(resourceGroupName, deploymentStackName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Deletes a Deployment Stack by name. When operation completes, status code + /// 200 returned without content. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the deployment stack. + /// + /// + /// Flag to indicate delete rather than detach for the resources. + /// + /// + /// Flag to indicate delete rather than detach for the resource groups. + /// + public static DeploymentStacksDeleteAtResourceGroupHeaders DeleteAtResourceGroup(this IDeploymentStacksOperations operations, string resourceGroupName, string deploymentStackName, string unmanageActionResources = default(string), string unmanageActionResourceGroups = default(string)) + { + return ((IDeploymentStacksOperations)operations).DeleteAtResourceGroupAsync(resourceGroupName, deploymentStackName, unmanageActionResources, unmanageActionResourceGroups).GetAwaiter().GetResult(); + } + + /// + /// Deletes a Deployment Stack by name. When operation completes, status code + /// 200 returned without content. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the deployment stack. + /// + /// + /// Flag to indicate delete rather than detach for the resources. + /// + /// + /// Flag to indicate delete rather than detach for the resource groups. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAtResourceGroupAsync(this IDeploymentStacksOperations operations, string resourceGroupName, string deploymentStackName, string unmanageActionResources = default(string), string unmanageActionResourceGroups = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.DeleteAtResourceGroupWithHttpMessagesAsync(resourceGroupName, deploymentStackName, unmanageActionResources, unmanageActionResourceGroups, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } + } + /// + /// Creates or updates a Deployment Stack. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the deployment stack. + /// + public static DeploymentStack CreateOrUpdateAtSubscription(this IDeploymentStacksOperations operations, string deploymentStackName, DeploymentStack deploymentStack) + { + return ((IDeploymentStacksOperations)operations).CreateOrUpdateAtSubscriptionAsync(deploymentStackName, deploymentStack).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates a Deployment Stack. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the deployment stack. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAtSubscriptionAsync(this IDeploymentStacksOperations operations, string deploymentStackName, DeploymentStack deploymentStack, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateAtSubscriptionWithHttpMessagesAsync(deploymentStackName, deploymentStack, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets a Deployment Stack with a given name. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the deployment stack. + /// + public static DeploymentStack GetAtSubscription(this IDeploymentStacksOperations operations, string deploymentStackName) + { + return ((IDeploymentStacksOperations)operations).GetAtSubscriptionAsync(deploymentStackName).GetAwaiter().GetResult(); + } + + /// + /// Gets a Deployment Stack with a given name. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the deployment stack. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAtSubscriptionAsync(this IDeploymentStacksOperations operations, string deploymentStackName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetAtSubscriptionWithHttpMessagesAsync(deploymentStackName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Deletes a Deployment Stack by name. When operation completes, status code + /// 200 returned without content. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the deployment stack. + /// + /// + /// Flag to indicate delete rather than detach for the resources. + /// + /// + /// Flag to indicate delete rather than detach for the resource groups. + /// + public static DeploymentStacksDeleteAtSubscriptionHeaders DeleteAtSubscription(this IDeploymentStacksOperations operations, string deploymentStackName, string unmanageActionResources = default(string), string unmanageActionResourceGroups = default(string)) + { + return ((IDeploymentStacksOperations)operations).DeleteAtSubscriptionAsync(deploymentStackName, unmanageActionResources, unmanageActionResourceGroups).GetAwaiter().GetResult(); + } + + /// + /// Deletes a Deployment Stack by name. When operation completes, status code + /// 200 returned without content. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the deployment stack. + /// + /// + /// Flag to indicate delete rather than detach for the resources. + /// + /// + /// Flag to indicate delete rather than detach for the resource groups. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAtSubscriptionAsync(this IDeploymentStacksOperations operations, string deploymentStackName, string unmanageActionResources = default(string), string unmanageActionResourceGroups = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.DeleteAtSubscriptionWithHttpMessagesAsync(deploymentStackName, unmanageActionResources, unmanageActionResourceGroups, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } + } + /// + /// Creates or updates a Deployment Stack. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Management Group. + /// + /// + /// Name of the deployment stack. + /// + public static DeploymentStack CreateOrUpdateAtManagementGroup(this IDeploymentStacksOperations operations, string managementGroupId, string deploymentStackName, DeploymentStack deploymentStack) + { + return ((IDeploymentStacksOperations)operations).CreateOrUpdateAtManagementGroupAsync(managementGroupId, deploymentStackName, deploymentStack).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates a Deployment Stack. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Management Group. + /// + /// + /// Name of the deployment stack. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAtManagementGroupAsync(this IDeploymentStacksOperations operations, string managementGroupId, string deploymentStackName, DeploymentStack deploymentStack, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateAtManagementGroupWithHttpMessagesAsync(managementGroupId, deploymentStackName, deploymentStack, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets a Deployment Stack with a given name. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Management Group. + /// + /// + /// Name of the deployment stack. + /// + public static DeploymentStack GetAtManagementGroup(this IDeploymentStacksOperations operations, string managementGroupId, string deploymentStackName) + { + return ((IDeploymentStacksOperations)operations).GetAtManagementGroupAsync(managementGroupId, deploymentStackName).GetAwaiter().GetResult(); + } + + /// + /// Gets a Deployment Stack with a given name. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Management Group. + /// + /// + /// Name of the deployment stack. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAtManagementGroupAsync(this IDeploymentStacksOperations operations, string managementGroupId, string deploymentStackName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetAtManagementGroupWithHttpMessagesAsync(managementGroupId, deploymentStackName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Deletes a Deployment Stack by name. When operation completes, status code + /// 200 returned without content. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Management Group. + /// + /// + /// Name of the deployment stack. + /// + /// + /// Flag to indicate delete rather than detach for the resources. + /// + /// + /// Flag to indicate delete rather than detach for the resource groups. + /// + /// + /// Flag to indicate delete rather than detach for the management groups. + /// + public static DeploymentStacksDeleteAtManagementGroupHeaders DeleteAtManagementGroup(this IDeploymentStacksOperations operations, string managementGroupId, string deploymentStackName, string unmanageActionResources = default(string), string unmanageActionResourceGroups = default(string), string unmanageActionManagementGroups = default(string)) + { + return ((IDeploymentStacksOperations)operations).DeleteAtManagementGroupAsync(managementGroupId, deploymentStackName, unmanageActionResources, unmanageActionResourceGroups, unmanageActionManagementGroups).GetAwaiter().GetResult(); + } + + /// + /// Deletes a Deployment Stack by name. When operation completes, status code + /// 200 returned without content. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Management Group. + /// + /// + /// Name of the deployment stack. + /// + /// + /// Flag to indicate delete rather than detach for the resources. + /// + /// + /// Flag to indicate delete rather than detach for the resource groups. + /// + /// + /// Flag to indicate delete rather than detach for the management groups. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAtManagementGroupAsync(this IDeploymentStacksOperations operations, string managementGroupId, string deploymentStackName, string unmanageActionResources = default(string), string unmanageActionResourceGroups = default(string), string unmanageActionManagementGroups = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.DeleteAtManagementGroupWithHttpMessagesAsync(managementGroupId, deploymentStackName, unmanageActionResources, unmanageActionResourceGroups, unmanageActionManagementGroups, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } + } + /// + /// Exports the template used to create the deployment stack. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the deployment stack. + /// + public static DeploymentStackTemplateDefinition ExportTemplateAtResourceGroup(this IDeploymentStacksOperations operations, string resourceGroupName, string deploymentStackName) + { + return ((IDeploymentStacksOperations)operations).ExportTemplateAtResourceGroupAsync(resourceGroupName, deploymentStackName).GetAwaiter().GetResult(); + } + + /// + /// Exports the template used to create the deployment stack. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the deployment stack. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task ExportTemplateAtResourceGroupAsync(this IDeploymentStacksOperations operations, string resourceGroupName, string deploymentStackName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ExportTemplateAtResourceGroupWithHttpMessagesAsync(resourceGroupName, deploymentStackName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Exports the template used to create the deployment stack. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the deployment stack. + /// + public static DeploymentStackTemplateDefinition ExportTemplateAtSubscription(this IDeploymentStacksOperations operations, string deploymentStackName) + { + return ((IDeploymentStacksOperations)operations).ExportTemplateAtSubscriptionAsync(deploymentStackName).GetAwaiter().GetResult(); + } + + /// + /// Exports the template used to create the deployment stack. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the deployment stack. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task ExportTemplateAtSubscriptionAsync(this IDeploymentStacksOperations operations, string deploymentStackName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ExportTemplateAtSubscriptionWithHttpMessagesAsync(deploymentStackName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Exports the template used to create the deployment stack. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Management Group. + /// + /// + /// Name of the deployment stack. + /// + public static DeploymentStackTemplateDefinition ExportTemplateAtManagementGroup(this IDeploymentStacksOperations operations, string managementGroupId, string deploymentStackName) + { + return ((IDeploymentStacksOperations)operations).ExportTemplateAtManagementGroupAsync(managementGroupId, deploymentStackName).GetAwaiter().GetResult(); + } + + /// + /// Exports the template used to create the deployment stack. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Management Group. + /// + /// + /// Name of the deployment stack. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task ExportTemplateAtManagementGroupAsync(this IDeploymentStacksOperations operations, string managementGroupId, string deploymentStackName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ExportTemplateAtManagementGroupWithHttpMessagesAsync(managementGroupId, deploymentStackName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Creates or updates a Deployment Stack. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the deployment stack. + /// + public static DeploymentStack BeginCreateOrUpdateAtResourceGroup(this IDeploymentStacksOperations operations, string resourceGroupName, string deploymentStackName, DeploymentStack deploymentStack) + { + return ((IDeploymentStacksOperations)operations).BeginCreateOrUpdateAtResourceGroupAsync(resourceGroupName, deploymentStackName, deploymentStack).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates a Deployment Stack. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the deployment stack. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAtResourceGroupAsync(this IDeploymentStacksOperations operations, string resourceGroupName, string deploymentStackName, DeploymentStack deploymentStack, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateAtResourceGroupWithHttpMessagesAsync(resourceGroupName, deploymentStackName, deploymentStack, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Deletes a Deployment Stack by name. When operation completes, status code + /// 200 returned without content. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the deployment stack. + /// + /// + /// Flag to indicate delete rather than detach for the resources. + /// + /// + /// Flag to indicate delete rather than detach for the resource groups. + /// + public static DeploymentStacksDeleteAtResourceGroupHeaders BeginDeleteAtResourceGroup(this IDeploymentStacksOperations operations, string resourceGroupName, string deploymentStackName, string unmanageActionResources = default(string), string unmanageActionResourceGroups = default(string)) + { + return ((IDeploymentStacksOperations)operations).BeginDeleteAtResourceGroupAsync(resourceGroupName, deploymentStackName, unmanageActionResources, unmanageActionResourceGroups).GetAwaiter().GetResult(); + } + + /// + /// Deletes a Deployment Stack by name. When operation completes, status code + /// 200 returned without content. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the deployment stack. + /// + /// + /// Flag to indicate delete rather than detach for the resources. + /// + /// + /// Flag to indicate delete rather than detach for the resource groups. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAtResourceGroupAsync(this IDeploymentStacksOperations operations, string resourceGroupName, string deploymentStackName, string unmanageActionResources = default(string), string unmanageActionResourceGroups = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginDeleteAtResourceGroupWithHttpMessagesAsync(resourceGroupName, deploymentStackName, unmanageActionResources, unmanageActionResourceGroups, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } + } + /// + /// Creates or updates a Deployment Stack. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the deployment stack. + /// + public static DeploymentStack BeginCreateOrUpdateAtSubscription(this IDeploymentStacksOperations operations, string deploymentStackName, DeploymentStack deploymentStack) + { + return ((IDeploymentStacksOperations)operations).BeginCreateOrUpdateAtSubscriptionAsync(deploymentStackName, deploymentStack).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates a Deployment Stack. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the deployment stack. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAtSubscriptionAsync(this IDeploymentStacksOperations operations, string deploymentStackName, DeploymentStack deploymentStack, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateAtSubscriptionWithHttpMessagesAsync(deploymentStackName, deploymentStack, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Deletes a Deployment Stack by name. When operation completes, status code + /// 200 returned without content. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the deployment stack. + /// + /// + /// Flag to indicate delete rather than detach for the resources. + /// + /// + /// Flag to indicate delete rather than detach for the resource groups. + /// + public static DeploymentStacksDeleteAtSubscriptionHeaders BeginDeleteAtSubscription(this IDeploymentStacksOperations operations, string deploymentStackName, string unmanageActionResources = default(string), string unmanageActionResourceGroups = default(string)) + { + return ((IDeploymentStacksOperations)operations).BeginDeleteAtSubscriptionAsync(deploymentStackName, unmanageActionResources, unmanageActionResourceGroups).GetAwaiter().GetResult(); + } + + /// + /// Deletes a Deployment Stack by name. When operation completes, status code + /// 200 returned without content. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the deployment stack. + /// + /// + /// Flag to indicate delete rather than detach for the resources. + /// + /// + /// Flag to indicate delete rather than detach for the resource groups. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAtSubscriptionAsync(this IDeploymentStacksOperations operations, string deploymentStackName, string unmanageActionResources = default(string), string unmanageActionResourceGroups = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginDeleteAtSubscriptionWithHttpMessagesAsync(deploymentStackName, unmanageActionResources, unmanageActionResourceGroups, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } + } + /// + /// Creates or updates a Deployment Stack. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Management Group. + /// + /// + /// Name of the deployment stack. + /// + public static DeploymentStack BeginCreateOrUpdateAtManagementGroup(this IDeploymentStacksOperations operations, string managementGroupId, string deploymentStackName, DeploymentStack deploymentStack) + { + return ((IDeploymentStacksOperations)operations).BeginCreateOrUpdateAtManagementGroupAsync(managementGroupId, deploymentStackName, deploymentStack).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates a Deployment Stack. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Management Group. + /// + /// + /// Name of the deployment stack. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAtManagementGroupAsync(this IDeploymentStacksOperations operations, string managementGroupId, string deploymentStackName, DeploymentStack deploymentStack, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateAtManagementGroupWithHttpMessagesAsync(managementGroupId, deploymentStackName, deploymentStack, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Deletes a Deployment Stack by name. When operation completes, status code + /// 200 returned without content. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Management Group. + /// + /// + /// Name of the deployment stack. + /// + /// + /// Flag to indicate delete rather than detach for the resources. + /// + /// + /// Flag to indicate delete rather than detach for the resource groups. + /// + /// + /// Flag to indicate delete rather than detach for the management groups. + /// + public static DeploymentStacksDeleteAtManagementGroupHeaders BeginDeleteAtManagementGroup(this IDeploymentStacksOperations operations, string managementGroupId, string deploymentStackName, string unmanageActionResources = default(string), string unmanageActionResourceGroups = default(string), string unmanageActionManagementGroups = default(string)) + { + return ((IDeploymentStacksOperations)operations).BeginDeleteAtManagementGroupAsync(managementGroupId, deploymentStackName, unmanageActionResources, unmanageActionResourceGroups, unmanageActionManagementGroups).GetAwaiter().GetResult(); + } + + /// + /// Deletes a Deployment Stack by name. When operation completes, status code + /// 200 returned without content. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Management Group. + /// + /// + /// Name of the deployment stack. + /// + /// + /// Flag to indicate delete rather than detach for the resources. + /// + /// + /// Flag to indicate delete rather than detach for the resource groups. + /// + /// + /// Flag to indicate delete rather than detach for the management groups. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAtManagementGroupAsync(this IDeploymentStacksOperations operations, string managementGroupId, string deploymentStackName, string unmanageActionResources = default(string), string unmanageActionResourceGroups = default(string), string unmanageActionManagementGroups = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginDeleteAtManagementGroupWithHttpMessagesAsync(managementGroupId, deploymentStackName, unmanageActionResources, unmanageActionResourceGroups, unmanageActionManagementGroups, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } + } + /// + /// Lists all the Deployment Stacks within the specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListAtResourceGroupNext(this IDeploymentStacksOperations operations, string nextPageLink) + { + return ((IDeploymentStacksOperations)operations).ListAtResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists all the Deployment Stacks within the specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAtResourceGroupNextAsync(this IDeploymentStacksOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListAtResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Lists all the Deployment Stacks within the specified subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListAtSubscriptionNext(this IDeploymentStacksOperations operations, string nextPageLink) + { + return ((IDeploymentStacksOperations)operations).ListAtSubscriptionNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists all the Deployment Stacks within the specified subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAtSubscriptionNextAsync(this IDeploymentStacksOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListAtSubscriptionNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Lists all the Deployment Stacks within the specified management group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListAtManagementGroupNext(this IDeploymentStacksOperations operations, string nextPageLink) + { + return ((IDeploymentStacksOperations)operations).ListAtManagementGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists all the Deployment Stacks within the specified management group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAtManagementGroupNextAsync(this IDeploymentStacksOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListAtManagementGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + } +} diff --git a/src/Resources/Resources.Sdk/Generated/DeploymentsOperations.cs b/src/Resources/Resources.Management.Sdk/Generated/DeploymentsOperations.cs similarity index 55% rename from src/Resources/Resources.Sdk/Generated/DeploymentsOperations.cs rename to src/Resources/Resources.Management.Sdk/Generated/DeploymentsOperations.cs index 4b22ba24e8c4..3264fa2fdf94 100644 --- a/src/Resources/Resources.Sdk/Generated/DeploymentsOperations.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/DeploymentsOperations.cs @@ -1,32 +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 Microsoft.Rest.Azure.OData; 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; /// /// DeploymentsOperations operations. /// - internal partial class DeploymentsOperations : IServiceOperations, IDeploymentsOperations + internal partial class DeploymentsOperations : Microsoft.Rest.IServiceOperations, IDeploymentsOperations { /// /// Initializes a new instance of the DeploymentsOperations class. @@ -37,13 +24,13 @@ internal partial class DeploymentsOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal DeploymentsOperations(ResourceManagementClient client) + internal DeploymentsOperations (ResourceManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -52,19 +39,8 @@ internal DeploymentsOperations(ResourceManagementClient client) public ResourceManagementClient Client { get; private set; } /// - /// Deletes a deployment from the deployment history. + /// A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the associated deployment operations. This is an asynchronous operation that returns a status of 202 until the template deployment is successfully deleted. The Location response header contains the URI that is used to obtain the status of the process. While the process is running, a call to the URI in the Location header returns a status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If the asynchronous request failed, the URI in the Location header returns an error-level status code. /// - /// - /// A template deployment that is currently running cannot be deleted. Deleting - /// a template deployment removes the associated deployment operations. This is - /// an asynchronous operation that returns a status of 202 until the template - /// deployment is successfully deleted. The Location response header contains - /// the URI that is used to obtain the status of the process. While the process - /// is running, a call to the URI in the Location header returns a status of - /// 202. When the process finishes, the URI in the Location header returns a - /// status of 204 on success. If the asynchronous request failed, the URI in - /// the Location header returns an error-level status code. - /// /// /// The resource scope. /// @@ -72,16 +48,16 @@ internal DeploymentsOperations(ResourceManagementClient client) /// The name of the deployment. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteAtScopeWithHttpMessagesAsync(string scope, string deploymentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteAtScopeWithHttpMessagesAsync(string scope, string deploymentName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteAtScopeWithHttpMessagesAsync(scope, deploymentName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteAtScopeWithHttpMessagesAsync(scope, deploymentName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -99,10 +75,10 @@ internal DeploymentsOperations(ResourceManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -111,81 +87,90 @@ internal DeploymentsOperations(ResourceManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CheckExistenceAtScopeWithHttpMessagesAsync(string scope, string deploymentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CheckExistenceAtScopeWithHttpMessagesAsync(string scope, string deploymentName, 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("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CheckExistenceAtScope", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "CheckExistenceAtScope", 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}").ToString(); _url = _url.Replace("{scope}", scope); _url = _url.Replace("{deploymentName}", System.Uri.EscapeDataString(deploymentName)); - 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("HEAD"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("HEAD"); _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) @@ -197,55 +182,56 @@ internal DeploymentsOperations(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, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, 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 != 204 && (int)_statusCode != 404) { - 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) @@ -255,28 +241,28 @@ internal DeploymentsOperations(ResourceManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; - _result.Body = _statusCode == System.Net.HttpStatusCode.NoContent; + _result.Body = (_statusCode == System.Net.HttpStatusCode.NoContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Deploys resources at a given scope. + /// You can provide the template and parameters directly in the request or link to JSON files. /// - /// - /// You can provide the template and parameters directly in the request or link - /// to JSON files. - /// /// /// The resource scope. /// @@ -287,16 +273,16 @@ internal DeploymentsOperations(ResourceManagementClient client) /// Additional parameters supplied to the operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateAtScopeWithHttpMessagesAsync(string scope, string deploymentName, Deployment parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateAtScopeWithHttpMessagesAsync(string scope, string deploymentName, Deployment parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateAtScopeWithHttpMessagesAsync(scope, deploymentName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateAtScopeWithHttpMessagesAsync(scope, deploymentName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -314,13 +300,13 @@ internal DeploymentsOperations(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 /// /// @@ -329,81 +315,90 @@ internal DeploymentsOperations(ResourceManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetAtScopeWithHttpMessagesAsync(string scope, string deploymentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetAtScopeWithHttpMessagesAsync(string scope, string deploymentName, 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("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}").ToString(); _url = _url.Replace("{scope}", scope); _url = _url.Replace("{deploymentName}", System.Uri.EscapeDataString(deploymentName)); - 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) @@ -415,55 +410,56 @@ internal DeploymentsOperations(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) @@ -473,9 +469,10 @@ internal DeploymentsOperations(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(); @@ -486,34 +483,35 @@ internal DeploymentsOperations(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; - } + + + + + } /// - /// Cancels a currently running template deployment. - /// - /// /// You can cancel a deployment only if the provisioningState is Accepted or /// Running. After the deployment is canceled, the provisioningState is set to /// Canceled. Canceling a template deployment stops the currently running /// template deployment and leaves the resources partially deployed. - /// + /// /// /// The resource scope. /// @@ -526,10 +524,10 @@ internal DeploymentsOperations(ResourceManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -538,81 +536,90 @@ internal DeploymentsOperations(ResourceManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task CancelAtScopeWithHttpMessagesAsync(string scope, string deploymentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task CancelAtScopeWithHttpMessagesAsync(string scope, string deploymentName, 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("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CancelAtScope", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "CancelAtScope", 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}/cancel").ToString(); _url = _url.Replace("{scope}", scope); _url = _url.Replace("{deploymentName}", System.Uri.EscapeDataString(deploymentName)); - 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("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _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) @@ -624,55 +631,56 @@ internal DeploymentsOperations(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 != 204) { - 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) @@ -682,23 +690,27 @@ internal DeploymentsOperations(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(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Validates whether the specified template is syntactically correct and will - /// be accepted by Azure Resource Manager.. + /// Validates whether the specified template is syntactically correct and will be accepted by Azure Resource Manager.. /// /// /// The resource scope. @@ -710,16 +722,16 @@ internal DeploymentsOperations(ResourceManagementClient client) /// Parameters to validate. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> ValidateAtScopeWithHttpMessagesAsync(string scope, string deploymentName, Deployment parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> ValidateAtScopeWithHttpMessagesAsync(string scope, string deploymentName, Deployment parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginValidateAtScopeWithHttpMessagesAsync(scope, deploymentName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginValidateAtScopeWithHttpMessagesAsync(scope, deploymentName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -737,13 +749,13 @@ internal DeploymentsOperations(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 /// /// @@ -752,81 +764,90 @@ internal DeploymentsOperations(ResourceManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ExportTemplateAtScopeWithHttpMessagesAsync(string scope, string deploymentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> ExportTemplateAtScopeWithHttpMessagesAsync(string scope, string deploymentName, 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("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ExportTemplateAtScope", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ExportTemplateAtScope", 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}/exportTemplate").ToString(); _url = _url.Replace("{scope}", scope); _url = _url.Replace("{deploymentName}", System.Uri.EscapeDataString(deploymentName)); - 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("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _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) @@ -838,55 +859,56 @@ internal DeploymentsOperations(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) @@ -896,9 +918,10 @@ internal DeploymentsOperations(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(); @@ -909,47 +932,51 @@ internal DeploymentsOperations(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; - } + + + + + } /// /// Get all the deployments at the given scope. /// + /// + /// + /// /// /// The resource scope. /// - /// - /// OData parameters to apply to the operation. - /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -958,69 +985,79 @@ internal DeploymentsOperations(ResourceManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListAtScopeWithHttpMessagesAsync(string scope, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListAtScopeWithHttpMessagesAsync(string scope, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), 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 (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("odataQuery", odataQuery); tracingParameters.Add("scope", scope); + + 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/").ToString(); _url = _url.Replace("{scope}", scope); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (odataQuery != null) { - var _odataFilter = odataQuery.ToString(); - if (!string.IsNullOrEmpty(_odataFilter)) + var _deploymentExtendedFilter = odataQuery.ToString(); + if (!string.IsNullOrEmpty(_deploymentExtendedFilter)) { - _queryParameters.Add(_odataFilter); + _queryParameters.Add(_deploymentExtendedFilter); } } - 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) @@ -1032,55 +1069,56 @@ internal DeploymentsOperations(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) @@ -1090,9 +1128,10 @@ internal DeploymentsOperations(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(); @@ -1103,53 +1142,46 @@ internal DeploymentsOperations(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; - } + + + + + } /// - /// Deletes a deployment from the deployment history. + /// A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the associated deployment operations. This is an asynchronous operation that returns a status of 202 until the template deployment is successfully deleted. The Location response header contains the URI that is used to obtain the status of the process. While the process is running, a call to the URI in the Location header returns a status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If the asynchronous request failed, the URI in the Location header returns an error-level status code. /// - /// - /// A template deployment that is currently running cannot be deleted. Deleting - /// a template deployment removes the associated deployment operations. This is - /// an asynchronous operation that returns a status of 202 until the template - /// deployment is successfully deleted. The Location response header contains - /// the URI that is used to obtain the status of the process. While the process - /// is running, a call to the URI in the Location header returns a status of - /// 202. When the process finishes, the URI in the Location header returns a - /// status of 204 on success. If the asynchronous request failed, the URI in - /// the Location header returns an error-level status code. - /// /// /// The name of the deployment. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteAtTenantScopeWithHttpMessagesAsync(string deploymentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteAtTenantScopeWithHttpMessagesAsync(string deploymentName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteAtTenantScopeWithHttpMessagesAsync(deploymentName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteAtTenantScopeWithHttpMessagesAsync(deploymentName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -1164,10 +1196,10 @@ internal DeploymentsOperations(ResourceManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1176,75 +1208,83 @@ internal DeploymentsOperations(ResourceManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CheckExistenceAtTenantScopeWithHttpMessagesAsync(string deploymentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CheckExistenceAtTenantScopeWithHttpMessagesAsync(string deploymentName, 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("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CheckExistenceAtTenantScope", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "CheckExistenceAtTenantScope", 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}").ToString(); _url = _url.Replace("{deploymentName}", System.Uri.EscapeDataString(deploymentName)); - 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("HEAD"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("HEAD"); _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) @@ -1256,55 +1296,56 @@ internal DeploymentsOperations(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, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, 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 != 204 && (int)_statusCode != 404) { - 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) @@ -1314,28 +1355,28 @@ internal DeploymentsOperations(ResourceManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; - _result.Body = _statusCode == System.Net.HttpStatusCode.NoContent; + _result.Body = (_statusCode == System.Net.HttpStatusCode.NoContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Deploys resources at tenant scope. + /// You can provide the template and parameters directly in the request or link to JSON files. /// - /// - /// You can provide the template and parameters directly in the request or link - /// to JSON files. - /// /// /// The name of the deployment. /// @@ -1343,16 +1384,16 @@ internal DeploymentsOperations(ResourceManagementClient client) /// Additional parameters supplied to the operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateAtTenantScopeWithHttpMessagesAsync(string deploymentName, ScopedDeployment parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateAtTenantScopeWithHttpMessagesAsync(string deploymentName, ScopedDeployment parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateAtTenantScopeWithHttpMessagesAsync(deploymentName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateAtTenantScopeWithHttpMessagesAsync(deploymentName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -1367,13 +1408,13 @@ internal DeploymentsOperations(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 /// /// @@ -1382,75 +1423,83 @@ internal DeploymentsOperations(ResourceManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetAtTenantScopeWithHttpMessagesAsync(string deploymentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetAtTenantScopeWithHttpMessagesAsync(string deploymentName, 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("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}").ToString(); _url = _url.Replace("{deploymentName}", System.Uri.EscapeDataString(deploymentName)); - 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) @@ -1462,55 +1511,56 @@ internal DeploymentsOperations(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 +1570,10 @@ internal DeploymentsOperations(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,34 +1584,35 @@ internal DeploymentsOperations(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; - } + + + + + } /// - /// Cancels a currently running template deployment. - /// - /// /// You can cancel a deployment only if the provisioningState is Accepted or /// Running. After the deployment is canceled, the provisioningState is set to /// Canceled. Canceling a template deployment stops the currently running /// template deployment and leaves the resources partially deployed. - /// + /// /// /// The name of the deployment. /// @@ -1570,10 +1622,10 @@ internal DeploymentsOperations(ResourceManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1582,75 +1634,83 @@ internal DeploymentsOperations(ResourceManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task CancelAtTenantScopeWithHttpMessagesAsync(string deploymentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task CancelAtTenantScopeWithHttpMessagesAsync(string deploymentName, 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("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CancelAtTenantScope", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "CancelAtTenantScope", 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}/cancel").ToString(); _url = _url.Replace("{deploymentName}", System.Uri.EscapeDataString(deploymentName)); - 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("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _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) @@ -1662,55 +1722,56 @@ internal DeploymentsOperations(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 != 204) { - 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) @@ -1720,23 +1781,27 @@ internal DeploymentsOperations(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(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Validates whether the specified template is syntactically correct and will - /// be accepted by Azure Resource Manager.. + /// Validates whether the specified template is syntactically correct and will be accepted by Azure Resource Manager.. /// /// /// The name of the deployment. @@ -1745,21 +1810,20 @@ internal DeploymentsOperations(ResourceManagementClient client) /// Parameters to validate. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> ValidateAtTenantScopeWithHttpMessagesAsync(string deploymentName, ScopedDeployment parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> ValidateAtTenantScopeWithHttpMessagesAsync(string deploymentName, ScopedDeployment parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginValidateAtTenantScopeWithHttpMessagesAsync(deploymentName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginValidateAtTenantScopeWithHttpMessagesAsync(deploymentName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Returns changes that will be made by the deployment if executed at the - /// scope of the tenant group. + /// Returns changes that will be made by the deployment if executed at the scope of the tenant group. /// /// /// The name of the deployment. @@ -1768,16 +1832,16 @@ internal DeploymentsOperations(ResourceManagementClient client) /// Parameters to validate. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> WhatIfAtTenantScopeWithHttpMessagesAsync(string deploymentName, ScopedDeploymentWhatIf parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> WhatIfAtTenantScopeWithHttpMessagesAsync(string deploymentName, ScopedDeploymentWhatIf parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginWhatIfAtTenantScopeWithHttpMessagesAsync(deploymentName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginWhatIfAtTenantScopeWithHttpMessagesAsync(deploymentName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -1792,13 +1856,13 @@ internal DeploymentsOperations(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 /// /// @@ -1807,75 +1871,83 @@ internal DeploymentsOperations(ResourceManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ExportTemplateAtTenantScopeWithHttpMessagesAsync(string deploymentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> ExportTemplateAtTenantScopeWithHttpMessagesAsync(string deploymentName, 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("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ExportTemplateAtTenantScope", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ExportTemplateAtTenantScope", 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}/exportTemplate").ToString(); _url = _url.Replace("{deploymentName}", System.Uri.EscapeDataString(deploymentName)); - 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("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _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) @@ -1887,55 +1959,56 @@ internal DeploymentsOperations(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) @@ -1945,9 +2018,10 @@ internal DeploymentsOperations(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(); @@ -1958,30 +2032,34 @@ internal DeploymentsOperations(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; - } + + + + + } /// /// Get all the deployments at the tenant scope. /// /// - /// OData parameters to apply to the operation. + /// /// /// /// Headers that will be added to request. @@ -1989,13 +2067,13 @@ internal DeploymentsOperations(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 /// /// @@ -2004,63 +2082,72 @@ internal DeploymentsOperations(ResourceManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListAtTenantScopeWithHttpMessagesAsync(ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListAtTenantScopeWithHttpMessagesAsync(Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - 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("odataQuery", odataQuery); + + 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/").ToString(); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (odataQuery != null) { - var _odataFilter = odataQuery.ToString(); - if (!string.IsNullOrEmpty(_odataFilter)) + var _deploymentExtendedFilter = odataQuery.ToString(); + if (!string.IsNullOrEmpty(_deploymentExtendedFilter)) { - _queryParameters.Add(_odataFilter); + _queryParameters.Add(_deploymentExtendedFilter); } } - 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) @@ -2072,55 +2159,56 @@ internal DeploymentsOperations(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) @@ -2130,9 +2218,10 @@ internal DeploymentsOperations(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(); @@ -2143,39 +2232,32 @@ internal DeploymentsOperations(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; - } + + + + + } /// - /// Deletes a deployment from the deployment history. + /// A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the associated deployment operations. This is an asynchronous operation that returns a status of 202 until the template deployment is successfully deleted. The Location response header contains the URI that is used to obtain the status of the process. While the process is running, a call to the URI in the Location header returns a status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If the asynchronous request failed, the URI in the Location header returns an error-level status code. /// - /// - /// A template deployment that is currently running cannot be deleted. Deleting - /// a template deployment removes the associated deployment operations. This is - /// an asynchronous operation that returns a status of 202 until the template - /// deployment is successfully deleted. The Location response header contains - /// the URI that is used to obtain the status of the process. While the process - /// is running, a call to the URI in the Location header returns a status of - /// 202. When the process finishes, the URI in the Location header returns a - /// status of 204 on success. If the asynchronous request failed, the URI in - /// the Location header returns an error-level status code. - /// /// /// The management group ID. /// @@ -2183,16 +2265,16 @@ internal DeploymentsOperations(ResourceManagementClient client) /// The name of the deployment. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteAtManagementGroupScopeWithHttpMessagesAsync(string groupId, string deploymentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteAtManagementGroupScopeWithHttpMessagesAsync(string groupId, string deploymentName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteAtManagementGroupScopeWithHttpMessagesAsync(groupId, deploymentName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteAtManagementGroupScopeWithHttpMessagesAsync(groupId, deploymentName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -2210,10 +2292,10 @@ internal DeploymentsOperations(ResourceManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -2222,92 +2304,100 @@ internal DeploymentsOperations(ResourceManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CheckExistenceAtManagementGroupScopeWithHttpMessagesAsync(string groupId, string deploymentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CheckExistenceAtManagementGroupScopeWithHttpMessagesAsync(string groupId, string deploymentName, 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("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CheckExistenceAtManagementGroupScope", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "CheckExistenceAtManagementGroupScope", 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}").ToString(); _url = _url.Replace("{groupId}", System.Uri.EscapeDataString(groupId)); _url = _url.Replace("{deploymentName}", System.Uri.EscapeDataString(deploymentName)); - 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("HEAD"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("HEAD"); _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) @@ -2319,55 +2409,56 @@ internal DeploymentsOperations(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, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, 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 != 204 && (int)_statusCode != 404) { - 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) @@ -2377,28 +2468,28 @@ internal DeploymentsOperations(ResourceManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; - _result.Body = _statusCode == System.Net.HttpStatusCode.NoContent; + _result.Body = (_statusCode == System.Net.HttpStatusCode.NoContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Deploys resources at management group scope. + /// You can provide the template and parameters directly in the request or link to JSON files. /// - /// - /// You can provide the template and parameters directly in the request or link - /// to JSON files. - /// /// /// The management group ID. /// @@ -2409,16 +2500,16 @@ internal DeploymentsOperations(ResourceManagementClient client) /// Additional parameters supplied to the operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateAtManagementGroupScopeWithHttpMessagesAsync(string groupId, string deploymentName, ScopedDeployment parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateAtManagementGroupScopeWithHttpMessagesAsync(string groupId, string deploymentName, ScopedDeployment parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateAtManagementGroupScopeWithHttpMessagesAsync(groupId, deploymentName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateAtManagementGroupScopeWithHttpMessagesAsync(groupId, deploymentName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -2436,13 +2527,13 @@ internal DeploymentsOperations(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 /// /// @@ -2451,92 +2542,100 @@ internal DeploymentsOperations(ResourceManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetAtManagementGroupScopeWithHttpMessagesAsync(string groupId, string deploymentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetAtManagementGroupScopeWithHttpMessagesAsync(string groupId, string deploymentName, 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("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}").ToString(); _url = _url.Replace("{groupId}", System.Uri.EscapeDataString(groupId)); _url = _url.Replace("{deploymentName}", System.Uri.EscapeDataString(deploymentName)); - 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) @@ -2548,55 +2647,56 @@ internal DeploymentsOperations(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) @@ -2606,9 +2706,10 @@ internal DeploymentsOperations(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(); @@ -2619,34 +2720,35 @@ internal DeploymentsOperations(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; - } + + + + + } /// - /// Cancels a currently running template deployment. - /// - /// /// You can cancel a deployment only if the provisioningState is Accepted or /// Running. After the deployment is canceled, the provisioningState is set to /// Canceled. Canceling a template deployment stops the currently running /// template deployment and leaves the resources partially deployed. - /// + /// /// /// The management group ID. /// @@ -2659,10 +2761,10 @@ internal DeploymentsOperations(ResourceManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -2671,92 +2773,100 @@ internal DeploymentsOperations(ResourceManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task CancelAtManagementGroupScopeWithHttpMessagesAsync(string groupId, string deploymentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task CancelAtManagementGroupScopeWithHttpMessagesAsync(string groupId, string deploymentName, 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("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CancelAtManagementGroupScope", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "CancelAtManagementGroupScope", 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}/cancel").ToString(); _url = _url.Replace("{groupId}", System.Uri.EscapeDataString(groupId)); _url = _url.Replace("{deploymentName}", System.Uri.EscapeDataString(deploymentName)); - 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("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _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) @@ -2768,55 +2878,56 @@ internal DeploymentsOperations(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 != 204) { - 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) @@ -2826,23 +2937,27 @@ internal DeploymentsOperations(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(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Validates whether the specified template is syntactically correct and will - /// be accepted by Azure Resource Manager.. + /// Validates whether the specified template is syntactically correct and will be accepted by Azure Resource Manager.. /// /// /// The management group ID. @@ -2854,21 +2969,20 @@ internal DeploymentsOperations(ResourceManagementClient client) /// Parameters to validate. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> ValidateAtManagementGroupScopeWithHttpMessagesAsync(string groupId, string deploymentName, ScopedDeployment parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> ValidateAtManagementGroupScopeWithHttpMessagesAsync(string groupId, string deploymentName, ScopedDeployment parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginValidateAtManagementGroupScopeWithHttpMessagesAsync(groupId, deploymentName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginValidateAtManagementGroupScopeWithHttpMessagesAsync(groupId, deploymentName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Returns changes that will be made by the deployment if executed at the - /// scope of the management group. + /// Returns changes that will be made by the deployment if executed at the scope of the management group. /// /// /// The management group ID. @@ -2880,16 +2994,16 @@ internal DeploymentsOperations(ResourceManagementClient client) /// Parameters to validate. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> WhatIfAtManagementGroupScopeWithHttpMessagesAsync(string groupId, string deploymentName, ScopedDeploymentWhatIf parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> WhatIfAtManagementGroupScopeWithHttpMessagesAsync(string groupId, string deploymentName, ScopedDeploymentWhatIf parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginWhatIfAtManagementGroupScopeWithHttpMessagesAsync(groupId, deploymentName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginWhatIfAtManagementGroupScopeWithHttpMessagesAsync(groupId, deploymentName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -2907,13 +3021,13 @@ internal DeploymentsOperations(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 /// /// @@ -2922,92 +3036,100 @@ internal DeploymentsOperations(ResourceManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ExportTemplateAtManagementGroupScopeWithHttpMessagesAsync(string groupId, string deploymentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> ExportTemplateAtManagementGroupScopeWithHttpMessagesAsync(string groupId, string deploymentName, 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("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ExportTemplateAtManagementGroupScope", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ExportTemplateAtManagementGroupScope", 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}/exportTemplate").ToString(); _url = _url.Replace("{groupId}", System.Uri.EscapeDataString(groupId)); _url = _url.Replace("{deploymentName}", System.Uri.EscapeDataString(deploymentName)); - 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("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _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) @@ -3019,55 +3141,56 @@ internal DeploymentsOperations(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) @@ -3077,9 +3200,10 @@ internal DeploymentsOperations(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(); @@ -3090,47 +3214,51 @@ internal DeploymentsOperations(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; - } + + + + + } /// /// Get all the deployments for a management group. /// + /// + /// + /// /// /// The management group ID. /// - /// - /// OData parameters to apply to the operation. - /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -3139,80 +3267,89 @@ internal DeploymentsOperations(ResourceManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListAtManagementGroupScopeWithHttpMessagesAsync(string groupId, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListAtManagementGroupScopeWithHttpMessagesAsync(string groupId, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), 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 (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("odataQuery", odataQuery); tracingParameters.Add("groupId", groupId); + + 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/").ToString(); _url = _url.Replace("{groupId}", System.Uri.EscapeDataString(groupId)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (odataQuery != null) { - var _odataFilter = odataQuery.ToString(); - if (!string.IsNullOrEmpty(_odataFilter)) + var _deploymentExtendedFilter = odataQuery.ToString(); + if (!string.IsNullOrEmpty(_deploymentExtendedFilter)) { - _queryParameters.Add(_odataFilter); + _queryParameters.Add(_deploymentExtendedFilter); } } - 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) @@ -3224,55 +3361,56 @@ internal DeploymentsOperations(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) @@ -3282,9 +3420,10 @@ internal DeploymentsOperations(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(); @@ -3295,53 +3434,46 @@ internal DeploymentsOperations(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; - } + + + + + } /// - /// Deletes a deployment from the deployment history. + /// A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the associated deployment operations. This is an asynchronous operation that returns a status of 202 until the template deployment is successfully deleted. The Location response header contains the URI that is used to obtain the status of the process. While the process is running, a call to the URI in the Location header returns a status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If the asynchronous request failed, the URI in the Location header returns an error-level status code. /// - /// - /// A template deployment that is currently running cannot be deleted. Deleting - /// a template deployment removes the associated deployment operations. This is - /// an asynchronous operation that returns a status of 202 until the template - /// deployment is successfully deleted. The Location response header contains - /// the URI that is used to obtain the status of the process. While the process - /// is running, a call to the URI in the Location header returns a status of - /// 202. When the process finishes, the URI in the Location header returns a - /// status of 204 on success. If the asynchronous request failed, the URI in - /// the Location header returns an error-level status code. - /// /// /// The name of the deployment. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteAtSubscriptionScopeWithHttpMessagesAsync(string deploymentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteAtSubscriptionScopeWithHttpMessagesAsync(string deploymentName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteAtSubscriptionScopeWithHttpMessagesAsync(deploymentName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteAtSubscriptionScopeWithHttpMessagesAsync(deploymentName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -3356,10 +3488,10 @@ internal DeploymentsOperations(ResourceManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -3368,80 +3500,89 @@ internal DeploymentsOperations(ResourceManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CheckExistenceAtSubscriptionScopeWithHttpMessagesAsync(string deploymentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CheckExistenceAtSubscriptionScopeWithHttpMessagesAsync(string deploymentName, 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("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CheckExistenceAtSubscriptionScope", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "CheckExistenceAtSubscriptionScope", 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}").ToString(); _url = _url.Replace("{deploymentName}", System.Uri.EscapeDataString(deploymentName)); - _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("HEAD"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("HEAD"); _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) @@ -3453,55 +3594,56 @@ internal DeploymentsOperations(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, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, 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 != 204 && (int)_statusCode != 404) { - 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) @@ -3511,28 +3653,28 @@ internal DeploymentsOperations(ResourceManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; - _result.Body = _statusCode == System.Net.HttpStatusCode.NoContent; + _result.Body = (_statusCode == System.Net.HttpStatusCode.NoContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Deploys resources at subscription scope. + /// You can provide the template and parameters directly in the request or link to JSON files. /// - /// - /// You can provide the template and parameters directly in the request or link - /// to JSON files. - /// /// /// The name of the deployment. /// @@ -3540,16 +3682,16 @@ internal DeploymentsOperations(ResourceManagementClient client) /// Additional parameters supplied to the operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateAtSubscriptionScopeWithHttpMessagesAsync(string deploymentName, Deployment parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateAtSubscriptionScopeWithHttpMessagesAsync(string deploymentName, Deployment parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateAtSubscriptionScopeWithHttpMessagesAsync(deploymentName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateAtSubscriptionScopeWithHttpMessagesAsync(deploymentName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -3564,13 +3706,13 @@ internal DeploymentsOperations(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 /// /// @@ -3579,80 +3721,89 @@ internal DeploymentsOperations(ResourceManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetAtSubscriptionScopeWithHttpMessagesAsync(string deploymentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetAtSubscriptionScopeWithHttpMessagesAsync(string deploymentName, 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("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}").ToString(); _url = _url.Replace("{deploymentName}", System.Uri.EscapeDataString(deploymentName)); - _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) @@ -3664,55 +3815,56 @@ internal DeploymentsOperations(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) @@ -3722,9 +3874,10 @@ internal DeploymentsOperations(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(); @@ -3735,34 +3888,35 @@ internal DeploymentsOperations(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; - } + + + + + } /// - /// Cancels a currently running template deployment. - /// - /// /// You can cancel a deployment only if the provisioningState is Accepted or /// Running. After the deployment is canceled, the provisioningState is set to /// Canceled. Canceling a template deployment stops the currently running /// template deployment and leaves the resources partially deployed. - /// + /// /// /// The name of the deployment. /// @@ -3772,10 +3926,10 @@ internal DeploymentsOperations(ResourceManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -3784,80 +3938,89 @@ internal DeploymentsOperations(ResourceManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task CancelAtSubscriptionScopeWithHttpMessagesAsync(string deploymentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task CancelAtSubscriptionScopeWithHttpMessagesAsync(string deploymentName, 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("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CancelAtSubscriptionScope", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "CancelAtSubscriptionScope", 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}/cancel").ToString(); _url = _url.Replace("{deploymentName}", System.Uri.EscapeDataString(deploymentName)); - _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("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _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) @@ -3869,55 +4032,56 @@ internal DeploymentsOperations(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 != 204) { - 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) @@ -3927,23 +4091,27 @@ internal DeploymentsOperations(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(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Validates whether the specified template is syntactically correct and will - /// be accepted by Azure Resource Manager.. + /// Validates whether the specified template is syntactically correct and will be accepted by Azure Resource Manager.. /// /// /// The name of the deployment. @@ -3952,21 +4120,20 @@ internal DeploymentsOperations(ResourceManagementClient client) /// Parameters to validate. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> ValidateAtSubscriptionScopeWithHttpMessagesAsync(string deploymentName, Deployment parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> ValidateAtSubscriptionScopeWithHttpMessagesAsync(string deploymentName, Deployment parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginValidateAtSubscriptionScopeWithHttpMessagesAsync(deploymentName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginValidateAtSubscriptionScopeWithHttpMessagesAsync(deploymentName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Returns changes that will be made by the deployment if executed at the - /// scope of the subscription. + /// Returns changes that will be made by the deployment if executed at the scope of the subscription. /// /// /// The name of the deployment. @@ -3975,16 +4142,16 @@ internal DeploymentsOperations(ResourceManagementClient client) /// Parameters to What If. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> WhatIfAtSubscriptionScopeWithHttpMessagesAsync(string deploymentName, DeploymentWhatIf parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> WhatIfAtSubscriptionScopeWithHttpMessagesAsync(string deploymentName, DeploymentWhatIf parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginWhatIfAtSubscriptionScopeWithHttpMessagesAsync(deploymentName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginWhatIfAtSubscriptionScopeWithHttpMessagesAsync(deploymentName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -3999,13 +4166,13 @@ internal DeploymentsOperations(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 /// /// @@ -4014,80 +4181,89 @@ internal DeploymentsOperations(ResourceManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ExportTemplateAtSubscriptionScopeWithHttpMessagesAsync(string deploymentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> ExportTemplateAtSubscriptionScopeWithHttpMessagesAsync(string deploymentName, 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("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ExportTemplateAtSubscriptionScope", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ExportTemplateAtSubscriptionScope", 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}/exportTemplate").ToString(); _url = _url.Replace("{deploymentName}", System.Uri.EscapeDataString(deploymentName)); - _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("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _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) @@ -4099,55 +4275,56 @@ internal DeploymentsOperations(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) @@ -4157,9 +4334,10 @@ internal DeploymentsOperations(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(); @@ -4170,30 +4348,34 @@ internal DeploymentsOperations(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; - } + + + + + } /// /// Get all the deployments for a subscription. /// /// - /// OData parameters to apply to the operation. + /// /// /// /// Headers that will be added to request. @@ -4201,13 +4383,13 @@ internal DeploymentsOperations(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 /// /// @@ -4216,68 +4398,78 @@ internal DeploymentsOperations(ResourceManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListAtSubscriptionScopeWithHttpMessagesAsync(ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListAtSubscriptionScopeWithHttpMessagesAsync(Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - 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("odataQuery", odataQuery); + + 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/").ToString(); - _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 (odataQuery != null) { - var _odataFilter = odataQuery.ToString(); - if (!string.IsNullOrEmpty(_odataFilter)) + var _deploymentExtendedFilter = odataQuery.ToString(); + if (!string.IsNullOrEmpty(_deploymentExtendedFilter)) { - _queryParameters.Add(_odataFilter); + _queryParameters.Add(_deploymentExtendedFilter); } } - 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) @@ -4289,55 +4481,56 @@ internal DeploymentsOperations(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) @@ -4347,9 +4540,10 @@ internal DeploymentsOperations(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(); @@ -4360,40 +4554,32 @@ internal DeploymentsOperations(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; - } + + + + + } /// - /// Deletes a deployment from the deployment history. + /// A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the associated deployment operations. Deleting a template deployment does not affect the state of the resource group. This is an asynchronous operation that returns a status of 202 until the template deployment is successfully deleted. The Location response header contains the URI that is used to obtain the status of the process. While the process is running, a call to the URI in the Location header returns a status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If the asynchronous request failed, the URI in the Location header returns an error-level status code. /// - /// - /// A template deployment that is currently running cannot be deleted. Deleting - /// a template deployment removes the associated deployment operations. - /// Deleting a template deployment does not affect the state of the resource - /// group. This is an asynchronous operation that returns a status of 202 until - /// the template deployment is successfully deleted. The Location response - /// header contains the URI that is used to obtain the status of the process. - /// While the process is running, a call to the URI in the Location header - /// returns a status of 202. When the process finishes, the URI in the Location - /// header returns a status of 204 on success. If the asynchronous request - /// failed, the URI in the Location header returns an error-level status code. - /// /// /// The name of the resource group with the deployment to delete. The name is /// case insensitive. @@ -4402,16 +4588,16 @@ internal DeploymentsOperations(ResourceManagementClient client) /// The name of the deployment. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string deploymentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string deploymentName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, deploymentName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, deploymentName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -4430,10 +4616,10 @@ internal DeploymentsOperations(ResourceManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -4442,101 +4628,110 @@ internal DeploymentsOperations(ResourceManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CheckExistenceWithHttpMessagesAsync(string resourceGroupName, string deploymentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CheckExistenceWithHttpMessagesAsync(string resourceGroupName, string deploymentName, 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("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CheckExistence", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "CheckExistence", 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}/providers/Microsoft.Resources/deployments/{deploymentName}").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(); - 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("HEAD"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("HEAD"); _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) @@ -4548,55 +4743,56 @@ internal DeploymentsOperations(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, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, 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 != 204 && (int)_statusCode != 404) { - 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) @@ -4606,28 +4802,28 @@ internal DeploymentsOperations(ResourceManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; - _result.Body = _statusCode == System.Net.HttpStatusCode.NoContent; + _result.Body = (_statusCode == System.Net.HttpStatusCode.NoContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Deploys resources to a resource group. + /// You can provide the template and parameters directly in the request or link to JSON files. /// - /// - /// You can provide the template and parameters directly in the request or link - /// to JSON files. - /// /// /// The name of the resource group to deploy the resources to. The name is case /// insensitive. The resource group must already exist. @@ -4639,16 +4835,16 @@ internal DeploymentsOperations(ResourceManagementClient client) /// Additional parameters supplied to the operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string deploymentName, Deployment parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string deploymentName, Deployment parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, deploymentName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, deploymentName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -4666,13 +4862,13 @@ internal DeploymentsOperations(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 /// /// @@ -4681,101 +4877,110 @@ internal DeploymentsOperations(ResourceManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string deploymentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string deploymentName, 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("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}/providers/Microsoft.Resources/deployments/{deploymentName}").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(); - 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) @@ -4787,55 +4992,56 @@ internal DeploymentsOperations(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) @@ -4845,9 +5051,10 @@ internal DeploymentsOperations(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(); @@ -4858,34 +5065,35 @@ internal DeploymentsOperations(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; - } + + + + + } /// - /// Cancels a currently running template deployment. - /// - /// /// You can cancel a deployment only if the provisioningState is Accepted or /// Running. After the deployment is canceled, the provisioningState is set to /// Canceled. Canceling a template deployment stops the currently running /// template deployment and leaves the resource group partially deployed. - /// + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -4898,10 +5106,10 @@ internal DeploymentsOperations(ResourceManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -4910,101 +5118,110 @@ internal DeploymentsOperations(ResourceManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task CancelWithHttpMessagesAsync(string resourceGroupName, string deploymentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task CancelWithHttpMessagesAsync(string resourceGroupName, string deploymentName, 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("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Cancel", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Cancel", 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}/providers/Microsoft.Resources/deployments/{deploymentName}/cancel").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(); - 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("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _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) @@ -5016,55 +5233,56 @@ internal DeploymentsOperations(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 != 204) { - 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) @@ -5074,23 +5292,27 @@ internal DeploymentsOperations(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(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Validates whether the specified template is syntactically correct and will - /// be accepted by Azure Resource Manager.. + /// Validates whether the specified template is syntactically correct and will be accepted by Azure Resource Manager.. /// /// /// The name of the resource group the template will be deployed to. The name @@ -5103,21 +5325,20 @@ internal DeploymentsOperations(ResourceManagementClient client) /// Parameters to validate. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> ValidateWithHttpMessagesAsync(string resourceGroupName, string deploymentName, Deployment parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> ValidateWithHttpMessagesAsync(string resourceGroupName, string deploymentName, Deployment parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginValidateWithHttpMessagesAsync(resourceGroupName, deploymentName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginValidateWithHttpMessagesAsync(resourceGroupName, deploymentName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Returns changes that will be made by the deployment if executed at the - /// scope of the resource group. + /// Returns changes that will be made by the deployment if executed at the scope of the resource group. /// /// /// The name of the resource group the template will be deployed to. The name @@ -5130,16 +5351,16 @@ internal DeploymentsOperations(ResourceManagementClient client) /// Parameters to validate. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> WhatIfWithHttpMessagesAsync(string resourceGroupName, string deploymentName, DeploymentWhatIf parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> WhatIfWithHttpMessagesAsync(string resourceGroupName, string deploymentName, DeploymentWhatIf parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginWhatIfWithHttpMessagesAsync(resourceGroupName, deploymentName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginWhatIfWithHttpMessagesAsync(resourceGroupName, deploymentName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -5157,13 +5378,13 @@ internal DeploymentsOperations(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 /// /// @@ -5172,101 +5393,110 @@ internal DeploymentsOperations(ResourceManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ExportTemplateWithHttpMessagesAsync(string resourceGroupName, string deploymentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> ExportTemplateWithHttpMessagesAsync(string resourceGroupName, string deploymentName, 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("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ExportTemplate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ExportTemplate", 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}/providers/Microsoft.Resources/deployments/{deploymentName}/exportTemplate").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(); - 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("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _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) @@ -5278,55 +5508,56 @@ internal DeploymentsOperations(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) @@ -5336,9 +5567,10 @@ internal DeploymentsOperations(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(); @@ -5349,48 +5581,52 @@ internal DeploymentsOperations(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; - } + + + + + } /// /// Get all the deployments for a resource group. /// + /// + /// + /// /// /// The name of the resource group with the deployments to get. The name is /// case insensitive. /// - /// - /// OData parameters to apply to the operation. - /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -5399,89 +5635,99 @@ internal DeploymentsOperations(ResourceManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), 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 (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("odataQuery", odataQuery); tracingParameters.Add("resourceGroupName", resourceGroupName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", 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}/providers/Microsoft.Resources/deployments/").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _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 (odataQuery != null) { - var _odataFilter = odataQuery.ToString(); - if (!string.IsNullOrEmpty(_odataFilter)) + var _deploymentExtendedFilter = odataQuery.ToString(); + if (!string.IsNullOrEmpty(_deploymentExtendedFilter)) { - _queryParameters.Add(_odataFilter); + _queryParameters.Add(_deploymentExtendedFilter); } } - 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) @@ -5493,55 +5739,56 @@ internal DeploymentsOperations(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) @@ -5551,9 +5798,10 @@ internal DeploymentsOperations(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(); @@ -5564,25 +5812,29 @@ internal DeploymentsOperations(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; - } + + + + + } /// /// Calculate the hash of the given template. /// @@ -5595,13 +5847,13 @@ internal DeploymentsOperations(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 /// /// @@ -5610,59 +5862,68 @@ internal DeploymentsOperations(ResourceManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CalculateTemplateHashWithHttpMessagesAsync(object template, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CalculateTemplateHashWithHttpMessagesAsync(object template, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.ApiVersion == null) + + + + + if (template == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "template"); } - if (template == null) + + if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "template"); + 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("template", template); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CalculateTemplateHash", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "CalculateTemplateHash", 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/calculateTemplateHash").ToString(); - 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("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _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) @@ -5674,61 +5935,62 @@ internal DeploymentsOperations(ResourceManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(template != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(template, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(template, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + 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) @@ -5738,9 +6000,10 @@ internal DeploymentsOperations(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(); @@ -5751,29 +6014,30 @@ internal DeploymentsOperations(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; - } + + + + + } /// - /// Deletes a deployment from the deployment history. - /// - /// /// A template deployment that is currently running cannot be deleted. Deleting /// a template deployment removes the associated deployment operations. This is /// an asynchronous operation that returns a status of 202 until the template @@ -5783,7 +6047,7 @@ internal DeploymentsOperations(ResourceManagementClient client) /// 202. When the process finishes, the URI in the Location header returns a /// status of 204 on success. If the asynchronous request failed, the URI in /// the Location header returns an error-level status code. - /// + /// /// /// The resource scope. /// @@ -5796,10 +6060,10 @@ internal DeploymentsOperations(ResourceManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -5808,81 +6072,90 @@ internal DeploymentsOperations(ResourceManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteAtScopeWithHttpMessagesAsync(string scope, string deploymentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteAtScopeWithHttpMessagesAsync(string scope, string deploymentName, 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("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDeleteAtScope", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDeleteAtScope", 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}").ToString(); _url = _url.Replace("{scope}", scope); _url = _url.Replace("{deploymentName}", System.Uri.EscapeDataString(deploymentName)); - 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("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _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) @@ -5894,55 +6167,56 @@ internal DeploymentsOperations(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 != 202 && (int)_statusCode != 204) { - 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) @@ -5952,27 +6226,29 @@ internal DeploymentsOperations(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(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Deploys resources at a given scope. - /// - /// /// You can provide the template and parameters directly in the request or link /// to JSON files. - /// + /// /// /// The resource scope. /// @@ -5988,13 +6264,13 @@ internal DeploymentsOperations(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 /// /// @@ -6003,90 +6279,99 @@ internal DeploymentsOperations(ResourceManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateAtScopeWithHttpMessagesAsync(string scope, string deploymentName, Deployment parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateAtScopeWithHttpMessagesAsync(string scope, string deploymentName, Deployment parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + + if (parameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); + } + if (parameters != null) + { + parameters.Validate(); + } 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 (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (parameters != null) + if (this.Client.ApiVersion == null) { - parameters.Validate(); - } - if (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("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdateAtScope", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdateAtScope", 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}").ToString(); _url = _url.Replace("{scope}", scope); _url = _url.Replace("{deploymentName}", System.Uri.EscapeDataString(deploymentName)); - 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("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _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) @@ -6098,61 +6383,62 @@ internal DeploymentsOperations(ResourceManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + 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 && (int)_statusCode != 201) { - 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) @@ -6162,9 +6448,10 @@ internal DeploymentsOperations(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(); @@ -6175,16 +6462,16 @@ internal DeploymentsOperations(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); } } // Deserialize Response @@ -6193,25 +6480,29 @@ internal DeploymentsOperations(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; - } + + + + + } /// /// Validates whether the specified template is syntactically correct and will /// be accepted by Azure Resource Manager.. @@ -6231,13 +6522,13 @@ internal DeploymentsOperations(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 /// /// @@ -6246,90 +6537,99 @@ internal DeploymentsOperations(ResourceManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginValidateAtScopeWithHttpMessagesAsync(string scope, string deploymentName, Deployment parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginValidateAtScopeWithHttpMessagesAsync(string scope, string deploymentName, Deployment parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + + if (parameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); + } + if (parameters != null) + { + parameters.Validate(); + } 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 (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (parameters != null) + if (this.Client.ApiVersion == null) { - parameters.Validate(); - } - if (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("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginValidateAtScope", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginValidateAtScope", 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}/validate").ToString(); _url = _url.Replace("{scope}", scope); _url = _url.Replace("{deploymentName}", System.Uri.EscapeDataString(deploymentName)); - 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("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _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) @@ -6341,61 +6641,62 @@ internal DeploymentsOperations(ResourceManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + 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 && (int)_statusCode != 202 && (int)_statusCode != 400) { - 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) @@ -6405,9 +6706,10 @@ internal DeploymentsOperations(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(); @@ -6418,16 +6720,16 @@ internal DeploymentsOperations(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); } } // Deserialize Response @@ -6436,29 +6738,30 @@ internal DeploymentsOperations(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; - } + + + + + } /// - /// Deletes a deployment from the deployment history. - /// - /// /// A template deployment that is currently running cannot be deleted. Deleting /// a template deployment removes the associated deployment operations. This is /// an asynchronous operation that returns a status of 202 until the template @@ -6468,7 +6771,7 @@ internal DeploymentsOperations(ResourceManagementClient client) /// 202. When the process finishes, the URI in the Location header returns a /// status of 204 on success. If the asynchronous request failed, the URI in /// the Location header returns an error-level status code. - /// + /// /// /// The name of the deployment. /// @@ -6478,10 +6781,10 @@ internal DeploymentsOperations(ResourceManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -6490,75 +6793,83 @@ internal DeploymentsOperations(ResourceManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteAtTenantScopeWithHttpMessagesAsync(string deploymentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteAtTenantScopeWithHttpMessagesAsync(string deploymentName, 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("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDeleteAtTenantScope", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDeleteAtTenantScope", 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}").ToString(); _url = _url.Replace("{deploymentName}", System.Uri.EscapeDataString(deploymentName)); - 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("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _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) @@ -6570,55 +6881,56 @@ internal DeploymentsOperations(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 != 202 && (int)_statusCode != 204) { - 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) @@ -6628,27 +6940,29 @@ internal DeploymentsOperations(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(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Deploys resources at tenant scope. - /// - /// /// You can provide the template and parameters directly in the request or link /// to JSON files. - /// + /// /// /// The name of the deployment. /// @@ -6661,13 +6975,13 @@ internal DeploymentsOperations(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 /// /// @@ -6676,84 +6990,92 @@ internal DeploymentsOperations(ResourceManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateAtTenantScopeWithHttpMessagesAsync(string deploymentName, ScopedDeployment parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateAtTenantScopeWithHttpMessagesAsync(string deploymentName, ScopedDeployment parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + + if (parameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); + } + if (parameters != null) + { + parameters.Validate(); + } 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 (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (parameters != null) - { - parameters.Validate(); - } - 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("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdateAtTenantScope", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdateAtTenantScope", 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}").ToString(); _url = _url.Replace("{deploymentName}", System.Uri.EscapeDataString(deploymentName)); - 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("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _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) @@ -6765,61 +7087,62 @@ internal DeploymentsOperations(ResourceManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + 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 && (int)_statusCode != 201) { - 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) @@ -6829,9 +7152,10 @@ internal DeploymentsOperations(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(); @@ -6842,16 +7166,16 @@ internal DeploymentsOperations(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); } } // Deserialize Response @@ -6860,25 +7184,29 @@ internal DeploymentsOperations(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; - } + + + + + } /// /// Validates whether the specified template is syntactically correct and will /// be accepted by Azure Resource Manager.. @@ -6895,13 +7223,13 @@ internal DeploymentsOperations(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 /// /// @@ -6910,84 +7238,92 @@ internal DeploymentsOperations(ResourceManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginValidateAtTenantScopeWithHttpMessagesAsync(string deploymentName, ScopedDeployment parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginValidateAtTenantScopeWithHttpMessagesAsync(string deploymentName, ScopedDeployment parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + + if (parameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); + } + if (parameters != null) + { + parameters.Validate(); + } 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 (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (parameters != null) - { - parameters.Validate(); - } - 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("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginValidateAtTenantScope", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginValidateAtTenantScope", 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}/validate").ToString(); _url = _url.Replace("{deploymentName}", System.Uri.EscapeDataString(deploymentName)); - 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("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _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) @@ -6999,61 +7335,62 @@ internal DeploymentsOperations(ResourceManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + 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 && (int)_statusCode != 202 && (int)_statusCode != 400) { - 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) @@ -7063,9 +7400,10 @@ internal DeploymentsOperations(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(); @@ -7076,16 +7414,16 @@ internal DeploymentsOperations(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); } } // Deserialize Response @@ -7094,25 +7432,29 @@ internal DeploymentsOperations(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; - } + + + + + } /// /// Returns changes that will be made by the deployment if executed at the /// scope of the tenant group. @@ -7129,13 +7471,13 @@ internal DeploymentsOperations(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 /// /// @@ -7144,84 +7486,92 @@ internal DeploymentsOperations(ResourceManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginWhatIfAtTenantScopeWithHttpMessagesAsync(string deploymentName, ScopedDeploymentWhatIf parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginWhatIfAtTenantScopeWithHttpMessagesAsync(string deploymentName, ScopedDeploymentWhatIf parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + + if (parameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); + } + if (parameters != null) + { + parameters.Validate(); + } 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 (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (parameters != null) - { - parameters.Validate(); - } - 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("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginWhatIfAtTenantScope", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginWhatIfAtTenantScope", 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}/whatIf").ToString(); _url = _url.Replace("{deploymentName}", System.Uri.EscapeDataString(deploymentName)); - 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("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _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) @@ -7233,61 +7583,62 @@ internal DeploymentsOperations(ResourceManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + 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 && (int)_statusCode != 202) { - 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) @@ -7297,9 +7648,10 @@ internal DeploymentsOperations(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(); @@ -7310,42 +7662,43 @@ internal DeploymentsOperations(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); } } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(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 headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Deletes a deployment from the deployment history. - /// - /// /// A template deployment that is currently running cannot be deleted. Deleting /// a template deployment removes the associated deployment operations. This is /// an asynchronous operation that returns a status of 202 until the template @@ -7355,7 +7708,7 @@ internal DeploymentsOperations(ResourceManagementClient client) /// 202. When the process finishes, the URI in the Location header returns a /// status of 204 on success. If the asynchronous request failed, the URI in /// the Location header returns an error-level status code. - /// + /// /// /// The management group ID. /// @@ -7368,10 +7721,10 @@ internal DeploymentsOperations(ResourceManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -7380,92 +7733,100 @@ internal DeploymentsOperations(ResourceManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteAtManagementGroupScopeWithHttpMessagesAsync(string groupId, string deploymentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteAtManagementGroupScopeWithHttpMessagesAsync(string groupId, string deploymentName, 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("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDeleteAtManagementGroupScope", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDeleteAtManagementGroupScope", 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}").ToString(); _url = _url.Replace("{groupId}", System.Uri.EscapeDataString(groupId)); _url = _url.Replace("{deploymentName}", System.Uri.EscapeDataString(deploymentName)); - 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("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _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) @@ -7477,55 +7838,56 @@ internal DeploymentsOperations(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 != 202 && (int)_statusCode != 204) { - 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) @@ -7535,27 +7897,29 @@ internal DeploymentsOperations(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(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Deploys resources at management group scope. - /// - /// /// You can provide the template and parameters directly in the request or link /// to JSON files. - /// + /// /// /// The management group ID. /// @@ -7571,13 +7935,13 @@ internal DeploymentsOperations(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 /// /// @@ -7586,101 +7950,109 @@ internal DeploymentsOperations(ResourceManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateAtManagementGroupScopeWithHttpMessagesAsync(string groupId, string deploymentName, ScopedDeployment parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateAtManagementGroupScopeWithHttpMessagesAsync(string groupId, string deploymentName, ScopedDeployment parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + + if (parameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); + } + if (parameters != null) + { + parameters.Validate(); + } 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 (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (parameters != null) - { - parameters.Validate(); - } - 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("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdateAtManagementGroupScope", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdateAtManagementGroupScope", 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}").ToString(); _url = _url.Replace("{groupId}", System.Uri.EscapeDataString(groupId)); _url = _url.Replace("{deploymentName}", System.Uri.EscapeDataString(deploymentName)); - 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("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _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) @@ -7692,61 +8064,62 @@ internal DeploymentsOperations(ResourceManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + 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 && (int)_statusCode != 201) { - 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) @@ -7756,9 +8129,10 @@ internal DeploymentsOperations(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(); @@ -7769,16 +8143,16 @@ internal DeploymentsOperations(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); } } // Deserialize Response @@ -7787,25 +8161,29 @@ internal DeploymentsOperations(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; - } + + + + + } /// /// Validates whether the specified template is syntactically correct and will /// be accepted by Azure Resource Manager.. @@ -7825,13 +8203,13 @@ internal DeploymentsOperations(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 /// /// @@ -7840,101 +8218,109 @@ internal DeploymentsOperations(ResourceManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginValidateAtManagementGroupScopeWithHttpMessagesAsync(string groupId, string deploymentName, ScopedDeployment parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginValidateAtManagementGroupScopeWithHttpMessagesAsync(string groupId, string deploymentName, ScopedDeployment parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + + if (parameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); + } + if (parameters != null) + { + parameters.Validate(); + } 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 (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (parameters != null) - { - parameters.Validate(); - } - 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("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginValidateAtManagementGroupScope", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginValidateAtManagementGroupScope", 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}/validate").ToString(); _url = _url.Replace("{groupId}", System.Uri.EscapeDataString(groupId)); _url = _url.Replace("{deploymentName}", System.Uri.EscapeDataString(deploymentName)); - 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("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _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) @@ -7946,61 +8332,62 @@ internal DeploymentsOperations(ResourceManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + 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 && (int)_statusCode != 202 && (int)_statusCode != 400) { - 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) @@ -8010,9 +8397,10 @@ internal DeploymentsOperations(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(); @@ -8023,16 +8411,16 @@ internal DeploymentsOperations(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); } } // Deserialize Response @@ -8041,25 +8429,29 @@ internal DeploymentsOperations(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; - } + + + + + } /// /// Returns changes that will be made by the deployment if executed at the /// scope of the management group. @@ -8079,13 +8471,13 @@ internal DeploymentsOperations(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 /// /// @@ -8094,101 +8486,109 @@ internal DeploymentsOperations(ResourceManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginWhatIfAtManagementGroupScopeWithHttpMessagesAsync(string groupId, string deploymentName, ScopedDeploymentWhatIf parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginWhatIfAtManagementGroupScopeWithHttpMessagesAsync(string groupId, string deploymentName, ScopedDeploymentWhatIf parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + + if (parameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); + } + if (parameters != null) + { + parameters.Validate(); + } 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 (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (parameters != null) - { - parameters.Validate(); - } - 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("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginWhatIfAtManagementGroupScope", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginWhatIfAtManagementGroupScope", 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}/whatIf").ToString(); _url = _url.Replace("{groupId}", System.Uri.EscapeDataString(groupId)); _url = _url.Replace("{deploymentName}", System.Uri.EscapeDataString(deploymentName)); - 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("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _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) @@ -8200,61 +8600,62 @@ internal DeploymentsOperations(ResourceManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + 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 && (int)_statusCode != 202) { - 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) @@ -8264,9 +8665,10 @@ internal DeploymentsOperations(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(); @@ -8277,42 +8679,43 @@ internal DeploymentsOperations(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); } } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(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 headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Deletes a deployment from the deployment history. - /// - /// /// A template deployment that is currently running cannot be deleted. Deleting /// a template deployment removes the associated deployment operations. This is /// an asynchronous operation that returns a status of 202 until the template @@ -8322,7 +8725,7 @@ internal DeploymentsOperations(ResourceManagementClient client) /// 202. When the process finishes, the URI in the Location header returns a /// status of 204 on success. If the asynchronous request failed, the URI in /// the Location header returns an error-level status code. - /// + /// /// /// The name of the deployment. /// @@ -8332,10 +8735,10 @@ internal DeploymentsOperations(ResourceManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -8344,80 +8747,89 @@ internal DeploymentsOperations(ResourceManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteAtSubscriptionScopeWithHttpMessagesAsync(string deploymentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteAtSubscriptionScopeWithHttpMessagesAsync(string deploymentName, 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("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDeleteAtSubscriptionScope", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDeleteAtSubscriptionScope", 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}").ToString(); _url = _url.Replace("{deploymentName}", System.Uri.EscapeDataString(deploymentName)); - _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("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _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) @@ -8429,55 +8841,56 @@ internal DeploymentsOperations(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 != 202 && (int)_statusCode != 204) { - 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) @@ -8487,27 +8900,29 @@ internal DeploymentsOperations(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(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Deploys resources at subscription scope. - /// - /// /// You can provide the template and parameters directly in the request or link /// to JSON files. - /// + /// /// /// The name of the deployment. /// @@ -8520,13 +8935,13 @@ internal DeploymentsOperations(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 /// /// @@ -8535,89 +8950,98 @@ internal DeploymentsOperations(ResourceManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateAtSubscriptionScopeWithHttpMessagesAsync(string deploymentName, Deployment parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateAtSubscriptionScopeWithHttpMessagesAsync(string deploymentName, Deployment parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + + if (parameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); + } + if (parameters != null) + { + parameters.Validate(); + } 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 (parameters == null) + if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (parameters != null) - { - parameters.Validate(); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(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("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdateAtSubscriptionScope", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdateAtSubscriptionScope", 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}").ToString(); _url = _url.Replace("{deploymentName}", System.Uri.EscapeDataString(deploymentName)); - _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("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _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) @@ -8629,61 +9053,62 @@ internal DeploymentsOperations(ResourceManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + 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 && (int)_statusCode != 201) { - 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) @@ -8693,9 +9118,10 @@ internal DeploymentsOperations(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(); @@ -8706,16 +9132,16 @@ internal DeploymentsOperations(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); } } // Deserialize Response @@ -8724,25 +9150,29 @@ internal DeploymentsOperations(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; - } + + + + + } /// /// Validates whether the specified template is syntactically correct and will /// be accepted by Azure Resource Manager.. @@ -8759,13 +9189,13 @@ internal DeploymentsOperations(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 /// /// @@ -8774,89 +9204,98 @@ internal DeploymentsOperations(ResourceManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginValidateAtSubscriptionScopeWithHttpMessagesAsync(string deploymentName, Deployment parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginValidateAtSubscriptionScopeWithHttpMessagesAsync(string deploymentName, Deployment parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + + if (parameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); + } + if (parameters != null) + { + parameters.Validate(); + } 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 (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (parameters != null) - { - parameters.Validate(); - } - 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("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginValidateAtSubscriptionScope", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginValidateAtSubscriptionScope", 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}/validate").ToString(); _url = _url.Replace("{deploymentName}", System.Uri.EscapeDataString(deploymentName)); - _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("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _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) @@ -8868,61 +9307,62 @@ internal DeploymentsOperations(ResourceManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + 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 && (int)_statusCode != 202 && (int)_statusCode != 400) { - 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) @@ -8932,9 +9372,10 @@ internal DeploymentsOperations(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(); @@ -8945,16 +9386,16 @@ internal DeploymentsOperations(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); } } // Deserialize Response @@ -8963,25 +9404,29 @@ internal DeploymentsOperations(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; - } + + + + + } /// /// Returns changes that will be made by the deployment if executed at the /// scope of the subscription. @@ -8998,13 +9443,13 @@ internal DeploymentsOperations(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 /// /// @@ -9013,89 +9458,98 @@ internal DeploymentsOperations(ResourceManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginWhatIfAtSubscriptionScopeWithHttpMessagesAsync(string deploymentName, DeploymentWhatIf parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginWhatIfAtSubscriptionScopeWithHttpMessagesAsync(string deploymentName, DeploymentWhatIf parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + + if (parameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); + } + if (parameters != null) + { + parameters.Validate(); + } 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 (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (parameters != null) - { - parameters.Validate(); - } - 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("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginWhatIfAtSubscriptionScope", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginWhatIfAtSubscriptionScope", 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}/whatIf").ToString(); _url = _url.Replace("{deploymentName}", System.Uri.EscapeDataString(deploymentName)); - _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("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _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) @@ -9107,61 +9561,62 @@ internal DeploymentsOperations(ResourceManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + 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 && (int)_statusCode != 202) { - 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) @@ -9171,9 +9626,10 @@ internal DeploymentsOperations(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(); @@ -9184,42 +9640,43 @@ internal DeploymentsOperations(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); } } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(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 headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Deletes a deployment from the deployment history. - /// - /// /// A template deployment that is currently running cannot be deleted. Deleting /// a template deployment removes the associated deployment operations. /// Deleting a template deployment does not affect the state of the resource @@ -9230,7 +9687,7 @@ internal DeploymentsOperations(ResourceManagementClient client) /// returns a status of 202. When the process finishes, the URI in the Location /// header returns a status of 204 on success. If the asynchronous request /// failed, the URI in the Location header returns an error-level status code. - /// + /// /// /// The name of the resource group with the deployment to delete. The name is /// case insensitive. @@ -9244,10 +9701,10 @@ internal DeploymentsOperations(ResourceManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -9256,101 +9713,110 @@ internal DeploymentsOperations(ResourceManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string deploymentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string deploymentName, 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("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", 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}/providers/Microsoft.Resources/deployments/{deploymentName}").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(); - 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("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _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) @@ -9362,55 +9828,56 @@ internal DeploymentsOperations(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 != 202 && (int)_statusCode != 204) { - 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) @@ -9420,27 +9887,29 @@ internal DeploymentsOperations(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(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Deploys resources to a resource group. - /// - /// /// You can provide the template and parameters directly in the request or link /// to JSON files. - /// + /// /// /// The name of the resource group to deploy the resources to. The name is case /// insensitive. The resource group must already exist. @@ -9457,13 +9926,13 @@ internal DeploymentsOperations(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 /// /// @@ -9472,110 +9941,119 @@ internal DeploymentsOperations(ResourceManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string deploymentName, Deployment parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string deploymentName, Deployment parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + + if (parameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); + } + if (parameters != null) + { + parameters.Validate(); + } 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 (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (parameters != null) - { - parameters.Validate(); - } - 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("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", 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}/providers/Microsoft.Resources/deployments/{deploymentName}").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(); - 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("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _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) @@ -9587,61 +10065,62 @@ internal DeploymentsOperations(ResourceManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + 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 && (int)_statusCode != 201) { - 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) @@ -9651,9 +10130,10 @@ internal DeploymentsOperations(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(); @@ -9664,16 +10144,16 @@ internal DeploymentsOperations(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); } } // Deserialize Response @@ -9682,25 +10162,29 @@ internal DeploymentsOperations(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; - } + + + + + } /// /// Validates whether the specified template is syntactically correct and will /// be accepted by Azure Resource Manager.. @@ -9721,13 +10205,13 @@ internal DeploymentsOperations(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 /// /// @@ -9736,110 +10220,119 @@ internal DeploymentsOperations(ResourceManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginValidateWithHttpMessagesAsync(string resourceGroupName, string deploymentName, Deployment parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginValidateWithHttpMessagesAsync(string resourceGroupName, string deploymentName, Deployment parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + + if (parameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); + } + if (parameters != null) + { + parameters.Validate(); + } 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 (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (parameters != null) - { - parameters.Validate(); - } - 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("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginValidate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginValidate", 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}/providers/Microsoft.Resources/deployments/{deploymentName}/validate").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(); - 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("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _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) @@ -9851,61 +10344,62 @@ internal DeploymentsOperations(ResourceManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + 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 && (int)_statusCode != 202 && (int)_statusCode != 400) { - 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) @@ -9915,9 +10409,10 @@ internal DeploymentsOperations(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(); @@ -9928,16 +10423,16 @@ internal DeploymentsOperations(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); } } // Deserialize Response @@ -9946,25 +10441,29 @@ internal DeploymentsOperations(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; - } + + + + + } /// /// Returns changes that will be made by the deployment if executed at the /// scope of the resource group. @@ -9985,13 +10484,13 @@ internal DeploymentsOperations(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 /// /// @@ -10000,110 +10499,119 @@ internal DeploymentsOperations(ResourceManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginWhatIfWithHttpMessagesAsync(string resourceGroupName, string deploymentName, DeploymentWhatIf parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginWhatIfWithHttpMessagesAsync(string resourceGroupName, string deploymentName, DeploymentWhatIf parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + + if (parameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); + } + if (parameters != null) + { + parameters.Validate(); + } 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 (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (parameters != null) + if (this.Client.ApiVersion == null) { - parameters.Validate(); - } - if (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("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginWhatIf", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginWhatIf", 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}/providers/Microsoft.Resources/deployments/{deploymentName}/whatIf").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(); - 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("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _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) @@ -10115,61 +10623,62 @@ internal DeploymentsOperations(ResourceManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + 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 && (int)_statusCode != 202) { - 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) @@ -10179,9 +10688,10 @@ internal DeploymentsOperations(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(); @@ -10192,38 +10702,42 @@ internal DeploymentsOperations(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); } } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(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 headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Get all the deployments at the given scope. /// @@ -10236,13 +10750,13 @@ internal DeploymentsOperations(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 /// /// @@ -10251,51 +10765,54 @@ internal DeploymentsOperations(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) @@ -10307,55 +10824,56 @@ internal DeploymentsOperations(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) @@ -10365,9 +10883,10 @@ internal DeploymentsOperations(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(); @@ -10378,25 +10897,29 @@ internal DeploymentsOperations(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; - } + + + + + } /// /// Get all the deployments at the tenant scope. /// @@ -10409,13 +10932,13 @@ internal DeploymentsOperations(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 /// /// @@ -10424,51 +10947,54 @@ internal DeploymentsOperations(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>> ListAtTenantScopeNextWithHttpMessagesAsync(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, "ListAtTenantScopeNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAtTenantScopeNext", 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) @@ -10480,55 +11006,56 @@ internal DeploymentsOperations(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) @@ -10538,9 +11065,10 @@ internal DeploymentsOperations(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(); @@ -10551,25 +11079,29 @@ internal DeploymentsOperations(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; - } + + + + + } /// /// Get all the deployments for a management group. /// @@ -10582,13 +11114,13 @@ internal DeploymentsOperations(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 /// /// @@ -10597,51 +11129,54 @@ internal DeploymentsOperations(ResourceManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListAtManagementGroupScopeNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListAtManagementGroupScopeNextWithHttpMessagesAsync(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, "ListAtManagementGroupScopeNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAtManagementGroupScopeNext", 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) @@ -10653,55 +11188,56 @@ internal DeploymentsOperations(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) @@ -10711,9 +11247,10 @@ internal DeploymentsOperations(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(); @@ -10724,25 +11261,29 @@ internal DeploymentsOperations(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; - } + + + + + } /// /// Get all the deployments for a subscription. /// @@ -10755,13 +11296,13 @@ internal DeploymentsOperations(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 /// /// @@ -10770,51 +11311,54 @@ internal DeploymentsOperations(ResourceManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListAtSubscriptionScopeNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListAtSubscriptionScopeNextWithHttpMessagesAsync(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, "ListAtSubscriptionScopeNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAtSubscriptionScopeNext", 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) @@ -10826,55 +11370,56 @@ internal DeploymentsOperations(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) @@ -10884,9 +11429,10 @@ internal DeploymentsOperations(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(); @@ -10897,25 +11443,29 @@ internal DeploymentsOperations(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; - } + + + + + } /// /// Get all the deployments for a resource group. /// @@ -10928,13 +11478,13 @@ internal DeploymentsOperations(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 /// /// @@ -10943,51 +11493,54 @@ internal DeploymentsOperations(ResourceManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByResourceGroupNextWithHttpMessagesAsync(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, "ListByResourceGroupNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", 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) @@ -10999,55 +11552,56 @@ internal DeploymentsOperations(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) @@ -11057,9 +11611,10 @@ internal DeploymentsOperations(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(); @@ -11070,24 +11625,28 @@ internal DeploymentsOperations(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; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Management.Sdk/Generated/DeploymentsOperationsExtensions.cs b/src/Resources/Resources.Management.Sdk/Generated/DeploymentsOperationsExtensions.cs new file mode 100644 index 000000000000..063ce42caa5e --- /dev/null +++ b/src/Resources/Resources.Management.Sdk/Generated/DeploymentsOperationsExtensions.cs @@ -0,0 +1,2734 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.Management.Resources +{ + using Microsoft.Rest.Azure; + using Models; + + /// + /// Extension methods for DeploymentsOperations + /// + public static partial class DeploymentsOperationsExtensions + { + /// + /// A template deployment that is currently running cannot be deleted. Deleting + /// a template deployment removes the associated deployment operations. This is + /// an asynchronous operation that returns a status of 202 until the template + /// deployment is successfully deleted. The Location response header contains + /// the URI that is used to obtain the status of the process. While the process + /// is running, a call to the URI in the Location header returns a status of + /// 202. When the process finishes, the URI in the Location header returns a + /// status of 204 on success. If the asynchronous request failed, the URI in + /// the Location header returns an error-level status code. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource scope. + /// + /// + /// The name of the deployment. + /// + public static void DeleteAtScope(this IDeploymentsOperations operations, string scope, string deploymentName) + { + ((IDeploymentsOperations)operations).DeleteAtScopeAsync(scope, deploymentName).GetAwaiter().GetResult(); + } + + /// + /// A template deployment that is currently running cannot be deleted. Deleting + /// a template deployment removes the associated deployment operations. This is + /// an asynchronous operation that returns a status of 202 until the template + /// deployment is successfully deleted. The Location response header contains + /// the URI that is used to obtain the status of the process. While the process + /// is running, a call to the URI in the Location header returns a status of + /// 202. When the process finishes, the URI in the Location header returns a + /// status of 204 on success. If the asynchronous request failed, the URI in + /// the Location header returns an error-level status code. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource scope. + /// + /// + /// The name of the deployment. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAtScopeAsync(this IDeploymentsOperations operations, string scope, string deploymentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteAtScopeWithHttpMessagesAsync(scope, deploymentName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Checks whether the deployment exists. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource scope. + /// + /// + /// The name of the deployment. + /// + public static bool CheckExistenceAtScope(this IDeploymentsOperations operations, string scope, string deploymentName) + { + return ((IDeploymentsOperations)operations).CheckExistenceAtScopeAsync(scope, deploymentName).GetAwaiter().GetResult(); + } + + /// + /// Checks whether the deployment exists. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource scope. + /// + /// + /// The name of the deployment. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CheckExistenceAtScopeAsync(this IDeploymentsOperations operations, string scope, string deploymentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CheckExistenceAtScopeWithHttpMessagesAsync(scope, deploymentName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// You can provide the template and parameters directly in the request or link + /// to JSON files. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource scope. + /// + /// + /// The name of the deployment. + /// + public static DeploymentExtended CreateOrUpdateAtScope(this IDeploymentsOperations operations, string scope, string deploymentName, Deployment parameters) + { + return ((IDeploymentsOperations)operations).CreateOrUpdateAtScopeAsync(scope, deploymentName, parameters).GetAwaiter().GetResult(); + } + + /// + /// You can provide the template and parameters directly in the request or link + /// to JSON files. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource scope. + /// + /// + /// The name of the deployment. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAtScopeAsync(this IDeploymentsOperations operations, string scope, string deploymentName, Deployment parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateAtScopeWithHttpMessagesAsync(scope, deploymentName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets a deployment. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource scope. + /// + /// + /// The name of the deployment. + /// + public static DeploymentExtended GetAtScope(this IDeploymentsOperations operations, string scope, string deploymentName) + { + return ((IDeploymentsOperations)operations).GetAtScopeAsync(scope, deploymentName).GetAwaiter().GetResult(); + } + + /// + /// Gets a deployment. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource scope. + /// + /// + /// The name of the deployment. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAtScopeAsync(this IDeploymentsOperations operations, string scope, string deploymentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetAtScopeWithHttpMessagesAsync(scope, deploymentName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// You can cancel a deployment only if the provisioningState is Accepted or + /// Running. After the deployment is canceled, the provisioningState is set to + /// Canceled. Canceling a template deployment stops the currently running + /// template deployment and leaves the resources partially deployed. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource scope. + /// + /// + /// The name of the deployment. + /// + public static void CancelAtScope(this IDeploymentsOperations operations, string scope, string deploymentName) + { + ((IDeploymentsOperations)operations).CancelAtScopeAsync(scope, deploymentName).GetAwaiter().GetResult(); + } + + /// + /// You can cancel a deployment only if the provisioningState is Accepted or + /// Running. After the deployment is canceled, the provisioningState is set to + /// Canceled. Canceling a template deployment stops the currently running + /// template deployment and leaves the resources partially deployed. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource scope. + /// + /// + /// The name of the deployment. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CancelAtScopeAsync(this IDeploymentsOperations operations, string scope, string deploymentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.CancelAtScopeWithHttpMessagesAsync(scope, deploymentName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Validates whether the specified template is syntactically correct and will + /// be accepted by Azure Resource Manager.. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource scope. + /// + /// + /// The name of the deployment. + /// + public static DeploymentValidateResult ValidateAtScope(this IDeploymentsOperations operations, string scope, string deploymentName, Deployment parameters) + { + return ((IDeploymentsOperations)operations).ValidateAtScopeAsync(scope, deploymentName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Validates whether the specified template is syntactically correct and will + /// be accepted by Azure Resource Manager.. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource scope. + /// + /// + /// The name of the deployment. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task ValidateAtScopeAsync(this IDeploymentsOperations operations, string scope, string deploymentName, Deployment parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ValidateAtScopeWithHttpMessagesAsync(scope, deploymentName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Exports the template used for specified deployment. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource scope. + /// + /// + /// The name of the deployment. + /// + public static DeploymentExportResult ExportTemplateAtScope(this IDeploymentsOperations operations, string scope, string deploymentName) + { + return ((IDeploymentsOperations)operations).ExportTemplateAtScopeAsync(scope, deploymentName).GetAwaiter().GetResult(); + } + + /// + /// Exports the template used for specified deployment. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource scope. + /// + /// + /// The name of the deployment. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task ExportTemplateAtScopeAsync(this IDeploymentsOperations operations, string scope, string deploymentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ExportTemplateAtScopeWithHttpMessagesAsync(scope, deploymentName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Get all the deployments at the given scope. + /// + /// + /// The operations group for this extension method. + /// + /// + /// + /// + /// + /// The resource scope. + /// + public static Microsoft.Rest.Azure.IPage ListAtScope(this IDeploymentsOperations operations, string scope, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery)) + { + return ((IDeploymentsOperations)operations).ListAtScopeAsync(scope, odataQuery).GetAwaiter().GetResult(); + } + + /// + /// Get all the deployments at the given scope. + /// + /// + /// The operations group for this extension method. + /// + /// + /// + /// + /// + /// The resource scope. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAtScopeAsync(this IDeploymentsOperations operations, string scope, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListAtScopeWithHttpMessagesAsync(scope, odataQuery, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// A template deployment that is currently running cannot be deleted. Deleting + /// a template deployment removes the associated deployment operations. This is + /// an asynchronous operation that returns a status of 202 until the template + /// deployment is successfully deleted. The Location response header contains + /// the URI that is used to obtain the status of the process. While the process + /// is running, a call to the URI in the Location header returns a status of + /// 202. When the process finishes, the URI in the Location header returns a + /// status of 204 on success. If the asynchronous request failed, the URI in + /// the Location header returns an error-level status code. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the deployment. + /// + public static void DeleteAtTenantScope(this IDeploymentsOperations operations, string deploymentName) + { + ((IDeploymentsOperations)operations).DeleteAtTenantScopeAsync(deploymentName).GetAwaiter().GetResult(); + } + + /// + /// A template deployment that is currently running cannot be deleted. Deleting + /// a template deployment removes the associated deployment operations. This is + /// an asynchronous operation that returns a status of 202 until the template + /// deployment is successfully deleted. The Location response header contains + /// the URI that is used to obtain the status of the process. While the process + /// is running, a call to the URI in the Location header returns a status of + /// 202. When the process finishes, the URI in the Location header returns a + /// status of 204 on success. If the asynchronous request failed, the URI in + /// the Location header returns an error-level status code. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the deployment. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAtTenantScopeAsync(this IDeploymentsOperations operations, string deploymentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteAtTenantScopeWithHttpMessagesAsync(deploymentName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Checks whether the deployment exists. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the deployment. + /// + public static bool CheckExistenceAtTenantScope(this IDeploymentsOperations operations, string deploymentName) + { + return ((IDeploymentsOperations)operations).CheckExistenceAtTenantScopeAsync(deploymentName).GetAwaiter().GetResult(); + } + + /// + /// Checks whether the deployment exists. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the deployment. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CheckExistenceAtTenantScopeAsync(this IDeploymentsOperations operations, string deploymentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CheckExistenceAtTenantScopeWithHttpMessagesAsync(deploymentName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// You can provide the template and parameters directly in the request or link + /// to JSON files. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the deployment. + /// + public static DeploymentExtended CreateOrUpdateAtTenantScope(this IDeploymentsOperations operations, string deploymentName, ScopedDeployment parameters) + { + return ((IDeploymentsOperations)operations).CreateOrUpdateAtTenantScopeAsync(deploymentName, parameters).GetAwaiter().GetResult(); + } + + /// + /// You can provide the template and parameters directly in the request or link + /// to JSON files. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the deployment. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAtTenantScopeAsync(this IDeploymentsOperations operations, string deploymentName, ScopedDeployment parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateAtTenantScopeWithHttpMessagesAsync(deploymentName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets a deployment. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the deployment. + /// + public static DeploymentExtended GetAtTenantScope(this IDeploymentsOperations operations, string deploymentName) + { + return ((IDeploymentsOperations)operations).GetAtTenantScopeAsync(deploymentName).GetAwaiter().GetResult(); + } + + /// + /// Gets a deployment. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the deployment. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAtTenantScopeAsync(this IDeploymentsOperations operations, string deploymentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetAtTenantScopeWithHttpMessagesAsync(deploymentName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// You can cancel a deployment only if the provisioningState is Accepted or + /// Running. After the deployment is canceled, the provisioningState is set to + /// Canceled. Canceling a template deployment stops the currently running + /// template deployment and leaves the resources partially deployed. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the deployment. + /// + public static void CancelAtTenantScope(this IDeploymentsOperations operations, string deploymentName) + { + ((IDeploymentsOperations)operations).CancelAtTenantScopeAsync(deploymentName).GetAwaiter().GetResult(); + } + + /// + /// You can cancel a deployment only if the provisioningState is Accepted or + /// Running. After the deployment is canceled, the provisioningState is set to + /// Canceled. Canceling a template deployment stops the currently running + /// template deployment and leaves the resources partially deployed. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the deployment. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CancelAtTenantScopeAsync(this IDeploymentsOperations operations, string deploymentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.CancelAtTenantScopeWithHttpMessagesAsync(deploymentName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Validates whether the specified template is syntactically correct and will + /// be accepted by Azure Resource Manager.. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the deployment. + /// + public static DeploymentValidateResult ValidateAtTenantScope(this IDeploymentsOperations operations, string deploymentName, ScopedDeployment parameters) + { + return ((IDeploymentsOperations)operations).ValidateAtTenantScopeAsync(deploymentName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Validates whether the specified template is syntactically correct and will + /// be accepted by Azure Resource Manager.. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the deployment. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task ValidateAtTenantScopeAsync(this IDeploymentsOperations operations, string deploymentName, ScopedDeployment parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ValidateAtTenantScopeWithHttpMessagesAsync(deploymentName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Returns changes that will be made by the deployment if executed at the + /// scope of the tenant group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the deployment. + /// + public static WhatIfOperationResult WhatIfAtTenantScope(this IDeploymentsOperations operations, string deploymentName, ScopedDeploymentWhatIf parameters) + { + return ((IDeploymentsOperations)operations).WhatIfAtTenantScopeAsync(deploymentName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Returns changes that will be made by the deployment if executed at the + /// scope of the tenant group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the deployment. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task WhatIfAtTenantScopeAsync(this IDeploymentsOperations operations, string deploymentName, ScopedDeploymentWhatIf parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.WhatIfAtTenantScopeWithHttpMessagesAsync(deploymentName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Exports the template used for specified deployment. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the deployment. + /// + public static DeploymentExportResult ExportTemplateAtTenantScope(this IDeploymentsOperations operations, string deploymentName) + { + return ((IDeploymentsOperations)operations).ExportTemplateAtTenantScopeAsync(deploymentName).GetAwaiter().GetResult(); + } + + /// + /// Exports the template used for specified deployment. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the deployment. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task ExportTemplateAtTenantScopeAsync(this IDeploymentsOperations operations, string deploymentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ExportTemplateAtTenantScopeWithHttpMessagesAsync(deploymentName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Get all the deployments at the tenant scope. + /// + /// + /// The operations group for this extension method. + /// + /// + /// + /// + public static Microsoft.Rest.Azure.IPage ListAtTenantScope(this IDeploymentsOperations operations, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery)) + { + return ((IDeploymentsOperations)operations).ListAtTenantScopeAsync(odataQuery).GetAwaiter().GetResult(); + } + + /// + /// Get all the deployments at the tenant scope. + /// + /// + /// The operations group for this extension method. + /// + /// + /// + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAtTenantScopeAsync(this IDeploymentsOperations operations, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListAtTenantScopeWithHttpMessagesAsync(odataQuery, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// A template deployment that is currently running cannot be deleted. Deleting + /// a template deployment removes the associated deployment operations. This is + /// an asynchronous operation that returns a status of 202 until the template + /// deployment is successfully deleted. The Location response header contains + /// the URI that is used to obtain the status of the process. While the process + /// is running, a call to the URI in the Location header returns a status of + /// 202. When the process finishes, the URI in the Location header returns a + /// status of 204 on success. If the asynchronous request failed, the URI in + /// the Location header returns an error-level status code. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The management group ID. + /// + /// + /// The name of the deployment. + /// + public static void DeleteAtManagementGroupScope(this IDeploymentsOperations operations, string groupId, string deploymentName) + { + ((IDeploymentsOperations)operations).DeleteAtManagementGroupScopeAsync(groupId, deploymentName).GetAwaiter().GetResult(); + } + + /// + /// A template deployment that is currently running cannot be deleted. Deleting + /// a template deployment removes the associated deployment operations. This is + /// an asynchronous operation that returns a status of 202 until the template + /// deployment is successfully deleted. The Location response header contains + /// the URI that is used to obtain the status of the process. While the process + /// is running, a call to the URI in the Location header returns a status of + /// 202. When the process finishes, the URI in the Location header returns a + /// status of 204 on success. If the asynchronous request failed, the URI in + /// the Location header returns an error-level status code. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The management group ID. + /// + /// + /// The name of the deployment. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAtManagementGroupScopeAsync(this IDeploymentsOperations operations, string groupId, string deploymentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteAtManagementGroupScopeWithHttpMessagesAsync(groupId, deploymentName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Checks whether the deployment exists. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The management group ID. + /// + /// + /// The name of the deployment. + /// + public static bool CheckExistenceAtManagementGroupScope(this IDeploymentsOperations operations, string groupId, string deploymentName) + { + return ((IDeploymentsOperations)operations).CheckExistenceAtManagementGroupScopeAsync(groupId, deploymentName).GetAwaiter().GetResult(); + } + + /// + /// Checks whether the deployment exists. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The management group ID. + /// + /// + /// The name of the deployment. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CheckExistenceAtManagementGroupScopeAsync(this IDeploymentsOperations operations, string groupId, string deploymentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CheckExistenceAtManagementGroupScopeWithHttpMessagesAsync(groupId, deploymentName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// You can provide the template and parameters directly in the request or link + /// to JSON files. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The management group ID. + /// + /// + /// The name of the deployment. + /// + public static DeploymentExtended CreateOrUpdateAtManagementGroupScope(this IDeploymentsOperations operations, string groupId, string deploymentName, ScopedDeployment parameters) + { + return ((IDeploymentsOperations)operations).CreateOrUpdateAtManagementGroupScopeAsync(groupId, deploymentName, parameters).GetAwaiter().GetResult(); + } + + /// + /// You can provide the template and parameters directly in the request or link + /// to JSON files. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The management group ID. + /// + /// + /// The name of the deployment. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAtManagementGroupScopeAsync(this IDeploymentsOperations operations, string groupId, string deploymentName, ScopedDeployment parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateAtManagementGroupScopeWithHttpMessagesAsync(groupId, deploymentName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets a deployment. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The management group ID. + /// + /// + /// The name of the deployment. + /// + public static DeploymentExtended GetAtManagementGroupScope(this IDeploymentsOperations operations, string groupId, string deploymentName) + { + return ((IDeploymentsOperations)operations).GetAtManagementGroupScopeAsync(groupId, deploymentName).GetAwaiter().GetResult(); + } + + /// + /// Gets a deployment. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The management group ID. + /// + /// + /// The name of the deployment. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAtManagementGroupScopeAsync(this IDeploymentsOperations operations, string groupId, string deploymentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetAtManagementGroupScopeWithHttpMessagesAsync(groupId, deploymentName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// You can cancel a deployment only if the provisioningState is Accepted or + /// Running. After the deployment is canceled, the provisioningState is set to + /// Canceled. Canceling a template deployment stops the currently running + /// template deployment and leaves the resources partially deployed. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The management group ID. + /// + /// + /// The name of the deployment. + /// + public static void CancelAtManagementGroupScope(this IDeploymentsOperations operations, string groupId, string deploymentName) + { + ((IDeploymentsOperations)operations).CancelAtManagementGroupScopeAsync(groupId, deploymentName).GetAwaiter().GetResult(); + } + + /// + /// You can cancel a deployment only if the provisioningState is Accepted or + /// Running. After the deployment is canceled, the provisioningState is set to + /// Canceled. Canceling a template deployment stops the currently running + /// template deployment and leaves the resources partially deployed. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The management group ID. + /// + /// + /// The name of the deployment. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CancelAtManagementGroupScopeAsync(this IDeploymentsOperations operations, string groupId, string deploymentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.CancelAtManagementGroupScopeWithHttpMessagesAsync(groupId, deploymentName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Validates whether the specified template is syntactically correct and will + /// be accepted by Azure Resource Manager.. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The management group ID. + /// + /// + /// The name of the deployment. + /// + public static DeploymentValidateResult ValidateAtManagementGroupScope(this IDeploymentsOperations operations, string groupId, string deploymentName, ScopedDeployment parameters) + { + return ((IDeploymentsOperations)operations).ValidateAtManagementGroupScopeAsync(groupId, deploymentName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Validates whether the specified template is syntactically correct and will + /// be accepted by Azure Resource Manager.. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The management group ID. + /// + /// + /// The name of the deployment. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task ValidateAtManagementGroupScopeAsync(this IDeploymentsOperations operations, string groupId, string deploymentName, ScopedDeployment parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ValidateAtManagementGroupScopeWithHttpMessagesAsync(groupId, deploymentName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Returns changes that will be made by the deployment if executed at the + /// scope of the management group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The management group ID. + /// + /// + /// The name of the deployment. + /// + public static WhatIfOperationResult WhatIfAtManagementGroupScope(this IDeploymentsOperations operations, string groupId, string deploymentName, ScopedDeploymentWhatIf parameters) + { + return ((IDeploymentsOperations)operations).WhatIfAtManagementGroupScopeAsync(groupId, deploymentName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Returns changes that will be made by the deployment if executed at the + /// scope of the management group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The management group ID. + /// + /// + /// The name of the deployment. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task WhatIfAtManagementGroupScopeAsync(this IDeploymentsOperations operations, string groupId, string deploymentName, ScopedDeploymentWhatIf parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.WhatIfAtManagementGroupScopeWithHttpMessagesAsync(groupId, deploymentName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Exports the template used for specified deployment. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The management group ID. + /// + /// + /// The name of the deployment. + /// + public static DeploymentExportResult ExportTemplateAtManagementGroupScope(this IDeploymentsOperations operations, string groupId, string deploymentName) + { + return ((IDeploymentsOperations)operations).ExportTemplateAtManagementGroupScopeAsync(groupId, deploymentName).GetAwaiter().GetResult(); + } + + /// + /// Exports the template used for specified deployment. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The management group ID. + /// + /// + /// The name of the deployment. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task ExportTemplateAtManagementGroupScopeAsync(this IDeploymentsOperations operations, string groupId, string deploymentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ExportTemplateAtManagementGroupScopeWithHttpMessagesAsync(groupId, deploymentName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Get all the deployments for a management group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// + /// + /// + /// The management group ID. + /// + public static Microsoft.Rest.Azure.IPage ListAtManagementGroupScope(this IDeploymentsOperations operations, string groupId, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery)) + { + return ((IDeploymentsOperations)operations).ListAtManagementGroupScopeAsync(groupId, odataQuery).GetAwaiter().GetResult(); + } + + /// + /// Get all the deployments for a management group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// + /// + /// + /// The management group ID. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAtManagementGroupScopeAsync(this IDeploymentsOperations operations, string groupId, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListAtManagementGroupScopeWithHttpMessagesAsync(groupId, odataQuery, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// A template deployment that is currently running cannot be deleted. Deleting + /// a template deployment removes the associated deployment operations. This is + /// an asynchronous operation that returns a status of 202 until the template + /// deployment is successfully deleted. The Location response header contains + /// the URI that is used to obtain the status of the process. While the process + /// is running, a call to the URI in the Location header returns a status of + /// 202. When the process finishes, the URI in the Location header returns a + /// status of 204 on success. If the asynchronous request failed, the URI in + /// the Location header returns an error-level status code. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the deployment. + /// + public static void DeleteAtSubscriptionScope(this IDeploymentsOperations operations, string deploymentName) + { + ((IDeploymentsOperations)operations).DeleteAtSubscriptionScopeAsync(deploymentName).GetAwaiter().GetResult(); + } + + /// + /// A template deployment that is currently running cannot be deleted. Deleting + /// a template deployment removes the associated deployment operations. This is + /// an asynchronous operation that returns a status of 202 until the template + /// deployment is successfully deleted. The Location response header contains + /// the URI that is used to obtain the status of the process. While the process + /// is running, a call to the URI in the Location header returns a status of + /// 202. When the process finishes, the URI in the Location header returns a + /// status of 204 on success. If the asynchronous request failed, the URI in + /// the Location header returns an error-level status code. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the deployment. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAtSubscriptionScopeAsync(this IDeploymentsOperations operations, string deploymentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteAtSubscriptionScopeWithHttpMessagesAsync(deploymentName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Checks whether the deployment exists. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the deployment. + /// + public static bool CheckExistenceAtSubscriptionScope(this IDeploymentsOperations operations, string deploymentName) + { + return ((IDeploymentsOperations)operations).CheckExistenceAtSubscriptionScopeAsync(deploymentName).GetAwaiter().GetResult(); + } + + /// + /// Checks whether the deployment exists. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the deployment. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CheckExistenceAtSubscriptionScopeAsync(this IDeploymentsOperations operations, string deploymentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CheckExistenceAtSubscriptionScopeWithHttpMessagesAsync(deploymentName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// You can provide the template and parameters directly in the request or link + /// to JSON files. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the deployment. + /// + public static DeploymentExtended CreateOrUpdateAtSubscriptionScope(this IDeploymentsOperations operations, string deploymentName, Deployment parameters) + { + return ((IDeploymentsOperations)operations).CreateOrUpdateAtSubscriptionScopeAsync(deploymentName, parameters).GetAwaiter().GetResult(); + } + + /// + /// You can provide the template and parameters directly in the request or link + /// to JSON files. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the deployment. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAtSubscriptionScopeAsync(this IDeploymentsOperations operations, string deploymentName, Deployment parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateAtSubscriptionScopeWithHttpMessagesAsync(deploymentName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets a deployment. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the deployment. + /// + public static DeploymentExtended GetAtSubscriptionScope(this IDeploymentsOperations operations, string deploymentName) + { + return ((IDeploymentsOperations)operations).GetAtSubscriptionScopeAsync(deploymentName).GetAwaiter().GetResult(); + } + + /// + /// Gets a deployment. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the deployment. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAtSubscriptionScopeAsync(this IDeploymentsOperations operations, string deploymentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetAtSubscriptionScopeWithHttpMessagesAsync(deploymentName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// You can cancel a deployment only if the provisioningState is Accepted or + /// Running. After the deployment is canceled, the provisioningState is set to + /// Canceled. Canceling a template deployment stops the currently running + /// template deployment and leaves the resources partially deployed. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the deployment. + /// + public static void CancelAtSubscriptionScope(this IDeploymentsOperations operations, string deploymentName) + { + ((IDeploymentsOperations)operations).CancelAtSubscriptionScopeAsync(deploymentName).GetAwaiter().GetResult(); + } + + /// + /// You can cancel a deployment only if the provisioningState is Accepted or + /// Running. After the deployment is canceled, the provisioningState is set to + /// Canceled. Canceling a template deployment stops the currently running + /// template deployment and leaves the resources partially deployed. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the deployment. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CancelAtSubscriptionScopeAsync(this IDeploymentsOperations operations, string deploymentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.CancelAtSubscriptionScopeWithHttpMessagesAsync(deploymentName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Validates whether the specified template is syntactically correct and will + /// be accepted by Azure Resource Manager.. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the deployment. + /// + public static DeploymentValidateResult ValidateAtSubscriptionScope(this IDeploymentsOperations operations, string deploymentName, Deployment parameters) + { + return ((IDeploymentsOperations)operations).ValidateAtSubscriptionScopeAsync(deploymentName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Validates whether the specified template is syntactically correct and will + /// be accepted by Azure Resource Manager.. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the deployment. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task ValidateAtSubscriptionScopeAsync(this IDeploymentsOperations operations, string deploymentName, Deployment parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ValidateAtSubscriptionScopeWithHttpMessagesAsync(deploymentName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Returns changes that will be made by the deployment if executed at the + /// scope of the subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the deployment. + /// + public static WhatIfOperationResult WhatIfAtSubscriptionScope(this IDeploymentsOperations operations, string deploymentName, DeploymentWhatIf parameters) + { + return ((IDeploymentsOperations)operations).WhatIfAtSubscriptionScopeAsync(deploymentName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Returns changes that will be made by the deployment if executed at the + /// scope of the subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the deployment. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task WhatIfAtSubscriptionScopeAsync(this IDeploymentsOperations operations, string deploymentName, DeploymentWhatIf parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.WhatIfAtSubscriptionScopeWithHttpMessagesAsync(deploymentName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Exports the template used for specified deployment. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the deployment. + /// + public static DeploymentExportResult ExportTemplateAtSubscriptionScope(this IDeploymentsOperations operations, string deploymentName) + { + return ((IDeploymentsOperations)operations).ExportTemplateAtSubscriptionScopeAsync(deploymentName).GetAwaiter().GetResult(); + } + + /// + /// Exports the template used for specified deployment. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the deployment. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task ExportTemplateAtSubscriptionScopeAsync(this IDeploymentsOperations operations, string deploymentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ExportTemplateAtSubscriptionScopeWithHttpMessagesAsync(deploymentName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Get all the deployments for a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// + /// + public static Microsoft.Rest.Azure.IPage ListAtSubscriptionScope(this IDeploymentsOperations operations, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery)) + { + return ((IDeploymentsOperations)operations).ListAtSubscriptionScopeAsync(odataQuery).GetAwaiter().GetResult(); + } + + /// + /// Get all the deployments for a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAtSubscriptionScopeAsync(this IDeploymentsOperations operations, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListAtSubscriptionScopeWithHttpMessagesAsync(odataQuery, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// A template deployment that is currently running cannot be deleted. Deleting + /// a template deployment removes the associated deployment operations. + /// Deleting a template deployment does not affect the state of the resource + /// group. This is an asynchronous operation that returns a status of 202 until + /// the template deployment is successfully deleted. The Location response + /// header contains the URI that is used to obtain the status of the process. + /// While the process is running, a call to the URI in the Location header + /// returns a status of 202. When the process finishes, the URI in the Location + /// header returns a status of 204 on success. If the asynchronous request + /// failed, the URI in the Location header returns an error-level status code. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group with the deployment to delete. The name is + /// case insensitive. + /// + /// + /// The name of the deployment. + /// + public static void Delete(this IDeploymentsOperations operations, string resourceGroupName, string deploymentName) + { + ((IDeploymentsOperations)operations).DeleteAsync(resourceGroupName, deploymentName).GetAwaiter().GetResult(); + } + + /// + /// A template deployment that is currently running cannot be deleted. Deleting + /// a template deployment removes the associated deployment operations. + /// Deleting a template deployment does not affect the state of the resource + /// group. This is an asynchronous operation that returns a status of 202 until + /// the template deployment is successfully deleted. The Location response + /// header contains the URI that is used to obtain the status of the process. + /// While the process is running, a call to the URI in the Location header + /// returns a status of 202. When the process finishes, the URI in the Location + /// header returns a status of 204 on success. If the asynchronous request + /// failed, the URI in the Location header returns an error-level status code. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group with the deployment to delete. The name is + /// case insensitive. + /// + /// + /// The name of the deployment. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IDeploymentsOperations operations, string resourceGroupName, string deploymentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, deploymentName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Checks whether the deployment exists. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group with the deployment to check. The name is + /// case insensitive. + /// + /// + /// The name of the deployment. + /// + public static bool CheckExistence(this IDeploymentsOperations operations, string resourceGroupName, string deploymentName) + { + return ((IDeploymentsOperations)operations).CheckExistenceAsync(resourceGroupName, deploymentName).GetAwaiter().GetResult(); + } + + /// + /// Checks whether the deployment exists. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group with the deployment to check. The name is + /// case insensitive. + /// + /// + /// The name of the deployment. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CheckExistenceAsync(this IDeploymentsOperations operations, string resourceGroupName, string deploymentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CheckExistenceWithHttpMessagesAsync(resourceGroupName, deploymentName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// You can provide the template and parameters directly in the request or link + /// to JSON files. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group to deploy the resources to. The name is case + /// insensitive. The resource group must already exist. + /// + /// + /// The name of the deployment. + /// + public static DeploymentExtended CreateOrUpdate(this IDeploymentsOperations operations, string resourceGroupName, string deploymentName, Deployment parameters) + { + return ((IDeploymentsOperations)operations).CreateOrUpdateAsync(resourceGroupName, deploymentName, parameters).GetAwaiter().GetResult(); + } + + /// + /// You can provide the template and parameters directly in the request or link + /// to JSON files. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group to deploy the resources to. The name is case + /// insensitive. The resource group must already exist. + /// + /// + /// The name of the deployment. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IDeploymentsOperations operations, string resourceGroupName, string deploymentName, Deployment parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, deploymentName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets a deployment. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the deployment. + /// + public static DeploymentExtended Get(this IDeploymentsOperations operations, string resourceGroupName, string deploymentName) + { + return ((IDeploymentsOperations)operations).GetAsync(resourceGroupName, deploymentName).GetAwaiter().GetResult(); + } + + /// + /// Gets a deployment. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the deployment. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IDeploymentsOperations operations, string resourceGroupName, string deploymentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, deploymentName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// You can cancel a deployment only if the provisioningState is Accepted or + /// Running. After the deployment is canceled, the provisioningState is set to + /// Canceled. Canceling a template deployment stops the currently running + /// template deployment and leaves the resource group partially deployed. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the deployment. + /// + public static void Cancel(this IDeploymentsOperations operations, string resourceGroupName, string deploymentName) + { + ((IDeploymentsOperations)operations).CancelAsync(resourceGroupName, deploymentName).GetAwaiter().GetResult(); + } + + /// + /// You can cancel a deployment only if the provisioningState is Accepted or + /// Running. After the deployment is canceled, the provisioningState is set to + /// Canceled. Canceling a template deployment stops the currently running + /// template deployment and leaves the resource group partially deployed. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the deployment. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CancelAsync(this IDeploymentsOperations operations, string resourceGroupName, string deploymentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.CancelWithHttpMessagesAsync(resourceGroupName, deploymentName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Validates whether the specified template is syntactically correct and will + /// be accepted by Azure Resource Manager.. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group the template will be deployed to. The name + /// is case insensitive. + /// + /// + /// The name of the deployment. + /// + public static DeploymentValidateResult Validate(this IDeploymentsOperations operations, string resourceGroupName, string deploymentName, Deployment parameters) + { + return ((IDeploymentsOperations)operations).ValidateAsync(resourceGroupName, deploymentName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Validates whether the specified template is syntactically correct and will + /// be accepted by Azure Resource Manager.. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group the template will be deployed to. The name + /// is case insensitive. + /// + /// + /// The name of the deployment. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task ValidateAsync(this IDeploymentsOperations operations, string resourceGroupName, string deploymentName, Deployment parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ValidateWithHttpMessagesAsync(resourceGroupName, deploymentName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Returns changes that will be made by the deployment if executed at the + /// scope of the resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group the template will be deployed to. The name + /// is case insensitive. + /// + /// + /// The name of the deployment. + /// + public static WhatIfOperationResult WhatIf(this IDeploymentsOperations operations, string resourceGroupName, string deploymentName, DeploymentWhatIf parameters) + { + return ((IDeploymentsOperations)operations).WhatIfAsync(resourceGroupName, deploymentName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Returns changes that will be made by the deployment if executed at the + /// scope of the resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group the template will be deployed to. The name + /// is case insensitive. + /// + /// + /// The name of the deployment. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task WhatIfAsync(this IDeploymentsOperations operations, string resourceGroupName, string deploymentName, DeploymentWhatIf parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.WhatIfWithHttpMessagesAsync(resourceGroupName, deploymentName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Exports the template used for specified deployment. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the deployment. + /// + public static DeploymentExportResult ExportTemplate(this IDeploymentsOperations operations, string resourceGroupName, string deploymentName) + { + return ((IDeploymentsOperations)operations).ExportTemplateAsync(resourceGroupName, deploymentName).GetAwaiter().GetResult(); + } + + /// + /// Exports the template used for specified deployment. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the deployment. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task ExportTemplateAsync(this IDeploymentsOperations operations, string resourceGroupName, string deploymentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ExportTemplateWithHttpMessagesAsync(resourceGroupName, deploymentName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Get all the deployments for a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// + /// + /// + /// The name of the resource group with the deployments to get. The name is + /// case insensitive. + /// + public static Microsoft.Rest.Azure.IPage ListByResourceGroup(this IDeploymentsOperations operations, string resourceGroupName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery)) + { + return ((IDeploymentsOperations)operations).ListByResourceGroupAsync(resourceGroupName, odataQuery).GetAwaiter().GetResult(); + } + + /// + /// Get all the deployments for a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// + /// + /// + /// The name of the resource group with the deployments to get. The name is + /// case insensitive. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByResourceGroupAsync(this IDeploymentsOperations operations, string resourceGroupName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, odataQuery, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Calculate the hash of the given template. + /// + /// + /// The operations group for this extension method. + /// + public static TemplateHashResult CalculateTemplateHash(this IDeploymentsOperations operations, object template) + { + return ((IDeploymentsOperations)operations).CalculateTemplateHashAsync(template).GetAwaiter().GetResult(); + } + + /// + /// Calculate the hash of the given template. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CalculateTemplateHashAsync(this IDeploymentsOperations operations, object template, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CalculateTemplateHashWithHttpMessagesAsync(template, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// A template deployment that is currently running cannot be deleted. Deleting + /// a template deployment removes the associated deployment operations. This is + /// an asynchronous operation that returns a status of 202 until the template + /// deployment is successfully deleted. The Location response header contains + /// the URI that is used to obtain the status of the process. While the process + /// is running, a call to the URI in the Location header returns a status of + /// 202. When the process finishes, the URI in the Location header returns a + /// status of 204 on success. If the asynchronous request failed, the URI in + /// the Location header returns an error-level status code. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource scope. + /// + /// + /// The name of the deployment. + /// + public static void BeginDeleteAtScope(this IDeploymentsOperations operations, string scope, string deploymentName) + { + ((IDeploymentsOperations)operations).BeginDeleteAtScopeAsync(scope, deploymentName).GetAwaiter().GetResult(); + } + + /// + /// A template deployment that is currently running cannot be deleted. Deleting + /// a template deployment removes the associated deployment operations. This is + /// an asynchronous operation that returns a status of 202 until the template + /// deployment is successfully deleted. The Location response header contains + /// the URI that is used to obtain the status of the process. While the process + /// is running, a call to the URI in the Location header returns a status of + /// 202. When the process finishes, the URI in the Location header returns a + /// status of 204 on success. If the asynchronous request failed, the URI in + /// the Location header returns an error-level status code. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource scope. + /// + /// + /// The name of the deployment. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAtScopeAsync(this IDeploymentsOperations operations, string scope, string deploymentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteAtScopeWithHttpMessagesAsync(scope, deploymentName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// You can provide the template and parameters directly in the request or link + /// to JSON files. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource scope. + /// + /// + /// The name of the deployment. + /// + public static DeploymentExtended BeginCreateOrUpdateAtScope(this IDeploymentsOperations operations, string scope, string deploymentName, Deployment parameters) + { + return ((IDeploymentsOperations)operations).BeginCreateOrUpdateAtScopeAsync(scope, deploymentName, parameters).GetAwaiter().GetResult(); + } + + /// + /// You can provide the template and parameters directly in the request or link + /// to JSON files. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource scope. + /// + /// + /// The name of the deployment. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAtScopeAsync(this IDeploymentsOperations operations, string scope, string deploymentName, Deployment parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateAtScopeWithHttpMessagesAsync(scope, deploymentName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Validates whether the specified template is syntactically correct and will + /// be accepted by Azure Resource Manager.. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource scope. + /// + /// + /// The name of the deployment. + /// + public static DeploymentValidateResult BeginValidateAtScope(this IDeploymentsOperations operations, string scope, string deploymentName, Deployment parameters) + { + return ((IDeploymentsOperations)operations).BeginValidateAtScopeAsync(scope, deploymentName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Validates whether the specified template is syntactically correct and will + /// be accepted by Azure Resource Manager.. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource scope. + /// + /// + /// The name of the deployment. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginValidateAtScopeAsync(this IDeploymentsOperations operations, string scope, string deploymentName, Deployment parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginValidateAtScopeWithHttpMessagesAsync(scope, deploymentName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// A template deployment that is currently running cannot be deleted. Deleting + /// a template deployment removes the associated deployment operations. This is + /// an asynchronous operation that returns a status of 202 until the template + /// deployment is successfully deleted. The Location response header contains + /// the URI that is used to obtain the status of the process. While the process + /// is running, a call to the URI in the Location header returns a status of + /// 202. When the process finishes, the URI in the Location header returns a + /// status of 204 on success. If the asynchronous request failed, the URI in + /// the Location header returns an error-level status code. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the deployment. + /// + public static void BeginDeleteAtTenantScope(this IDeploymentsOperations operations, string deploymentName) + { + ((IDeploymentsOperations)operations).BeginDeleteAtTenantScopeAsync(deploymentName).GetAwaiter().GetResult(); + } + + /// + /// A template deployment that is currently running cannot be deleted. Deleting + /// a template deployment removes the associated deployment operations. This is + /// an asynchronous operation that returns a status of 202 until the template + /// deployment is successfully deleted. The Location response header contains + /// the URI that is used to obtain the status of the process. While the process + /// is running, a call to the URI in the Location header returns a status of + /// 202. When the process finishes, the URI in the Location header returns a + /// status of 204 on success. If the asynchronous request failed, the URI in + /// the Location header returns an error-level status code. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the deployment. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAtTenantScopeAsync(this IDeploymentsOperations operations, string deploymentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteAtTenantScopeWithHttpMessagesAsync(deploymentName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// You can provide the template and parameters directly in the request or link + /// to JSON files. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the deployment. + /// + public static DeploymentExtended BeginCreateOrUpdateAtTenantScope(this IDeploymentsOperations operations, string deploymentName, ScopedDeployment parameters) + { + return ((IDeploymentsOperations)operations).BeginCreateOrUpdateAtTenantScopeAsync(deploymentName, parameters).GetAwaiter().GetResult(); + } + + /// + /// You can provide the template and parameters directly in the request or link + /// to JSON files. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the deployment. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAtTenantScopeAsync(this IDeploymentsOperations operations, string deploymentName, ScopedDeployment parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateAtTenantScopeWithHttpMessagesAsync(deploymentName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Validates whether the specified template is syntactically correct and will + /// be accepted by Azure Resource Manager.. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the deployment. + /// + public static DeploymentValidateResult BeginValidateAtTenantScope(this IDeploymentsOperations operations, string deploymentName, ScopedDeployment parameters) + { + return ((IDeploymentsOperations)operations).BeginValidateAtTenantScopeAsync(deploymentName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Validates whether the specified template is syntactically correct and will + /// be accepted by Azure Resource Manager.. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the deployment. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginValidateAtTenantScopeAsync(this IDeploymentsOperations operations, string deploymentName, ScopedDeployment parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginValidateAtTenantScopeWithHttpMessagesAsync(deploymentName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Returns changes that will be made by the deployment if executed at the + /// scope of the tenant group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the deployment. + /// + public static WhatIfOperationResult BeginWhatIfAtTenantScope(this IDeploymentsOperations operations, string deploymentName, ScopedDeploymentWhatIf parameters) + { + return ((IDeploymentsOperations)operations).BeginWhatIfAtTenantScopeAsync(deploymentName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Returns changes that will be made by the deployment if executed at the + /// scope of the tenant group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the deployment. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginWhatIfAtTenantScopeAsync(this IDeploymentsOperations operations, string deploymentName, ScopedDeploymentWhatIf parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginWhatIfAtTenantScopeWithHttpMessagesAsync(deploymentName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// A template deployment that is currently running cannot be deleted. Deleting + /// a template deployment removes the associated deployment operations. This is + /// an asynchronous operation that returns a status of 202 until the template + /// deployment is successfully deleted. The Location response header contains + /// the URI that is used to obtain the status of the process. While the process + /// is running, a call to the URI in the Location header returns a status of + /// 202. When the process finishes, the URI in the Location header returns a + /// status of 204 on success. If the asynchronous request failed, the URI in + /// the Location header returns an error-level status code. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The management group ID. + /// + /// + /// The name of the deployment. + /// + public static void BeginDeleteAtManagementGroupScope(this IDeploymentsOperations operations, string groupId, string deploymentName) + { + ((IDeploymentsOperations)operations).BeginDeleteAtManagementGroupScopeAsync(groupId, deploymentName).GetAwaiter().GetResult(); + } + + /// + /// A template deployment that is currently running cannot be deleted. Deleting + /// a template deployment removes the associated deployment operations. This is + /// an asynchronous operation that returns a status of 202 until the template + /// deployment is successfully deleted. The Location response header contains + /// the URI that is used to obtain the status of the process. While the process + /// is running, a call to the URI in the Location header returns a status of + /// 202. When the process finishes, the URI in the Location header returns a + /// status of 204 on success. If the asynchronous request failed, the URI in + /// the Location header returns an error-level status code. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The management group ID. + /// + /// + /// The name of the deployment. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAtManagementGroupScopeAsync(this IDeploymentsOperations operations, string groupId, string deploymentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteAtManagementGroupScopeWithHttpMessagesAsync(groupId, deploymentName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// You can provide the template and parameters directly in the request or link + /// to JSON files. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The management group ID. + /// + /// + /// The name of the deployment. + /// + public static DeploymentExtended BeginCreateOrUpdateAtManagementGroupScope(this IDeploymentsOperations operations, string groupId, string deploymentName, ScopedDeployment parameters) + { + return ((IDeploymentsOperations)operations).BeginCreateOrUpdateAtManagementGroupScopeAsync(groupId, deploymentName, parameters).GetAwaiter().GetResult(); + } + + /// + /// You can provide the template and parameters directly in the request or link + /// to JSON files. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The management group ID. + /// + /// + /// The name of the deployment. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAtManagementGroupScopeAsync(this IDeploymentsOperations operations, string groupId, string deploymentName, ScopedDeployment parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateAtManagementGroupScopeWithHttpMessagesAsync(groupId, deploymentName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Validates whether the specified template is syntactically correct and will + /// be accepted by Azure Resource Manager.. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The management group ID. + /// + /// + /// The name of the deployment. + /// + public static DeploymentValidateResult BeginValidateAtManagementGroupScope(this IDeploymentsOperations operations, string groupId, string deploymentName, ScopedDeployment parameters) + { + return ((IDeploymentsOperations)operations).BeginValidateAtManagementGroupScopeAsync(groupId, deploymentName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Validates whether the specified template is syntactically correct and will + /// be accepted by Azure Resource Manager.. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The management group ID. + /// + /// + /// The name of the deployment. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginValidateAtManagementGroupScopeAsync(this IDeploymentsOperations operations, string groupId, string deploymentName, ScopedDeployment parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginValidateAtManagementGroupScopeWithHttpMessagesAsync(groupId, deploymentName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Returns changes that will be made by the deployment if executed at the + /// scope of the management group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The management group ID. + /// + /// + /// The name of the deployment. + /// + public static WhatIfOperationResult BeginWhatIfAtManagementGroupScope(this IDeploymentsOperations operations, string groupId, string deploymentName, ScopedDeploymentWhatIf parameters) + { + return ((IDeploymentsOperations)operations).BeginWhatIfAtManagementGroupScopeAsync(groupId, deploymentName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Returns changes that will be made by the deployment if executed at the + /// scope of the management group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The management group ID. + /// + /// + /// The name of the deployment. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginWhatIfAtManagementGroupScopeAsync(this IDeploymentsOperations operations, string groupId, string deploymentName, ScopedDeploymentWhatIf parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginWhatIfAtManagementGroupScopeWithHttpMessagesAsync(groupId, deploymentName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// A template deployment that is currently running cannot be deleted. Deleting + /// a template deployment removes the associated deployment operations. This is + /// an asynchronous operation that returns a status of 202 until the template + /// deployment is successfully deleted. The Location response header contains + /// the URI that is used to obtain the status of the process. While the process + /// is running, a call to the URI in the Location header returns a status of + /// 202. When the process finishes, the URI in the Location header returns a + /// status of 204 on success. If the asynchronous request failed, the URI in + /// the Location header returns an error-level status code. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the deployment. + /// + public static void BeginDeleteAtSubscriptionScope(this IDeploymentsOperations operations, string deploymentName) + { + ((IDeploymentsOperations)operations).BeginDeleteAtSubscriptionScopeAsync(deploymentName).GetAwaiter().GetResult(); + } + + /// + /// A template deployment that is currently running cannot be deleted. Deleting + /// a template deployment removes the associated deployment operations. This is + /// an asynchronous operation that returns a status of 202 until the template + /// deployment is successfully deleted. The Location response header contains + /// the URI that is used to obtain the status of the process. While the process + /// is running, a call to the URI in the Location header returns a status of + /// 202. When the process finishes, the URI in the Location header returns a + /// status of 204 on success. If the asynchronous request failed, the URI in + /// the Location header returns an error-level status code. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the deployment. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAtSubscriptionScopeAsync(this IDeploymentsOperations operations, string deploymentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteAtSubscriptionScopeWithHttpMessagesAsync(deploymentName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// You can provide the template and parameters directly in the request or link + /// to JSON files. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the deployment. + /// + public static DeploymentExtended BeginCreateOrUpdateAtSubscriptionScope(this IDeploymentsOperations operations, string deploymentName, Deployment parameters) + { + return ((IDeploymentsOperations)operations).BeginCreateOrUpdateAtSubscriptionScopeAsync(deploymentName, parameters).GetAwaiter().GetResult(); + } + + /// + /// You can provide the template and parameters directly in the request or link + /// to JSON files. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the deployment. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAtSubscriptionScopeAsync(this IDeploymentsOperations operations, string deploymentName, Deployment parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateAtSubscriptionScopeWithHttpMessagesAsync(deploymentName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Validates whether the specified template is syntactically correct and will + /// be accepted by Azure Resource Manager.. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the deployment. + /// + public static DeploymentValidateResult BeginValidateAtSubscriptionScope(this IDeploymentsOperations operations, string deploymentName, Deployment parameters) + { + return ((IDeploymentsOperations)operations).BeginValidateAtSubscriptionScopeAsync(deploymentName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Validates whether the specified template is syntactically correct and will + /// be accepted by Azure Resource Manager.. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the deployment. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginValidateAtSubscriptionScopeAsync(this IDeploymentsOperations operations, string deploymentName, Deployment parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginValidateAtSubscriptionScopeWithHttpMessagesAsync(deploymentName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Returns changes that will be made by the deployment if executed at the + /// scope of the subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the deployment. + /// + public static WhatIfOperationResult BeginWhatIfAtSubscriptionScope(this IDeploymentsOperations operations, string deploymentName, DeploymentWhatIf parameters) + { + return ((IDeploymentsOperations)operations).BeginWhatIfAtSubscriptionScopeAsync(deploymentName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Returns changes that will be made by the deployment if executed at the + /// scope of the subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the deployment. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginWhatIfAtSubscriptionScopeAsync(this IDeploymentsOperations operations, string deploymentName, DeploymentWhatIf parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginWhatIfAtSubscriptionScopeWithHttpMessagesAsync(deploymentName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// A template deployment that is currently running cannot be deleted. Deleting + /// a template deployment removes the associated deployment operations. + /// Deleting a template deployment does not affect the state of the resource + /// group. This is an asynchronous operation that returns a status of 202 until + /// the template deployment is successfully deleted. The Location response + /// header contains the URI that is used to obtain the status of the process. + /// While the process is running, a call to the URI in the Location header + /// returns a status of 202. When the process finishes, the URI in the Location + /// header returns a status of 204 on success. If the asynchronous request + /// failed, the URI in the Location header returns an error-level status code. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group with the deployment to delete. The name is + /// case insensitive. + /// + /// + /// The name of the deployment. + /// + public static void BeginDelete(this IDeploymentsOperations operations, string resourceGroupName, string deploymentName) + { + ((IDeploymentsOperations)operations).BeginDeleteAsync(resourceGroupName, deploymentName).GetAwaiter().GetResult(); + } + + /// + /// A template deployment that is currently running cannot be deleted. Deleting + /// a template deployment removes the associated deployment operations. + /// Deleting a template deployment does not affect the state of the resource + /// group. This is an asynchronous operation that returns a status of 202 until + /// the template deployment is successfully deleted. The Location response + /// header contains the URI that is used to obtain the status of the process. + /// While the process is running, a call to the URI in the Location header + /// returns a status of 202. When the process finishes, the URI in the Location + /// header returns a status of 204 on success. If the asynchronous request + /// failed, the URI in the Location header returns an error-level status code. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group with the deployment to delete. The name is + /// case insensitive. + /// + /// + /// The name of the deployment. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IDeploymentsOperations operations, string resourceGroupName, string deploymentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, deploymentName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// You can provide the template and parameters directly in the request or link + /// to JSON files. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group to deploy the resources to. The name is case + /// insensitive. The resource group must already exist. + /// + /// + /// The name of the deployment. + /// + public static DeploymentExtended BeginCreateOrUpdate(this IDeploymentsOperations operations, string resourceGroupName, string deploymentName, Deployment parameters) + { + return ((IDeploymentsOperations)operations).BeginCreateOrUpdateAsync(resourceGroupName, deploymentName, parameters).GetAwaiter().GetResult(); + } + + /// + /// You can provide the template and parameters directly in the request or link + /// to JSON files. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group to deploy the resources to. The name is case + /// insensitive. The resource group must already exist. + /// + /// + /// The name of the deployment. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IDeploymentsOperations operations, string resourceGroupName, string deploymentName, Deployment parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, deploymentName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Validates whether the specified template is syntactically correct and will + /// be accepted by Azure Resource Manager.. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group the template will be deployed to. The name + /// is case insensitive. + /// + /// + /// The name of the deployment. + /// + public static DeploymentValidateResult BeginValidate(this IDeploymentsOperations operations, string resourceGroupName, string deploymentName, Deployment parameters) + { + return ((IDeploymentsOperations)operations).BeginValidateAsync(resourceGroupName, deploymentName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Validates whether the specified template is syntactically correct and will + /// be accepted by Azure Resource Manager.. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group the template will be deployed to. The name + /// is case insensitive. + /// + /// + /// The name of the deployment. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginValidateAsync(this IDeploymentsOperations operations, string resourceGroupName, string deploymentName, Deployment parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginValidateWithHttpMessagesAsync(resourceGroupName, deploymentName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Returns changes that will be made by the deployment if executed at the + /// scope of the resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group the template will be deployed to. The name + /// is case insensitive. + /// + /// + /// The name of the deployment. + /// + public static WhatIfOperationResult BeginWhatIf(this IDeploymentsOperations operations, string resourceGroupName, string deploymentName, DeploymentWhatIf parameters) + { + return ((IDeploymentsOperations)operations).BeginWhatIfAsync(resourceGroupName, deploymentName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Returns changes that will be made by the deployment if executed at the + /// scope of the resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group the template will be deployed to. The name + /// is case insensitive. + /// + /// + /// The name of the deployment. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginWhatIfAsync(this IDeploymentsOperations operations, string resourceGroupName, string deploymentName, DeploymentWhatIf parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginWhatIfWithHttpMessagesAsync(resourceGroupName, deploymentName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Get all the deployments at the given scope. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListAtScopeNext(this IDeploymentsOperations operations, string nextPageLink) + { + return ((IDeploymentsOperations)operations).ListAtScopeNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Get all the deployments at the given scope. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAtScopeNextAsync(this IDeploymentsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListAtScopeNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Get all the deployments at the tenant scope. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListAtTenantScopeNext(this IDeploymentsOperations operations, string nextPageLink) + { + return ((IDeploymentsOperations)operations).ListAtTenantScopeNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Get all the deployments at the tenant scope. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAtTenantScopeNextAsync(this IDeploymentsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListAtTenantScopeNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Get all the deployments for a management group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListAtManagementGroupScopeNext(this IDeploymentsOperations operations, string nextPageLink) + { + return ((IDeploymentsOperations)operations).ListAtManagementGroupScopeNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Get all the deployments for a management group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAtManagementGroupScopeNextAsync(this IDeploymentsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListAtManagementGroupScopeNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Get all the deployments for a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListAtSubscriptionScopeNext(this IDeploymentsOperations operations, string nextPageLink) + { + return ((IDeploymentsOperations)operations).ListAtSubscriptionScopeNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Get all the deployments for a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAtSubscriptionScopeNextAsync(this IDeploymentsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListAtSubscriptionScopeNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Get all the deployments for a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListByResourceGroupNext(this IDeploymentsOperations operations, string nextPageLink) + { + return ((IDeploymentsOperations)operations).ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Get all the deployments for a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByResourceGroupNextAsync(this IDeploymentsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + } +} diff --git a/src/Resources/Resources.Sdk/Generated/FeatureClient.cs b/src/Resources/Resources.Management.Sdk/Generated/FeatureClient.cs similarity index 61% rename from src/Resources/Resources.Sdk/Generated/FeatureClient.cs rename to src/Resources/Resources.Management.Sdk/Generated/FeatureClient.cs index d23db2655340..e31c52c8f508 100644 --- a/src/Resources/Resources.Sdk/Generated/FeatureClient.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/FeatureClient.cs @@ -1,88 +1,77 @@ -// // 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 Microsoft.Rest.Serialization; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; - public partial class FeatureClient : ServiceClient, IFeatureClient, IAzureClient + /// + /// Azure Feature Exposure Control (AFEC) provides a mechanism for the resource + /// providers to control feature exposure to users. Resource providers + /// typically use this mechanism to provide public/private preview for new + /// features prior to making them generally available. Users need to explicitly + /// register for AFEC features to get access to such functionality. + /// + public partial class FeatureClient : Microsoft.Rest.ServiceClient, IFeatureClient, IAzureClient { /// /// The base URI of the service. /// public System.Uri BaseUri { get; set; } - /// /// Gets or sets json serialization settings. /// - public JsonSerializerSettings SerializationSettings { get; private set; } - + public Newtonsoft.Json.JsonSerializerSettings SerializationSettings { get; private set; } /// /// Gets or sets json deserialization settings. /// - public JsonSerializerSettings DeserializationSettings { get; private set; } - + public Newtonsoft.Json.JsonSerializerSettings DeserializationSettings { get; private set; } /// /// Credentials needed for the client to connect to Azure. /// - public ServiceClientCredentials Credentials { get; private set; } + public Microsoft.Rest.ServiceClientCredentials Credentials { get; private set; } /// - /// The Azure subscription ID. + /// The API version to use for this operation. /// - public string SubscriptionId { get; set; } + public string ApiVersion { get; private set; } /// - /// The API version to use for this operation. + /// The Azure subscription ID. /// - public string ApiVersion { get; private set; } + public string SubscriptionId { get; set;} /// /// The preferred language for the response. /// - public string AcceptLanguage { get; set; } + public string AcceptLanguage { get; set;} /// - /// The retry timeout in seconds for Long Running Operations. Default value is - /// 30. + /// The retry timeout in seconds for Long Running Operations. Default + /// /// value is 30. /// - public int? LongRunningOperationRetryTimeout { get; set; } + public int? LongRunningOperationRetryTimeout { get; set;} /// - /// Whether a unique x-ms-client-request-id should be generated. When set to - /// true a unique x-ms-client-request-id value is generated and included in - /// each request. Default is true. + /// Whether a unique x-ms-client-request-id should be generated. When + /// /// set to true a unique x-ms-client-request-id value is generated and + /// /// included in each request. Default is true. /// - public bool? GenerateClientRequestId { get; set; } + public bool? GenerateClientRequestId { get; set;} /// - /// Gets the IFeaturesOperations. + /// Gets the IFeaturesOperations /// public virtual IFeaturesOperations Features { get; private set; } - /// - /// Gets the ISubscriptionFeatureRegistrationsOperations. + /// Gets the ISubscriptionFeatureRegistrationsOperations /// public virtual ISubscriptionFeatureRegistrationsOperations SubscriptionFeatureRegistrations { get; private set; } - /// /// Initializes a new instance of the FeatureClient class. /// @@ -91,24 +80,22 @@ public partial class FeatureClient : ServiceClient, IFeatureClien /// /// /// True: will dispose the provided httpClient on calling FeatureClient.Dispose(). False: will not dispose provided httpClient - protected FeatureClient(HttpClient httpClient, bool disposeHttpClient) : base(httpClient, disposeHttpClient) + protected FeatureClient(System.Net.Http.HttpClient httpClient, bool disposeHttpClient) : base(httpClient, disposeHttpClient) { - Initialize(); + this.Initialize(); } - /// /// Initializes a new instance of the FeatureClient class. /// /// /// Optional. The delegating handlers to add to the http client pipeline. /// - protected FeatureClient(params DelegatingHandler[] handlers) : base(handlers) + protected FeatureClient(params System.Net.Http.DelegatingHandler[] handlers) : base(handlers) { - Initialize(); + this.Initialize(); } - /// - /// Initializes a new instance of the FeatureClient class. + /// Initializes a new instance of the FeatureClient class. /// /// /// Optional. The http client handler used to handle http transport. @@ -116,11 +103,10 @@ protected FeatureClient(params DelegatingHandler[] handlers) : base(handlers) /// /// Optional. The delegating handlers to add to the http client pipeline. /// - protected FeatureClient(HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : base(rootHandler, handlers) + protected FeatureClient(System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : base(rootHandler, handlers) { - Initialize(); + this.Initialize(); } - /// /// Initializes a new instance of the FeatureClient class. /// @@ -133,15 +119,14 @@ protected FeatureClient(HttpClientHandler rootHandler, params DelegatingHandler[ /// /// Thrown when a required parameter is null /// - protected FeatureClient(System.Uri baseUri, params DelegatingHandler[] handlers) : this(handlers) + protected FeatureClient(System.Uri baseUri, params System.Net.Http.DelegatingHandler[] handlers) : this(handlers) { if (baseUri == null) { throw new System.ArgumentNullException("baseUri"); } - BaseUri = baseUri; + this.BaseUri = baseUri; } - /// /// Initializes a new instance of the FeatureClient class. /// @@ -157,15 +142,15 @@ protected FeatureClient(System.Uri baseUri, params DelegatingHandler[] handlers) /// /// Thrown when a required parameter is null /// - protected FeatureClient(System.Uri baseUri, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + protected FeatureClient(System.Uri baseUri, System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : this(rootHandler, handlers) { if (baseUri == null) { throw new System.ArgumentNullException("baseUri"); } - BaseUri = baseUri; + + this.BaseUri = baseUri; } - /// /// Initializes a new instance of the FeatureClient class. /// @@ -178,23 +163,23 @@ protected FeatureClient(System.Uri baseUri, HttpClientHandler rootHandler, param /// /// Thrown when a required parameter is null /// - public FeatureClient(ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers) + public FeatureClient(Microsoft.Rest.ServiceClientCredentials credentials, params System.Net.Http.DelegatingHandler[] handlers) : this(handlers) { if (credentials == null) { throw new System.ArgumentNullException("credentials"); } - Credentials = credentials; - if (Credentials != null) + this.Credentials = credentials; + if (this.Credentials != null) { - Credentials.InitializeServiceClient(this); + this.Credentials.InitializeServiceClient(this); } + } - /// /// Initializes a new instance of the FeatureClient class. /// - /// + /// /// Required. Credentials needed for the client to connect to Azure. /// /// @@ -205,23 +190,23 @@ public FeatureClient(ServiceClientCredentials credentials, params DelegatingHand /// /// Thrown when a required parameter is null /// - public FeatureClient(ServiceClientCredentials credentials, HttpClient httpClient, bool disposeHttpClient) : this(httpClient, disposeHttpClient) + public FeatureClient(Microsoft.Rest.ServiceClientCredentials credentials, System.Net.Http.HttpClient httpClient, bool disposeHttpClient) : this(httpClient, disposeHttpClient) { if (credentials == null) { throw new System.ArgumentNullException("credentials"); } - Credentials = credentials; - if (Credentials != null) + this.Credentials = credentials; + if (this.Credentials != null) { - Credentials.InitializeServiceClient(this); + this.Credentials.InitializeServiceClient(this); } + } - /// /// Initializes a new instance of the FeatureClient class. /// - /// + /// /// Required. Credentials needed for the client to connect to Azure. /// /// @@ -233,26 +218,26 @@ public FeatureClient(ServiceClientCredentials credentials, HttpClient httpClient /// /// Thrown when a required parameter is null /// - public FeatureClient(ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + public FeatureClient(Microsoft.Rest.ServiceClientCredentials credentials, System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : this(rootHandler, handlers) { if (credentials == null) { throw new System.ArgumentNullException("credentials"); } - Credentials = credentials; - if (Credentials != null) + this.Credentials = credentials; + if (this.Credentials != null) { - Credentials.InitializeServiceClient(this); + this.Credentials.InitializeServiceClient(this); } + } - /// /// Initializes a new instance of the FeatureClient class. /// /// /// Optional. The base URI of the service. /// - /// + /// /// Required. Credentials needed for the client to connect to Azure. /// /// @@ -261,7 +246,7 @@ public FeatureClient(ServiceClientCredentials credentials, HttpClientHandler roo /// /// Thrown when a required parameter is null /// - public FeatureClient(System.Uri baseUri, ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers) + public FeatureClient(System.Uri baseUri, Microsoft.Rest.ServiceClientCredentials credentials, params System.Net.Http.DelegatingHandler[] handlers) : this(handlers) { if (baseUri == null) { @@ -271,33 +256,30 @@ public FeatureClient(System.Uri baseUri, ServiceClientCredentials credentials, p { throw new System.ArgumentNullException("credentials"); } - BaseUri = baseUri; - Credentials = credentials; - if (Credentials != null) + this.BaseUri = baseUri; + this.Credentials = credentials; + if (this.Credentials != null) { - Credentials.InitializeServiceClient(this); + this.Credentials.InitializeServiceClient(this); } + } - /// /// Initializes a new instance of the FeatureClient class. /// /// /// Optional. The base URI of the service. /// - /// + /// /// Required. Credentials needed for the client to connect to Azure. /// /// /// Optional. The http client handler used to handle http transport. /// - /// - /// Optional. The delegating handlers to add to the http client pipeline. - /// /// /// Thrown when a required parameter is null /// - public FeatureClient(System.Uri baseUri, ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + public FeatureClient(System.Uri baseUri, Microsoft.Rest.ServiceClientCredentials credentials, System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : this(rootHandler, handlers) { if (baseUri == null) { @@ -307,57 +289,58 @@ public FeatureClient(System.Uri baseUri, ServiceClientCredentials credentials, H { throw new System.ArgumentNullException("credentials"); } - BaseUri = baseUri; - Credentials = credentials; - if (Credentials != null) + this.BaseUri = baseUri; + this.Credentials = credentials; + if (this.Credentials != null) { - Credentials.InitializeServiceClient(this); + this.Credentials.InitializeServiceClient(this); } + } - /// /// An optional partial-method to perform custom initialization. /// partial void CustomInitialize(); + /// /// Initializes client properties. /// private void Initialize() { - Features = new FeaturesOperations(this); - SubscriptionFeatureRegistrations = new SubscriptionFeatureRegistrationsOperations(this); - BaseUri = new System.Uri("https://management.azure.com"); - ApiVersion = "2021-07-01"; - AcceptLanguage = "en-US"; - LongRunningOperationRetryTimeout = 30; - GenerateClientRequestId = true; - SerializationSettings = new JsonSerializerSettings + this.Features = new FeaturesOperations(this); + this.SubscriptionFeatureRegistrations = new SubscriptionFeatureRegistrationsOperations(this); + this.BaseUri = new System.Uri("https://management.azure.com"); + this.ApiVersion = "2021-07-01"; + this.AcceptLanguage = "en-US"; + this.LongRunningOperationRetryTimeout = 30; + this.GenerateClientRequestId = true; + SerializationSettings = new Newtonsoft.Json.JsonSerializerSettings { Formatting = Newtonsoft.Json.Formatting.Indented, DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, - ContractResolver = new ReadOnlyJsonContractResolver(), - Converters = new List + ContractResolver = new Microsoft.Rest.Serialization.ReadOnlyJsonContractResolver(), + Converters = new System.Collections.Generic.List { - new Iso8601TimeSpanConverter() + new Microsoft.Rest.Serialization.Iso8601TimeSpanConverter() } }; - DeserializationSettings = new JsonSerializerSettings + DeserializationSettings = new Newtonsoft.Json.JsonSerializerSettings { DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, - ContractResolver = new ReadOnlyJsonContractResolver(), - Converters = new List + ContractResolver = new Microsoft.Rest.Serialization.ReadOnlyJsonContractResolver(), + Converters = new System.Collections.Generic.List { - new Iso8601TimeSpanConverter() + new Microsoft.Rest.Serialization.Iso8601TimeSpanConverter() } }; CustomInitialize(); - DeserializationSettings.Converters.Add(new CloudErrorJsonConverter()); + DeserializationSettings.Converters.Add(new Microsoft.Rest.Azure.CloudErrorJsonConverter()); } /// /// Lists all of the available Microsoft.Features REST API operations. @@ -368,13 +351,13 @@ private void Initialize() /// /// 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 /// /// @@ -383,54 +366,62 @@ private void Initialize() /// /// A response object containing the response body and response headers. /// - public async Task>> ListOperationsWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListOperationsWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (ApiVersion == null) + + + + + if (this.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.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("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListOperations", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListOperations", tracingParameters); } // Construct URL - var _baseUrl = BaseUri.AbsoluteUri; + + var _baseUrl = this.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Features/operations").ToString(); - List _queryParameters = new List(); - if (ApiVersion != null) + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.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 (GenerateClientRequestId != null && GenerateClientRequestId.Value) + if (this.GenerateClientRequestId != null && this.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (AcceptLanguage != null) + if (this.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -442,50 +433,51 @@ private void Initialize() _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Credentials != null) + if (this.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.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 ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -495,9 +487,10 @@ private void Initialize() 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(); @@ -508,25 +501,29 @@ private void Initialize() _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.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; - } + + + + + } /// /// Lists all of the available Microsoft.Features REST API operations. /// @@ -539,13 +536,13 @@ private void Initialize() /// /// 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 /// /// @@ -554,51 +551,54 @@ private void Initialize() /// /// A response object containing the response body and response headers. /// - public async Task>> ListOperationsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListOperationsNextWithHttpMessagesAsync(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, "ListOperationsNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListOperationsNext", 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 (GenerateClientRequestId != null && GenerateClientRequestId.Value) + if (this.GenerateClientRequestId != null && this.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (AcceptLanguage != null) + if (this.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -610,50 +610,51 @@ private void Initialize() _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Credentials != null) + if (this.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.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 ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -663,9 +664,10 @@ private void Initialize() 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(); @@ -676,24 +678,28 @@ private void Initialize() _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.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; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Management.Sdk/Generated/FeatureClientExtensions.cs b/src/Resources/Resources.Management.Sdk/Generated/FeatureClientExtensions.cs new file mode 100644 index 000000000000..e5fc6220314d --- /dev/null +++ b/src/Resources/Resources.Management.Sdk/Generated/FeatureClientExtensions.cs @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.Management.Resources +{ + using Microsoft.Rest.Azure; + using Models; + + /// + /// Extension methods for FeatureClient + /// + public static partial class FeatureClientExtensions + { + /// + /// Lists all of the available Microsoft.Features REST API operations. + /// + /// + /// The operations group for this extension method. + /// + public static Microsoft.Rest.Azure.IPage ListOperations(this IFeatureClient operations) + { + return ((IFeatureClient)operations).ListOperationsAsync().GetAwaiter().GetResult(); + } + + /// + /// Lists all of the available Microsoft.Features REST API operations. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListOperationsAsync(this IFeatureClient operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListOperationsWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Lists all of the available Microsoft.Features REST API operations. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListOperationsNext(this IFeatureClient operations, string nextPageLink) + { + return ((IFeatureClient)operations).ListOperationsNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists all of the available Microsoft.Features REST API operations. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListOperationsNextAsync(this IFeatureClient operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListOperationsNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + } +} diff --git a/src/Resources/Resources.Sdk/Generated/FeaturesOperations.cs b/src/Resources/Resources.Management.Sdk/Generated/FeaturesOperations.cs similarity index 58% rename from src/Resources/Resources.Sdk/Generated/FeaturesOperations.cs rename to src/Resources/Resources.Management.Sdk/Generated/FeaturesOperations.cs index a274081f0e00..0bcff253b2fb 100644 --- a/src/Resources/Resources.Sdk/Generated/FeaturesOperations.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/FeaturesOperations.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; /// /// FeaturesOperations operations. /// - internal partial class FeaturesOperations : IServiceOperations, IFeaturesOperations + internal partial class FeaturesOperations : Microsoft.Rest.IServiceOperations, IFeaturesOperations { /// /// Initializes a new instance of the FeaturesOperations class. @@ -36,13 +24,13 @@ internal partial class FeaturesOperations : IServiceOperations, I /// /// Thrown when a required parameter is null /// - internal FeaturesOperations(FeatureClient client) + internal FeaturesOperations (FeatureClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -60,13 +48,13 @@ internal FeaturesOperations(FeatureClient 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 /// /// @@ -75,59 +63,68 @@ internal FeaturesOperations(FeatureClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListAllWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - 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("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAll", 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.Features/features").ToString(); - _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) @@ -139,50 +136,51 @@ internal FeaturesOperations(FeatureClient 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 ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -192,9 +190,10 @@ internal FeaturesOperations(FeatureClient 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(); @@ -205,25 +204,29 @@ internal FeaturesOperations(FeatureClient 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 the preview features in a provider namespace that are available /// through AFEC for the subscription. @@ -237,13 +240,13 @@ internal FeaturesOperations(FeatureClient 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 /// /// @@ -252,65 +255,75 @@ internal FeaturesOperations(FeatureClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceProviderNamespace, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceProviderNamespace, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceProviderNamespace == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceProviderNamespace"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceProviderNamespace"); } - 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("resourceProviderNamespace", resourceProviderNamespace); + + 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}/providers/Microsoft.Features/providers/{resourceProviderNamespace}/features").ToString(); _url = _url.Replace("{resourceProviderNamespace}", System.Uri.EscapeDataString(resourceProviderNamespace)); - _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) @@ -322,50 +335,51 @@ internal FeaturesOperations(FeatureClient 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 ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -375,9 +389,10 @@ internal FeaturesOperations(FeatureClient 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(); @@ -388,25 +403,29 @@ internal FeaturesOperations(FeatureClient 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 the preview feature with the specified name. /// @@ -422,13 +441,13 @@ internal FeaturesOperations(FeatureClient 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 /// /// @@ -437,71 +456,82 @@ internal FeaturesOperations(FeatureClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceProviderNamespace, string featureName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceProviderNamespace, string featureName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceProviderNamespace == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceProviderNamespace"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceProviderNamespace"); } + if (featureName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "featureName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "featureName"); } - 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("resourceProviderNamespace", resourceProviderNamespace); tracingParameters.Add("featureName", featureName); + + 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}/providers/Microsoft.Features/providers/{resourceProviderNamespace}/features/{featureName}").ToString(); _url = _url.Replace("{resourceProviderNamespace}", System.Uri.EscapeDataString(resourceProviderNamespace)); _url = _url.Replace("{featureName}", System.Uri.EscapeDataString(featureName)); - _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) @@ -513,50 +543,51 @@ internal FeaturesOperations(FeatureClient 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 ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -566,9 +597,10 @@ internal FeaturesOperations(FeatureClient 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(); @@ -579,25 +611,29 @@ internal FeaturesOperations(FeatureClient 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; - } + + + + + } /// /// Registers the preview feature for the subscription. /// @@ -613,13 +649,13 @@ internal FeaturesOperations(FeatureClient 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 /// /// @@ -628,71 +664,82 @@ internal FeaturesOperations(FeatureClient client) /// /// A response object containing the response body and response headers. /// - public async Task> RegisterWithHttpMessagesAsync(string resourceProviderNamespace, string featureName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> RegisterWithHttpMessagesAsync(string resourceProviderNamespace, string featureName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceProviderNamespace == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceProviderNamespace"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceProviderNamespace"); } + if (featureName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "featureName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "featureName"); } - 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("resourceProviderNamespace", resourceProviderNamespace); tracingParameters.Add("featureName", featureName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Register", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Register", 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.Features/providers/{resourceProviderNamespace}/features/{featureName}/register").ToString(); _url = _url.Replace("{resourceProviderNamespace}", System.Uri.EscapeDataString(resourceProviderNamespace)); _url = _url.Replace("{featureName}", System.Uri.EscapeDataString(featureName)); - _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("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _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) @@ -704,50 +751,51 @@ internal FeaturesOperations(FeatureClient 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 ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -757,9 +805,10 @@ internal FeaturesOperations(FeatureClient 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(); @@ -770,25 +819,29 @@ internal FeaturesOperations(FeatureClient 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; - } + + + + + } /// /// Unregisters the preview feature for the subscription. /// @@ -804,13 +857,13 @@ internal FeaturesOperations(FeatureClient 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 /// /// @@ -819,71 +872,82 @@ internal FeaturesOperations(FeatureClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UnregisterWithHttpMessagesAsync(string resourceProviderNamespace, string featureName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> UnregisterWithHttpMessagesAsync(string resourceProviderNamespace, string featureName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceProviderNamespace == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceProviderNamespace"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceProviderNamespace"); } + if (featureName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "featureName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "featureName"); } - 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("resourceProviderNamespace", resourceProviderNamespace); tracingParameters.Add("featureName", featureName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Unregister", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Unregister", 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.Features/providers/{resourceProviderNamespace}/features/{featureName}/unregister").ToString(); _url = _url.Replace("{resourceProviderNamespace}", System.Uri.EscapeDataString(resourceProviderNamespace)); _url = _url.Replace("{featureName}", System.Uri.EscapeDataString(featureName)); - _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("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _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) @@ -895,50 +959,51 @@ internal FeaturesOperations(FeatureClient 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 ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -948,9 +1013,10 @@ internal FeaturesOperations(FeatureClient 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(); @@ -961,25 +1027,29 @@ internal FeaturesOperations(FeatureClient 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 the preview features that are available through AFEC for the /// subscription. @@ -993,13 +1063,13 @@ internal FeaturesOperations(FeatureClient 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 /// /// @@ -1008,51 +1078,54 @@ internal FeaturesOperations(FeatureClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListAllNextWithHttpMessagesAsync(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, "ListAllNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAllNext", 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) @@ -1064,50 +1137,51 @@ internal FeaturesOperations(FeatureClient 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 ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1117,9 +1191,10 @@ internal FeaturesOperations(FeatureClient 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(); @@ -1130,25 +1205,29 @@ internal FeaturesOperations(FeatureClient 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 the preview features in a provider namespace that are available /// through AFEC for the subscription. @@ -1162,13 +1241,13 @@ internal FeaturesOperations(FeatureClient 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 /// /// @@ -1177,51 +1256,54 @@ internal FeaturesOperations(FeatureClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(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, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", 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) @@ -1233,50 +1315,51 @@ internal FeaturesOperations(FeatureClient 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 ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1286,9 +1369,10 @@ internal FeaturesOperations(FeatureClient 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(); @@ -1299,24 +1383,28 @@ internal FeaturesOperations(FeatureClient 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; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Management.Sdk/Generated/FeaturesOperationsExtensions.cs b/src/Resources/Resources.Management.Sdk/Generated/FeaturesOperationsExtensions.cs new file mode 100644 index 000000000000..4e5a705e7121 --- /dev/null +++ b/src/Resources/Resources.Management.Sdk/Generated/FeaturesOperationsExtensions.cs @@ -0,0 +1,267 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.Management.Resources +{ + using Microsoft.Rest.Azure; + using Models; + + /// + /// Extension methods for FeaturesOperations + /// + public static partial class FeaturesOperationsExtensions + { + /// + /// Gets all the preview features that are available through AFEC for the + /// subscription. + /// + /// + /// The operations group for this extension method. + /// + public static Microsoft.Rest.Azure.IPage ListAll(this IFeaturesOperations operations) + { + return ((IFeaturesOperations)operations).ListAllAsync().GetAwaiter().GetResult(); + } + + /// + /// Gets all the preview features that are available through AFEC for the + /// subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAllAsync(this IFeaturesOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListAllWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets all the preview features in a provider namespace that are available + /// through AFEC for the subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The namespace of the resource provider for getting features. + /// + public static Microsoft.Rest.Azure.IPage List(this IFeaturesOperations operations, string resourceProviderNamespace) + { + return ((IFeaturesOperations)operations).ListAsync(resourceProviderNamespace).GetAwaiter().GetResult(); + } + + /// + /// Gets all the preview features in a provider namespace that are available + /// through AFEC for the subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The namespace of the resource provider for getting features. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IFeaturesOperations operations, string resourceProviderNamespace, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceProviderNamespace, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets the preview feature with the specified name. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource provider namespace for the feature. + /// + /// + /// The name of the feature to get. + /// + public static FeatureResult Get(this IFeaturesOperations operations, string resourceProviderNamespace, string featureName) + { + return ((IFeaturesOperations)operations).GetAsync(resourceProviderNamespace, featureName).GetAwaiter().GetResult(); + } + + /// + /// Gets the preview feature with the specified name. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource provider namespace for the feature. + /// + /// + /// The name of the feature to get. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IFeaturesOperations operations, string resourceProviderNamespace, string featureName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceProviderNamespace, featureName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Registers the preview feature for the subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The namespace of the resource provider. + /// + /// + /// The name of the feature to register. + /// + public static FeatureResult Register(this IFeaturesOperations operations, string resourceProviderNamespace, string featureName) + { + return ((IFeaturesOperations)operations).RegisterAsync(resourceProviderNamespace, featureName).GetAwaiter().GetResult(); + } + + /// + /// Registers the preview feature for the subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The namespace of the resource provider. + /// + /// + /// The name of the feature to register. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task RegisterAsync(this IFeaturesOperations operations, string resourceProviderNamespace, string featureName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.RegisterWithHttpMessagesAsync(resourceProviderNamespace, featureName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Unregisters the preview feature for the subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The namespace of the resource provider. + /// + /// + /// The name of the feature to unregister. + /// + public static FeatureResult Unregister(this IFeaturesOperations operations, string resourceProviderNamespace, string featureName) + { + return ((IFeaturesOperations)operations).UnregisterAsync(resourceProviderNamespace, featureName).GetAwaiter().GetResult(); + } + + /// + /// Unregisters the preview feature for the subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The namespace of the resource provider. + /// + /// + /// The name of the feature to unregister. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UnregisterAsync(this IFeaturesOperations operations, string resourceProviderNamespace, string featureName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.UnregisterWithHttpMessagesAsync(resourceProviderNamespace, featureName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets all the preview features that are available through AFEC for the + /// subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListAllNext(this IFeaturesOperations operations, string nextPageLink) + { + return ((IFeaturesOperations)operations).ListAllNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets all the preview features that are available through AFEC for the + /// subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAllNextAsync(this IFeaturesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListAllNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets all the preview features in a provider namespace that are available + /// through AFEC for the subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IFeaturesOperations operations, string nextPageLink) + { + return ((IFeaturesOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets all the preview features in a provider namespace that are available + /// through AFEC for the subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IFeaturesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + } +} diff --git a/src/Resources/Resources.Sdk/Generated/IDeploymentOperations.cs b/src/Resources/Resources.Management.Sdk/Generated/IDeploymentOperations.cs similarity index 63% rename from src/Resources/Resources.Sdk/Generated/IDeploymentOperations.cs rename to src/Resources/Resources.Management.Sdk/Generated/IDeploymentOperations.cs index b57fc7117f08..5b67548dc2bc 100644 --- a/src/Resources/Resources.Sdk/Generated/IDeploymentOperations.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/IDeploymentOperations.cs @@ -1,22 +1,12 @@ -// // 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 Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// DeploymentOperations operations. @@ -26,6 +16,9 @@ public partial interface IDeploymentOperations /// /// Gets a deployments operation. /// + /// + /// Gets a deployments operation. + /// /// /// The resource scope. /// @@ -47,13 +40,14 @@ public partial interface IDeploymentOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetAtScopeWithHttpMessagesAsync(string scope, string deploymentName, string operationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + 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)); + /// /// Gets all deployments operations for a deployment. /// + /// + /// Gets all deployments operations for a deployment. + /// /// /// The resource scope. /// @@ -75,13 +69,14 @@ public partial interface IDeploymentOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListAtScopeWithHttpMessagesAsync(string scope, string deploymentName, int? top = default(int?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + 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)); + /// /// Gets a deployments operation. /// + /// + /// Gets a deployments operation. + /// /// /// The name of the deployment. /// @@ -100,13 +95,14 @@ public partial interface IDeploymentOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetAtTenantScopeWithHttpMessagesAsync(string deploymentName, string operationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetAtTenantScopeWithHttpMessagesAsync(string deploymentName, string operationId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all deployments operations for a deployment. /// + /// + /// Gets all deployments operations for a deployment. + /// /// /// The name of the deployment. /// @@ -125,13 +121,14 @@ public partial interface IDeploymentOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListAtTenantScopeWithHttpMessagesAsync(string deploymentName, int? top = default(int?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + 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)); + /// /// Gets a deployments operation. /// + /// + /// Gets a deployments operation. + /// /// /// The management group ID. /// @@ -153,13 +150,14 @@ public partial interface IDeploymentOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetAtManagementGroupScopeWithHttpMessagesAsync(string groupId, string deploymentName, string operationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + 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)); + /// /// Gets all deployments operations for a deployment. /// + /// + /// Gets all deployments operations for a deployment. + /// /// /// The management group ID. /// @@ -181,13 +179,14 @@ public partial interface IDeploymentOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListAtManagementGroupScopeWithHttpMessagesAsync(string groupId, string deploymentName, int? top = default(int?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + 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)); + /// /// Gets a deployments operation. /// + /// + /// Gets a deployments operation. + /// /// /// The name of the deployment. /// @@ -206,13 +205,14 @@ public partial interface IDeploymentOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetAtSubscriptionScopeWithHttpMessagesAsync(string deploymentName, string operationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetAtSubscriptionScopeWithHttpMessagesAsync(string deploymentName, string operationId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all deployments operations for a deployment. /// + /// + /// Gets all deployments operations for a deployment. + /// /// /// The name of the deployment. /// @@ -231,13 +231,14 @@ public partial interface IDeploymentOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListAtSubscriptionScopeWithHttpMessagesAsync(string deploymentName, int? top = default(int?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + 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)); + /// /// Gets a deployments operation. /// + /// + /// Gets a deployments operation. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -259,13 +260,14 @@ public partial interface IDeploymentOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string deploymentName, string operationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + 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)); + /// /// Gets all deployments operations for a deployment. /// + /// + /// Gets all deployments operations for a deployment. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -287,13 +289,14 @@ public partial interface IDeploymentOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, string deploymentName, int? top = default(int?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + 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)); + /// /// Gets all deployments operations for a deployment. /// + /// + /// Gets all deployments operations for a deployment. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -309,13 +312,14 @@ public partial interface IDeploymentOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListAtScopeNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListAtScopeNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all deployments operations for a deployment. /// + /// + /// Gets all deployments operations for a deployment. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -331,13 +335,14 @@ public partial interface IDeploymentOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListAtTenantScopeNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListAtTenantScopeNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all deployments operations for a deployment. /// + /// + /// Gets all deployments operations for a deployment. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -353,13 +358,14 @@ public partial interface IDeploymentOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListAtManagementGroupScopeNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListAtManagementGroupScopeNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all deployments operations for a deployment. /// + /// + /// Gets all deployments operations for a deployment. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -375,13 +381,14 @@ public partial interface IDeploymentOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListAtSubscriptionScopeNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListAtSubscriptionScopeNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all deployments operations for a deployment. /// + /// + /// Gets all deployments operations for a deployment. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -397,9 +404,7 @@ public partial interface IDeploymentOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/IDeploymentScriptsClient.cs b/src/Resources/Resources.Management.Sdk/Generated/IDeploymentScriptsClient.cs similarity index 62% rename from src/Resources/Resources.Sdk/Generated/IDeploymentScriptsClient.cs rename to src/Resources/Resources.Management.Sdk/Generated/IDeploymentScriptsClient.cs index fa5018b8251c..35b6a24c3b51 100644 --- a/src/Resources/Resources.Sdk/Generated/IDeploymentScriptsClient.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/IDeploymentScriptsClient.cs @@ -1,25 +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 Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; /// /// The APIs listed in this specification can be used to manage Deployment - /// Scripts resource through the Azure Resource Manager. + /// Scripts resource through the Azure Resource Manager. /// - public partial interface IDeploymentScriptsClient : System.IDisposable + public partial interface IDeploymentScriptsClient : System.IDisposable { /// /// The base URI of the service. @@ -29,51 +23,56 @@ public partial interface IDeploymentScriptsClient : System.IDisposable /// /// Gets or sets json serialization settings. /// - JsonSerializerSettings SerializationSettings { get; } + Newtonsoft.Json.JsonSerializerSettings SerializationSettings { get; } /// /// Gets or sets json deserialization settings. /// - JsonSerializerSettings DeserializationSettings { get; } + Newtonsoft.Json.JsonSerializerSettings DeserializationSettings { get; } /// /// Credentials needed for the client to connect to Azure. /// - ServiceClientCredentials Credentials { get; } + Microsoft.Rest.ServiceClientCredentials Credentials { get;} + /// - /// Subscription Id which forms part of the URI for every service call. + /// The API version to use for this operation. /// - string SubscriptionId { get; set; } + string ApiVersion { get;} + /// - /// Client Api version. + /// Subscription Id which forms part of the URI for every service call. /// - string ApiVersion { get; } + string SubscriptionId { get; set;} + /// /// The preferred language for the response. /// - string AcceptLanguage { get; set; } + string AcceptLanguage { get; set;} + /// /// The retry timeout in seconds for Long Running Operations. Default - /// value is 30. + /// /// value is 30. /// - int? LongRunningOperationRetryTimeout { get; set; } + int? LongRunningOperationRetryTimeout { get; set;} + /// /// Whether a unique x-ms-client-request-id should be generated. When - /// set to true a unique x-ms-client-request-id value is generated and - /// included in each request. Default is true. + /// /// set to true a unique x-ms-client-request-id value is generated and + /// /// included in each request. Default is true. /// - bool? GenerateClientRequestId { get; set; } + bool? GenerateClientRequestId { get; set;} /// - /// Gets the IDeploymentScriptsOperations. + /// Gets the IDeploymentScriptsOperations /// IDeploymentScriptsOperations DeploymentScripts { get; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/IDeploymentScriptsOperations.cs b/src/Resources/Resources.Management.Sdk/Generated/IDeploymentScriptsOperations.cs similarity index 58% rename from src/Resources/Resources.Sdk/Generated/IDeploymentScriptsOperations.cs rename to src/Resources/Resources.Management.Sdk/Generated/IDeploymentScriptsOperations.cs index 085a45701cae..9e9d5ba182d6 100644 --- a/src/Resources/Resources.Sdk/Generated/IDeploymentScriptsOperations.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/IDeploymentScriptsOperations.cs @@ -1,22 +1,12 @@ -// // 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 Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// DeploymentScriptsOperations operations. @@ -26,6 +16,9 @@ public partial interface IDeploymentScriptsOperations /// /// Creates a deployment script. /// + /// + /// Creates a deployment script. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -41,19 +34,20 @@ public partial interface IDeploymentScriptsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateWithHttpMessagesAsync(string resourceGroupName, string scriptName, DeploymentScript deploymentScript, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateWithHttpMessagesAsync(string resourceGroupName, string scriptName, DeploymentScript deploymentScript, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Updates deployment script tags with specified values. /// + /// + /// Updates deployment script tags with specified values. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -69,19 +63,20 @@ public partial interface IDeploymentScriptsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string scriptName, DeploymentScriptUpdateParameter deploymentScript = default(DeploymentScriptUpdateParameter), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string scriptName, DeploymentScriptUpdateParameter deploymentScript = default(DeploymentScriptUpdateParameter), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets a deployment script with a given name. /// + /// + /// Gets a deployment script with a given name. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -94,20 +89,22 @@ public partial interface IDeploymentScriptsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string scriptName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string scriptName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Deletes a deployment script. When operation completes, status code - /// 200 returned without content. + /// Deletes a deployment script. When operation completes, status code 200 + /// returned without content. /// + /// + /// Deletes a deployment script. When operation completes, status code 200 + /// returned without content. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -120,35 +117,37 @@ public partial interface IDeploymentScriptsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string scriptName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string scriptName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists all deployment scripts for a given subscription. /// + /// + /// Lists all deployment scripts for a given subscription. + /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListBySubscriptionWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListBySubscriptionWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets deployment script logs for a given deployment script name. /// + /// + /// Gets deployment script logs for a given deployment script name. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -161,19 +160,20 @@ public partial interface IDeploymentScriptsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetLogsWithHttpMessagesAsync(string resourceGroupName, string scriptName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetLogsWithHttpMessagesAsync(string resourceGroupName, string scriptName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets deployment script logs for a given deployment script name. /// + /// + /// Gets deployment script logs for a given deployment script name. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -181,10 +181,9 @@ public partial interface IDeploymentScriptsOperations /// Name of the deployment script. /// /// - /// The number of lines to show from the tail of the deployment script - /// log. Valid value is a positive number up to 1000. If 'tail' is not - /// provided, all available logs are shown up to container instance log - /// capacity of 4mb. + /// The number of lines to show from the tail of the deployment script log. + /// Valid value is a positive number up to 1000. If 'tail' is not provided, all + /// available logs are shown up to container instance log capacity of 4mb. /// /// /// The headers that will be added to request. @@ -192,19 +191,20 @@ public partial interface IDeploymentScriptsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetLogsDefaultWithHttpMessagesAsync(string resourceGroupName, string scriptName, int? tail = default(int?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetLogsDefaultWithHttpMessagesAsync(string resourceGroupName, string scriptName, int? tail = default(int?), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists deployments scripts. /// + /// + /// Lists deployments scripts. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -214,19 +214,20 @@ public partial interface IDeploymentScriptsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Creates a deployment script. /// + /// + /// Creates a deployment script. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -242,19 +243,20 @@ public partial interface IDeploymentScriptsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateWithHttpMessagesAsync(string resourceGroupName, string scriptName, DeploymentScript deploymentScript, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateWithHttpMessagesAsync(string resourceGroupName, string scriptName, DeploymentScript deploymentScript, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists all deployment scripts for a given subscription. /// + /// + /// Lists all deployment scripts for a given subscription. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -264,19 +266,20 @@ public partial interface IDeploymentScriptsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListBySubscriptionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListBySubscriptionNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists deployments scripts. /// + /// + /// Lists deployments scripts. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -286,15 +289,13 @@ public partial interface IDeploymentScriptsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/IDeploymentStacksClient.cs b/src/Resources/Resources.Management.Sdk/Generated/IDeploymentStacksClient.cs similarity index 64% rename from src/Resources/Resources.Sdk/Generated/IDeploymentStacksClient.cs rename to src/Resources/Resources.Management.Sdk/Generated/IDeploymentStacksClient.cs index a468e9fdfaa6..2f6ebf43172f 100644 --- a/src/Resources/Resources.Sdk/Generated/IDeploymentStacksClient.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/IDeploymentStacksClient.cs @@ -1,25 +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 Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; /// /// The APIs listed in this specification can be used to manage deployment - /// stack resources through the Azure Resource Manager. + /// stack resources through the Azure Resource Manager. /// - public partial interface IDeploymentStacksClient : System.IDisposable + public partial interface IDeploymentStacksClient : System.IDisposable { /// /// The base URI of the service. @@ -29,51 +23,56 @@ public partial interface IDeploymentStacksClient : System.IDisposable /// /// Gets or sets json serialization settings. /// - JsonSerializerSettings SerializationSettings { get; } + Newtonsoft.Json.JsonSerializerSettings SerializationSettings { get; } /// /// Gets or sets json deserialization settings. /// - JsonSerializerSettings DeserializationSettings { get; } + Newtonsoft.Json.JsonSerializerSettings DeserializationSettings { get; } /// /// Credentials needed for the client to connect to Azure. /// - ServiceClientCredentials Credentials { get; } + Microsoft.Rest.ServiceClientCredentials Credentials { get;} + /// /// The API version to use for this operation. /// - string ApiVersion { get; } + string ApiVersion { get;} + /// /// The ID of the target subscription. /// - string SubscriptionId { get; set; } + string SubscriptionId { get; set;} + /// /// The preferred language for the response. /// - string AcceptLanguage { get; set; } + string AcceptLanguage { get; set;} + /// /// The retry timeout in seconds for Long Running Operations. Default - /// value is 30. + /// /// value is 30. /// - int? LongRunningOperationRetryTimeout { get; set; } + int? LongRunningOperationRetryTimeout { get; set;} + /// /// Whether a unique x-ms-client-request-id should be generated. When - /// set to true a unique x-ms-client-request-id value is generated and - /// included in each request. Default is true. + /// /// set to true a unique x-ms-client-request-id value is generated and + /// /// included in each request. Default is true. /// - bool? GenerateClientRequestId { get; set; } + bool? GenerateClientRequestId { get; set;} /// - /// Gets the IDeploymentStacksOperations. + /// Gets the IDeploymentStacksOperations /// IDeploymentStacksOperations DeploymentStacks { get; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/IDeploymentStacksOperations.cs b/src/Resources/Resources.Management.Sdk/Generated/IDeploymentStacksOperations.cs similarity index 55% rename from src/Resources/Resources.Sdk/Generated/IDeploymentStacksOperations.cs rename to src/Resources/Resources.Management.Sdk/Generated/IDeploymentStacksOperations.cs index c3290f688285..66a1e6145523 100644 --- a/src/Resources/Resources.Sdk/Generated/IDeploymentStacksOperations.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/IDeploymentStacksOperations.cs @@ -1,22 +1,12 @@ -// // 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 Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// DeploymentStacksOperations operations. @@ -24,9 +14,11 @@ namespace Microsoft.Azure.Management.Resources public partial interface IDeploymentStacksOperations { /// - /// Lists all the Deployment Stacks within the specified resource - /// group. + /// Lists all the Deployment Stacks within the specified resource group. /// + /// + /// Lists all the Deployment Stacks within the specified resource group. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -36,39 +28,40 @@ public partial interface IDeploymentStacksOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListAtResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListAtResourceGroupWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists all the Deployment Stacks within the specified subscription. /// + /// + /// Lists all the Deployment Stacks within the specified subscription. + /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListAtSubscriptionWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListAtSubscriptionWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Lists all the Deployment Stacks within the specified management - /// group. + /// Lists all the Deployment Stacks within the specified management group. /// + /// + /// Lists all the Deployment Stacks within the specified management group. + /// /// /// Management Group. /// @@ -78,19 +71,20 @@ public partial interface IDeploymentStacksOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListAtManagementGroupWithHttpMessagesAsync(string managementGroupId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListAtManagementGroupWithHttpMessagesAsync(string managementGroupId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Creates or updates a Deployment Stack. /// + /// + /// Creates or updates a Deployment Stack. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -106,19 +100,20 @@ public partial interface IDeploymentStacksOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateAtResourceGroupWithHttpMessagesAsync(string resourceGroupName, string deploymentStackName, DeploymentStack deploymentStack, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateAtResourceGroupWithHttpMessagesAsync(string resourceGroupName, string deploymentStackName, DeploymentStack deploymentStack, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets a Deployment Stack with a given name. /// + /// + /// Gets a Deployment Stack with a given name. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -131,20 +126,22 @@ public partial interface IDeploymentStacksOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetAtResourceGroupWithHttpMessagesAsync(string resourceGroupName, string deploymentStackName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetAtResourceGroupWithHttpMessagesAsync(string resourceGroupName, string deploymentStackName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Deletes a Deployment Stack by name. When operation completes, - /// status code 200 returned without content. + /// Deletes a Deployment Stack by name. When operation completes, status code + /// 200 returned without content. /// + /// + /// Deletes a Deployment Stack by name. When operation completes, status code + /// 200 returned without content. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -153,11 +150,9 @@ public partial interface IDeploymentStacksOperations /// /// /// Flag to indicate delete rather than detach for the resources. - /// Possible values include: 'delete', 'detach' /// /// /// Flag to indicate delete rather than detach for the resource groups. - /// Possible values include: 'delete', 'detach' /// /// /// The headers that will be added to request. @@ -165,16 +160,17 @@ public partial interface IDeploymentStacksOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task> DeleteAtResourceGroupWithHttpMessagesAsync(string resourceGroupName, string deploymentStackName, string unmanageActionResources = default(string), string unmanageActionResourceGroups = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> DeleteAtResourceGroupWithHttpMessagesAsync(string resourceGroupName, string deploymentStackName, string unmanageActionResources = default(string), string unmanageActionResourceGroups = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Creates or updates a Deployment Stack. /// + /// + /// Creates or updates a Deployment Stack. + /// /// /// Name of the deployment stack. /// @@ -187,19 +183,20 @@ public partial interface IDeploymentStacksOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateAtSubscriptionWithHttpMessagesAsync(string deploymentStackName, DeploymentStack deploymentStack, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateAtSubscriptionWithHttpMessagesAsync(string deploymentStackName, DeploymentStack deploymentStack, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets a Deployment Stack with a given name. /// + /// + /// Gets a Deployment Stack with a given name. + /// /// /// Name of the deployment stack. /// @@ -209,30 +206,30 @@ public partial interface IDeploymentStacksOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetAtSubscriptionWithHttpMessagesAsync(string deploymentStackName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetAtSubscriptionWithHttpMessagesAsync(string deploymentStackName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Deletes a Deployment Stack by name. When operation completes, - /// status code 200 returned without content. + /// Deletes a Deployment Stack by name. When operation completes, status code + /// 200 returned without content. /// + /// + /// Deletes a Deployment Stack by name. When operation completes, status code + /// 200 returned without content. + /// /// /// Name of the deployment stack. /// /// /// Flag to indicate delete rather than detach for the resources. - /// Possible values include: 'delete', 'detach' /// /// /// Flag to indicate delete rather than detach for the resource groups. - /// Possible values include: 'delete', 'detach' /// /// /// The headers that will be added to request. @@ -240,16 +237,17 @@ public partial interface IDeploymentStacksOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task> DeleteAtSubscriptionWithHttpMessagesAsync(string deploymentStackName, string unmanageActionResources = default(string), string unmanageActionResourceGroups = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> DeleteAtSubscriptionWithHttpMessagesAsync(string deploymentStackName, string unmanageActionResources = default(string), string unmanageActionResourceGroups = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Creates or updates a Deployment Stack. /// + /// + /// Creates or updates a Deployment Stack. + /// /// /// Management Group. /// @@ -265,19 +263,20 @@ public partial interface IDeploymentStacksOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateAtManagementGroupWithHttpMessagesAsync(string managementGroupId, string deploymentStackName, DeploymentStack deploymentStack, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateAtManagementGroupWithHttpMessagesAsync(string managementGroupId, string deploymentStackName, DeploymentStack deploymentStack, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets a Deployment Stack with a given name. /// + /// + /// Gets a Deployment Stack with a given name. + /// /// /// Management Group. /// @@ -290,20 +289,22 @@ public partial interface IDeploymentStacksOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetAtManagementGroupWithHttpMessagesAsync(string managementGroupId, string deploymentStackName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetAtManagementGroupWithHttpMessagesAsync(string managementGroupId, string deploymentStackName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Deletes a Deployment Stack by name. When operation completes, - /// status code 200 returned without content. + /// Deletes a Deployment Stack by name. When operation completes, status code + /// 200 returned without content. /// + /// + /// Deletes a Deployment Stack by name. When operation completes, status code + /// 200 returned without content. + /// /// /// Management Group. /// @@ -312,15 +313,12 @@ public partial interface IDeploymentStacksOperations /// /// /// Flag to indicate delete rather than detach for the resources. - /// Possible values include: 'delete', 'detach' /// /// /// Flag to indicate delete rather than detach for the resource groups. - /// Possible values include: 'delete', 'detach' /// /// - /// Flag to indicate delete rather than detach for the management - /// groups. Possible values include: 'delete', 'detach' + /// Flag to indicate delete rather than detach for the management groups. /// /// /// The headers that will be added to request. @@ -328,16 +326,17 @@ public partial interface IDeploymentStacksOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task> DeleteAtManagementGroupWithHttpMessagesAsync(string managementGroupId, string deploymentStackName, string unmanageActionResources = default(string), string unmanageActionResourceGroups = default(string), string unmanageActionManagementGroups = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> DeleteAtManagementGroupWithHttpMessagesAsync(string managementGroupId, string deploymentStackName, string unmanageActionResources = default(string), string unmanageActionResourceGroups = default(string), string unmanageActionManagementGroups = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Exports the template used to create the deployment stack. /// + /// + /// Exports the template used to create the deployment stack. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -350,19 +349,20 @@ public partial interface IDeploymentStacksOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> ExportTemplateAtResourceGroupWithHttpMessagesAsync(string resourceGroupName, string deploymentStackName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> ExportTemplateAtResourceGroupWithHttpMessagesAsync(string resourceGroupName, string deploymentStackName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Exports the template used to create the deployment stack. /// + /// + /// Exports the template used to create the deployment stack. + /// /// /// Name of the deployment stack. /// @@ -372,19 +372,20 @@ public partial interface IDeploymentStacksOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> ExportTemplateAtSubscriptionWithHttpMessagesAsync(string deploymentStackName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> ExportTemplateAtSubscriptionWithHttpMessagesAsync(string deploymentStackName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Exports the template used to create the deployment stack. /// + /// + /// Exports the template used to create the deployment stack. + /// /// /// Management Group. /// @@ -397,19 +398,20 @@ public partial interface IDeploymentStacksOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> ExportTemplateAtManagementGroupWithHttpMessagesAsync(string managementGroupId, string deploymentStackName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> ExportTemplateAtManagementGroupWithHttpMessagesAsync(string managementGroupId, string deploymentStackName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Creates or updates a Deployment Stack. /// + /// + /// Creates or updates a Deployment Stack. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -425,20 +427,22 @@ public partial interface IDeploymentStacksOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateAtResourceGroupWithHttpMessagesAsync(string resourceGroupName, string deploymentStackName, DeploymentStack deploymentStack, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateAtResourceGroupWithHttpMessagesAsync(string resourceGroupName, string deploymentStackName, DeploymentStack deploymentStack, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Deletes a Deployment Stack by name. When operation completes, - /// status code 200 returned without content. + /// Deletes a Deployment Stack by name. When operation completes, status code + /// 200 returned without content. /// + /// + /// Deletes a Deployment Stack by name. When operation completes, status code + /// 200 returned without content. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -447,11 +451,9 @@ public partial interface IDeploymentStacksOperations /// /// /// Flag to indicate delete rather than detach for the resources. - /// Possible values include: 'delete', 'detach' /// /// /// Flag to indicate delete rather than detach for the resource groups. - /// Possible values include: 'delete', 'detach' /// /// /// The headers that will be added to request. @@ -459,16 +461,17 @@ public partial interface IDeploymentStacksOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginDeleteAtResourceGroupWithHttpMessagesAsync(string resourceGroupName, string deploymentStackName, string unmanageActionResources = default(string), string unmanageActionResourceGroups = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginDeleteAtResourceGroupWithHttpMessagesAsync(string resourceGroupName, string deploymentStackName, string unmanageActionResources = default(string), string unmanageActionResourceGroups = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Creates or updates a Deployment Stack. /// + /// + /// Creates or updates a Deployment Stack. + /// /// /// Name of the deployment stack. /// @@ -481,30 +484,30 @@ public partial interface IDeploymentStacksOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateAtSubscriptionWithHttpMessagesAsync(string deploymentStackName, DeploymentStack deploymentStack, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateAtSubscriptionWithHttpMessagesAsync(string deploymentStackName, DeploymentStack deploymentStack, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Deletes a Deployment Stack by name. When operation completes, - /// status code 200 returned without content. + /// Deletes a Deployment Stack by name. When operation completes, status code + /// 200 returned without content. /// + /// + /// Deletes a Deployment Stack by name. When operation completes, status code + /// 200 returned without content. + /// /// /// Name of the deployment stack. /// /// /// Flag to indicate delete rather than detach for the resources. - /// Possible values include: 'delete', 'detach' /// /// /// Flag to indicate delete rather than detach for the resource groups. - /// Possible values include: 'delete', 'detach' /// /// /// The headers that will be added to request. @@ -512,16 +515,17 @@ public partial interface IDeploymentStacksOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginDeleteAtSubscriptionWithHttpMessagesAsync(string deploymentStackName, string unmanageActionResources = default(string), string unmanageActionResourceGroups = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginDeleteAtSubscriptionWithHttpMessagesAsync(string deploymentStackName, string unmanageActionResources = default(string), string unmanageActionResourceGroups = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Creates or updates a Deployment Stack. /// + /// + /// Creates or updates a Deployment Stack. + /// /// /// Management Group. /// @@ -537,20 +541,22 @@ public partial interface IDeploymentStacksOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateAtManagementGroupWithHttpMessagesAsync(string managementGroupId, string deploymentStackName, DeploymentStack deploymentStack, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateAtManagementGroupWithHttpMessagesAsync(string managementGroupId, string deploymentStackName, DeploymentStack deploymentStack, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Deletes a Deployment Stack by name. When operation completes, - /// status code 200 returned without content. + /// Deletes a Deployment Stack by name. When operation completes, status code + /// 200 returned without content. /// + /// + /// Deletes a Deployment Stack by name. When operation completes, status code + /// 200 returned without content. + /// /// /// Management Group. /// @@ -559,15 +565,12 @@ public partial interface IDeploymentStacksOperations /// /// /// Flag to indicate delete rather than detach for the resources. - /// Possible values include: 'delete', 'detach' /// /// /// Flag to indicate delete rather than detach for the resource groups. - /// Possible values include: 'delete', 'detach' /// /// - /// Flag to indicate delete rather than detach for the management - /// groups. Possible values include: 'delete', 'detach' + /// Flag to indicate delete rather than detach for the management groups. /// /// /// The headers that will be added to request. @@ -575,17 +578,17 @@ public partial interface IDeploymentStacksOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginDeleteAtManagementGroupWithHttpMessagesAsync(string managementGroupId, string deploymentStackName, string unmanageActionResources = default(string), string unmanageActionResourceGroups = default(string), string unmanageActionManagementGroups = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginDeleteAtManagementGroupWithHttpMessagesAsync(string managementGroupId, string deploymentStackName, string unmanageActionResources = default(string), string unmanageActionResourceGroups = default(string), string unmanageActionManagementGroups = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Lists all the Deployment Stacks within the specified resource - /// group. + /// Lists all the Deployment Stacks within the specified resource group. /// + /// + /// Lists all the Deployment Stacks within the specified resource group. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -595,19 +598,20 @@ public partial interface IDeploymentStacksOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListAtResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListAtResourceGroupNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists all the Deployment Stacks within the specified subscription. /// + /// + /// Lists all the Deployment Stacks within the specified subscription. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -617,20 +621,20 @@ public partial interface IDeploymentStacksOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListAtSubscriptionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListAtSubscriptionNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Lists all the Deployment Stacks within the specified management - /// group. + /// Lists all the Deployment Stacks within the specified management group. /// + /// + /// Lists all the Deployment Stacks within the specified management group. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -640,15 +644,13 @@ public partial interface IDeploymentStacksOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListAtManagementGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListAtManagementGroupNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/IDeploymentsOperations.cs b/src/Resources/Resources.Management.Sdk/Generated/IDeploymentsOperations.cs similarity index 51% rename from src/Resources/Resources.Sdk/Generated/IDeploymentsOperations.cs rename to src/Resources/Resources.Management.Sdk/Generated/IDeploymentsOperations.cs index 1f4acf5d9f85..e0ddfcc94a50 100644 --- a/src/Resources/Resources.Sdk/Generated/IDeploymentsOperations.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/IDeploymentsOperations.cs @@ -1,23 +1,12 @@ -// // 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 Microsoft.Rest; using Microsoft.Rest.Azure; - using Microsoft.Rest.Azure.OData; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// DeploymentsOperations operations. @@ -25,18 +14,25 @@ namespace Microsoft.Azure.Management.Resources public partial interface IDeploymentsOperations { /// - /// Deletes a deployment from the deployment history. + /// A template deployment that is currently running cannot be deleted. Deleting + /// a template deployment removes the associated deployment operations. This is + /// an asynchronous operation that returns a status of 202 until the template + /// deployment is successfully deleted. The Location response header contains + /// the URI that is used to obtain the status of the process. While the process + /// is running, a call to the URI in the Location header returns a status of + /// 202. When the process finishes, the URI in the Location header returns a + /// status of 204 on success. If the asynchronous request failed, the URI in + /// the Location header returns an error-level status code. /// /// - /// A template deployment that is currently running cannot be deleted. - /// Deleting a template deployment removes the associated deployment - /// operations. This is an asynchronous operation that returns a status - /// of 202 until the template deployment is successfully deleted. The - /// Location response header contains the URI that is used to obtain - /// the status of the process. While the process is running, a call to - /// the URI in the Location header returns a status of 202. When the - /// process finishes, the URI in the Location header returns a status - /// of 204 on success. If the asynchronous request failed, the URI in + /// A template deployment that is currently running cannot be deleted. Deleting + /// a template deployment removes the associated deployment operations. This is + /// an asynchronous operation that returns a status of 202 until the template + /// deployment is successfully deleted. The Location response header contains + /// the URI that is used to obtain the status of the process. While the process + /// is running, a call to the URI in the Location header returns a status of + /// 202. When the process finishes, the URI in the Location header returns a + /// status of 204 on success. If the asynchronous request failed, the URI in /// the Location header returns an error-level status code. /// /// @@ -54,13 +50,14 @@ public partial interface IDeploymentsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteAtScopeWithHttpMessagesAsync(string scope, string deploymentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteAtScopeWithHttpMessagesAsync(string scope, string deploymentName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Checks whether the deployment exists. /// + /// + /// Checks whether the deployment exists. + /// /// /// The resource scope. /// @@ -76,16 +73,15 @@ public partial interface IDeploymentsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task> CheckExistenceAtScopeWithHttpMessagesAsync(string scope, string deploymentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CheckExistenceAtScopeWithHttpMessagesAsync(string scope, string deploymentName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Deploys resources at a given scope. + /// You can provide the template and parameters directly in the request or link + /// to JSON files. /// /// - /// You can provide the template and parameters directly in the request - /// or link to JSON files. + /// You can provide the template and parameters directly in the request or link + /// to JSON files. /// /// /// The resource scope. @@ -108,13 +104,14 @@ public partial interface IDeploymentsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateAtScopeWithHttpMessagesAsync(string scope, string deploymentName, Deployment parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateAtScopeWithHttpMessagesAsync(string scope, string deploymentName, Deployment parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets a deployment. /// + /// + /// Gets a deployment. + /// /// /// The resource scope. /// @@ -133,19 +130,19 @@ public partial interface IDeploymentsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetAtScopeWithHttpMessagesAsync(string scope, string deploymentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetAtScopeWithHttpMessagesAsync(string scope, string deploymentName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Cancels a currently running template deployment. + /// You can cancel a deployment only if the provisioningState is Accepted or + /// Running. After the deployment is canceled, the provisioningState is set to + /// Canceled. Canceling a template deployment stops the currently running + /// template deployment and leaves the resources partially deployed. /// /// - /// You can cancel a deployment only if the provisioningState is - /// Accepted or Running. After the deployment is canceled, the - /// provisioningState is set to Canceled. Canceling a template - /// deployment stops the currently running template deployment and - /// leaves the resources partially deployed. + /// You can cancel a deployment only if the provisioningState is Accepted or + /// Running. After the deployment is canceled, the provisioningState is set to + /// Canceled. Canceling a template deployment stops the currently running + /// template deployment and leaves the resources partially deployed. /// /// /// The resource scope. @@ -162,14 +159,16 @@ public partial interface IDeploymentsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task CancelAtScopeWithHttpMessagesAsync(string scope, string deploymentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task CancelAtScopeWithHttpMessagesAsync(string scope, string deploymentName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Validates whether the specified template is syntactically correct - /// and will be accepted by Azure Resource Manager.. + /// Validates whether the specified template is syntactically correct and will + /// be accepted by Azure Resource Manager.. /// + /// + /// Validates whether the specified template is syntactically correct and will + /// be accepted by Azure Resource Manager.. + /// /// /// The resource scope. /// @@ -191,13 +190,14 @@ public partial interface IDeploymentsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> ValidateAtScopeWithHttpMessagesAsync(string scope, string deploymentName, Deployment parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> ValidateAtScopeWithHttpMessagesAsync(string scope, string deploymentName, Deployment parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Exports the template used for specified deployment. /// + /// + /// Exports the template used for specified deployment. + /// /// /// The resource scope. /// @@ -216,19 +216,20 @@ public partial interface IDeploymentsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> ExportTemplateAtScopeWithHttpMessagesAsync(string scope, string deploymentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> ExportTemplateAtScopeWithHttpMessagesAsync(string scope, string deploymentName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Get all the deployments at the given scope. /// + /// + /// Get all the deployments at the given scope. + /// + /// + /// + /// /// /// The resource scope. /// - /// - /// OData parameters to apply to the operation. - /// /// /// The headers that will be added to request. /// @@ -241,23 +242,28 @@ public partial interface IDeploymentsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListAtScopeWithHttpMessagesAsync(string scope, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListAtScopeWithHttpMessagesAsync(string scope, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Deletes a deployment from the deployment history. + /// A template deployment that is currently running cannot be deleted. Deleting + /// a template deployment removes the associated deployment operations. This is + /// an asynchronous operation that returns a status of 202 until the template + /// deployment is successfully deleted. The Location response header contains + /// the URI that is used to obtain the status of the process. While the process + /// is running, a call to the URI in the Location header returns a status of + /// 202. When the process finishes, the URI in the Location header returns a + /// status of 204 on success. If the asynchronous request failed, the URI in + /// the Location header returns an error-level status code. /// /// - /// A template deployment that is currently running cannot be deleted. - /// Deleting a template deployment removes the associated deployment - /// operations. This is an asynchronous operation that returns a status - /// of 202 until the template deployment is successfully deleted. The - /// Location response header contains the URI that is used to obtain - /// the status of the process. While the process is running, a call to - /// the URI in the Location header returns a status of 202. When the - /// process finishes, the URI in the Location header returns a status - /// of 204 on success. If the asynchronous request failed, the URI in + /// A template deployment that is currently running cannot be deleted. Deleting + /// a template deployment removes the associated deployment operations. This is + /// an asynchronous operation that returns a status of 202 until the template + /// deployment is successfully deleted. The Location response header contains + /// the URI that is used to obtain the status of the process. While the process + /// is running, a call to the URI in the Location header returns a status of + /// 202. When the process finishes, the URI in the Location header returns a + /// status of 204 on success. If the asynchronous request failed, the URI in /// the Location header returns an error-level status code. /// /// @@ -272,13 +278,14 @@ public partial interface IDeploymentsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteAtTenantScopeWithHttpMessagesAsync(string deploymentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteAtTenantScopeWithHttpMessagesAsync(string deploymentName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Checks whether the deployment exists. /// + /// + /// Checks whether the deployment exists. + /// /// /// The name of the deployment. /// @@ -291,16 +298,15 @@ public partial interface IDeploymentsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task> CheckExistenceAtTenantScopeWithHttpMessagesAsync(string deploymentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CheckExistenceAtTenantScopeWithHttpMessagesAsync(string deploymentName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Deploys resources at tenant scope. + /// You can provide the template and parameters directly in the request or link + /// to JSON files. /// /// - /// You can provide the template and parameters directly in the request - /// or link to JSON files. + /// You can provide the template and parameters directly in the request or link + /// to JSON files. /// /// /// The name of the deployment. @@ -320,13 +326,14 @@ public partial interface IDeploymentsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateAtTenantScopeWithHttpMessagesAsync(string deploymentName, ScopedDeployment parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateAtTenantScopeWithHttpMessagesAsync(string deploymentName, ScopedDeployment parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets a deployment. /// + /// + /// Gets a deployment. + /// /// /// The name of the deployment. /// @@ -342,19 +349,19 @@ public partial interface IDeploymentsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetAtTenantScopeWithHttpMessagesAsync(string deploymentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetAtTenantScopeWithHttpMessagesAsync(string deploymentName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Cancels a currently running template deployment. + /// You can cancel a deployment only if the provisioningState is Accepted or + /// Running. After the deployment is canceled, the provisioningState is set to + /// Canceled. Canceling a template deployment stops the currently running + /// template deployment and leaves the resources partially deployed. /// /// - /// You can cancel a deployment only if the provisioningState is - /// Accepted or Running. After the deployment is canceled, the - /// provisioningState is set to Canceled. Canceling a template - /// deployment stops the currently running template deployment and - /// leaves the resources partially deployed. + /// You can cancel a deployment only if the provisioningState is Accepted or + /// Running. After the deployment is canceled, the provisioningState is set to + /// Canceled. Canceling a template deployment stops the currently running + /// template deployment and leaves the resources partially deployed. /// /// /// The name of the deployment. @@ -368,14 +375,16 @@ public partial interface IDeploymentsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task CancelAtTenantScopeWithHttpMessagesAsync(string deploymentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task CancelAtTenantScopeWithHttpMessagesAsync(string deploymentName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Validates whether the specified template is syntactically correct - /// and will be accepted by Azure Resource Manager.. + /// Validates whether the specified template is syntactically correct and will + /// be accepted by Azure Resource Manager.. /// + /// + /// Validates whether the specified template is syntactically correct and will + /// be accepted by Azure Resource Manager.. + /// /// /// The name of the deployment. /// @@ -394,14 +403,16 @@ public partial interface IDeploymentsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> ValidateAtTenantScopeWithHttpMessagesAsync(string deploymentName, ScopedDeployment parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> ValidateAtTenantScopeWithHttpMessagesAsync(string deploymentName, ScopedDeployment parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Returns changes that will be made by the deployment if executed at - /// the scope of the tenant group. + /// Returns changes that will be made by the deployment if executed at the + /// scope of the tenant group. /// + /// + /// Returns changes that will be made by the deployment if executed at the + /// scope of the tenant group. + /// /// /// The name of the deployment. /// @@ -420,13 +431,14 @@ public partial interface IDeploymentsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> WhatIfAtTenantScopeWithHttpMessagesAsync(string deploymentName, ScopedDeploymentWhatIf parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> WhatIfAtTenantScopeWithHttpMessagesAsync(string deploymentName, ScopedDeploymentWhatIf parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Exports the template used for specified deployment. /// + /// + /// Exports the template used for specified deployment. + /// /// /// The name of the deployment. /// @@ -442,15 +454,16 @@ public partial interface IDeploymentsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> ExportTemplateAtTenantScopeWithHttpMessagesAsync(string deploymentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> ExportTemplateAtTenantScopeWithHttpMessagesAsync(string deploymentName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Get all the deployments at the tenant scope. /// + /// + /// Get all the deployments at the tenant scope. + /// /// - /// OData parameters to apply to the operation. + /// /// /// /// The headers that will be added to request. @@ -464,23 +477,28 @@ public partial interface IDeploymentsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListAtTenantScopeWithHttpMessagesAsync(ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListAtTenantScopeWithHttpMessagesAsync(Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Deletes a deployment from the deployment history. + /// A template deployment that is currently running cannot be deleted. Deleting + /// a template deployment removes the associated deployment operations. This is + /// an asynchronous operation that returns a status of 202 until the template + /// deployment is successfully deleted. The Location response header contains + /// the URI that is used to obtain the status of the process. While the process + /// is running, a call to the URI in the Location header returns a status of + /// 202. When the process finishes, the URI in the Location header returns a + /// status of 204 on success. If the asynchronous request failed, the URI in + /// the Location header returns an error-level status code. /// /// - /// A template deployment that is currently running cannot be deleted. - /// Deleting a template deployment removes the associated deployment - /// operations. This is an asynchronous operation that returns a status - /// of 202 until the template deployment is successfully deleted. The - /// Location response header contains the URI that is used to obtain - /// the status of the process. While the process is running, a call to - /// the URI in the Location header returns a status of 202. When the - /// process finishes, the URI in the Location header returns a status - /// of 204 on success. If the asynchronous request failed, the URI in + /// A template deployment that is currently running cannot be deleted. Deleting + /// a template deployment removes the associated deployment operations. This is + /// an asynchronous operation that returns a status of 202 until the template + /// deployment is successfully deleted. The Location response header contains + /// the URI that is used to obtain the status of the process. While the process + /// is running, a call to the URI in the Location header returns a status of + /// 202. When the process finishes, the URI in the Location header returns a + /// status of 204 on success. If the asynchronous request failed, the URI in /// the Location header returns an error-level status code. /// /// @@ -498,13 +516,14 @@ public partial interface IDeploymentsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteAtManagementGroupScopeWithHttpMessagesAsync(string groupId, string deploymentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteAtManagementGroupScopeWithHttpMessagesAsync(string groupId, string deploymentName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Checks whether the deployment exists. /// + /// + /// Checks whether the deployment exists. + /// /// /// The management group ID. /// @@ -520,16 +539,15 @@ public partial interface IDeploymentsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task> CheckExistenceAtManagementGroupScopeWithHttpMessagesAsync(string groupId, string deploymentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CheckExistenceAtManagementGroupScopeWithHttpMessagesAsync(string groupId, string deploymentName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Deploys resources at management group scope. + /// You can provide the template and parameters directly in the request or link + /// to JSON files. /// /// - /// You can provide the template and parameters directly in the request - /// or link to JSON files. + /// You can provide the template and parameters directly in the request or link + /// to JSON files. /// /// /// The management group ID. @@ -552,13 +570,14 @@ public partial interface IDeploymentsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateAtManagementGroupScopeWithHttpMessagesAsync(string groupId, string deploymentName, ScopedDeployment parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateAtManagementGroupScopeWithHttpMessagesAsync(string groupId, string deploymentName, ScopedDeployment parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets a deployment. /// + /// + /// Gets a deployment. + /// /// /// The management group ID. /// @@ -577,19 +596,19 @@ public partial interface IDeploymentsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetAtManagementGroupScopeWithHttpMessagesAsync(string groupId, string deploymentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetAtManagementGroupScopeWithHttpMessagesAsync(string groupId, string deploymentName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Cancels a currently running template deployment. + /// You can cancel a deployment only if the provisioningState is Accepted or + /// Running. After the deployment is canceled, the provisioningState is set to + /// Canceled. Canceling a template deployment stops the currently running + /// template deployment and leaves the resources partially deployed. /// /// - /// You can cancel a deployment only if the provisioningState is - /// Accepted or Running. After the deployment is canceled, the - /// provisioningState is set to Canceled. Canceling a template - /// deployment stops the currently running template deployment and - /// leaves the resources partially deployed. + /// You can cancel a deployment only if the provisioningState is Accepted or + /// Running. After the deployment is canceled, the provisioningState is set to + /// Canceled. Canceling a template deployment stops the currently running + /// template deployment and leaves the resources partially deployed. /// /// /// The management group ID. @@ -606,14 +625,16 @@ public partial interface IDeploymentsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task CancelAtManagementGroupScopeWithHttpMessagesAsync(string groupId, string deploymentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task CancelAtManagementGroupScopeWithHttpMessagesAsync(string groupId, string deploymentName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Validates whether the specified template is syntactically correct - /// and will be accepted by Azure Resource Manager.. + /// Validates whether the specified template is syntactically correct and will + /// be accepted by Azure Resource Manager.. /// + /// + /// Validates whether the specified template is syntactically correct and will + /// be accepted by Azure Resource Manager.. + /// /// /// The management group ID. /// @@ -635,14 +656,16 @@ public partial interface IDeploymentsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> ValidateAtManagementGroupScopeWithHttpMessagesAsync(string groupId, string deploymentName, ScopedDeployment parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> ValidateAtManagementGroupScopeWithHttpMessagesAsync(string groupId, string deploymentName, ScopedDeployment parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Returns changes that will be made by the deployment if executed at - /// the scope of the management group. + /// Returns changes that will be made by the deployment if executed at the + /// scope of the management group. /// + /// + /// Returns changes that will be made by the deployment if executed at the + /// scope of the management group. + /// /// /// The management group ID. /// @@ -664,13 +687,14 @@ public partial interface IDeploymentsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> WhatIfAtManagementGroupScopeWithHttpMessagesAsync(string groupId, string deploymentName, ScopedDeploymentWhatIf parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> WhatIfAtManagementGroupScopeWithHttpMessagesAsync(string groupId, string deploymentName, ScopedDeploymentWhatIf parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Exports the template used for specified deployment. /// + /// + /// Exports the template used for specified deployment. + /// /// /// The management group ID. /// @@ -689,19 +713,20 @@ public partial interface IDeploymentsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> ExportTemplateAtManagementGroupScopeWithHttpMessagesAsync(string groupId, string deploymentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> ExportTemplateAtManagementGroupScopeWithHttpMessagesAsync(string groupId, string deploymentName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Get all the deployments for a management group. /// + /// + /// Get all the deployments for a management group. + /// + /// + /// + /// /// /// The management group ID. /// - /// - /// OData parameters to apply to the operation. - /// /// /// The headers that will be added to request. /// @@ -714,23 +739,28 @@ public partial interface IDeploymentsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListAtManagementGroupScopeWithHttpMessagesAsync(string groupId, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListAtManagementGroupScopeWithHttpMessagesAsync(string groupId, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Deletes a deployment from the deployment history. + /// A template deployment that is currently running cannot be deleted. Deleting + /// a template deployment removes the associated deployment operations. This is + /// an asynchronous operation that returns a status of 202 until the template + /// deployment is successfully deleted. The Location response header contains + /// the URI that is used to obtain the status of the process. While the process + /// is running, a call to the URI in the Location header returns a status of + /// 202. When the process finishes, the URI in the Location header returns a + /// status of 204 on success. If the asynchronous request failed, the URI in + /// the Location header returns an error-level status code. /// /// - /// A template deployment that is currently running cannot be deleted. - /// Deleting a template deployment removes the associated deployment - /// operations. This is an asynchronous operation that returns a status - /// of 202 until the template deployment is successfully deleted. The - /// Location response header contains the URI that is used to obtain - /// the status of the process. While the process is running, a call to - /// the URI in the Location header returns a status of 202. When the - /// process finishes, the URI in the Location header returns a status - /// of 204 on success. If the asynchronous request failed, the URI in + /// A template deployment that is currently running cannot be deleted. Deleting + /// a template deployment removes the associated deployment operations. This is + /// an asynchronous operation that returns a status of 202 until the template + /// deployment is successfully deleted. The Location response header contains + /// the URI that is used to obtain the status of the process. While the process + /// is running, a call to the URI in the Location header returns a status of + /// 202. When the process finishes, the URI in the Location header returns a + /// status of 204 on success. If the asynchronous request failed, the URI in /// the Location header returns an error-level status code. /// /// @@ -745,13 +775,14 @@ public partial interface IDeploymentsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteAtSubscriptionScopeWithHttpMessagesAsync(string deploymentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteAtSubscriptionScopeWithHttpMessagesAsync(string deploymentName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Checks whether the deployment exists. /// + /// + /// Checks whether the deployment exists. + /// /// /// The name of the deployment. /// @@ -764,16 +795,15 @@ public partial interface IDeploymentsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task> CheckExistenceAtSubscriptionScopeWithHttpMessagesAsync(string deploymentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CheckExistenceAtSubscriptionScopeWithHttpMessagesAsync(string deploymentName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Deploys resources at subscription scope. + /// You can provide the template and parameters directly in the request or link + /// to JSON files. /// /// - /// You can provide the template and parameters directly in the request - /// or link to JSON files. + /// You can provide the template and parameters directly in the request or link + /// to JSON files. /// /// /// The name of the deployment. @@ -793,13 +823,14 @@ public partial interface IDeploymentsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateAtSubscriptionScopeWithHttpMessagesAsync(string deploymentName, Deployment parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateAtSubscriptionScopeWithHttpMessagesAsync(string deploymentName, Deployment parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets a deployment. /// + /// + /// Gets a deployment. + /// /// /// The name of the deployment. /// @@ -815,19 +846,19 @@ public partial interface IDeploymentsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetAtSubscriptionScopeWithHttpMessagesAsync(string deploymentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetAtSubscriptionScopeWithHttpMessagesAsync(string deploymentName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Cancels a currently running template deployment. + /// You can cancel a deployment only if the provisioningState is Accepted or + /// Running. After the deployment is canceled, the provisioningState is set to + /// Canceled. Canceling a template deployment stops the currently running + /// template deployment and leaves the resources partially deployed. /// /// - /// You can cancel a deployment only if the provisioningState is - /// Accepted or Running. After the deployment is canceled, the - /// provisioningState is set to Canceled. Canceling a template - /// deployment stops the currently running template deployment and - /// leaves the resources partially deployed. + /// You can cancel a deployment only if the provisioningState is Accepted or + /// Running. After the deployment is canceled, the provisioningState is set to + /// Canceled. Canceling a template deployment stops the currently running + /// template deployment and leaves the resources partially deployed. /// /// /// The name of the deployment. @@ -841,14 +872,16 @@ public partial interface IDeploymentsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task CancelAtSubscriptionScopeWithHttpMessagesAsync(string deploymentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task CancelAtSubscriptionScopeWithHttpMessagesAsync(string deploymentName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Validates whether the specified template is syntactically correct - /// and will be accepted by Azure Resource Manager.. + /// Validates whether the specified template is syntactically correct and will + /// be accepted by Azure Resource Manager.. /// + /// + /// Validates whether the specified template is syntactically correct and will + /// be accepted by Azure Resource Manager.. + /// /// /// The name of the deployment. /// @@ -867,14 +900,16 @@ public partial interface IDeploymentsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> ValidateAtSubscriptionScopeWithHttpMessagesAsync(string deploymentName, Deployment parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> ValidateAtSubscriptionScopeWithHttpMessagesAsync(string deploymentName, Deployment parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Returns changes that will be made by the deployment if executed at - /// the scope of the subscription. + /// Returns changes that will be made by the deployment if executed at the + /// scope of the subscription. /// + /// + /// Returns changes that will be made by the deployment if executed at the + /// scope of the subscription. + /// /// /// The name of the deployment. /// @@ -893,13 +928,14 @@ public partial interface IDeploymentsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> WhatIfAtSubscriptionScopeWithHttpMessagesAsync(string deploymentName, DeploymentWhatIf parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> WhatIfAtSubscriptionScopeWithHttpMessagesAsync(string deploymentName, DeploymentWhatIf parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Exports the template used for specified deployment. /// + /// + /// Exports the template used for specified deployment. + /// /// /// The name of the deployment. /// @@ -915,15 +951,16 @@ public partial interface IDeploymentsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> ExportTemplateAtSubscriptionScopeWithHttpMessagesAsync(string deploymentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> ExportTemplateAtSubscriptionScopeWithHttpMessagesAsync(string deploymentName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Get all the deployments for a subscription. /// + /// + /// Get all the deployments for a subscription. + /// /// - /// OData parameters to apply to the operation. + /// /// /// /// The headers that will be added to request. @@ -937,30 +974,35 @@ public partial interface IDeploymentsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListAtSubscriptionScopeWithHttpMessagesAsync(ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListAtSubscriptionScopeWithHttpMessagesAsync(Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Deletes a deployment from the deployment history. + /// A template deployment that is currently running cannot be deleted. Deleting + /// a template deployment removes the associated deployment operations. + /// Deleting a template deployment does not affect the state of the resource + /// group. This is an asynchronous operation that returns a status of 202 until + /// the template deployment is successfully deleted. The Location response + /// header contains the URI that is used to obtain the status of the process. + /// While the process is running, a call to the URI in the Location header + /// returns a status of 202. When the process finishes, the URI in the Location + /// header returns a status of 204 on success. If the asynchronous request + /// failed, the URI in the Location header returns an error-level status code. /// /// - /// A template deployment that is currently running cannot be deleted. - /// Deleting a template deployment removes the associated deployment - /// operations. Deleting a template deployment does not affect the - /// state of the resource group. This is an asynchronous operation that - /// returns a status of 202 until the template deployment is - /// successfully deleted. The Location response header contains the URI - /// that is used to obtain the status of the process. While the process - /// is running, a call to the URI in the Location header returns a - /// status of 202. When the process finishes, the URI in the Location - /// header returns a status of 204 on success. If the asynchronous - /// request failed, the URI in the Location header returns an - /// error-level status code. + /// A template deployment that is currently running cannot be deleted. Deleting + /// a template deployment removes the associated deployment operations. + /// Deleting a template deployment does not affect the state of the resource + /// group. This is an asynchronous operation that returns a status of 202 until + /// the template deployment is successfully deleted. The Location response + /// header contains the URI that is used to obtain the status of the process. + /// While the process is running, a call to the URI in the Location header + /// returns a status of 202. When the process finishes, the URI in the Location + /// header returns a status of 204 on success. If the asynchronous request + /// failed, the URI in the Location header returns an error-level status code. /// /// - /// The name of the resource group with the deployment to delete. The - /// name is case insensitive. + /// The name of the resource group with the deployment to delete. The name is + /// case insensitive. /// /// /// The name of the deployment. @@ -974,16 +1016,17 @@ public partial interface IDeploymentsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string deploymentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string deploymentName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Checks whether the deployment exists. /// + /// + /// Checks whether the deployment exists. + /// /// - /// The name of the resource group with the deployment to check. The - /// name is case insensitive. + /// The name of the resource group with the deployment to check. The name is + /// case insensitive. /// /// /// The name of the deployment. @@ -997,20 +1040,19 @@ public partial interface IDeploymentsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task> CheckExistenceWithHttpMessagesAsync(string resourceGroupName, string deploymentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CheckExistenceWithHttpMessagesAsync(string resourceGroupName, string deploymentName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Deploys resources to a resource group. + /// You can provide the template and parameters directly in the request or link + /// to JSON files. /// /// - /// You can provide the template and parameters directly in the request - /// or link to JSON files. + /// You can provide the template and parameters directly in the request or link + /// to JSON files. /// /// - /// The name of the resource group to deploy the resources to. The name - /// is case insensitive. The resource group must already exist. + /// The name of the resource group to deploy the resources to. The name is case + /// insensitive. The resource group must already exist. /// /// /// The name of the deployment. @@ -1030,13 +1072,14 @@ public partial interface IDeploymentsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string deploymentName, Deployment parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string deploymentName, Deployment parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets a deployment. /// + /// + /// Gets a deployment. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -1055,19 +1098,19 @@ public partial interface IDeploymentsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string deploymentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string deploymentName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Cancels a currently running template deployment. + /// You can cancel a deployment only if the provisioningState is Accepted or + /// Running. After the deployment is canceled, the provisioningState is set to + /// Canceled. Canceling a template deployment stops the currently running + /// template deployment and leaves the resource group partially deployed. /// /// - /// You can cancel a deployment only if the provisioningState is - /// Accepted or Running. After the deployment is canceled, the - /// provisioningState is set to Canceled. Canceling a template - /// deployment stops the currently running template deployment and - /// leaves the resource group partially deployed. + /// You can cancel a deployment only if the provisioningState is Accepted or + /// Running. After the deployment is canceled, the provisioningState is set to + /// Canceled. Canceling a template deployment stops the currently running + /// template deployment and leaves the resource group partially deployed. /// /// /// The name of the resource group. The name is case insensitive. @@ -1084,17 +1127,19 @@ public partial interface IDeploymentsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task CancelWithHttpMessagesAsync(string resourceGroupName, string deploymentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task CancelWithHttpMessagesAsync(string resourceGroupName, string deploymentName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Validates whether the specified template is syntactically correct - /// and will be accepted by Azure Resource Manager.. + /// Validates whether the specified template is syntactically correct and will + /// be accepted by Azure Resource Manager.. /// + /// + /// Validates whether the specified template is syntactically correct and will + /// be accepted by Azure Resource Manager.. + /// /// - /// The name of the resource group the template will be deployed to. - /// The name is case insensitive. + /// The name of the resource group the template will be deployed to. The name + /// is case insensitive. /// /// /// The name of the deployment. @@ -1114,17 +1159,19 @@ public partial interface IDeploymentsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> ValidateWithHttpMessagesAsync(string resourceGroupName, string deploymentName, Deployment parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> ValidateWithHttpMessagesAsync(string resourceGroupName, string deploymentName, Deployment parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Returns changes that will be made by the deployment if executed at - /// the scope of the resource group. + /// Returns changes that will be made by the deployment if executed at the + /// scope of the resource group. /// + /// + /// Returns changes that will be made by the deployment if executed at the + /// scope of the resource group. + /// /// - /// The name of the resource group the template will be deployed to. - /// The name is case insensitive. + /// The name of the resource group the template will be deployed to. The name + /// is case insensitive. /// /// /// The name of the deployment. @@ -1144,13 +1191,14 @@ public partial interface IDeploymentsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> WhatIfWithHttpMessagesAsync(string resourceGroupName, string deploymentName, DeploymentWhatIf parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> WhatIfWithHttpMessagesAsync(string resourceGroupName, string deploymentName, DeploymentWhatIf parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Exports the template used for specified deployment. /// + /// + /// Exports the template used for specified deployment. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -1169,19 +1217,20 @@ public partial interface IDeploymentsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> ExportTemplateWithHttpMessagesAsync(string resourceGroupName, string deploymentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> ExportTemplateWithHttpMessagesAsync(string resourceGroupName, string deploymentName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Get all the deployments for a resource group. /// - /// - /// The name of the resource group with the deployments to get. The - /// name is case insensitive. - /// + /// + /// Get all the deployments for a resource group. + /// /// - /// OData parameters to apply to the operation. + /// + /// + /// + /// The name of the resource group with the deployments to get. The name is + /// case insensitive. /// /// /// The headers that will be added to request. @@ -1195,13 +1244,14 @@ public partial interface IDeploymentsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Calculate the hash of the given template. /// + /// + /// Calculate the hash of the given template. + /// /// /// The template provided to calculate hash. /// @@ -1217,23 +1267,28 @@ public partial interface IDeploymentsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CalculateTemplateHashWithHttpMessagesAsync(object template, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CalculateTemplateHashWithHttpMessagesAsync(object template, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Deletes a deployment from the deployment history. + /// A template deployment that is currently running cannot be deleted. Deleting + /// a template deployment removes the associated deployment operations. This is + /// an asynchronous operation that returns a status of 202 until the template + /// deployment is successfully deleted. The Location response header contains + /// the URI that is used to obtain the status of the process. While the process + /// is running, a call to the URI in the Location header returns a status of + /// 202. When the process finishes, the URI in the Location header returns a + /// status of 204 on success. If the asynchronous request failed, the URI in + /// the Location header returns an error-level status code. /// /// - /// A template deployment that is currently running cannot be deleted. - /// Deleting a template deployment removes the associated deployment - /// operations. This is an asynchronous operation that returns a status - /// of 202 until the template deployment is successfully deleted. The - /// Location response header contains the URI that is used to obtain - /// the status of the process. While the process is running, a call to - /// the URI in the Location header returns a status of 202. When the - /// process finishes, the URI in the Location header returns a status - /// of 204 on success. If the asynchronous request failed, the URI in + /// A template deployment that is currently running cannot be deleted. Deleting + /// a template deployment removes the associated deployment operations. This is + /// an asynchronous operation that returns a status of 202 until the template + /// deployment is successfully deleted. The Location response header contains + /// the URI that is used to obtain the status of the process. While the process + /// is running, a call to the URI in the Location header returns a status of + /// 202. When the process finishes, the URI in the Location header returns a + /// status of 204 on success. If the asynchronous request failed, the URI in /// the Location header returns an error-level status code. /// /// @@ -1251,16 +1306,15 @@ public partial interface IDeploymentsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteAtScopeWithHttpMessagesAsync(string scope, string deploymentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteAtScopeWithHttpMessagesAsync(string scope, string deploymentName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Deploys resources at a given scope. + /// You can provide the template and parameters directly in the request or link + /// to JSON files. /// /// - /// You can provide the template and parameters directly in the request - /// or link to JSON files. + /// You can provide the template and parameters directly in the request or link + /// to JSON files. /// /// /// The resource scope. @@ -1283,14 +1337,16 @@ public partial interface IDeploymentsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateAtScopeWithHttpMessagesAsync(string scope, string deploymentName, Deployment parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateAtScopeWithHttpMessagesAsync(string scope, string deploymentName, Deployment parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Validates whether the specified template is syntactically correct - /// and will be accepted by Azure Resource Manager.. + /// Validates whether the specified template is syntactically correct and will + /// be accepted by Azure Resource Manager.. /// + /// + /// Validates whether the specified template is syntactically correct and will + /// be accepted by Azure Resource Manager.. + /// /// /// The resource scope. /// @@ -1312,23 +1368,28 @@ public partial interface IDeploymentsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginValidateAtScopeWithHttpMessagesAsync(string scope, string deploymentName, Deployment parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginValidateAtScopeWithHttpMessagesAsync(string scope, string deploymentName, Deployment parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Deletes a deployment from the deployment history. + /// A template deployment that is currently running cannot be deleted. Deleting + /// a template deployment removes the associated deployment operations. This is + /// an asynchronous operation that returns a status of 202 until the template + /// deployment is successfully deleted. The Location response header contains + /// the URI that is used to obtain the status of the process. While the process + /// is running, a call to the URI in the Location header returns a status of + /// 202. When the process finishes, the URI in the Location header returns a + /// status of 204 on success. If the asynchronous request failed, the URI in + /// the Location header returns an error-level status code. /// /// - /// A template deployment that is currently running cannot be deleted. - /// Deleting a template deployment removes the associated deployment - /// operations. This is an asynchronous operation that returns a status - /// of 202 until the template deployment is successfully deleted. The - /// Location response header contains the URI that is used to obtain - /// the status of the process. While the process is running, a call to - /// the URI in the Location header returns a status of 202. When the - /// process finishes, the URI in the Location header returns a status - /// of 204 on success. If the asynchronous request failed, the URI in + /// A template deployment that is currently running cannot be deleted. Deleting + /// a template deployment removes the associated deployment operations. This is + /// an asynchronous operation that returns a status of 202 until the template + /// deployment is successfully deleted. The Location response header contains + /// the URI that is used to obtain the status of the process. While the process + /// is running, a call to the URI in the Location header returns a status of + /// 202. When the process finishes, the URI in the Location header returns a + /// status of 204 on success. If the asynchronous request failed, the URI in /// the Location header returns an error-level status code. /// /// @@ -1343,16 +1404,15 @@ public partial interface IDeploymentsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteAtTenantScopeWithHttpMessagesAsync(string deploymentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteAtTenantScopeWithHttpMessagesAsync(string deploymentName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Deploys resources at tenant scope. + /// You can provide the template and parameters directly in the request or link + /// to JSON files. /// /// - /// You can provide the template and parameters directly in the request - /// or link to JSON files. + /// You can provide the template and parameters directly in the request or link + /// to JSON files. /// /// /// The name of the deployment. @@ -1372,14 +1432,16 @@ public partial interface IDeploymentsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateAtTenantScopeWithHttpMessagesAsync(string deploymentName, ScopedDeployment parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateAtTenantScopeWithHttpMessagesAsync(string deploymentName, ScopedDeployment parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Validates whether the specified template is syntactically correct - /// and will be accepted by Azure Resource Manager.. + /// Validates whether the specified template is syntactically correct and will + /// be accepted by Azure Resource Manager.. /// + /// + /// Validates whether the specified template is syntactically correct and will + /// be accepted by Azure Resource Manager.. + /// /// /// The name of the deployment. /// @@ -1398,14 +1460,16 @@ public partial interface IDeploymentsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginValidateAtTenantScopeWithHttpMessagesAsync(string deploymentName, ScopedDeployment parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginValidateAtTenantScopeWithHttpMessagesAsync(string deploymentName, ScopedDeployment parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Returns changes that will be made by the deployment if executed at - /// the scope of the tenant group. + /// Returns changes that will be made by the deployment if executed at the + /// scope of the tenant group. /// + /// + /// Returns changes that will be made by the deployment if executed at the + /// scope of the tenant group. + /// /// /// The name of the deployment. /// @@ -1424,23 +1488,28 @@ public partial interface IDeploymentsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginWhatIfAtTenantScopeWithHttpMessagesAsync(string deploymentName, ScopedDeploymentWhatIf parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginWhatIfAtTenantScopeWithHttpMessagesAsync(string deploymentName, ScopedDeploymentWhatIf parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Deletes a deployment from the deployment history. + /// A template deployment that is currently running cannot be deleted. Deleting + /// a template deployment removes the associated deployment operations. This is + /// an asynchronous operation that returns a status of 202 until the template + /// deployment is successfully deleted. The Location response header contains + /// the URI that is used to obtain the status of the process. While the process + /// is running, a call to the URI in the Location header returns a status of + /// 202. When the process finishes, the URI in the Location header returns a + /// status of 204 on success. If the asynchronous request failed, the URI in + /// the Location header returns an error-level status code. /// /// - /// A template deployment that is currently running cannot be deleted. - /// Deleting a template deployment removes the associated deployment - /// operations. This is an asynchronous operation that returns a status - /// of 202 until the template deployment is successfully deleted. The - /// Location response header contains the URI that is used to obtain - /// the status of the process. While the process is running, a call to - /// the URI in the Location header returns a status of 202. When the - /// process finishes, the URI in the Location header returns a status - /// of 204 on success. If the asynchronous request failed, the URI in + /// A template deployment that is currently running cannot be deleted. Deleting + /// a template deployment removes the associated deployment operations. This is + /// an asynchronous operation that returns a status of 202 until the template + /// deployment is successfully deleted. The Location response header contains + /// the URI that is used to obtain the status of the process. While the process + /// is running, a call to the URI in the Location header returns a status of + /// 202. When the process finishes, the URI in the Location header returns a + /// status of 204 on success. If the asynchronous request failed, the URI in /// the Location header returns an error-level status code. /// /// @@ -1458,16 +1527,15 @@ public partial interface IDeploymentsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteAtManagementGroupScopeWithHttpMessagesAsync(string groupId, string deploymentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteAtManagementGroupScopeWithHttpMessagesAsync(string groupId, string deploymentName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Deploys resources at management group scope. + /// You can provide the template and parameters directly in the request or link + /// to JSON files. /// /// - /// You can provide the template and parameters directly in the request - /// or link to JSON files. + /// You can provide the template and parameters directly in the request or link + /// to JSON files. /// /// /// The management group ID. @@ -1490,14 +1558,16 @@ public partial interface IDeploymentsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateAtManagementGroupScopeWithHttpMessagesAsync(string groupId, string deploymentName, ScopedDeployment parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateAtManagementGroupScopeWithHttpMessagesAsync(string groupId, string deploymentName, ScopedDeployment parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Validates whether the specified template is syntactically correct - /// and will be accepted by Azure Resource Manager.. + /// Validates whether the specified template is syntactically correct and will + /// be accepted by Azure Resource Manager.. /// + /// + /// Validates whether the specified template is syntactically correct and will + /// be accepted by Azure Resource Manager.. + /// /// /// The management group ID. /// @@ -1519,14 +1589,16 @@ public partial interface IDeploymentsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginValidateAtManagementGroupScopeWithHttpMessagesAsync(string groupId, string deploymentName, ScopedDeployment parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginValidateAtManagementGroupScopeWithHttpMessagesAsync(string groupId, string deploymentName, ScopedDeployment parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Returns changes that will be made by the deployment if executed at - /// the scope of the management group. + /// Returns changes that will be made by the deployment if executed at the + /// scope of the management group. /// + /// + /// Returns changes that will be made by the deployment if executed at the + /// scope of the management group. + /// /// /// The management group ID. /// @@ -1548,23 +1620,28 @@ public partial interface IDeploymentsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginWhatIfAtManagementGroupScopeWithHttpMessagesAsync(string groupId, string deploymentName, ScopedDeploymentWhatIf parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginWhatIfAtManagementGroupScopeWithHttpMessagesAsync(string groupId, string deploymentName, ScopedDeploymentWhatIf parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Deletes a deployment from the deployment history. + /// A template deployment that is currently running cannot be deleted. Deleting + /// a template deployment removes the associated deployment operations. This is + /// an asynchronous operation that returns a status of 202 until the template + /// deployment is successfully deleted. The Location response header contains + /// the URI that is used to obtain the status of the process. While the process + /// is running, a call to the URI in the Location header returns a status of + /// 202. When the process finishes, the URI in the Location header returns a + /// status of 204 on success. If the asynchronous request failed, the URI in + /// the Location header returns an error-level status code. /// /// - /// A template deployment that is currently running cannot be deleted. - /// Deleting a template deployment removes the associated deployment - /// operations. This is an asynchronous operation that returns a status - /// of 202 until the template deployment is successfully deleted. The - /// Location response header contains the URI that is used to obtain - /// the status of the process. While the process is running, a call to - /// the URI in the Location header returns a status of 202. When the - /// process finishes, the URI in the Location header returns a status - /// of 204 on success. If the asynchronous request failed, the URI in + /// A template deployment that is currently running cannot be deleted. Deleting + /// a template deployment removes the associated deployment operations. This is + /// an asynchronous operation that returns a status of 202 until the template + /// deployment is successfully deleted. The Location response header contains + /// the URI that is used to obtain the status of the process. While the process + /// is running, a call to the URI in the Location header returns a status of + /// 202. When the process finishes, the URI in the Location header returns a + /// status of 204 on success. If the asynchronous request failed, the URI in /// the Location header returns an error-level status code. /// /// @@ -1579,16 +1656,15 @@ public partial interface IDeploymentsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteAtSubscriptionScopeWithHttpMessagesAsync(string deploymentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteAtSubscriptionScopeWithHttpMessagesAsync(string deploymentName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Deploys resources at subscription scope. + /// You can provide the template and parameters directly in the request or link + /// to JSON files. /// /// - /// You can provide the template and parameters directly in the request - /// or link to JSON files. + /// You can provide the template and parameters directly in the request or link + /// to JSON files. /// /// /// The name of the deployment. @@ -1608,14 +1684,16 @@ public partial interface IDeploymentsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateAtSubscriptionScopeWithHttpMessagesAsync(string deploymentName, Deployment parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateAtSubscriptionScopeWithHttpMessagesAsync(string deploymentName, Deployment parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Validates whether the specified template is syntactically correct - /// and will be accepted by Azure Resource Manager.. + /// Validates whether the specified template is syntactically correct and will + /// be accepted by Azure Resource Manager.. /// + /// + /// Validates whether the specified template is syntactically correct and will + /// be accepted by Azure Resource Manager.. + /// /// /// The name of the deployment. /// @@ -1634,14 +1712,16 @@ public partial interface IDeploymentsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginValidateAtSubscriptionScopeWithHttpMessagesAsync(string deploymentName, Deployment parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginValidateAtSubscriptionScopeWithHttpMessagesAsync(string deploymentName, Deployment parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Returns changes that will be made by the deployment if executed at - /// the scope of the subscription. + /// Returns changes that will be made by the deployment if executed at the + /// scope of the subscription. /// + /// + /// Returns changes that will be made by the deployment if executed at the + /// scope of the subscription. + /// /// /// The name of the deployment. /// @@ -1660,30 +1740,35 @@ public partial interface IDeploymentsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginWhatIfAtSubscriptionScopeWithHttpMessagesAsync(string deploymentName, DeploymentWhatIf parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginWhatIfAtSubscriptionScopeWithHttpMessagesAsync(string deploymentName, DeploymentWhatIf parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Deletes a deployment from the deployment history. + /// A template deployment that is currently running cannot be deleted. Deleting + /// a template deployment removes the associated deployment operations. + /// Deleting a template deployment does not affect the state of the resource + /// group. This is an asynchronous operation that returns a status of 202 until + /// the template deployment is successfully deleted. The Location response + /// header contains the URI that is used to obtain the status of the process. + /// While the process is running, a call to the URI in the Location header + /// returns a status of 202. When the process finishes, the URI in the Location + /// header returns a status of 204 on success. If the asynchronous request + /// failed, the URI in the Location header returns an error-level status code. /// /// - /// A template deployment that is currently running cannot be deleted. - /// Deleting a template deployment removes the associated deployment - /// operations. Deleting a template deployment does not affect the - /// state of the resource group. This is an asynchronous operation that - /// returns a status of 202 until the template deployment is - /// successfully deleted. The Location response header contains the URI - /// that is used to obtain the status of the process. While the process - /// is running, a call to the URI in the Location header returns a - /// status of 202. When the process finishes, the URI in the Location - /// header returns a status of 204 on success. If the asynchronous - /// request failed, the URI in the Location header returns an - /// error-level status code. + /// A template deployment that is currently running cannot be deleted. Deleting + /// a template deployment removes the associated deployment operations. + /// Deleting a template deployment does not affect the state of the resource + /// group. This is an asynchronous operation that returns a status of 202 until + /// the template deployment is successfully deleted. The Location response + /// header contains the URI that is used to obtain the status of the process. + /// While the process is running, a call to the URI in the Location header + /// returns a status of 202. When the process finishes, the URI in the Location + /// header returns a status of 204 on success. If the asynchronous request + /// failed, the URI in the Location header returns an error-level status code. /// /// - /// The name of the resource group with the deployment to delete. The - /// name is case insensitive. + /// The name of the resource group with the deployment to delete. The name is + /// case insensitive. /// /// /// The name of the deployment. @@ -1697,20 +1782,19 @@ public partial interface IDeploymentsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string deploymentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string deploymentName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Deploys resources to a resource group. + /// You can provide the template and parameters directly in the request or link + /// to JSON files. /// /// - /// You can provide the template and parameters directly in the request - /// or link to JSON files. + /// You can provide the template and parameters directly in the request or link + /// to JSON files. /// /// - /// The name of the resource group to deploy the resources to. The name - /// is case insensitive. The resource group must already exist. + /// The name of the resource group to deploy the resources to. The name is case + /// insensitive. The resource group must already exist. /// /// /// The name of the deployment. @@ -1730,17 +1814,19 @@ public partial interface IDeploymentsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string deploymentName, Deployment parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string deploymentName, Deployment parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Validates whether the specified template is syntactically correct - /// and will be accepted by Azure Resource Manager.. + /// Validates whether the specified template is syntactically correct and will + /// be accepted by Azure Resource Manager.. /// + /// + /// Validates whether the specified template is syntactically correct and will + /// be accepted by Azure Resource Manager.. + /// /// - /// The name of the resource group the template will be deployed to. - /// The name is case insensitive. + /// The name of the resource group the template will be deployed to. The name + /// is case insensitive. /// /// /// The name of the deployment. @@ -1760,17 +1846,19 @@ public partial interface IDeploymentsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginValidateWithHttpMessagesAsync(string resourceGroupName, string deploymentName, Deployment parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginValidateWithHttpMessagesAsync(string resourceGroupName, string deploymentName, Deployment parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Returns changes that will be made by the deployment if executed at - /// the scope of the resource group. + /// Returns changes that will be made by the deployment if executed at the + /// scope of the resource group. /// + /// + /// Returns changes that will be made by the deployment if executed at the + /// scope of the resource group. + /// /// - /// The name of the resource group the template will be deployed to. - /// The name is case insensitive. + /// The name of the resource group the template will be deployed to. The name + /// is case insensitive. /// /// /// The name of the deployment. @@ -1790,13 +1878,14 @@ public partial interface IDeploymentsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginWhatIfWithHttpMessagesAsync(string resourceGroupName, string deploymentName, DeploymentWhatIf parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginWhatIfWithHttpMessagesAsync(string resourceGroupName, string deploymentName, DeploymentWhatIf parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Get all the deployments at the given scope. /// + /// + /// Get all the deployments at the given scope. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -1812,13 +1901,14 @@ public partial interface IDeploymentsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListAtScopeNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListAtScopeNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Get all the deployments at the tenant scope. /// + /// + /// Get all the deployments at the tenant scope. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -1834,13 +1924,14 @@ public partial interface IDeploymentsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListAtTenantScopeNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListAtTenantScopeNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Get all the deployments for a management group. /// + /// + /// Get all the deployments for a management group. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -1856,13 +1947,14 @@ public partial interface IDeploymentsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListAtManagementGroupScopeNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListAtManagementGroupScopeNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Get all the deployments for a subscription. /// + /// + /// Get all the deployments for a subscription. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -1878,13 +1970,14 @@ public partial interface IDeploymentsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListAtSubscriptionScopeNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListAtSubscriptionScopeNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Get all the deployments for a resource group. /// + /// + /// Get all the deployments for a resource group. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -1900,9 +1993,7 @@ public partial interface IDeploymentsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Management.Sdk/Generated/IFeatureClient.cs b/src/Resources/Resources.Management.Sdk/Generated/IFeatureClient.cs new file mode 100644 index 000000000000..04733615088e --- /dev/null +++ b/src/Resources/Resources.Management.Sdk/Generated/IFeatureClient.cs @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Resources +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + + /// + /// Azure Feature Exposure Control (AFEC) provides a mechanism for the resource + /// providers to control feature exposure to users. Resource providers + /// typically use this mechanism to provide public/private preview for new + /// features prior to making them generally available. Users need to explicitly + /// register for AFEC features to get access to such functionality. + /// + public partial interface IFeatureClient : System.IDisposable + { + /// + /// The base URI of the service. + /// + System.Uri BaseUri { get; set; } + + /// + /// Gets or sets json serialization settings. + /// + Newtonsoft.Json.JsonSerializerSettings SerializationSettings { get; } + + /// + /// Gets or sets json deserialization settings. + /// + Newtonsoft.Json.JsonSerializerSettings DeserializationSettings { get; } + + /// + /// Credentials needed for the client to connect to Azure. + /// + Microsoft.Rest.ServiceClientCredentials Credentials { get;} + + + /// + /// The API version to use for this operation. + /// + string ApiVersion { get;} + + + /// + /// The Azure subscription ID. + /// + string SubscriptionId { get; set;} + + + /// + /// The preferred language for the response. + /// + string AcceptLanguage { get; set;} + + + /// + /// The retry timeout in seconds for Long Running Operations. Default + /// /// value is 30. + /// + int? LongRunningOperationRetryTimeout { get; set;} + + + /// + /// Whether a unique x-ms-client-request-id should be generated. When + /// /// set to true a unique x-ms-client-request-id value is generated and + /// /// included in each request. Default is true. + /// + bool? GenerateClientRequestId { get; set;} + + + /// + /// Gets the IFeaturesOperations + /// + IFeaturesOperations Features { get; } + + /// + /// Gets the ISubscriptionFeatureRegistrationsOperations + /// + ISubscriptionFeatureRegistrationsOperations SubscriptionFeatureRegistrations { get; } + + /// + /// Lists all of the available Microsoft.Features REST API operations. + /// + /// + /// Lists all of the available Microsoft.Features REST API operations. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + System.Threading.Tasks.Task>> ListOperationsWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Lists all of the available Microsoft.Features REST API operations. + /// + /// + /// Lists all of the available Microsoft.Features REST API operations. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + System.Threading.Tasks.Task>> ListOperationsNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + } +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/IFeaturesOperations.cs b/src/Resources/Resources.Management.Sdk/Generated/IFeaturesOperations.cs similarity index 56% rename from src/Resources/Resources.Sdk/Generated/IFeaturesOperations.cs rename to src/Resources/Resources.Management.Sdk/Generated/IFeaturesOperations.cs index fb88f183bd00..83d7fc2f8cfb 100644 --- a/src/Resources/Resources.Sdk/Generated/IFeaturesOperations.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/IFeaturesOperations.cs @@ -1,22 +1,12 @@ -// // 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 Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// FeaturesOperations operations. @@ -24,29 +14,35 @@ namespace Microsoft.Azure.Management.Resources public partial interface IFeaturesOperations { /// - /// Gets all the preview features that are available through AFEC for - /// the subscription. + /// Gets all the preview features that are available through AFEC for the + /// subscription. /// + /// + /// Gets all the preview features that are available through AFEC for the + /// subscription. + /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListAllWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Gets all the preview features in a provider namespace that are - /// available through AFEC for the subscription. + /// Gets all the preview features in a provider namespace that are available + /// through AFEC for the subscription. /// + /// + /// Gets all the preview features in a provider namespace that are available + /// through AFEC for the subscription. + /// /// /// The namespace of the resource provider for getting features. /// @@ -56,19 +52,20 @@ public partial interface IFeaturesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string resourceProviderNamespace, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceProviderNamespace, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets the preview feature with the specified name. /// + /// + /// Gets the preview feature with the specified name. + /// /// /// The resource provider namespace for the feature. /// @@ -81,19 +78,20 @@ public partial interface IFeaturesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceProviderNamespace, string featureName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceProviderNamespace, string featureName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Registers the preview feature for the subscription. /// + /// + /// Registers the preview feature for the subscription. + /// /// /// The namespace of the resource provider. /// @@ -106,19 +104,20 @@ public partial interface IFeaturesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> RegisterWithHttpMessagesAsync(string resourceProviderNamespace, string featureName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> RegisterWithHttpMessagesAsync(string resourceProviderNamespace, string featureName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Unregisters the preview feature for the subscription. /// + /// + /// Unregisters the preview feature for the subscription. + /// /// /// The namespace of the resource provider. /// @@ -131,20 +130,22 @@ public partial interface IFeaturesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> UnregisterWithHttpMessagesAsync(string resourceProviderNamespace, string featureName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> UnregisterWithHttpMessagesAsync(string resourceProviderNamespace, string featureName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Gets all the preview features that are available through AFEC for - /// the subscription. + /// Gets all the preview features that are available through AFEC for the + /// subscription. /// + /// + /// Gets all the preview features that are available through AFEC for the + /// subscription. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -154,20 +155,22 @@ public partial interface IFeaturesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Gets all the preview features in a provider namespace that are - /// available through AFEC for the subscription. + /// Gets all the preview features in a provider namespace that are available + /// through AFEC for the subscription. /// + /// + /// Gets all the preview features in a provider namespace that are available + /// through AFEC for the subscription. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -177,15 +180,13 @@ public partial interface IFeaturesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/IOperations.cs b/src/Resources/Resources.Management.Sdk/Generated/IOperations.cs similarity index 67% rename from src/Resources/Resources.Sdk/Generated/IOperations.cs rename to src/Resources/Resources.Management.Sdk/Generated/IOperations.cs index 8ad7414b9463..c7122a216a71 100644 --- a/src/Resources/Resources.Sdk/Generated/IOperations.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/IOperations.cs @@ -1,22 +1,12 @@ -// // 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 Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// Operations operations. @@ -26,6 +16,9 @@ public partial interface IOperations /// /// Lists all of the available Microsoft.Resources REST API operations. /// + /// + /// Lists all of the available Microsoft.Resources REST API operations. + /// /// /// The headers that will be added to request. /// @@ -38,13 +31,14 @@ public partial interface IOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists all of the available Microsoft.Resources REST API operations. /// + /// + /// Lists all of the available Microsoft.Resources REST API operations. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -60,9 +54,7 @@ public partial interface IOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/IPrivateLinkAssociationOperations.cs b/src/Resources/Resources.Management.Sdk/Generated/IPrivateLinkAssociationOperations.cs similarity index 65% rename from src/Resources/Resources.Sdk/Generated/IPrivateLinkAssociationOperations.cs rename to src/Resources/Resources.Management.Sdk/Generated/IPrivateLinkAssociationOperations.cs index 882a4281ee63..fd99598dd65c 100644 --- a/src/Resources/Resources.Sdk/Generated/IPrivateLinkAssociationOperations.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/IPrivateLinkAssociationOperations.cs @@ -1,22 +1,12 @@ -// // 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 Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// PrivateLinkAssociationOperations operations. @@ -26,6 +16,9 @@ public partial interface IPrivateLinkAssociationOperations /// /// Create a PrivateLinkAssociation /// + /// + /// Create a PrivateLinkAssociation + /// /// /// The management group ID. /// @@ -47,13 +40,14 @@ public partial interface IPrivateLinkAssociationOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> PutWithHttpMessagesAsync(string groupId, string plaId, PrivateLinkAssociationObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> PutWithHttpMessagesAsync(string groupId, string plaId, PrivateLinkAssociationObject parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Get a single private link association /// + /// + /// Get a single private link association + /// /// /// The management group ID. /// @@ -72,13 +66,14 @@ public partial interface IPrivateLinkAssociationOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string groupId, string plaId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string groupId, string plaId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Delete a PrivateLinkAssociation /// + /// + /// Delete a PrivateLinkAssociation + /// /// /// The management group ID. /// @@ -94,13 +89,14 @@ public partial interface IPrivateLinkAssociationOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string groupId, string plaId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string groupId, string plaId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Get a private link association for a management group scope /// + /// + /// Get a private link association for a management group scope + /// /// /// The management group ID. /// @@ -116,9 +112,7 @@ public partial interface IPrivateLinkAssociationOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> ListWithHttpMessagesAsync(string groupId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> ListWithHttpMessagesAsync(string groupId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/IProviderResourceTypesOperations.cs b/src/Resources/Resources.Management.Sdk/Generated/IProviderResourceTypesOperations.cs similarity index 64% rename from src/Resources/Resources.Sdk/Generated/IProviderResourceTypesOperations.cs rename to src/Resources/Resources.Management.Sdk/Generated/IProviderResourceTypesOperations.cs index 1a8f46c92b3f..ba3147a62f08 100644 --- a/src/Resources/Resources.Sdk/Generated/IProviderResourceTypesOperations.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/IProviderResourceTypesOperations.cs @@ -1,22 +1,12 @@ -// // 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 Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// ProviderResourceTypesOperations operations. @@ -26,13 +16,16 @@ public partial interface IProviderResourceTypesOperations /// /// List the resource types for a specified resource provider. /// + /// + /// List the resource types for a specified resource provider. + /// + /// + /// The $expand query parameter. For example, to include property aliases in + /// response, use $expand=resourceTypes/aliases. + /// /// /// The namespace of the resource provider. /// - /// - /// The $expand query parameter. For example, to include property - /// aliases in response, use $expand=resourceTypes/aliases. - /// /// /// The headers that will be added to request. /// @@ -45,9 +38,7 @@ public partial interface IProviderResourceTypesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> ListWithHttpMessagesAsync(string resourceProviderNamespace, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> ListWithHttpMessagesAsync(string resourceProviderNamespace, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/IProvidersOperations.cs b/src/Resources/Resources.Management.Sdk/Generated/IProvidersOperations.cs similarity index 59% rename from src/Resources/Resources.Sdk/Generated/IProvidersOperations.cs rename to src/Resources/Resources.Management.Sdk/Generated/IProvidersOperations.cs index 9142f5d838f3..799d4ea80d8e 100644 --- a/src/Resources/Resources.Sdk/Generated/IProvidersOperations.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/IProvidersOperations.cs @@ -1,22 +1,12 @@ -// // 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 Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// ProvidersOperations operations. @@ -26,6 +16,9 @@ public partial interface IProvidersOperations /// /// Unregisters a subscription from a resource provider. /// + /// + /// Unregisters a subscription from a resource provider. + /// /// /// The namespace of the resource provider to unregister. /// @@ -41,17 +34,22 @@ public partial interface IProvidersOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> UnregisterWithHttpMessagesAsync(string resourceProviderNamespace, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> UnregisterWithHttpMessagesAsync(string resourceProviderNamespace, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Registers a management group with a resource provider. Use this - /// operation to register a resource provider with resource types that - /// can be deployed at the management group scope. It does not - /// recursively register subscriptions within the management group. - /// Instead, you must register subscriptions individually. + /// Registers a management group with a resource provider. Use this operation + /// to register a resource provider with resource types that can be deployed at + /// the management group scope. It does not recursively register subscriptions + /// within the management group. Instead, you must register subscriptions + /// individually. /// + /// + /// Registers a management group with a resource provider. Use this operation + /// to register a resource provider with resource types that can be deployed at + /// the management group scope. It does not recursively register subscriptions + /// within the management group. Instead, you must register subscriptions + /// individually. + /// /// /// The namespace of the resource provider to register. /// @@ -67,13 +65,14 @@ public partial interface IProvidersOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task RegisterAtManagementGroupScopeWithHttpMessagesAsync(string resourceProviderNamespace, string groupId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task RegisterAtManagementGroupScopeWithHttpMessagesAsync(string resourceProviderNamespace, string groupId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Get the provider permissions. /// + /// + /// Get the provider permissions. + /// /// /// The namespace of the resource provider. /// @@ -89,13 +88,14 @@ public partial interface IProvidersOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> ProviderPermissionsWithHttpMessagesAsync(string resourceProviderNamespace, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> ProviderPermissionsWithHttpMessagesAsync(string resourceProviderNamespace, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Registers a subscription with a resource provider. /// + /// + /// Registers a subscription with a resource provider. + /// /// /// The namespace of the resource provider to register. /// @@ -114,17 +114,18 @@ public partial interface IProvidersOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> RegisterWithHttpMessagesAsync(string resourceProviderNamespace, ProviderRegistrationRequest properties = default(ProviderRegistrationRequest), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> RegisterWithHttpMessagesAsync(string resourceProviderNamespace, ProviderRegistrationRequest properties = default(ProviderRegistrationRequest), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all resource providers for a subscription. /// + /// + /// Gets all resource providers for a subscription. + /// /// /// The properties to include in the results. For example, use - /// &$expand=metadata in the query string to retrieve resource - /// provider metadata. To include property aliases in response, use + /// &$expand=metadata in the query string to retrieve resource provider + /// metadata. To include property aliases in response, use /// $expand=resourceTypes/aliases. /// /// @@ -139,17 +140,18 @@ public partial interface IProvidersOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all resource providers for the tenant. /// + /// + /// Gets all resource providers for the tenant. + /// /// /// The properties to include in the results. For example, use - /// &$expand=metadata in the query string to retrieve resource - /// provider metadata. To include property aliases in response, use + /// &$expand=metadata in the query string to retrieve resource provider + /// metadata. To include property aliases in response, use /// $expand=resourceTypes/aliases. /// /// @@ -164,20 +166,21 @@ public partial interface IProvidersOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListAtTenantScopeWithHttpMessagesAsync(string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListAtTenantScopeWithHttpMessagesAsync(string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets the specified resource provider. /// + /// + /// Gets the specified resource provider. + /// + /// + /// The $expand query parameter. For example, to include property aliases in + /// response, use $expand=resourceTypes/aliases. + /// /// /// The namespace of the resource provider. /// - /// - /// The $expand query parameter. For example, to include property - /// aliases in response, use $expand=resourceTypes/aliases. - /// /// /// The headers that will be added to request. /// @@ -190,20 +193,21 @@ public partial interface IProvidersOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceProviderNamespace, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceProviderNamespace, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets the specified resource provider at the tenant level. /// + /// + /// Gets the specified resource provider at the tenant level. + /// + /// + /// The $expand query parameter. For example, to include property aliases in + /// response, use $expand=resourceTypes/aliases. + /// /// /// The namespace of the resource provider. /// - /// - /// The $expand query parameter. For example, to include property - /// aliases in response, use $expand=resourceTypes/aliases. - /// /// /// The headers that will be added to request. /// @@ -216,13 +220,14 @@ public partial interface IProvidersOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetAtTenantScopeWithHttpMessagesAsync(string resourceProviderNamespace, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetAtTenantScopeWithHttpMessagesAsync(string resourceProviderNamespace, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all resource providers for a subscription. /// + /// + /// Gets all resource providers for a subscription. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -238,13 +243,14 @@ public partial interface IProvidersOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all resource providers for the tenant. /// + /// + /// Gets all resource providers for the tenant. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -260,9 +266,7 @@ public partial interface IProvidersOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListAtTenantScopeNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListAtTenantScopeNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/IResourceGroupsOperations.cs b/src/Resources/Resources.Management.Sdk/Generated/IResourceGroupsOperations.cs similarity index 58% rename from src/Resources/Resources.Sdk/Generated/IResourceGroupsOperations.cs rename to src/Resources/Resources.Management.Sdk/Generated/IResourceGroupsOperations.cs index f83f3d64fb02..c504eeeed6d7 100644 --- a/src/Resources/Resources.Sdk/Generated/IResourceGroupsOperations.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/IResourceGroupsOperations.cs @@ -1,23 +1,12 @@ -// // 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 Microsoft.Rest; using Microsoft.Rest.Azure; - using Microsoft.Rest.Azure.OData; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// ResourceGroupsOperations operations. @@ -27,9 +16,11 @@ public partial interface IResourceGroupsOperations /// /// Checks whether a resource group exists. /// + /// + /// Checks whether a resource group exists. + /// /// - /// The name of the resource group to check. The name is case - /// insensitive. + /// The name of the resource group to check. The name is case insensitive. /// /// /// The headers that will be added to request. @@ -40,17 +31,18 @@ public partial interface IResourceGroupsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task> CheckExistenceWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CheckExistenceWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Creates or updates a resource group. /// + /// + /// Creates or updates a resource group. + /// /// /// The name of the resource group to create or update. Can include - /// alphanumeric, underscore, parentheses, hyphen, period (except at - /// end), and Unicode characters that match the allowed characters. + /// alphanumeric, underscore, parentheses, hyphen, period (except at end), and + /// Unicode characters that match the allowed characters. /// /// /// Parameters supplied to the create or update a resource group. @@ -67,25 +59,24 @@ public partial interface IResourceGroupsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, ResourceGroup parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, ResourceGroup parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Deletes a resource group. + /// When you delete a resource group, all of its resources are also deleted. + /// Deleting a resource group deletes all of its template deployments and + /// currently stored operations. /// /// - /// When you delete a resource group, all of its resources are also - /// deleted. Deleting a resource group deletes all of its template - /// deployments and currently stored operations. + /// When you delete a resource group, all of its resources are also deleted. + /// Deleting a resource group deletes all of its template deployments and + /// currently stored operations. /// /// - /// The name of the resource group to delete. The name is case - /// insensitive. + /// The name of the resource group to delete. The name is case insensitive. /// /// - /// The resource types you want to force delete. Currently, only the - /// following is supported: + /// The resource types you want to force delete. Currently, only the following + /// is supported: /// forceDeletionTypes=Microsoft.Compute/virtualMachines,Microsoft.Compute/virtualMachineScaleSets /// /// @@ -97,16 +88,16 @@ public partial interface IResourceGroupsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string forceDeletionTypes = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string forceDeletionTypes = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets a resource group. /// + /// + /// Gets a resource group. + /// /// - /// The name of the resource group to get. The name is case - /// insensitive. + /// The name of the resource group to get. The name is case insensitive. /// /// /// The headers that will be added to request. @@ -120,22 +111,20 @@ public partial interface IResourceGroupsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Updates a resource group. + /// Resource groups can be updated through a simple PATCH operation to a group + /// address. The format of the request is the same as that for creating a + /// resource group. If a field is unspecified, the current value is retained. /// /// - /// Resource groups can be updated through a simple PATCH operation to - /// a group address. The format of the request is the same as that for - /// creating a resource group. If a field is unspecified, the current - /// value is retained. + /// Resource groups can be updated through a simple PATCH operation to a group + /// address. The format of the request is the same as that for creating a + /// resource group. If a field is unspecified, the current value is retained. /// /// - /// The name of the resource group to update. The name is case - /// insensitive. + /// The name of the resource group to update. The name is case insensitive. /// /// /// Parameters supplied to update a resource group. @@ -152,13 +141,14 @@ public partial interface IResourceGroupsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateWithHttpMessagesAsync(string resourceGroupName, ResourceGroupPatchable parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, ResourceGroupPatchable parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Captures the specified resource group as a template. /// + /// + /// Captures the specified resource group as a template. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -177,15 +167,16 @@ public partial interface IResourceGroupsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> ExportTemplateWithHttpMessagesAsync(string resourceGroupName, ExportTemplateRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> ExportTemplateWithHttpMessagesAsync(string resourceGroupName, ExportTemplateRequest parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all the resource groups for a subscription. /// + /// + /// Gets all the resource groups for a subscription. + /// /// - /// OData parameters to apply to the operation. + /// /// /// /// The headers that will be added to request. @@ -199,25 +190,24 @@ public partial interface IResourceGroupsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Deletes a resource group. + /// When you delete a resource group, all of its resources are also deleted. + /// Deleting a resource group deletes all of its template deployments and + /// currently stored operations. /// /// - /// When you delete a resource group, all of its resources are also - /// deleted. Deleting a resource group deletes all of its template - /// deployments and currently stored operations. + /// When you delete a resource group, all of its resources are also deleted. + /// Deleting a resource group deletes all of its template deployments and + /// currently stored operations. /// /// - /// The name of the resource group to delete. The name is case - /// insensitive. + /// The name of the resource group to delete. The name is case insensitive. /// /// - /// The resource types you want to force delete. Currently, only the - /// following is supported: + /// The resource types you want to force delete. Currently, only the following + /// is supported: /// forceDeletionTypes=Microsoft.Compute/virtualMachines,Microsoft.Compute/virtualMachineScaleSets /// /// @@ -229,13 +219,14 @@ public partial interface IResourceGroupsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string forceDeletionTypes = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string forceDeletionTypes = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Captures the specified resource group as a template. /// + /// + /// Captures the specified resource group as a template. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -254,13 +245,14 @@ public partial interface IResourceGroupsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginExportTemplateWithHttpMessagesAsync(string resourceGroupName, ExportTemplateRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginExportTemplateWithHttpMessagesAsync(string resourceGroupName, ExportTemplateRequest parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all the resource groups for a subscription. /// + /// + /// Gets all the resource groups for a subscription. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -276,9 +268,7 @@ public partial interface IResourceGroupsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/IResourceManagementClient.cs b/src/Resources/Resources.Management.Sdk/Generated/IResourceManagementClient.cs similarity index 66% rename from src/Resources/Resources.Sdk/Generated/IResourceManagementClient.cs rename to src/Resources/Resources.Management.Sdk/Generated/IResourceManagementClient.cs index f6751a387faa..a6f8168ac4b5 100644 --- a/src/Resources/Resources.Sdk/Generated/IResourceManagementClient.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/IResourceManagementClient.cs @@ -1,24 +1,18 @@ -// // 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 Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; /// /// Provides operations for working with resources and resource groups. /// - public partial interface IResourceManagementClient : System.IDisposable + public partial interface IResourceManagementClient : System.IDisposable { /// /// The base URI of the service. @@ -28,86 +22,91 @@ public partial interface IResourceManagementClient : System.IDisposable /// /// Gets or sets json serialization settings. /// - JsonSerializerSettings SerializationSettings { get; } + Newtonsoft.Json.JsonSerializerSettings SerializationSettings { get; } /// /// Gets or sets json deserialization settings. /// - JsonSerializerSettings DeserializationSettings { get; } + Newtonsoft.Json.JsonSerializerSettings DeserializationSettings { get; } /// /// Credentials needed for the client to connect to Azure. /// - ServiceClientCredentials Credentials { get; } + Microsoft.Rest.ServiceClientCredentials Credentials { get;} + /// - /// The Microsoft Azure subscription ID. + /// The API version to use for this operation. /// - string SubscriptionId { get; set; } + string ApiVersion { get;} + /// - /// The API version to use for this operation. + /// The Microsoft Azure subscription ID. /// - string ApiVersion { get; } + string SubscriptionId { get; set;} + /// /// The preferred language for the response. /// - string AcceptLanguage { get; set; } + string AcceptLanguage { get; set;} + /// /// The retry timeout in seconds for Long Running Operations. Default - /// value is 30. + /// /// value is 30. /// - int? LongRunningOperationRetryTimeout { get; set; } + int? LongRunningOperationRetryTimeout { get; set;} + /// /// Whether a unique x-ms-client-request-id should be generated. When - /// set to true a unique x-ms-client-request-id value is generated and - /// included in each request. Default is true. + /// /// set to true a unique x-ms-client-request-id value is generated and + /// /// included in each request. Default is true. /// - bool? GenerateClientRequestId { get; set; } + bool? GenerateClientRequestId { get; set;} /// - /// Gets the IOperations. + /// Gets the IOperations /// IOperations Operations { get; } /// - /// Gets the IDeploymentsOperations. + /// Gets the IDeploymentsOperations /// IDeploymentsOperations Deployments { get; } /// - /// Gets the IProvidersOperations. + /// Gets the IProvidersOperations /// IProvidersOperations Providers { get; } /// - /// Gets the IProviderResourceTypesOperations. + /// Gets the IProviderResourceTypesOperations /// IProviderResourceTypesOperations ProviderResourceTypes { get; } /// - /// Gets the IResourcesOperations. + /// Gets the IResourcesOperations /// IResourcesOperations Resources { get; } /// - /// Gets the IResourceGroupsOperations. + /// Gets the IResourceGroupsOperations /// IResourceGroupsOperations ResourceGroups { get; } /// - /// Gets the ITagsOperations. + /// Gets the ITagsOperations /// ITagsOperations Tags { get; } /// - /// Gets the IDeploymentOperations. + /// Gets the IDeploymentOperations /// IDeploymentOperations DeploymentOperations { get; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/IResourceManagementPrivateLinkOperations.cs b/src/Resources/Resources.Management.Sdk/Generated/IResourceManagementPrivateLinkOperations.cs similarity index 64% rename from src/Resources/Resources.Sdk/Generated/IResourceManagementPrivateLinkOperations.cs rename to src/Resources/Resources.Management.Sdk/Generated/IResourceManagementPrivateLinkOperations.cs index bcefc7c41353..fa17af66da5d 100644 --- a/src/Resources/Resources.Sdk/Generated/IResourceManagementPrivateLinkOperations.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/IResourceManagementPrivateLinkOperations.cs @@ -1,22 +1,12 @@ -// // 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 Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// ResourceManagementPrivateLinkOperations operations. @@ -26,6 +16,9 @@ public partial interface IResourceManagementPrivateLinkOperations /// /// Create a resource management group private link. /// + /// + /// Create a resource management group private link. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -47,13 +40,14 @@ public partial interface IResourceManagementPrivateLinkOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> PutWithHttpMessagesAsync(string resourceGroupName, string rmplName, ResourceManagementPrivateLinkLocation parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> PutWithHttpMessagesAsync(string resourceGroupName, string rmplName, ResourceManagementPrivateLinkLocation parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Get a resource management private link(resource-level). /// + /// + /// Get a resource management private link(resource-level). + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -72,13 +66,14 @@ public partial interface IResourceManagementPrivateLinkOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string rmplName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string rmplName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Delete a resource management private link. /// + /// + /// Delete a resource management private link. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -94,13 +89,14 @@ public partial interface IResourceManagementPrivateLinkOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string rmplName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string rmplName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Get all the resource management private links in a subscription. /// + /// + /// Get all the resource management private links in a subscription. + /// /// /// The headers that will be added to request. /// @@ -113,13 +109,14 @@ public partial interface IResourceManagementPrivateLinkOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Get all the resource management private links in a resource group. /// + /// + /// Get all the resource management private links in a resource group. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -135,9 +132,7 @@ public partial interface IResourceManagementPrivateLinkOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/IResourcePrivateLinkClient.cs b/src/Resources/Resources.Management.Sdk/Generated/IResourcePrivateLinkClient.cs similarity index 65% rename from src/Resources/Resources.Sdk/Generated/IResourcePrivateLinkClient.cs rename to src/Resources/Resources.Management.Sdk/Generated/IResourcePrivateLinkClient.cs index 5a8c3fd487cb..576510b048a2 100644 --- a/src/Resources/Resources.Sdk/Generated/IResourcePrivateLinkClient.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/IResourcePrivateLinkClient.cs @@ -1,24 +1,18 @@ -// // 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 Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; /// /// Provides operations for managing private link resources /// - public partial interface IResourcePrivateLinkClient : System.IDisposable + public partial interface IResourcePrivateLinkClient : System.IDisposable { /// /// The base URI of the service. @@ -28,56 +22,61 @@ public partial interface IResourcePrivateLinkClient : System.IDisposable /// /// Gets or sets json serialization settings. /// - JsonSerializerSettings SerializationSettings { get; } + Newtonsoft.Json.JsonSerializerSettings SerializationSettings { get; } /// /// Gets or sets json deserialization settings. /// - JsonSerializerSettings DeserializationSettings { get; } + Newtonsoft.Json.JsonSerializerSettings DeserializationSettings { get; } /// /// Credentials needed for the client to connect to Azure. /// - ServiceClientCredentials Credentials { get; } + Microsoft.Rest.ServiceClientCredentials Credentials { get;} + /// /// The API version to use for this operation. /// - string ApiVersion { get; } + string ApiVersion { get;} + /// /// The ID of the target subscription. /// - string SubscriptionId { get; set; } + string SubscriptionId { get; set;} + /// /// The preferred language for the response. /// - string AcceptLanguage { get; set; } + string AcceptLanguage { get; set;} + /// /// The retry timeout in seconds for Long Running Operations. Default - /// value is 30. + /// /// value is 30. /// - int? LongRunningOperationRetryTimeout { get; set; } + int? LongRunningOperationRetryTimeout { get; set;} + /// /// Whether a unique x-ms-client-request-id should be generated. When - /// set to true a unique x-ms-client-request-id value is generated and - /// included in each request. Default is true. + /// /// set to true a unique x-ms-client-request-id value is generated and + /// /// included in each request. Default is true. /// - bool? GenerateClientRequestId { get; set; } + bool? GenerateClientRequestId { get; set;} /// - /// Gets the IPrivateLinkAssociationOperations. + /// Gets the IPrivateLinkAssociationOperations /// IPrivateLinkAssociationOperations PrivateLinkAssociation { get; } /// - /// Gets the IResourceManagementPrivateLinkOperations. + /// Gets the IResourceManagementPrivateLinkOperations /// IResourceManagementPrivateLinkOperations ResourceManagementPrivateLink { get; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/IResourcesOperations.cs b/src/Resources/Resources.Management.Sdk/Generated/IResourcesOperations.cs similarity index 59% rename from src/Resources/Resources.Sdk/Generated/IResourcesOperations.cs rename to src/Resources/Resources.Management.Sdk/Generated/IResourcesOperations.cs index f07834e61daf..9b36be8d1ef9 100644 --- a/src/Resources/Resources.Sdk/Generated/IResourcesOperations.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/IResourcesOperations.cs @@ -1,23 +1,12 @@ -// // 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 Microsoft.Rest; using Microsoft.Rest.Azure; - using Microsoft.Rest.Azure.OData; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// ResourcesOperations operations. @@ -27,12 +16,15 @@ public partial interface IResourcesOperations /// /// Get all the resources for a resource group. /// + /// + /// Get all the resources for a resource group. + /// + /// + /// + /// /// /// The resource group with the resources to get. /// - /// - /// OData parameters to apply to the operation. - /// /// /// The headers that will be added to request. /// @@ -45,24 +37,25 @@ public partial interface IResourcesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Moves resources from one resource group to another resource group. + /// The resources to be moved must be in the same source resource group in the + /// source subscription being used. The target resource group may be in a + /// different subscription. When moving resources, both the source group and + /// the target group are locked for the duration of the operation. Write and + /// delete operations are blocked on the groups until the move completes. /// /// - /// The resources to be moved must be in the same source resource group - /// in the source subscription being used. The target resource group - /// may be in a different subscription. When moving resources, both the - /// source group and the target group are locked for the duration of - /// the operation. Write and delete operations are blocked on the - /// groups until the move completes. + /// The resources to be moved must be in the same source resource group in the + /// source subscription being used. The target resource group may be in a + /// different subscription. When moving resources, both the source group and + /// the target group are locked for the duration of the operation. Write and + /// delete operations are blocked on the groups until the move completes. /// /// - /// The name of the resource group from the source subscription - /// containing the resources to be moved. + /// The name of the resource group from the source subscription containing the + /// resources to be moved. /// /// /// Parameters for moving resources. @@ -76,27 +69,29 @@ public partial interface IResourcesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task MoveResourcesWithHttpMessagesAsync(string sourceResourceGroupName, ResourcesMoveInfo parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task MoveResourcesWithHttpMessagesAsync(string sourceResourceGroupName, ResourcesMoveInfo parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Validates whether resources can be moved from one resource group to - /// another resource group. + /// This operation checks whether the specified resources can be moved to the + /// target. The resources to be moved must be in the same source resource group + /// in the source subscription being used. The target resource group may be in + /// a different subscription. If validation succeeds, it returns HTTP response + /// code 204 (no content). If validation fails, it returns HTTP response code + /// 409 (Conflict) with an error message. Retrieve the URL in the Location + /// header value to check the result of the long-running operation. /// /// - /// This operation checks whether the specified resources can be moved - /// to the target. The resources to be moved must be in the same source - /// resource group in the source subscription being used. The target - /// resource group may be in a different subscription. If validation - /// succeeds, it returns HTTP response code 204 (no content). If - /// validation fails, it returns HTTP response code 409 (Conflict) with - /// an error message. Retrieve the URL in the Location header value to - /// check the result of the long-running operation. + /// This operation checks whether the specified resources can be moved to the + /// target. The resources to be moved must be in the same source resource group + /// in the source subscription being used. The target resource group may be in + /// a different subscription. If validation succeeds, it returns HTTP response + /// code 204 (no content). If validation fails, it returns HTTP response code + /// 409 (Conflict) with an error message. Retrieve the URL in the Location + /// header value to check the result of the long-running operation. /// /// - /// The name of the resource group from the source subscription - /// containing the resources to be validated for move. + /// The name of the resource group from the source subscription containing the + /// resources to be validated for move. /// /// /// Parameters for moving resources. @@ -110,15 +105,16 @@ public partial interface IResourcesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task ValidateMoveResourcesWithHttpMessagesAsync(string sourceResourceGroupName, ResourcesMoveInfo parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task ValidateMoveResourcesWithHttpMessagesAsync(string sourceResourceGroupName, ResourcesMoveInfo parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Get all the resources in a subscription. /// + /// + /// Get all the resources in a subscription. + /// /// - /// OData parameters to apply to the operation. + /// /// /// /// The headers that will be added to request. @@ -132,16 +128,17 @@ public partial interface IResourcesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Checks whether a resource exists. /// + /// + /// Checks whether a resource exists. + /// /// - /// The name of the resource group containing the resource to check. - /// The name is case insensitive. + /// The name of the resource group containing the resource to check. The name + /// is case insensitive. /// /// /// The resource provider of the resource to check. @@ -167,16 +164,17 @@ public partial interface IResourcesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task> CheckExistenceWithHttpMessagesAsync(string resourceGroupName, string resourceProviderNamespace, string parentResourcePath, string resourceType, string resourceName, string apiVersion, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CheckExistenceWithHttpMessagesAsync(string resourceGroupName, string resourceProviderNamespace, string parentResourcePath, string resourceType, string resourceName, string apiVersion, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes a resource. /// + /// + /// Deletes a resource. + /// /// - /// The name of the resource group that contains the resource to - /// delete. The name is case insensitive. + /// The name of the resource group that contains the resource to delete. The + /// name is case insensitive. /// /// /// The namespace of the resource provider. @@ -202,13 +200,14 @@ public partial interface IResourcesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string resourceProviderNamespace, string parentResourcePath, string resourceType, string resourceName, string apiVersion, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string resourceProviderNamespace, string parentResourcePath, string resourceType, string resourceName, string apiVersion, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Creates a resource. /// + /// + /// Creates a resource. + /// /// /// The name of the resource group for the resource. The name is case /// insensitive. @@ -243,13 +242,14 @@ public partial interface IResourcesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string resourceProviderNamespace, string parentResourcePath, string resourceType, string resourceName, string apiVersion, GenericResource parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string resourceProviderNamespace, string parentResourcePath, string resourceType, string resourceName, string apiVersion, GenericResource parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Updates a resource. /// + /// + /// Updates a resource. + /// /// /// The name of the resource group for the resource. The name is case /// insensitive. @@ -284,16 +284,17 @@ public partial interface IResourcesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string resourceProviderNamespace, string parentResourcePath, string resourceType, string resourceName, string apiVersion, GenericResource parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string resourceProviderNamespace, string parentResourcePath, string resourceType, string resourceName, string apiVersion, GenericResource parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets a resource. /// + /// + /// Gets a resource. + /// /// - /// The name of the resource group containing the resource to get. The - /// name is case insensitive. + /// The name of the resource group containing the resource to get. The name is + /// case insensitive. /// /// /// The namespace of the resource provider. @@ -322,20 +323,23 @@ public partial interface IResourcesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string resourceProviderNamespace, string parentResourcePath, string resourceType, string resourceName, string apiVersion, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string resourceProviderNamespace, string parentResourcePath, string resourceType, string resourceName, string apiVersion, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Checks by ID whether a resource exists. This API currently works - /// only for a limited set of Resource providers. In the event that a - /// Resource provider does not implement this API, ARM will respond - /// with a 405. The alternative then is to use the GET API to check for - /// the existence of the resource. + /// Checks by ID whether a resource exists. This API currently works only for a + /// limited set of Resource providers. In the event that a Resource provider + /// does not implement this API, ARM will respond with a 405. The alternative + /// then is to use the GET API to check for the existence of the resource. /// + /// + /// Checks by ID whether a resource exists. This API currently works only for a + /// limited set of Resource providers. In the event that a Resource provider + /// does not implement this API, ARM will respond with a 405. The alternative + /// then is to use the GET API to check for the existence of the resource. + /// /// - /// The fully qualified ID of the resource, including the resource name - /// and resource type. Use the format, + /// The fully qualified ID of the resource, including the resource name and + /// resource type. Use the format, /// /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} /// /// @@ -350,16 +354,17 @@ public partial interface IResourcesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task> CheckExistenceByIdWithHttpMessagesAsync(string resourceId, string apiVersion, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CheckExistenceByIdWithHttpMessagesAsync(string resourceId, string apiVersion, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes a resource by ID. /// + /// + /// Deletes a resource by ID. + /// /// - /// The fully qualified ID of the resource, including the resource name - /// and resource type. Use the format, + /// The fully qualified ID of the resource, including the resource name and + /// resource type. Use the format, /// /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} /// /// @@ -374,16 +379,17 @@ public partial interface IResourcesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteByIdWithHttpMessagesAsync(string resourceId, string apiVersion, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteByIdWithHttpMessagesAsync(string resourceId, string apiVersion, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Create a resource by ID. /// + /// + /// Create a resource by ID. + /// /// - /// The fully qualified ID of the resource, including the resource name - /// and resource type. Use the format, + /// The fully qualified ID of the resource, including the resource name and + /// resource type. Use the format, /// /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} /// /// @@ -404,16 +410,17 @@ public partial interface IResourcesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateByIdWithHttpMessagesAsync(string resourceId, string apiVersion, GenericResource parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateByIdWithHttpMessagesAsync(string resourceId, string apiVersion, GenericResource parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Updates a resource by ID. /// + /// + /// Updates a resource by ID. + /// /// - /// The fully qualified ID of the resource, including the resource name - /// and resource type. Use the format, + /// The fully qualified ID of the resource, including the resource name and + /// resource type. Use the format, /// /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} /// /// @@ -434,16 +441,17 @@ public partial interface IResourcesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateByIdWithHttpMessagesAsync(string resourceId, string apiVersion, GenericResource parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> UpdateByIdWithHttpMessagesAsync(string resourceId, string apiVersion, GenericResource parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets a resource by ID. /// + /// + /// Gets a resource by ID. + /// /// - /// The fully qualified ID of the resource, including the resource name - /// and resource type. Use the format, + /// The fully qualified ID of the resource, including the resource name and + /// resource type. Use the format, /// /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} /// /// @@ -461,24 +469,25 @@ public partial interface IResourcesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetByIdWithHttpMessagesAsync(string resourceId, string apiVersion, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetByIdWithHttpMessagesAsync(string resourceId, string apiVersion, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Moves resources from one resource group to another resource group. + /// The resources to be moved must be in the same source resource group in the + /// source subscription being used. The target resource group may be in a + /// different subscription. When moving resources, both the source group and + /// the target group are locked for the duration of the operation. Write and + /// delete operations are blocked on the groups until the move completes. /// /// - /// The resources to be moved must be in the same source resource group - /// in the source subscription being used. The target resource group - /// may be in a different subscription. When moving resources, both the - /// source group and the target group are locked for the duration of - /// the operation. Write and delete operations are blocked on the - /// groups until the move completes. + /// The resources to be moved must be in the same source resource group in the + /// source subscription being used. The target resource group may be in a + /// different subscription. When moving resources, both the source group and + /// the target group are locked for the duration of the operation. Write and + /// delete operations are blocked on the groups until the move completes. /// /// - /// The name of the resource group from the source subscription - /// containing the resources to be moved. + /// The name of the resource group from the source subscription containing the + /// resources to be moved. /// /// /// Parameters for moving resources. @@ -492,27 +501,29 @@ public partial interface IResourcesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginMoveResourcesWithHttpMessagesAsync(string sourceResourceGroupName, ResourcesMoveInfo parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginMoveResourcesWithHttpMessagesAsync(string sourceResourceGroupName, ResourcesMoveInfo parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Validates whether resources can be moved from one resource group to - /// another resource group. + /// This operation checks whether the specified resources can be moved to the + /// target. The resources to be moved must be in the same source resource group + /// in the source subscription being used. The target resource group may be in + /// a different subscription. If validation succeeds, it returns HTTP response + /// code 204 (no content). If validation fails, it returns HTTP response code + /// 409 (Conflict) with an error message. Retrieve the URL in the Location + /// header value to check the result of the long-running operation. /// /// - /// This operation checks whether the specified resources can be moved - /// to the target. The resources to be moved must be in the same source - /// resource group in the source subscription being used. The target - /// resource group may be in a different subscription. If validation - /// succeeds, it returns HTTP response code 204 (no content). If - /// validation fails, it returns HTTP response code 409 (Conflict) with - /// an error message. Retrieve the URL in the Location header value to - /// check the result of the long-running operation. + /// This operation checks whether the specified resources can be moved to the + /// target. The resources to be moved must be in the same source resource group + /// in the source subscription being used. The target resource group may be in + /// a different subscription. If validation succeeds, it returns HTTP response + /// code 204 (no content). If validation fails, it returns HTTP response code + /// 409 (Conflict) with an error message. Retrieve the URL in the Location + /// header value to check the result of the long-running operation. /// /// - /// The name of the resource group from the source subscription - /// containing the resources to be validated for move. + /// The name of the resource group from the source subscription containing the + /// resources to be validated for move. /// /// /// Parameters for moving resources. @@ -526,16 +537,17 @@ public partial interface IResourcesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginValidateMoveResourcesWithHttpMessagesAsync(string sourceResourceGroupName, ResourcesMoveInfo parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginValidateMoveResourcesWithHttpMessagesAsync(string sourceResourceGroupName, ResourcesMoveInfo parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes a resource. /// + /// + /// Deletes a resource. + /// /// - /// The name of the resource group that contains the resource to - /// delete. The name is case insensitive. + /// The name of the resource group that contains the resource to delete. The + /// name is case insensitive. /// /// /// The namespace of the resource provider. @@ -561,13 +573,14 @@ public partial interface IResourcesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string resourceProviderNamespace, string parentResourcePath, string resourceType, string resourceName, string apiVersion, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string resourceProviderNamespace, string parentResourcePath, string resourceType, string resourceName, string apiVersion, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Creates a resource. /// + /// + /// Creates a resource. + /// /// /// The name of the resource group for the resource. The name is case /// insensitive. @@ -602,13 +615,14 @@ public partial interface IResourcesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string resourceProviderNamespace, string parentResourcePath, string resourceType, string resourceName, string apiVersion, GenericResource parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string resourceProviderNamespace, string parentResourcePath, string resourceType, string resourceName, string apiVersion, GenericResource parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Updates a resource. /// + /// + /// Updates a resource. + /// /// /// The name of the resource group for the resource. The name is case /// insensitive. @@ -643,16 +657,17 @@ public partial interface IResourcesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string resourceProviderNamespace, string parentResourcePath, string resourceType, string resourceName, string apiVersion, GenericResource parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string resourceProviderNamespace, string parentResourcePath, string resourceType, string resourceName, string apiVersion, GenericResource parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes a resource by ID. /// + /// + /// Deletes a resource by ID. + /// /// - /// The fully qualified ID of the resource, including the resource name - /// and resource type. Use the format, + /// The fully qualified ID of the resource, including the resource name and + /// resource type. Use the format, /// /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} /// /// @@ -667,16 +682,17 @@ public partial interface IResourcesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteByIdWithHttpMessagesAsync(string resourceId, string apiVersion, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteByIdWithHttpMessagesAsync(string resourceId, string apiVersion, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Create a resource by ID. /// + /// + /// Create a resource by ID. + /// /// - /// The fully qualified ID of the resource, including the resource name - /// and resource type. Use the format, + /// The fully qualified ID of the resource, including the resource name and + /// resource type. Use the format, /// /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} /// /// @@ -697,16 +713,17 @@ public partial interface IResourcesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateByIdWithHttpMessagesAsync(string resourceId, string apiVersion, GenericResource parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateByIdWithHttpMessagesAsync(string resourceId, string apiVersion, GenericResource parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Updates a resource by ID. /// + /// + /// Updates a resource by ID. + /// /// - /// The fully qualified ID of the resource, including the resource name - /// and resource type. Use the format, + /// The fully qualified ID of the resource, including the resource name and + /// resource type. Use the format, /// /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} /// /// @@ -727,13 +744,14 @@ public partial interface IResourcesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginUpdateByIdWithHttpMessagesAsync(string resourceId, string apiVersion, GenericResource parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginUpdateByIdWithHttpMessagesAsync(string resourceId, string apiVersion, GenericResource parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Get all the resources for a resource group. /// + /// + /// Get all the resources for a resource group. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -749,13 +767,14 @@ public partial interface IResourcesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Get all the resources in a subscription. /// + /// + /// Get all the resources in a subscription. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -771,9 +790,7 @@ public partial interface IResourcesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/ISubscriptionClient.cs b/src/Resources/Resources.Management.Sdk/Generated/ISubscriptionClient.cs similarity index 50% rename from src/Resources/Resources.Sdk/Generated/ISubscriptionClient.cs rename to src/Resources/Resources.Management.Sdk/Generated/ISubscriptionClient.cs index 726d7bac021f..9e540c35c760 100644 --- a/src/Resources/Resources.Sdk/Generated/ISubscriptionClient.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/ISubscriptionClient.cs @@ -1,31 +1,21 @@ -// // 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 Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// All resource groups and resources exist within subscriptions. These - /// operation enable you get information about your subscriptions and - /// tenants. A tenant is a dedicated instance of Azure Active Directory - /// (Azure AD) for your organization. + /// operation enable you get information about your subscriptions and tenants. + /// A tenant is a dedicated instance of Azure Active Directory (Azure AD) for + /// your organization. /// - public partial interface ISubscriptionClient : System.IDisposable + public partial interface ISubscriptionClient : System.IDisposable { /// /// The base URI of the service. @@ -35,58 +25,63 @@ public partial interface ISubscriptionClient : System.IDisposable /// /// Gets or sets json serialization settings. /// - JsonSerializerSettings SerializationSettings { get; } + Newtonsoft.Json.JsonSerializerSettings SerializationSettings { get; } /// /// Gets or sets json deserialization settings. /// - JsonSerializerSettings DeserializationSettings { get; } + Newtonsoft.Json.JsonSerializerSettings DeserializationSettings { get; } /// /// Credentials needed for the client to connect to Azure. /// - ServiceClientCredentials Credentials { get; } + Microsoft.Rest.ServiceClientCredentials Credentials { get;} + /// - /// The API version to use for the operation. + /// The API version to use for this operation. /// - string ApiVersion { get; } + string ApiVersion { get;} + /// /// The preferred language for the response. /// - string AcceptLanguage { get; set; } + string AcceptLanguage { get; set;} + /// /// The retry timeout in seconds for Long Running Operations. Default - /// value is 30. + /// /// value is 30. /// - int? LongRunningOperationRetryTimeout { get; set; } + int? LongRunningOperationRetryTimeout { get; set;} + /// /// Whether a unique x-ms-client-request-id should be generated. When - /// set to true a unique x-ms-client-request-id value is generated and - /// included in each request. Default is true. + /// /// set to true a unique x-ms-client-request-id value is generated and + /// /// included in each request. Default is true. /// - bool? GenerateClientRequestId { get; set; } + bool? GenerateClientRequestId { get; set;} /// - /// Gets the ISubscriptionsOperations. + /// Gets the ISubscriptionsOperations /// ISubscriptionsOperations Subscriptions { get; } /// - /// Gets the ITenantsOperations. + /// Gets the ITenantsOperations /// ITenantsOperations Tenants { get; } /// - /// Checks resource name validity + /// A resource name is valid if it is not a reserved word, does not contains a + /// reserved word and does not start with a reserved word /// /// - /// A resource name is valid if it is not a reserved word, does not - /// contains a reserved word and does not start with a reserved word + /// A resource name is valid if it is not a reserved word, does not contains a + /// reserved word and does not start with a reserved word /// /// /// Resource object with values for resource name and resource type @@ -97,7 +92,13 @@ public partial interface ISubscriptionClient : System.IDisposable /// /// The cancellation token. /// - Task> CheckResourceNameWithHttpMessagesAsync(ResourceName resourceNameDefinition = default(ResourceName), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + System.Threading.Tasks.Task> CheckResourceNameWithHttpMessagesAsync(ResourceName resourceNameDefinition = default(ResourceName), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/ISubscriptionFeatureRegistrationsOperations.cs b/src/Resources/Resources.Management.Sdk/Generated/ISubscriptionFeatureRegistrationsOperations.cs similarity index 55% rename from src/Resources/Resources.Sdk/Generated/ISubscriptionFeatureRegistrationsOperations.cs rename to src/Resources/Resources.Management.Sdk/Generated/ISubscriptionFeatureRegistrationsOperations.cs index 2a990f03d557..cf7a093ef037 100644 --- a/src/Resources/Resources.Sdk/Generated/ISubscriptionFeatureRegistrationsOperations.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/ISubscriptionFeatureRegistrationsOperations.cs @@ -1,22 +1,12 @@ -// // 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 Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// SubscriptionFeatureRegistrationsOperations operations. @@ -26,6 +16,9 @@ public partial interface ISubscriptionFeatureRegistrationsOperations /// /// Returns a feature registration /// + /// + /// Returns a feature registration + /// /// /// The provider namespace. /// @@ -38,19 +31,20 @@ public partial interface ISubscriptionFeatureRegistrationsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string providerNamespace, string featureName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string providerNamespace, string featureName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Create or update a feature registration. /// + /// + /// Create or update a feature registration. + /// /// /// The provider namespace. /// @@ -66,19 +60,20 @@ public partial interface ISubscriptionFeatureRegistrationsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string providerNamespace, string featureName, SubscriptionFeatureRegistration subscriptionFeatureRegistrationType = default(SubscriptionFeatureRegistration), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string providerNamespace, string featureName, SubscriptionFeatureRegistration subscriptionFeatureRegistrationType = default(SubscriptionFeatureRegistration), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes a feature registration /// + /// + /// Deletes a feature registration + /// /// /// The provider namespace. /// @@ -91,17 +86,19 @@ public partial interface ISubscriptionFeatureRegistrationsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string providerNamespace, string featureName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string providerNamespace, string featureName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Returns subscription feature registrations for given subscription - /// and provider namespace. + /// Returns subscription feature registrations for given subscription and + /// provider namespace. /// + /// + /// Returns subscription feature registrations for given subscription and + /// provider namespace. + /// /// /// The provider namespace. /// @@ -111,39 +108,42 @@ public partial interface ISubscriptionFeatureRegistrationsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListBySubscriptionWithHttpMessagesAsync(string providerNamespace, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListBySubscriptionWithHttpMessagesAsync(string providerNamespace, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Returns subscription feature registrations for given subscription. /// + /// + /// Returns subscription feature registrations for given subscription. + /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListAllBySubscriptionWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListAllBySubscriptionWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Returns subscription feature registrations for given subscription - /// and provider namespace. + /// Returns subscription feature registrations for given subscription and + /// provider namespace. /// + /// + /// Returns subscription feature registrations for given subscription and + /// provider namespace. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -153,19 +153,20 @@ public partial interface ISubscriptionFeatureRegistrationsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListBySubscriptionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListBySubscriptionNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Returns subscription feature registrations for given subscription. /// + /// + /// Returns subscription feature registrations for given subscription. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -175,15 +176,13 @@ public partial interface ISubscriptionFeatureRegistrationsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListAllBySubscriptionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListAllBySubscriptionNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/ISubscriptionsOperations.cs b/src/Resources/Resources.Management.Sdk/Generated/ISubscriptionsOperations.cs similarity index 60% rename from src/Resources/Resources.Sdk/Generated/ISubscriptionsOperations.cs rename to src/Resources/Resources.Management.Sdk/Generated/ISubscriptionsOperations.cs index 0b563419ff51..e9907a3228fc 100644 --- a/src/Resources/Resources.Sdk/Generated/ISubscriptionsOperations.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/ISubscriptionsOperations.cs @@ -1,22 +1,12 @@ -// // 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 Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// SubscriptionsOperations operations. @@ -24,12 +14,14 @@ namespace Microsoft.Azure.Management.Resources public partial interface ISubscriptionsOperations { /// - /// Gets all available geo-locations. + /// This operation provides all the locations that are available for resource + /// providers; however, each resource provider may support a subset of this + /// list. /// /// - /// This operation provides all the locations that are available for - /// resource providers; however, each resource provider may support a - /// subset of this list. + /// This operation provides all the locations that are available for resource + /// providers; however, each resource provider may support a subset of this + /// list. /// /// /// The ID of the target subscription. @@ -49,13 +41,14 @@ public partial interface ISubscriptionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListLocationsWithHttpMessagesAsync(string subscriptionId, bool? includeExtendedLocations = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListLocationsWithHttpMessagesAsync(string subscriptionId, bool? includeExtendedLocations = default(bool?), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets details about a specified subscription. /// + /// + /// Gets details about a specified subscription. + /// /// /// The ID of the target subscription. /// @@ -71,13 +64,14 @@ public partial interface ISubscriptionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string subscriptionId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string subscriptionId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all subscriptions for a tenant. /// + /// + /// Gets all subscriptions for a tenant. + /// /// /// The headers that will be added to request. /// @@ -90,13 +84,14 @@ public partial interface ISubscriptionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Compares a subscriptions logical zone mapping /// + /// + /// Compares a subscriptions logical zone mapping + /// /// /// The ID of the target subscription. /// @@ -109,19 +104,20 @@ public partial interface ISubscriptionsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CheckZonePeersWithHttpMessagesAsync(string subscriptionId, CheckZonePeersRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CheckZonePeersWithHttpMessagesAsync(string subscriptionId, CheckZonePeersRequest parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all subscriptions for a tenant. /// + /// + /// Gets all subscriptions for a tenant. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -137,9 +133,7 @@ public partial interface ISubscriptionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Management.Sdk/Generated/ITagsOperations.cs b/src/Resources/Resources.Management.Sdk/Generated/ITagsOperations.cs new file mode 100644 index 000000000000..1ecc859f766d --- /dev/null +++ b/src/Resources/Resources.Management.Sdk/Generated/ITagsOperations.cs @@ -0,0 +1,295 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Resources +{ + using Microsoft.Rest.Azure; + using Models; + + /// + /// TagsOperations operations. + /// + public partial interface ITagsOperations + { + /// + /// This operation allows deleting a value from the list of predefined values + /// for an existing predefined tag name. The value being deleted must not be in + /// use as a tag value for the given tag name for any resource. + /// + /// + /// This operation allows deleting a value from the list of predefined values + /// for an existing predefined tag name. The value being deleted must not be in + /// use as a tag value for the given tag name for any resource. + /// + /// + /// The name of the tag. + /// + /// + /// The value of the tag to delete. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + System.Threading.Tasks.Task DeleteValueWithHttpMessagesAsync(string tagName, string tagValue, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// This operation allows adding a value to the list of predefined values for + /// an existing predefined tag name. A tag value can have a maximum of 256 + /// characters. + /// + /// + /// This operation allows adding a value to the list of predefined values for + /// an existing predefined tag name. A tag value can have a maximum of 256 + /// characters. + /// + /// + /// The name of the tag. + /// + /// + /// The value of the tag to create. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + System.Threading.Tasks.Task> CreateOrUpdateValueWithHttpMessagesAsync(string tagName, string tagValue, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// This operation allows adding a name to the list of predefined tag names for + /// the given subscription. A tag name can have a maximum of 512 characters and + /// is case-insensitive. Tag names cannot have the following prefixes which are + /// reserved for Azure use: 'microsoft', 'azure', 'windows'. + /// + /// + /// This operation allows adding a name to the list of predefined tag names for + /// the given subscription. A tag name can have a maximum of 512 characters and + /// is case-insensitive. Tag names cannot have the following prefixes which are + /// reserved for Azure use: 'microsoft', 'azure', 'windows'. + /// + /// + /// The name of the tag to create. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string tagName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// This operation allows deleting a name from the list of predefined tag names + /// for the given subscription. The name being deleted must not be in use as a + /// tag name for any resource. All predefined values for the given name must + /// have already been deleted. + /// + /// + /// This operation allows deleting a name from the list of predefined tag names + /// for the given subscription. The name being deleted must not be in use as a + /// tag name for any resource. All predefined values for the given name must + /// have already been deleted. + /// + /// + /// The name of the tag. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string tagName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// This operation performs a union of predefined tags, resource tags, resource + /// group tags and subscription tags, and returns a summary of usage for each + /// tag name and value under the given subscription. In case of a large number + /// of tags, this operation may return a previously cached result. + /// + /// + /// This operation performs a union of predefined tags, resource tags, resource + /// group tags and subscription tags, and returns a summary of usage for each + /// tag name and value under the given subscription. In case of a large number + /// of tags, this operation may return a previously cached result. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// This operation allows adding or replacing the entire set of tags on the + /// specified resource or subscription. The specified entity can have a maximum + /// of 50 tags. + /// + /// + /// This operation allows adding or replacing the entire set of tags on the + /// specified resource or subscription. The specified entity can have a maximum + /// of 50 tags. + /// + /// + /// The resource scope. + /// + /// + /// + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + System.Threading.Tasks.Task> CreateOrUpdateAtScopeWithHttpMessagesAsync(string scope, TagsResource parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// This operation allows replacing, merging or selectively deleting tags on + /// the specified resource or subscription. The specified entity can have a + /// maximum of 50 tags at the end of the operation. The 'replace' option + /// replaces the entire set of existing tags with a new set. The 'merge' option + /// allows adding tags with new names and updating the values of tags with + /// existing names. The 'delete' option allows selectively deleting tags based + /// on given names or name/value pairs. + /// + /// + /// This operation allows replacing, merging or selectively deleting tags on + /// the specified resource or subscription. The specified entity can have a + /// maximum of 50 tags at the end of the operation. The 'replace' option + /// replaces the entire set of existing tags with a new set. The 'merge' option + /// allows adding tags with new names and updating the values of tags with + /// existing names. The 'delete' option allows selectively deleting tags based + /// on given names or name/value pairs. + /// + /// + /// The resource scope. + /// + /// + /// + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + System.Threading.Tasks.Task> UpdateAtScopeWithHttpMessagesAsync(string scope, TagsPatchResource parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Gets the entire set of tags on a resource or subscription. + /// + /// + /// Gets the entire set of tags on a resource or subscription. + /// + /// + /// The resource scope. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + System.Threading.Tasks.Task> GetAtScopeWithHttpMessagesAsync(string scope, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Deletes the entire set of tags on a resource or subscription. + /// + /// + /// Deletes the entire set of tags on a resource or subscription. + /// + /// + /// The resource scope. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + System.Threading.Tasks.Task DeleteAtScopeWithHttpMessagesAsync(string scope, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// This operation performs a union of predefined tags, resource tags, resource + /// group tags and subscription tags, and returns a summary of usage for each + /// tag name and value under the given subscription. In case of a large number + /// of tags, this operation may return a previously cached result. + /// + /// + /// This operation performs a union of predefined tags, resource tags, resource + /// group tags and subscription tags, and returns a summary of usage for each + /// tag name and value under the given subscription. In case of a large number + /// of tags, this operation may return a previously cached result. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + } +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/ITemplateSpecVersionsOperations.cs b/src/Resources/Resources.Management.Sdk/Generated/ITemplateSpecVersionsOperations.cs similarity index 59% rename from src/Resources/Resources.Sdk/Generated/ITemplateSpecVersionsOperations.cs rename to src/Resources/Resources.Management.Sdk/Generated/ITemplateSpecVersionsOperations.cs index 6f8fe7948639..06a04b2a7123 100644 --- a/src/Resources/Resources.Sdk/Generated/ITemplateSpecVersionsOperations.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/ITemplateSpecVersionsOperations.cs @@ -1,22 +1,12 @@ -// // 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 Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// TemplateSpecVersionsOperations operations. @@ -26,6 +16,9 @@ public partial interface ITemplateSpecVersionsOperations /// /// Creates or updates a Template Spec version. /// + /// + /// Creates or updates a Template Spec version. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -44,19 +37,20 @@ public partial interface ITemplateSpecVersionsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string templateSpecName, string templateSpecVersion, TemplateSpecVersion templateSpecVersionModel, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string templateSpecName, string templateSpecVersion, TemplateSpecVersion templateSpecVersionModel, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Updates Template Spec Version tags with specified values. /// + /// + /// Updates Template Spec Version tags with specified values. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -75,19 +69,20 @@ public partial interface ITemplateSpecVersionsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string templateSpecName, string templateSpecVersion, TemplateSpecVersionUpdateModel templateSpecVersionUpdateModel = default(TemplateSpecVersionUpdateModel), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string templateSpecName, string templateSpecVersion, TemplateSpecVersionUpdateModel templateSpecVersionUpdateModel = default(TemplateSpecVersionUpdateModel), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets a Template Spec version from a specific Template Spec. /// + /// + /// Gets a Template Spec version from a specific Template Spec. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -103,20 +98,22 @@ public partial interface ITemplateSpecVersionsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string templateSpecName, string templateSpecVersion, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string templateSpecName, string templateSpecVersion, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Deletes a specific version from a Template Spec. When operation - /// completes, status code 200 returned without content. + /// Deletes a specific version from a Template Spec. When operation completes, + /// status code 200 returned without content. /// + /// + /// Deletes a specific version from a Template Spec. When operation completes, + /// status code 200 returned without content. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -132,17 +129,17 @@ public partial interface ITemplateSpecVersionsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string templateSpecName, string templateSpecVersion, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string templateSpecName, string templateSpecVersion, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Lists all the Template Spec versions in the specified Template - /// Spec. + /// Lists all the Template Spec versions in the specified Template Spec. /// + /// + /// Lists all the Template Spec versions in the specified Template Spec. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -155,20 +152,20 @@ public partial interface ITemplateSpecVersionsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, string templateSpecName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string templateSpecName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Lists all the Template Spec versions in the specified Template - /// Spec. + /// Lists all the Template Spec versions in the specified Template Spec. /// + /// + /// Lists all the Template Spec versions in the specified Template Spec. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -178,15 +175,13 @@ public partial interface ITemplateSpecVersionsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/ITemplateSpecsClient.cs b/src/Resources/Resources.Management.Sdk/Generated/ITemplateSpecsClient.cs similarity index 62% rename from src/Resources/Resources.Sdk/Generated/ITemplateSpecsClient.cs rename to src/Resources/Resources.Management.Sdk/Generated/ITemplateSpecsClient.cs index f5798dce6889..f72e78ee13c0 100644 --- a/src/Resources/Resources.Sdk/Generated/ITemplateSpecsClient.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/ITemplateSpecsClient.cs @@ -1,25 +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 Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; /// - /// The APIs listed in this specification can be used to manage Template - /// Spec resources through the Azure Resource Manager. + /// The APIs listed in this specification can be used to manage Template Spec + /// resources through the Azure Resource Manager. /// - public partial interface ITemplateSpecsClient : System.IDisposable + public partial interface ITemplateSpecsClient : System.IDisposable { /// /// The base URI of the service. @@ -29,56 +23,61 @@ public partial interface ITemplateSpecsClient : System.IDisposable /// /// Gets or sets json serialization settings. /// - JsonSerializerSettings SerializationSettings { get; } + Newtonsoft.Json.JsonSerializerSettings SerializationSettings { get; } /// /// Gets or sets json deserialization settings. /// - JsonSerializerSettings DeserializationSettings { get; } + Newtonsoft.Json.JsonSerializerSettings DeserializationSettings { get; } /// /// Credentials needed for the client to connect to Azure. /// - ServiceClientCredentials Credentials { get; } + Microsoft.Rest.ServiceClientCredentials Credentials { get;} + /// - /// Subscription Id which forms part of the URI for every service call. + /// The API version to use for this operation. /// - string SubscriptionId { get; set; } + string ApiVersion { get;} + /// - /// Client Api version. + /// Subscription Id which forms part of the URI for every service call. /// - string ApiVersion { get; } + string SubscriptionId { get; set;} + /// /// The preferred language for the response. /// - string AcceptLanguage { get; set; } + string AcceptLanguage { get; set;} + /// /// The retry timeout in seconds for Long Running Operations. Default - /// value is 30. + /// /// value is 30. /// - int? LongRunningOperationRetryTimeout { get; set; } + int? LongRunningOperationRetryTimeout { get; set;} + /// /// Whether a unique x-ms-client-request-id should be generated. When - /// set to true a unique x-ms-client-request-id value is generated and - /// included in each request. Default is true. + /// /// set to true a unique x-ms-client-request-id value is generated and + /// /// included in each request. Default is true. /// - bool? GenerateClientRequestId { get; set; } + bool? GenerateClientRequestId { get; set;} /// - /// Gets the ITemplateSpecsOperations. + /// Gets the ITemplateSpecsOperations /// ITemplateSpecsOperations TemplateSpecs { get; } /// - /// Gets the ITemplateSpecVersionsOperations. + /// Gets the ITemplateSpecVersionsOperations /// ITemplateSpecVersionsOperations TemplateSpecVersions { get; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/ITemplateSpecsOperations.cs b/src/Resources/Resources.Management.Sdk/Generated/ITemplateSpecsOperations.cs similarity index 58% rename from src/Resources/Resources.Sdk/Generated/ITemplateSpecsOperations.cs rename to src/Resources/Resources.Management.Sdk/Generated/ITemplateSpecsOperations.cs index 8c5511ca891c..dbfab7614f73 100644 --- a/src/Resources/Resources.Sdk/Generated/ITemplateSpecsOperations.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/ITemplateSpecsOperations.cs @@ -1,22 +1,12 @@ -// // 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 Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// TemplateSpecsOperations operations. @@ -26,6 +16,9 @@ public partial interface ITemplateSpecsOperations /// /// Creates or updates a Template Spec. /// + /// + /// Creates or updates a Template Spec. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -41,19 +34,20 @@ public partial interface ITemplateSpecsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string templateSpecName, TemplateSpec templateSpec, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string templateSpecName, TemplateSpec templateSpec, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Updates Template Spec tags with specified values. /// + /// + /// Updates Template Spec tags with specified values. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -69,19 +63,20 @@ public partial interface ITemplateSpecsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string templateSpecName, TemplateSpecUpdateModel templateSpec = default(TemplateSpecUpdateModel), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string templateSpecName, TemplateSpecUpdateModel templateSpec = default(TemplateSpecUpdateModel), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets a Template Spec with a given name. /// + /// + /// Gets a Template Spec with a given name. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -89,8 +84,8 @@ public partial interface ITemplateSpecsOperations /// Name of the Template Spec. /// /// - /// Allows for expansion of additional Template Spec details in the - /// response. Optional. Possible values include: 'versions' + /// Allows for expansion of additional Template Spec details in the response. + /// Optional. /// /// /// The headers that will be added to request. @@ -98,20 +93,22 @@ public partial interface ITemplateSpecsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string templateSpecName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string templateSpecName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Deletes a Template Spec by name. When operation completes, status - /// code 200 returned without content. + /// Deletes a Template Spec by name. When operation completes, status code 200 + /// returned without content. /// + /// + /// Deletes a Template Spec by name. When operation completes, status code 200 + /// returned without content. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -124,19 +121,20 @@ public partial interface ITemplateSpecsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string templateSpecName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string templateSpecName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists all the Template Specs within the specified subscriptions. /// + /// + /// Lists all the Template Specs within the specified subscriptions. + /// /// - /// Allows for expansion of additional Template Spec details in the - /// response. Optional. Possible values include: 'versions' + /// Allows for expansion of additional Template Spec details in the response. + /// Optional. /// /// /// The headers that will be added to request. @@ -144,25 +142,26 @@ public partial interface ITemplateSpecsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListBySubscriptionWithHttpMessagesAsync(string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListBySubscriptionWithHttpMessagesAsync(string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists all the Template Specs within the specified resource group. /// + /// + /// Lists all the Template Specs within the specified resource group. + /// /// /// The name of the resource group. The name is case insensitive. /// /// - /// Allows for expansion of additional Template Spec details in the - /// response. Optional. Possible values include: 'versions' + /// Allows for expansion of additional Template Spec details in the response. + /// Optional. /// /// /// The headers that will be added to request. @@ -170,19 +169,20 @@ public partial interface ITemplateSpecsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists all the Template Specs within the specified subscriptions. /// + /// + /// Lists all the Template Specs within the specified subscriptions. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -192,19 +192,20 @@ public partial interface ITemplateSpecsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListBySubscriptionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListBySubscriptionNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists all the Template Specs within the specified resource group. /// + /// + /// Lists all the Template Specs within the specified resource group. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -214,15 +215,13 @@ public partial interface ITemplateSpecsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/ITenantsOperations.cs b/src/Resources/Resources.Management.Sdk/Generated/ITenantsOperations.cs similarity index 65% rename from src/Resources/Resources.Sdk/Generated/ITenantsOperations.cs rename to src/Resources/Resources.Management.Sdk/Generated/ITenantsOperations.cs index 1285c4d0da17..dd8ce9657071 100644 --- a/src/Resources/Resources.Sdk/Generated/ITenantsOperations.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/ITenantsOperations.cs @@ -1,22 +1,12 @@ -// // 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 Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// TenantsOperations operations. @@ -26,6 +16,9 @@ public partial interface ITenantsOperations /// /// Gets the tenants for your account. /// + /// + /// Gets the tenants for your account. + /// /// /// The headers that will be added to request. /// @@ -38,13 +31,14 @@ public partial interface ITenantsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets the tenants for your account. /// + /// + /// Gets the tenants for your account. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -60,9 +54,7 @@ public partial interface ITenantsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Management.Sdk/Generated/Models/Alias.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/Alias.cs new file mode 100644 index 000000000000..48b53f637f43 --- /dev/null +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/Alias.cs @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Resources.Models +{ + using System.Linq; + + /// + /// The alias type. + /// + public partial class Alias + { + /// + /// Initializes a new instance of the Alias class. + /// + public Alias() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Alias class. + /// + + /// The alias name. + /// + + /// The paths for an alias. + /// + + /// The type of the alias. + /// Possible values include: 'NotSpecified', 'PlainText', 'Mask' + + /// The default path for an alias. + /// + + /// The default pattern for an alias. + /// + + /// The default alias path metadata. Applies to the default path and to any + /// alias path that doesn't have metadata + /// + public Alias(string name = default(string), System.Collections.Generic.IList paths = default(System.Collections.Generic.IList), AliasType? type = default(AliasType?), string defaultPath = default(string), AliasPattern defaultPattern = default(AliasPattern), AliasPathMetadata defaultMetadata = default(AliasPathMetadata)) + + { + this.Name = name; + this.Paths = paths; + this.Type = type; + this.DefaultPath = defaultPath; + this.DefaultPattern = defaultPattern; + this.DefaultMetadata = defaultMetadata; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the alias name. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } + + /// + /// Gets or sets the paths for an alias. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "paths")] + public System.Collections.Generic.IList Paths {get; set; } + + /// + /// Gets or sets the type of the alias. Possible values include: 'NotSpecified', 'PlainText', 'Mask' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public AliasType? Type {get; set; } + + /// + /// Gets or sets the default path for an alias. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "defaultPath")] + public string DefaultPath {get; set; } + + /// + /// Gets or sets the default pattern for an alias. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "defaultPattern")] + public AliasPattern DefaultPattern {get; set; } + + /// + /// Gets the default alias path metadata. Applies to the default path and to + /// any alias path that doesn't have metadata + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "defaultMetadata")] + public AliasPathMetadata DefaultMetadata {get; private set; } + } +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/AliasPath.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/AliasPath.cs similarity index 53% rename from src/Resources/Resources.Sdk/Generated/Models/AliasPath.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/AliasPath.cs index a655473ff54f..264206e0342c 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/AliasPath.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/AliasPath.cs @@ -1,18 +1,10 @@ -// // 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.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,17 +23,26 @@ public AliasPath() /// /// Initializes a new instance of the AliasPath class. /// - /// The path of an alias. - /// The API versions. - /// The pattern for an alias path. - /// The metadata of the alias path. If missing, - /// fall back to the default metadata of the alias. - public AliasPath(string path = default(string), IList apiVersions = default(IList), AliasPattern pattern = default(AliasPattern), AliasPathMetadata metadata = default(AliasPathMetadata)) + + /// The path of an alias. + /// + + /// The API versions. + /// + + /// The pattern for an alias path. + /// + + /// The metadata of the alias path. If missing, fall back to the default + /// metadata of the alias. + /// + public AliasPath(string path = default(string), System.Collections.Generic.IList apiVersions = default(System.Collections.Generic.IList), AliasPattern pattern = default(AliasPattern), AliasPathMetadata metadata = default(AliasPathMetadata)) + { - Path = path; - ApiVersions = apiVersions; - Pattern = pattern; - Metadata = metadata; + this.Path = path; + this.ApiVersions = apiVersions; + this.Pattern = pattern; + this.Metadata = metadata; CustomInit(); } @@ -50,30 +51,30 @@ public AliasPath() /// partial void CustomInit(); + /// /// Gets or sets the path of an alias. /// - [JsonProperty(PropertyName = "path")] - public string Path { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "path")] + public string Path {get; set; } /// /// Gets or sets the API versions. /// - [JsonProperty(PropertyName = "apiVersions")] - public IList ApiVersions { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "apiVersions")] + public System.Collections.Generic.IList ApiVersions {get; set; } /// /// Gets or sets the pattern for an alias path. /// - [JsonProperty(PropertyName = "pattern")] - public AliasPattern Pattern { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "pattern")] + public AliasPattern Pattern {get; set; } /// - /// Gets the metadata of the alias path. If missing, fall back to the - /// default metadata of the alias. + /// Gets the metadata of the alias path. If missing, fall back to the default + /// metadata of the alias. /// - [JsonProperty(PropertyName = "metadata")] - public AliasPathMetadata Metadata { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "metadata")] + public AliasPathMetadata Metadata {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/AliasPathAttributes.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/AliasPathAttributes.cs similarity index 83% rename from src/Resources/Resources.Sdk/Generated/Models/AliasPathAttributes.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/AliasPathAttributes.cs index 5992a064af13..63db94052ed7 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/AliasPathAttributes.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/AliasPathAttributes.cs @@ -1,12 +1,7 @@ -// // 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.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Resources.Models /// /// Defines values for AliasPathAttributes. /// + + public static class AliasPathAttributes { /// @@ -21,9 +18,9 @@ public static class AliasPathAttributes /// public const string None = "None"; /// - /// The token that the alias path is referring to is modifiable by - /// policies with 'modify' effect. + /// The token that the alias path is referring to is modifiable by policies + /// with 'modify' effect. /// public const string Modifiable = "Modifiable"; } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/AliasPathMetadata.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/AliasPathMetadata.cs similarity index 58% rename from src/Resources/Resources.Sdk/Generated/Models/AliasPathMetadata.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/AliasPathMetadata.cs index 4fa718d80a3c..615dfe9b691e 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/AliasPathMetadata.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/AliasPathMetadata.cs @@ -1,16 +1,10 @@ -// // 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.Models { - using Newtonsoft.Json; using System.Linq; public partial class AliasPathMetadata @@ -26,16 +20,18 @@ public AliasPathMetadata() /// /// Initializes a new instance of the AliasPathMetadata class. /// - /// The type of the token that the alias path is - /// referring to. Possible values include: 'NotSpecified', 'Any', - /// 'String', 'Object', 'Array', 'Integer', 'Number', 'Boolean' - /// The attributes of the token that the alias - /// path is referring to. Possible values include: 'None', - /// 'Modifiable' + + /// The type of the token that the alias path is referring to. + /// Possible values include: 'NotSpecified', 'Any', 'String', 'Object', + /// 'Array', 'Integer', 'Number', 'Boolean' + + /// The attributes of the token that the alias path is referring to. + /// Possible values include: 'None', 'Modifiable' public AliasPathMetadata(string type = default(string), string attributes = default(string)) + { - Type = type; - Attributes = attributes; + this.Type = type; + this.Attributes = attributes; CustomInit(); } @@ -44,20 +40,17 @@ public AliasPathMetadata() /// partial void CustomInit(); + /// - /// Gets the type of the token that the alias path is referring to. - /// Possible values include: 'NotSpecified', 'Any', 'String', 'Object', - /// 'Array', 'Integer', 'Number', 'Boolean' + /// Gets the type of the token that the alias path is referring to. Possible values include: 'NotSpecified', 'Any', 'String', 'Object', 'Array', 'Integer', 'Number', 'Boolean' /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } /// - /// Gets the attributes of the token that the alias path is referring - /// to. Possible values include: 'None', 'Modifiable' + /// Gets the attributes of the token that the alias path is referring to. Possible values include: 'None', 'Modifiable' /// - [JsonProperty(PropertyName = "attributes")] - public string Attributes { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "attributes")] + public string Attributes {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/AliasPathTokenType.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/AliasPathTokenType.cs similarity index 93% rename from src/Resources/Resources.Sdk/Generated/Models/AliasPathTokenType.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/AliasPathTokenType.cs index d013d372299d..2b2971943a4e 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/AliasPathTokenType.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/AliasPathTokenType.cs @@ -1,12 +1,7 @@ -// // 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.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Resources.Models /// /// Defines values for AliasPathTokenType. /// + + public static class AliasPathTokenType { /// @@ -49,4 +46,4 @@ public static class AliasPathTokenType /// public const string Boolean = "Boolean"; } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/AliasPattern.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/AliasPattern.cs similarity index 60% rename from src/Resources/Resources.Sdk/Generated/Models/AliasPattern.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/AliasPattern.cs index 0db278cf0c25..21fe93df6de5 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/AliasPattern.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/AliasPattern.cs @@ -1,16 +1,10 @@ -// // 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.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,15 +23,21 @@ public AliasPattern() /// /// Initializes a new instance of the AliasPattern class. /// - /// The alias pattern phrase. - /// The alias pattern variable. - /// The type of alias pattern. Possible values - /// include: 'NotSpecified', 'Extract' + + /// The alias pattern phrase. + /// + + /// The alias pattern variable. + /// + + /// The type of alias pattern + /// Possible values include: 'NotSpecified', 'Extract' public AliasPattern(string phrase = default(string), string variable = default(string), AliasPatternType? type = default(AliasPatternType?)) + { - Phrase = phrase; - Variable = variable; - Type = type; + this.Phrase = phrase; + this.Variable = variable; + this.Type = type; CustomInit(); } @@ -46,24 +46,23 @@ public AliasPattern() /// partial void CustomInit(); + /// /// Gets or sets the alias pattern phrase. /// - [JsonProperty(PropertyName = "phrase")] - public string Phrase { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "phrase")] + public string Phrase {get; set; } /// /// Gets or sets the alias pattern variable. /// - [JsonProperty(PropertyName = "variable")] - public string Variable { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "variable")] + public string Variable {get; set; } /// - /// Gets or sets the type of alias pattern. Possible values include: - /// 'NotSpecified', 'Extract' + /// Gets or sets the type of alias pattern Possible values include: 'NotSpecified', 'Extract' /// - [JsonProperty(PropertyName = "type")] - public AliasPatternType? Type { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public AliasPatternType? Type {get; set; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/AliasPatternType.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/AliasPatternType.cs similarity index 81% rename from src/Resources/Resources.Sdk/Generated/Models/AliasPatternType.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/AliasPatternType.cs index 60642ee728ef..2a67ace8386d 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/AliasPatternType.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/AliasPatternType.cs @@ -1,35 +1,28 @@ -// // 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.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; /// /// Defines values for AliasPatternType. /// - [JsonConverter(typeof(StringEnumConverter))] + + + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] public enum AliasPatternType { /// /// NotSpecified is not allowed. /// - [EnumMember(Value = "NotSpecified")] + [System.Runtime.Serialization.EnumMember(Value = "NotSpecified")] NotSpecified, /// /// Extract is the only allowed value. /// - [EnumMember(Value = "Extract")] + [System.Runtime.Serialization.EnumMember(Value = "Extract")] Extract } internal static class AliasPatternTypeEnumExtension @@ -38,7 +31,6 @@ internal static string ToSerializedValue(this AliasPatternType? value) { return value == null ? null : ((AliasPatternType)value).ToSerializedValue(); } - internal static string ToSerializedValue(this AliasPatternType value) { switch( value ) @@ -50,7 +42,6 @@ internal static string ToSerializedValue(this AliasPatternType value) } return null; } - internal static AliasPatternType? ParseAliasPatternType(this string value) { switch( value ) @@ -63,4 +54,4 @@ internal static string ToSerializedValue(this AliasPatternType value) return null; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/AliasType.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/AliasType.cs similarity index 81% rename from src/Resources/Resources.Sdk/Generated/Models/AliasType.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/AliasType.cs index 2c4778d0cd39..d4522b815654 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/AliasType.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/AliasType.cs @@ -1,40 +1,33 @@ -// // 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.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; /// /// Defines values for AliasType. /// - [JsonConverter(typeof(StringEnumConverter))] + + + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] public enum AliasType { /// /// Alias type is unknown (same as not providing alias type). /// - [EnumMember(Value = "NotSpecified")] + [System.Runtime.Serialization.EnumMember(Value = "NotSpecified")] NotSpecified, /// /// Alias value is not secret. /// - [EnumMember(Value = "PlainText")] + [System.Runtime.Serialization.EnumMember(Value = "PlainText")] PlainText, /// /// Alias value is secret. /// - [EnumMember(Value = "Mask")] + [System.Runtime.Serialization.EnumMember(Value = "Mask")] Mask } internal static class AliasTypeEnumExtension @@ -43,7 +36,6 @@ internal static string ToSerializedValue(this AliasType? value) { return value == null ? null : ((AliasType)value).ToSerializedValue(); } - internal static string ToSerializedValue(this AliasType value) { switch( value ) @@ -57,7 +49,6 @@ internal static string ToSerializedValue(this AliasType value) } return null; } - internal static AliasType? ParseAliasType(this string value) { switch( value ) @@ -72,4 +63,4 @@ internal static string ToSerializedValue(this AliasType value) return null; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/ApiProfile.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/ApiProfile.cs similarity index 67% rename from src/Resources/Resources.Sdk/Generated/Models/ApiProfile.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/ApiProfile.cs index e8bc5f4ec665..74e67ffa19c5 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/ApiProfile.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/ApiProfile.cs @@ -1,16 +1,10 @@ -// // 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.Models { - using Newtonsoft.Json; using System.Linq; public partial class ApiProfile @@ -26,12 +20,17 @@ public ApiProfile() /// /// Initializes a new instance of the ApiProfile class. /// - /// The profile version. - /// The API version. + + /// The profile version. + /// + + /// The API version. + /// public ApiProfile(string profileVersion = default(string), string apiVersion = default(string)) + { - ProfileVersion = profileVersion; - ApiVersion = apiVersion; + this.ProfileVersion = profileVersion; + this.ApiVersion = apiVersion; CustomInit(); } @@ -40,17 +39,17 @@ public ApiProfile() /// partial void CustomInit(); + /// /// Gets the profile version. /// - [JsonProperty(PropertyName = "profileVersion")] - public string ProfileVersion { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "profileVersion")] + public string ProfileVersion {get; private set; } /// /// Gets the API version. /// - [JsonProperty(PropertyName = "apiVersion")] - public string ApiVersion { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "apiVersion")] + public string ApiVersion {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/AuthorizationProfile.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/AuthorizationProfile.cs similarity index 58% rename from src/Resources/Resources.Sdk/Generated/Models/AuthorizationProfile.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/AuthorizationProfile.cs index 1cca3bfb036d..8c58553e80fb 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/AuthorizationProfile.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/AuthorizationProfile.cs @@ -1,16 +1,10 @@ -// // 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.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,18 +23,29 @@ public AuthorizationProfile() /// /// Initializes a new instance of the AuthorizationProfile class. /// - /// The requested time - /// The requester - /// The requester object id - /// The approved time - /// The approver + + /// The requested time + /// + + /// The requester + /// + + /// The requester object id + /// + + /// The approved time + /// + + /// The approver + /// public AuthorizationProfile(System.DateTime? requestedTime = default(System.DateTime?), string requester = default(string), string requesterObjectId = default(string), System.DateTime? approvedTime = default(System.DateTime?), string approver = default(string)) + { - RequestedTime = requestedTime; - Requester = requester; - RequesterObjectId = requesterObjectId; - ApprovedTime = approvedTime; - Approver = approver; + this.RequestedTime = requestedTime; + this.Requester = requester; + this.RequesterObjectId = requesterObjectId; + this.ApprovedTime = approvedTime; + this.Approver = approver; CustomInit(); } @@ -49,35 +54,35 @@ public AuthorizationProfile() /// partial void CustomInit(); + /// /// Gets the requested time /// - [JsonProperty(PropertyName = "requestedTime")] - public System.DateTime? RequestedTime { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "requestedTime")] + public System.DateTime? RequestedTime {get; private set; } /// /// Gets the requester /// - [JsonProperty(PropertyName = "requester")] - public string Requester { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "requester")] + public string Requester {get; private set; } /// /// Gets the requester object id /// - [JsonProperty(PropertyName = "requesterObjectId")] - public string RequesterObjectId { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "requesterObjectId")] + public string RequesterObjectId {get; private set; } /// /// Gets the approved time /// - [JsonProperty(PropertyName = "approvedTime")] - public System.DateTime? ApprovedTime { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "approvedTime")] + public System.DateTime? ApprovedTime {get; private set; } /// /// Gets the approver /// - [JsonProperty(PropertyName = "approver")] - public string Approver { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "approver")] + public string Approver {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/AvailabilityZonePeers.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/AvailabilityZonePeers.cs similarity index 71% rename from src/Resources/Resources.Sdk/Generated/Models/AvailabilityZonePeers.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/AvailabilityZonePeers.cs index 47f386176876..39dc3a60abc0 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/AvailabilityZonePeers.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/AvailabilityZonePeers.cs @@ -1,18 +1,10 @@ -// // 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.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,12 +23,17 @@ public AvailabilityZonePeers() /// /// Initializes a new instance of the AvailabilityZonePeers class. /// - /// The availabilityZone. - /// Details of shared availability zone. - public AvailabilityZonePeers(string availabilityZone = default(string), IList peers = default(IList)) + + /// The availabilityZone. + /// + + /// Details of shared availability zone. + /// + public AvailabilityZonePeers(string availabilityZone = default(string), System.Collections.Generic.IList peers = default(System.Collections.Generic.IList)) + { - AvailabilityZone = availabilityZone; - Peers = peers; + this.AvailabilityZone = availabilityZone; + this.Peers = peers; CustomInit(); } @@ -45,17 +42,17 @@ public AvailabilityZonePeers() /// partial void CustomInit(); + /// /// Gets the availabilityZone. /// - [JsonProperty(PropertyName = "availabilityZone")] - public string AvailabilityZone { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "availabilityZone")] + public string AvailabilityZone {get; private set; } /// /// Gets or sets details of shared availability zone. /// - [JsonProperty(PropertyName = "peers")] - public IList Peers { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "peers")] + public System.Collections.Generic.IList Peers {get; set; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Management.Sdk/Generated/Models/AzureCliScript.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/AzureCliScript.cs new file mode 100644 index 000000000000..7005f831622f --- /dev/null +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/AzureCliScript.cs @@ -0,0 +1,268 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Resources.Models +{ + using System.Linq; + + /// + /// Object model for the Azure CLI script. + /// + [Newtonsoft.Json.JsonObject("AzureCLI")] + [Microsoft.Rest.Serialization.JsonTransformation] + public partial class AzureCliScript : DeploymentScript + { + /// + /// Initializes a new instance of the AzureCliScript class. + /// + public AzureCliScript() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AzureCliScript class. + /// + + /// String Id used to locate any resource on Azure. + /// + + /// Name of this resource. + /// + + /// Type of this resource. + /// + + /// Optional property. Managed identity to be used for this deployment script. + /// Currently, only user-assigned MSI is supported. + /// + + /// The location of the ACI and the storage account for the deployment script. + /// + + /// Resource tags. + /// + + /// The system metadata related to this resource. + /// + + /// Container settings. + /// + + /// Storage Account settings. + /// + + /// The clean up preference when the script execution gets in a terminal state. + /// Default setting is 'Always'. + /// Possible values include: 'Always', 'OnSuccess', 'OnExpiration' + + /// State of the script execution. This only appears in the response. + /// Possible values include: 'Creating', 'ProvisioningResources', 'Running', + /// 'Succeeded', 'Failed', 'Canceled' + + /// Contains the results of script execution. + /// + + /// List of script outputs. + /// + + /// Uri for the script. This is the entry point for the external script. + /// + + /// Supporting files for the external script. + /// + + /// Script body. + /// + + /// Command line arguments to pass to the script. Arguments are separated by + /// spaces. ex: -Name blue* -Location 'West US 2' + /// + + /// The environment variables to pass over to the script. + /// + + /// Gets or sets how the deployment script should be forced to execute even if + /// the script resource has not changed. Can be current time stamp or a GUID. + /// + + /// Interval for which the service retains the script resource after it reaches + /// a terminal state. Resource will be deleted when this duration expires. + /// Duration is based on ISO 8601 pattern (for example P1D means one day). + /// + + /// Maximum allowed script execution time specified in ISO 8601 format. Default + /// value is P1D + /// + + /// Azure CLI module version to be used. + /// + public AzureCliScript(string location, System.TimeSpan retentionInterval, string azCliVersion, string id = default(string), string name = default(string), string type = default(string), ManagedServiceIdentity identity = default(ManagedServiceIdentity), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), SystemData systemData = default(SystemData), ContainerConfiguration containerSettings = default(ContainerConfiguration), StorageAccountConfiguration storageAccountSettings = default(StorageAccountConfiguration), string cleanupPreference = default(string), string provisioningState = default(string), ScriptStatus status = default(ScriptStatus), System.Collections.Generic.IDictionary outputs = default(System.Collections.Generic.IDictionary), string primaryScriptUri = default(string), System.Collections.Generic.IList supportingScriptUris = default(System.Collections.Generic.IList), string scriptContent = default(string), string arguments = default(string), System.Collections.Generic.IList environmentVariables = default(System.Collections.Generic.IList), string forceUpdateTag = default(string), System.TimeSpan? timeout = default(System.TimeSpan?)) + + : base(location, id, name, type, identity, tags, systemData) + { + this.ContainerSettings = containerSettings; + this.StorageAccountSettings = storageAccountSettings; + this.CleanupPreference = cleanupPreference; + this.ProvisioningState = provisioningState; + this.Status = status; + this.Outputs = outputs; + this.PrimaryScriptUri = primaryScriptUri; + this.SupportingScriptUris = supportingScriptUris; + this.ScriptContent = scriptContent; + this.Arguments = arguments; + this.EnvironmentVariables = environmentVariables; + this.ForceUpdateTag = forceUpdateTag; + this.RetentionInterval = retentionInterval; + this.Timeout = timeout; + this.AzCliVersion = azCliVersion; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets container settings. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.containerSettings")] + public ContainerConfiguration ContainerSettings {get; set; } + + /// + /// Gets or sets storage Account settings. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.storageAccountSettings")] + public StorageAccountConfiguration StorageAccountSettings {get; set; } + + /// + /// Gets or sets the clean up preference when the script execution gets in a + /// terminal state. Default setting is 'Always'. Possible values include: 'Always', 'OnSuccess', 'OnExpiration' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.cleanupPreference")] + public string CleanupPreference {get; set; } + + /// + /// Gets state of the script execution. This only appears in the response. Possible values include: 'Creating', 'ProvisioningResources', 'Running', 'Succeeded', 'Failed', 'Canceled' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets contains the results of script execution. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.status")] + public ScriptStatus Status {get; private set; } + + /// + /// Gets list of script outputs. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.outputs")] + public System.Collections.Generic.IDictionary Outputs {get; private set; } + + /// + /// Gets or sets uri for the script. This is the entry point for the external + /// script. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.primaryScriptUri")] + public string PrimaryScriptUri {get; set; } + + /// + /// Gets or sets supporting files for the external script. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.supportingScriptUris")] + public System.Collections.Generic.IList SupportingScriptUris {get; set; } + + /// + /// Gets or sets script body. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.scriptContent")] + public string ScriptContent {get; set; } + + /// + /// Gets or sets command line arguments to pass to the script. Arguments are + /// separated by spaces. ex: -Name blue* -Location 'West US 2' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.arguments")] + public string Arguments {get; set; } + + /// + /// Gets or sets the environment variables to pass over to the script. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.environmentVariables")] + public System.Collections.Generic.IList EnvironmentVariables {get; set; } + + /// + /// Gets or sets gets or sets how the deployment script should be forced to + /// execute even if the script resource has not changed. Can be current time + /// stamp or a GUID. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.forceUpdateTag")] + public string ForceUpdateTag {get; set; } + + /// + /// Gets or sets interval for which the service retains the script resource + /// after it reaches a terminal state. Resource will be deleted when this + /// duration expires. Duration is based on ISO 8601 pattern (for example P1D + /// means one day). + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.retentionInterval")] + public System.TimeSpan RetentionInterval {get; set; } + + /// + /// Gets or sets maximum allowed script execution time specified in ISO 8601 + /// format. Default value is P1D + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.timeout")] + public System.TimeSpan? Timeout {get; set; } + + /// + /// Gets or sets azure CLI module version to be used. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.azCliVersion")] + public string AzCliVersion {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + if (this.AzCliVersion == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "AzCliVersion"); + } + if (this.ContainerSettings != null) + { + this.ContainerSettings.Validate(); + } + + + + + + + + + + if (this.EnvironmentVariables != null) + { + foreach (var element in this.EnvironmentVariables) + { + if (element != null) + { + element.Validate(); + } + } + } + + + } + } +} \ No newline at end of file diff --git a/src/Resources/Resources.Management.Sdk/Generated/Models/AzureCliScriptProperties.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/AzureCliScriptProperties.cs new file mode 100644 index 000000000000..a0d25a2cbb54 --- /dev/null +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/AzureCliScriptProperties.cs @@ -0,0 +1,242 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Resources.Models +{ + using System.Linq; + + /// + /// Properties of the Azure CLI script object. + /// + public partial class AzureCliScriptProperties + { + /// + /// Initializes a new instance of the AzureCliScriptProperties class. + /// + public AzureCliScriptProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AzureCliScriptProperties class. + /// + + /// Container settings. + /// + + /// Storage Account settings. + /// + + /// The clean up preference when the script execution gets in a terminal state. + /// Default setting is 'Always'. + /// Possible values include: 'Always', 'OnSuccess', 'OnExpiration' + + /// State of the script execution. This only appears in the response. + /// Possible values include: 'Creating', 'ProvisioningResources', 'Running', + /// 'Succeeded', 'Failed', 'Canceled' + + /// Contains the results of script execution. + /// + + /// List of script outputs. + /// + + /// Uri for the script. This is the entry point for the external script. + /// + + /// Supporting files for the external script. + /// + + /// Script body. + /// + + /// Command line arguments to pass to the script. Arguments are separated by + /// spaces. ex: -Name blue* -Location 'West US 2' + /// + + /// The environment variables to pass over to the script. + /// + + /// Gets or sets how the deployment script should be forced to execute even if + /// the script resource has not changed. Can be current time stamp or a GUID. + /// + + /// Interval for which the service retains the script resource after it reaches + /// a terminal state. Resource will be deleted when this duration expires. + /// Duration is based on ISO 8601 pattern (for example P1D means one day). + /// + + /// Maximum allowed script execution time specified in ISO 8601 format. Default + /// value is P1D + /// + + /// Azure CLI module version to be used. + /// + public AzureCliScriptProperties(System.TimeSpan retentionInterval, string azCliVersion, ContainerConfiguration containerSettings = default(ContainerConfiguration), StorageAccountConfiguration storageAccountSettings = default(StorageAccountConfiguration), string cleanupPreference = default(string), string provisioningState = default(string), ScriptStatus status = default(ScriptStatus), System.Collections.Generic.IDictionary outputs = default(System.Collections.Generic.IDictionary), string primaryScriptUri = default(string), System.Collections.Generic.IList supportingScriptUris = default(System.Collections.Generic.IList), string scriptContent = default(string), string arguments = default(string), System.Collections.Generic.IList environmentVariables = default(System.Collections.Generic.IList), string forceUpdateTag = default(string), System.TimeSpan? timeout = default(System.TimeSpan?)) + + { + this.ContainerSettings = containerSettings; + this.StorageAccountSettings = storageAccountSettings; + this.CleanupPreference = cleanupPreference; + this.ProvisioningState = provisioningState; + this.Status = status; + this.Outputs = outputs; + this.PrimaryScriptUri = primaryScriptUri; + this.SupportingScriptUris = supportingScriptUris; + this.ScriptContent = scriptContent; + this.Arguments = arguments; + this.EnvironmentVariables = environmentVariables; + this.ForceUpdateTag = forceUpdateTag; + this.RetentionInterval = retentionInterval; + this.Timeout = timeout; + this.AzCliVersion = azCliVersion; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets container settings. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "containerSettings")] + public ContainerConfiguration ContainerSettings {get; set; } + + /// + /// Gets or sets storage Account settings. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "storageAccountSettings")] + public StorageAccountConfiguration StorageAccountSettings {get; set; } + + /// + /// Gets or sets the clean up preference when the script execution gets in a + /// terminal state. Default setting is 'Always'. Possible values include: 'Always', 'OnSuccess', 'OnExpiration' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "cleanupPreference")] + public string CleanupPreference {get; set; } + + /// + /// Gets state of the script execution. This only appears in the response. Possible values include: 'Creating', 'ProvisioningResources', 'Running', 'Succeeded', 'Failed', 'Canceled' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets contains the results of script execution. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "status")] + public ScriptStatus Status {get; private set; } + + /// + /// Gets list of script outputs. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "outputs")] + public System.Collections.Generic.IDictionary Outputs {get; private set; } + + /// + /// Gets or sets uri for the script. This is the entry point for the external + /// script. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "primaryScriptUri")] + public string PrimaryScriptUri {get; set; } + + /// + /// Gets or sets supporting files for the external script. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "supportingScriptUris")] + public System.Collections.Generic.IList SupportingScriptUris {get; set; } + + /// + /// Gets or sets script body. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "scriptContent")] + public string ScriptContent {get; set; } + + /// + /// Gets or sets command line arguments to pass to the script. Arguments are + /// separated by spaces. ex: -Name blue* -Location 'West US 2' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "arguments")] + public string Arguments {get; set; } + + /// + /// Gets or sets the environment variables to pass over to the script. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "environmentVariables")] + public System.Collections.Generic.IList EnvironmentVariables {get; set; } + + /// + /// Gets or sets gets or sets how the deployment script should be forced to + /// execute even if the script resource has not changed. Can be current time + /// stamp or a GUID. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "forceUpdateTag")] + public string ForceUpdateTag {get; set; } + + /// + /// Gets or sets interval for which the service retains the script resource + /// after it reaches a terminal state. Resource will be deleted when this + /// duration expires. Duration is based on ISO 8601 pattern (for example P1D + /// means one day). + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "retentionInterval")] + public System.TimeSpan RetentionInterval {get; set; } + + /// + /// Gets or sets maximum allowed script execution time specified in ISO 8601 + /// format. Default value is P1D + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "timeout")] + public System.TimeSpan? Timeout {get; set; } + + /// + /// Gets or sets azure CLI module version to be used. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "azCliVersion")] + public string AzCliVersion {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (this.AzCliVersion == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "AzCliVersion"); + } + if (this.ContainerSettings != null) + { + this.ContainerSettings.Validate(); + } + + + + + + + + + + if (this.EnvironmentVariables != null) + { + foreach (var element in this.EnvironmentVariables) + { + if (element != null) + { + element.Validate(); + } + } + } + + + } + } +} \ No newline at end of file diff --git a/src/Resources/Resources.Management.Sdk/Generated/Models/AzurePowerShellScript.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/AzurePowerShellScript.cs new file mode 100644 index 000000000000..4e9172613852 --- /dev/null +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/AzurePowerShellScript.cs @@ -0,0 +1,268 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Resources.Models +{ + using System.Linq; + + /// + /// Object model for the Azure PowerShell script. + /// + [Newtonsoft.Json.JsonObject("AzurePowerShell")] + [Microsoft.Rest.Serialization.JsonTransformation] + public partial class AzurePowerShellScript : DeploymentScript + { + /// + /// Initializes a new instance of the AzurePowerShellScript class. + /// + public AzurePowerShellScript() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AzurePowerShellScript class. + /// + + /// String Id used to locate any resource on Azure. + /// + + /// Name of this resource. + /// + + /// Type of this resource. + /// + + /// Optional property. Managed identity to be used for this deployment script. + /// Currently, only user-assigned MSI is supported. + /// + + /// The location of the ACI and the storage account for the deployment script. + /// + + /// Resource tags. + /// + + /// The system metadata related to this resource. + /// + + /// Container settings. + /// + + /// Storage Account settings. + /// + + /// The clean up preference when the script execution gets in a terminal state. + /// Default setting is 'Always'. + /// Possible values include: 'Always', 'OnSuccess', 'OnExpiration' + + /// State of the script execution. This only appears in the response. + /// Possible values include: 'Creating', 'ProvisioningResources', 'Running', + /// 'Succeeded', 'Failed', 'Canceled' + + /// Contains the results of script execution. + /// + + /// List of script outputs. + /// + + /// Uri for the script. This is the entry point for the external script. + /// + + /// Supporting files for the external script. + /// + + /// Script body. + /// + + /// Command line arguments to pass to the script. Arguments are separated by + /// spaces. ex: -Name blue* -Location 'West US 2' + /// + + /// The environment variables to pass over to the script. + /// + + /// Gets or sets how the deployment script should be forced to execute even if + /// the script resource has not changed. Can be current time stamp or a GUID. + /// + + /// Interval for which the service retains the script resource after it reaches + /// a terminal state. Resource will be deleted when this duration expires. + /// Duration is based on ISO 8601 pattern (for example P1D means one day). + /// + + /// Maximum allowed script execution time specified in ISO 8601 format. Default + /// value is P1D + /// + + /// Azure PowerShell module version to be used. + /// + public AzurePowerShellScript(string location, System.TimeSpan retentionInterval, string azPowerShellVersion, string id = default(string), string name = default(string), string type = default(string), ManagedServiceIdentity identity = default(ManagedServiceIdentity), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), SystemData systemData = default(SystemData), ContainerConfiguration containerSettings = default(ContainerConfiguration), StorageAccountConfiguration storageAccountSettings = default(StorageAccountConfiguration), string cleanupPreference = default(string), string provisioningState = default(string), ScriptStatus status = default(ScriptStatus), System.Collections.Generic.IDictionary outputs = default(System.Collections.Generic.IDictionary), string primaryScriptUri = default(string), System.Collections.Generic.IList supportingScriptUris = default(System.Collections.Generic.IList), string scriptContent = default(string), string arguments = default(string), System.Collections.Generic.IList environmentVariables = default(System.Collections.Generic.IList), string forceUpdateTag = default(string), System.TimeSpan? timeout = default(System.TimeSpan?)) + + : base(location, id, name, type, identity, tags, systemData) + { + this.ContainerSettings = containerSettings; + this.StorageAccountSettings = storageAccountSettings; + this.CleanupPreference = cleanupPreference; + this.ProvisioningState = provisioningState; + this.Status = status; + this.Outputs = outputs; + this.PrimaryScriptUri = primaryScriptUri; + this.SupportingScriptUris = supportingScriptUris; + this.ScriptContent = scriptContent; + this.Arguments = arguments; + this.EnvironmentVariables = environmentVariables; + this.ForceUpdateTag = forceUpdateTag; + this.RetentionInterval = retentionInterval; + this.Timeout = timeout; + this.AzPowerShellVersion = azPowerShellVersion; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets container settings. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.containerSettings")] + public ContainerConfiguration ContainerSettings {get; set; } + + /// + /// Gets or sets storage Account settings. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.storageAccountSettings")] + public StorageAccountConfiguration StorageAccountSettings {get; set; } + + /// + /// Gets or sets the clean up preference when the script execution gets in a + /// terminal state. Default setting is 'Always'. Possible values include: 'Always', 'OnSuccess', 'OnExpiration' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.cleanupPreference")] + public string CleanupPreference {get; set; } + + /// + /// Gets state of the script execution. This only appears in the response. Possible values include: 'Creating', 'ProvisioningResources', 'Running', 'Succeeded', 'Failed', 'Canceled' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets contains the results of script execution. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.status")] + public ScriptStatus Status {get; private set; } + + /// + /// Gets list of script outputs. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.outputs")] + public System.Collections.Generic.IDictionary Outputs {get; private set; } + + /// + /// Gets or sets uri for the script. This is the entry point for the external + /// script. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.primaryScriptUri")] + public string PrimaryScriptUri {get; set; } + + /// + /// Gets or sets supporting files for the external script. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.supportingScriptUris")] + public System.Collections.Generic.IList SupportingScriptUris {get; set; } + + /// + /// Gets or sets script body. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.scriptContent")] + public string ScriptContent {get; set; } + + /// + /// Gets or sets command line arguments to pass to the script. Arguments are + /// separated by spaces. ex: -Name blue* -Location 'West US 2' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.arguments")] + public string Arguments {get; set; } + + /// + /// Gets or sets the environment variables to pass over to the script. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.environmentVariables")] + public System.Collections.Generic.IList EnvironmentVariables {get; set; } + + /// + /// Gets or sets gets or sets how the deployment script should be forced to + /// execute even if the script resource has not changed. Can be current time + /// stamp or a GUID. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.forceUpdateTag")] + public string ForceUpdateTag {get; set; } + + /// + /// Gets or sets interval for which the service retains the script resource + /// after it reaches a terminal state. Resource will be deleted when this + /// duration expires. Duration is based on ISO 8601 pattern (for example P1D + /// means one day). + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.retentionInterval")] + public System.TimeSpan RetentionInterval {get; set; } + + /// + /// Gets or sets maximum allowed script execution time specified in ISO 8601 + /// format. Default value is P1D + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.timeout")] + public System.TimeSpan? Timeout {get; set; } + + /// + /// Gets or sets azure PowerShell module version to be used. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.azPowerShellVersion")] + public string AzPowerShellVersion {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + if (this.AzPowerShellVersion == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "AzPowerShellVersion"); + } + if (this.ContainerSettings != null) + { + this.ContainerSettings.Validate(); + } + + + + + + + + + + if (this.EnvironmentVariables != null) + { + foreach (var element in this.EnvironmentVariables) + { + if (element != null) + { + element.Validate(); + } + } + } + + + } + } +} \ No newline at end of file diff --git a/src/Resources/Resources.Management.Sdk/Generated/Models/AzurePowerShellScriptProperties.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/AzurePowerShellScriptProperties.cs new file mode 100644 index 000000000000..aad7caa49352 --- /dev/null +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/AzurePowerShellScriptProperties.cs @@ -0,0 +1,242 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Resources.Models +{ + using System.Linq; + + /// + /// Properties of the Azure PowerShell script object. + /// + public partial class AzurePowerShellScriptProperties + { + /// + /// Initializes a new instance of the AzurePowerShellScriptProperties class. + /// + public AzurePowerShellScriptProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AzurePowerShellScriptProperties class. + /// + + /// Container settings. + /// + + /// Storage Account settings. + /// + + /// The clean up preference when the script execution gets in a terminal state. + /// Default setting is 'Always'. + /// Possible values include: 'Always', 'OnSuccess', 'OnExpiration' + + /// State of the script execution. This only appears in the response. + /// Possible values include: 'Creating', 'ProvisioningResources', 'Running', + /// 'Succeeded', 'Failed', 'Canceled' + + /// Contains the results of script execution. + /// + + /// List of script outputs. + /// + + /// Uri for the script. This is the entry point for the external script. + /// + + /// Supporting files for the external script. + /// + + /// Script body. + /// + + /// Command line arguments to pass to the script. Arguments are separated by + /// spaces. ex: -Name blue* -Location 'West US 2' + /// + + /// The environment variables to pass over to the script. + /// + + /// Gets or sets how the deployment script should be forced to execute even if + /// the script resource has not changed. Can be current time stamp or a GUID. + /// + + /// Interval for which the service retains the script resource after it reaches + /// a terminal state. Resource will be deleted when this duration expires. + /// Duration is based on ISO 8601 pattern (for example P1D means one day). + /// + + /// Maximum allowed script execution time specified in ISO 8601 format. Default + /// value is P1D + /// + + /// Azure PowerShell module version to be used. + /// + public AzurePowerShellScriptProperties(System.TimeSpan retentionInterval, string azPowerShellVersion, ContainerConfiguration containerSettings = default(ContainerConfiguration), StorageAccountConfiguration storageAccountSettings = default(StorageAccountConfiguration), string cleanupPreference = default(string), string provisioningState = default(string), ScriptStatus status = default(ScriptStatus), System.Collections.Generic.IDictionary outputs = default(System.Collections.Generic.IDictionary), string primaryScriptUri = default(string), System.Collections.Generic.IList supportingScriptUris = default(System.Collections.Generic.IList), string scriptContent = default(string), string arguments = default(string), System.Collections.Generic.IList environmentVariables = default(System.Collections.Generic.IList), string forceUpdateTag = default(string), System.TimeSpan? timeout = default(System.TimeSpan?)) + + { + this.ContainerSettings = containerSettings; + this.StorageAccountSettings = storageAccountSettings; + this.CleanupPreference = cleanupPreference; + this.ProvisioningState = provisioningState; + this.Status = status; + this.Outputs = outputs; + this.PrimaryScriptUri = primaryScriptUri; + this.SupportingScriptUris = supportingScriptUris; + this.ScriptContent = scriptContent; + this.Arguments = arguments; + this.EnvironmentVariables = environmentVariables; + this.ForceUpdateTag = forceUpdateTag; + this.RetentionInterval = retentionInterval; + this.Timeout = timeout; + this.AzPowerShellVersion = azPowerShellVersion; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets container settings. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "containerSettings")] + public ContainerConfiguration ContainerSettings {get; set; } + + /// + /// Gets or sets storage Account settings. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "storageAccountSettings")] + public StorageAccountConfiguration StorageAccountSettings {get; set; } + + /// + /// Gets or sets the clean up preference when the script execution gets in a + /// terminal state. Default setting is 'Always'. Possible values include: 'Always', 'OnSuccess', 'OnExpiration' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "cleanupPreference")] + public string CleanupPreference {get; set; } + + /// + /// Gets state of the script execution. This only appears in the response. Possible values include: 'Creating', 'ProvisioningResources', 'Running', 'Succeeded', 'Failed', 'Canceled' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets contains the results of script execution. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "status")] + public ScriptStatus Status {get; private set; } + + /// + /// Gets list of script outputs. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "outputs")] + public System.Collections.Generic.IDictionary Outputs {get; private set; } + + /// + /// Gets or sets uri for the script. This is the entry point for the external + /// script. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "primaryScriptUri")] + public string PrimaryScriptUri {get; set; } + + /// + /// Gets or sets supporting files for the external script. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "supportingScriptUris")] + public System.Collections.Generic.IList SupportingScriptUris {get; set; } + + /// + /// Gets or sets script body. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "scriptContent")] + public string ScriptContent {get; set; } + + /// + /// Gets or sets command line arguments to pass to the script. Arguments are + /// separated by spaces. ex: -Name blue* -Location 'West US 2' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "arguments")] + public string Arguments {get; set; } + + /// + /// Gets or sets the environment variables to pass over to the script. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "environmentVariables")] + public System.Collections.Generic.IList EnvironmentVariables {get; set; } + + /// + /// Gets or sets gets or sets how the deployment script should be forced to + /// execute even if the script resource has not changed. Can be current time + /// stamp or a GUID. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "forceUpdateTag")] + public string ForceUpdateTag {get; set; } + + /// + /// Gets or sets interval for which the service retains the script resource + /// after it reaches a terminal state. Resource will be deleted when this + /// duration expires. Duration is based on ISO 8601 pattern (for example P1D + /// means one day). + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "retentionInterval")] + public System.TimeSpan RetentionInterval {get; set; } + + /// + /// Gets or sets maximum allowed script execution time specified in ISO 8601 + /// format. Default value is P1D + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "timeout")] + public System.TimeSpan? Timeout {get; set; } + + /// + /// Gets or sets azure PowerShell module version to be used. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "azPowerShellVersion")] + public string AzPowerShellVersion {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (this.AzPowerShellVersion == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "AzPowerShellVersion"); + } + if (this.ContainerSettings != null) + { + this.ContainerSettings.Validate(); + } + + + + + + + + + + if (this.EnvironmentVariables != null) + { + foreach (var element in this.EnvironmentVariables) + { + if (element != null) + { + element.Validate(); + } + } + } + + + } + } +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/AzureResourceBase.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/AzureResourceBase.cs similarity index 61% rename from src/Resources/Resources.Sdk/Generated/Models/AzureResourceBase.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/AzureResourceBase.cs index 3f6ab30ea648..6949bc20cf49 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/AzureResourceBase.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/AzureResourceBase.cs @@ -1,24 +1,16 @@ -// // 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.Models { - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Newtonsoft.Json; using System.Linq; /// /// Common properties for all Azure resources. /// - public partial class AzureResourceBase : IResource + public partial class AzureResourceBase : Microsoft.Rest.Azure.IResource { /// /// Initializes a new instance of the AzureResourceBase class. @@ -31,18 +23,26 @@ public AzureResourceBase() /// /// Initializes a new instance of the AzureResourceBase class. /// - /// String Id used to locate any resource on - /// Azure. - /// Name of this resource. - /// Type of this resource. - /// Azure Resource Manager metadata containing - /// createdBy and modifiedBy information. + + /// String Id used to locate any resource on Azure. + /// + + /// Name of this resource. + /// + + /// Type of this resource. + /// + + /// Azure Resource Manager metadata containing createdBy and modifiedBy + /// information. + /// public AzureResourceBase(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData)) + { - Id = id; - Name = name; - Type = type; - SystemData = systemData; + this.Id = id; + this.Name = name; + this.Type = type; + this.SystemData = systemData; CustomInit(); } @@ -51,30 +51,30 @@ public AzureResourceBase() /// partial void CustomInit(); + /// /// Gets string Id used to locate any resource on Azure. /// - [JsonProperty(PropertyName = "id")] - public string Id { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; private set; } /// /// Gets name of this resource. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; private set; } /// /// Gets type of this resource. /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } /// - /// Gets azure Resource Manager metadata containing createdBy and - /// modifiedBy information. + /// Gets azure Resource Manager metadata containing createdBy and modifiedBy + /// information. /// - [JsonProperty(PropertyName = "systemData")] - public SystemData SystemData { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "systemData")] + public SystemData SystemData {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/BasicDependency.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/BasicDependency.cs similarity index 70% rename from src/Resources/Resources.Sdk/Generated/Models/BasicDependency.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/BasicDependency.cs index fe7a68898552..0893c34de94f 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/BasicDependency.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/BasicDependency.cs @@ -1,16 +1,10 @@ -// // 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.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,14 +23,21 @@ public BasicDependency() /// /// Initializes a new instance of the BasicDependency class. /// - /// The ID of the dependency. - /// The dependency resource type. - /// The dependency resource name. + + /// The ID of the dependency. + /// + + /// The dependency resource type. + /// + + /// The dependency resource name. + /// public BasicDependency(string id = default(string), string resourceType = default(string), string resourceName = default(string)) + { - Id = id; - ResourceType = resourceType; - ResourceName = resourceName; + this.Id = id; + this.ResourceType = resourceType; + this.ResourceName = resourceName; CustomInit(); } @@ -45,23 +46,23 @@ public BasicDependency() /// partial void CustomInit(); + /// /// Gets or sets the ID of the dependency. /// - [JsonProperty(PropertyName = "id")] - public string Id { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; set; } /// /// Gets or sets the dependency resource type. /// - [JsonProperty(PropertyName = "resourceType")] - public string ResourceType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "resourceType")] + public string ResourceType {get; set; } /// /// Gets or sets the dependency resource name. /// - [JsonProperty(PropertyName = "resourceName")] - public string ResourceName { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "resourceName")] + public string ResourceName {get; set; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/ChangeType.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/ChangeType.cs similarity index 68% rename from src/Resources/Resources.Sdk/Generated/Models/ChangeType.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/ChangeType.cs index 2daa63b962c9..b74ac66dee9f 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/ChangeType.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/ChangeType.cs @@ -1,72 +1,64 @@ -// // 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.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; /// /// Defines values for ChangeType. /// - [JsonConverter(typeof(StringEnumConverter))] + + + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] public enum ChangeType { /// - /// The resource does not exist in the current state but is present in - /// the desired state. The resource will be created when the deployment - /// is executed. + /// The resource does not exist in the current state but is present in the + /// desired state. The resource will be created when the deployment is + /// executed. /// - [EnumMember(Value = "Create")] + [System.Runtime.Serialization.EnumMember(Value = "Create")] Create, /// - /// The resource exists in the current state and is missing from the - /// desired state. The resource will be deleted when the deployment is - /// executed. + /// The resource exists in the current state and is missing from the desired + /// state. The resource will be deleted when the deployment is executed. /// - [EnumMember(Value = "Delete")] + [System.Runtime.Serialization.EnumMember(Value = "Delete")] Delete, /// - /// The resource exists in the current state and is missing from the - /// desired state. The resource will not be deployed or modified when - /// the deployment is executed. + /// The resource exists in the current state and is missing from the desired + /// state. The resource will not be deployed or modified when the deployment is + /// executed. /// - [EnumMember(Value = "Ignore")] + [System.Runtime.Serialization.EnumMember(Value = "Ignore")] Ignore, /// - /// The resource exists in the current state and the desired state and - /// will be redeployed when the deployment is executed. The properties - /// of the resource may or may not change. + /// The resource exists in the current state and the desired state and will be + /// redeployed when the deployment is executed. The properties of the resource + /// may or may not change. /// - [EnumMember(Value = "Deploy")] + [System.Runtime.Serialization.EnumMember(Value = "Deploy")] Deploy, /// - /// The resource exists in the current state and the desired state and - /// will be redeployed when the deployment is executed. The properties - /// of the resource will not change. + /// The resource exists in the current state and the desired state and will be + /// redeployed when the deployment is executed. The properties of the resource + /// will not change. /// - [EnumMember(Value = "NoChange")] + [System.Runtime.Serialization.EnumMember(Value = "NoChange")] NoChange, /// - /// The resource exists in the current state and the desired state and - /// will be redeployed when the deployment is executed. The properties - /// of the resource will change. + /// The resource exists in the current state and the desired state and will be + /// redeployed when the deployment is executed. The properties of the resource + /// will change. /// - [EnumMember(Value = "Modify")] + [System.Runtime.Serialization.EnumMember(Value = "Modify")] Modify, /// /// The resource is not supported by What-If. /// - [EnumMember(Value = "Unsupported")] + [System.Runtime.Serialization.EnumMember(Value = "Unsupported")] Unsupported } internal static class ChangeTypeEnumExtension @@ -75,7 +67,6 @@ internal static string ToSerializedValue(this ChangeType? value) { return value == null ? null : ((ChangeType)value).ToSerializedValue(); } - internal static string ToSerializedValue(this ChangeType value) { switch( value ) @@ -97,7 +88,6 @@ internal static string ToSerializedValue(this ChangeType value) } return null; } - internal static ChangeType? ParseChangeType(this string value) { switch( value ) @@ -120,4 +110,4 @@ internal static string ToSerializedValue(this ChangeType value) return null; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/CheckResourceNameResult.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/CheckResourceNameResult.cs similarity index 67% rename from src/Resources/Resources.Sdk/Generated/Models/CheckResourceNameResult.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/CheckResourceNameResult.cs index a9f16cb7a43b..3964d220142e 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/CheckResourceNameResult.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/CheckResourceNameResult.cs @@ -1,16 +1,10 @@ -// // 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.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -30,15 +24,21 @@ public CheckResourceNameResult() /// /// Initializes a new instance of the CheckResourceNameResult class. /// - /// Name of Resource - /// Type of Resource - /// Is the resource name Allowed or Reserved. - /// Possible values include: 'Allowed', 'Reserved' + + /// Name of Resource + /// + + /// Type of Resource + /// + + /// Is the resource name Allowed or Reserved + /// Possible values include: 'Allowed', 'Reserved' public CheckResourceNameResult(string name = default(string), string type = default(string), string status = default(string)) + { - Name = name; - Type = type; - Status = status; + this.Name = name; + this.Type = type; + this.Status = status; CustomInit(); } @@ -47,24 +47,23 @@ public CheckResourceNameResult() /// partial void CustomInit(); + /// /// Gets or sets name of Resource /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// /// Gets or sets type of Resource /// - [JsonProperty(PropertyName = "type")] - public string Type { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; set; } /// - /// Gets or sets is the resource name Allowed or Reserved. Possible - /// values include: 'Allowed', 'Reserved' + /// Gets or sets is the resource name Allowed or Reserved Possible values include: 'Allowed', 'Reserved' /// - [JsonProperty(PropertyName = "status")] - public string Status { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "status")] + public string Status {get; set; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/CheckZonePeersRequest.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/CheckZonePeersRequest.cs similarity index 67% rename from src/Resources/Resources.Sdk/Generated/Models/CheckZonePeersRequest.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/CheckZonePeersRequest.cs index c8a4f05f9aad..6f03e6204069 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/CheckZonePeersRequest.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/CheckZonePeersRequest.cs @@ -1,18 +1,10 @@ -// // 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.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,13 +23,17 @@ public CheckZonePeersRequest() /// /// Initializes a new instance of the CheckZonePeersRequest class. /// - /// The Microsoft location. - /// The peer Microsoft Azure subscription - /// ID. - public CheckZonePeersRequest(string location = default(string), IList subscriptionIds = default(IList)) + + /// The Microsoft location. + /// + + /// The peer Microsoft Azure subscription ID. + /// + public CheckZonePeersRequest(string location = default(string), System.Collections.Generic.IList subscriptionIds = default(System.Collections.Generic.IList)) + { - Location = location; - SubscriptionIds = subscriptionIds; + this.Location = location; + this.SubscriptionIds = subscriptionIds; CustomInit(); } @@ -46,17 +42,17 @@ public CheckZonePeersRequest() /// partial void CustomInit(); + /// /// Gets or sets the Microsoft location. /// - [JsonProperty(PropertyName = "location")] - public string Location { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + public string Location {get; set; } /// /// Gets or sets the peer Microsoft Azure subscription ID. /// - [JsonProperty(PropertyName = "subscriptionIds")] - public IList SubscriptionIds { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "subscriptionIds")] + public System.Collections.Generic.IList SubscriptionIds {get; set; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/CheckZonePeersResult.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/CheckZonePeersResult.cs similarity index 60% rename from src/Resources/Resources.Sdk/Generated/Models/CheckZonePeersResult.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/CheckZonePeersResult.cs index 03e0a450fe13..fb5dc09b8e0d 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/CheckZonePeersResult.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/CheckZonePeersResult.cs @@ -1,18 +1,10 @@ -// // 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.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,15 +23,21 @@ public CheckZonePeersResult() /// /// Initializes a new instance of the CheckZonePeersResult class. /// - /// The subscription ID. - /// the location of the subscription. - /// The Availability Zones shared - /// by the subscriptions. - public CheckZonePeersResult(string subscriptionId = default(string), string location = default(string), IList availabilityZonePeers = default(IList)) + + /// The subscription ID. + /// + + /// the location of the subscription. + /// + + /// The Availability Zones shared by the subscriptions. + /// + public CheckZonePeersResult(string subscriptionId = default(string), string location = default(string), System.Collections.Generic.IList availabilityZonePeers = default(System.Collections.Generic.IList)) + { - SubscriptionId = subscriptionId; - Location = location; - AvailabilityZonePeers = availabilityZonePeers; + this.SubscriptionId = subscriptionId; + this.Location = location; + this.AvailabilityZonePeers = availabilityZonePeers; CustomInit(); } @@ -48,23 +46,23 @@ public CheckZonePeersResult() /// partial void CustomInit(); + /// /// Gets the subscription ID. /// - [JsonProperty(PropertyName = "subscriptionId")] - public string SubscriptionId { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "subscriptionId")] + public string SubscriptionId {get; private set; } /// /// Gets or sets the location of the subscription. /// - [JsonProperty(PropertyName = "location")] - public string Location { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + public string Location {get; set; } /// /// Gets or sets the Availability Zones shared by the subscriptions. /// - [JsonProperty(PropertyName = "availabilityZonePeers")] - public IList AvailabilityZonePeers { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "availabilityZonePeers")] + public System.Collections.Generic.IList AvailabilityZonePeers {get; set; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/CleanupOptions.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/CleanupOptions.cs similarity index 85% rename from src/Resources/Resources.Sdk/Generated/Models/CleanupOptions.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/CleanupOptions.cs index 8b268c953fa8..0e3e8aaf35fc 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/CleanupOptions.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/CleanupOptions.cs @@ -1,12 +1,7 @@ -// // 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.Models { @@ -14,10 +9,12 @@ namespace Microsoft.Azure.Management.Resources.Models /// /// Defines values for CleanupOptions. /// + + public static class CleanupOptions { public const string Always = "Always"; public const string OnSuccess = "OnSuccess"; public const string OnExpiration = "OnExpiration"; } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Management.Sdk/Generated/Models/ContainerConfiguration.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/ContainerConfiguration.cs new file mode 100644 index 000000000000..999b7745f0f8 --- /dev/null +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/ContainerConfiguration.cs @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Resources.Models +{ + using System.Linq; + + /// + /// Settings to customize ACI container instance. + /// + public partial class ContainerConfiguration + { + /// + /// Initializes a new instance of the ContainerConfiguration class. + /// + public ContainerConfiguration() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ContainerConfiguration class. + /// + + /// Container group name, if not specified then the name will get + /// auto-generated. Not specifying a 'containerGroupName' indicates the system + /// to generate a unique name which might end up flagging an Azure Policy as + /// non-compliant. Use 'containerGroupName' when you have an Azure Policy that + /// expects a specific naming convention or when you want to fully control the + /// name. 'containerGroupName' property must be between 1 and 63 characters + /// long, must contain only lowercase letters, numbers, and dashes and it + /// cannot start or end with a dash and consecutive dashes are not allowed. To + /// specify a 'containerGroupName', add the following object to properties: { + /// "containerSettings": { "containerGroupName": "contoso-container" } }. If + /// you do not want to specify a 'containerGroupName' then do not add + /// 'containerSettings' property. + /// + public ContainerConfiguration(string containerGroupName = default(string)) + + { + this.ContainerGroupName = containerGroupName; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets container group name, if not specified then the name will get + /// auto-generated. Not specifying a 'containerGroupName' indicates the system + /// to generate a unique name which might end up flagging an Azure Policy as + /// non-compliant. Use 'containerGroupName' when you have an Azure Policy that + /// expects a specific naming convention or when you want to fully control the + /// name. 'containerGroupName' property must be between 1 and 63 characters + /// long, must contain only lowercase letters, numbers, and dashes and it + /// cannot start or end with a dash and consecutive dashes are not allowed. To + /// specify a 'containerGroupName', add the following object to properties: { + /// "containerSettings": { "containerGroupName": "contoso-container" } }. If + /// you do not want to specify a 'containerGroupName' then do not add + /// 'containerSettings' property. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "containerGroupName")] + public string ContainerGroupName {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (this.ContainerGroupName != null) + { + if (this.ContainerGroupName.Length > 63) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "ContainerGroupName", 63); + } + if (this.ContainerGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "ContainerGroupName", 1); + } + } + } + } +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/CreatedByType.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/CreatedByType.cs similarity index 85% rename from src/Resources/Resources.Sdk/Generated/Models/CreatedByType.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/CreatedByType.cs index dd569f9c0a8a..727a643b55e5 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/CreatedByType.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/CreatedByType.cs @@ -1,12 +1,7 @@ -// // 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.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Resources.Models /// /// Defines values for CreatedByType. /// + + public static class CreatedByType { public const string User = "User"; @@ -21,4 +18,4 @@ public static class CreatedByType public const string ManagedIdentity = "ManagedIdentity"; public const string Key = "Key"; } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/DebugSetting.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/DebugSetting.cs similarity index 52% rename from src/Resources/Resources.Sdk/Generated/Models/DebugSetting.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/DebugSetting.cs index 30d5641c01b7..982e4ee49f1e 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/DebugSetting.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/DebugSetting.cs @@ -1,16 +1,10 @@ -// // 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.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,17 +23,19 @@ public DebugSetting() /// /// Initializes a new instance of the DebugSetting class. /// - /// Specifies the type of information to log - /// for debugging. The permitted values are none, requestContent, - /// responseContent, or both requestContent and responseContent - /// separated by a comma. The default is none. When setting this value, - /// carefully consider the type of information you are passing in - /// during deployment. By logging information about the request or - /// response, you could potentially expose sensitive data that is - /// retrieved through the deployment operations. + + /// Specifies the type of information to log for debugging. The permitted + /// values are none, requestContent, responseContent, or both requestContent + /// and responseContent separated by a comma. The default is none. When setting + /// this value, carefully consider the type of information you are passing in + /// during deployment. By logging information about the request or response, + /// you could potentially expose sensitive data that is retrieved through the + /// deployment operations. + /// public DebugSetting(string detailLevel = default(string)) + { - DetailLevel = detailLevel; + this.DetailLevel = detailLevel; CustomInit(); } @@ -48,18 +44,17 @@ public DebugSetting() /// partial void CustomInit(); + /// - /// Gets or sets specifies the type of information to log for - /// debugging. The permitted values are none, requestContent, - /// responseContent, or both requestContent and responseContent - /// separated by a comma. The default is none. When setting this value, - /// carefully consider the type of information you are passing in - /// during deployment. By logging information about the request or - /// response, you could potentially expose sensitive data that is + /// Gets or sets specifies the type of information to log for debugging. The + /// permitted values are none, requestContent, responseContent, or both + /// requestContent and responseContent separated by a comma. The default is + /// none. When setting this value, carefully consider the type of information + /// you are passing in during deployment. By logging information about the + /// request or response, you could potentially expose sensitive data that is /// retrieved through the deployment operations. /// - [JsonProperty(PropertyName = "detailLevel")] - public string DetailLevel { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "detailLevel")] + public string DetailLevel {get; set; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Management.Sdk/Generated/Models/DenySettings.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/DenySettings.cs new file mode 100644 index 000000000000..17d36d0d2311 --- /dev/null +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/DenySettings.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Resources.Models +{ + using System.Linq; + + /// + /// Defines how resources deployed by the deployment stack are locked. + /// + public partial class DenySettings + { + /// + /// Initializes a new instance of the DenySettings class. + /// + public DenySettings() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DenySettings class. + /// + + /// denySettings Mode. + /// Possible values include: 'denyDelete', 'denyWriteAndDelete', 'none' + + /// List of AAD principal IDs excluded from the lock. Up to 5 principals are + /// permitted. + /// + + /// List of role-based management operations that are excluded from the + /// denySettings. Up to 200 actions are permitted. If the denySetting mode is + /// set to 'denyWriteAndDelete', then the following actions are automatically + /// appended to 'excludedActions': '*/read' and + /// 'Microsoft.Authorization/locks/delete'. If the denySetting mode is set to + /// 'denyDelete', then the following actions are automatically appended to + /// 'excludedActions': 'Microsoft.Authorization/locks/delete'. Duplicate + /// actions will be removed. + /// + + /// DenySettings will be applied to child scopes. + /// + public DenySettings(string mode, System.Collections.Generic.IList excludedPrincipals = default(System.Collections.Generic.IList), System.Collections.Generic.IList excludedActions = default(System.Collections.Generic.IList), bool? applyToChildScopes = default(bool?)) + + { + this.Mode = mode; + this.ExcludedPrincipals = excludedPrincipals; + this.ExcludedActions = excludedActions; + this.ApplyToChildScopes = applyToChildScopes; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets denySettings Mode. Possible values include: 'denyDelete', 'denyWriteAndDelete', 'none' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "mode")] + public string Mode {get; set; } + + /// + /// Gets or sets list of AAD principal IDs excluded from the lock. Up to 5 + /// principals are permitted. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "excludedPrincipals")] + public System.Collections.Generic.IList ExcludedPrincipals {get; set; } + + /// + /// Gets or sets list of role-based management operations that are excluded + /// from the denySettings. Up to 200 actions are permitted. If the denySetting + /// mode is set to 'denyWriteAndDelete', then the following actions are + /// automatically appended to 'excludedActions': '*/read' and + /// 'Microsoft.Authorization/locks/delete'. If the denySetting mode is set to + /// 'denyDelete', then the following actions are automatically appended to + /// 'excludedActions': 'Microsoft.Authorization/locks/delete'. Duplicate + /// actions will be removed. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "excludedActions")] + public System.Collections.Generic.IList ExcludedActions {get; set; } + + /// + /// Gets or sets denySettings will be applied to child scopes. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "applyToChildScopes")] + public bool? ApplyToChildScopes {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (this.Mode == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Mode"); + } + + + + } + } +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/DenySettingsMode.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/DenySettingsMode.cs similarity index 83% rename from src/Resources/Resources.Sdk/Generated/Models/DenySettingsMode.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/DenySettingsMode.cs index 4c8d8652a12a..35c47b0677c0 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/DenySettingsMode.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/DenySettingsMode.cs @@ -1,12 +1,7 @@ -// // 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.Models { @@ -14,16 +9,18 @@ namespace Microsoft.Azure.Management.Resources.Models /// /// Defines values for DenySettingsMode. /// + + public static class DenySettingsMode { /// - /// Authorized users are able to read and modify the resources, but - /// cannot delete. + /// Authorized users are able to read and modify the resources, but cannot + /// delete. /// public const string DenyDelete = "denyDelete"; /// - /// Authorized users can only read from a resource, but cannot modify - /// or delete it. + /// Authorized users can only read from a resource, but cannot modify or delete + /// it. /// public const string DenyWriteAndDelete = "denyWriteAndDelete"; /// @@ -31,4 +28,4 @@ public static class DenySettingsMode /// public const string None = "none"; } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/DenyStatusMode.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/DenyStatusMode.cs similarity index 82% rename from src/Resources/Resources.Sdk/Generated/Models/DenyStatusMode.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/DenyStatusMode.cs index 211e63017e5e..3c75487fe81b 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/DenyStatusMode.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/DenyStatusMode.cs @@ -1,12 +1,7 @@ -// // 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.Models { @@ -14,11 +9,13 @@ namespace Microsoft.Azure.Management.Resources.Models /// /// Defines values for DenyStatusMode. /// + + public static class DenyStatusMode { /// - /// Authorized users are able to read and modify the resources, but - /// cannot delete. + /// Authorized users are able to read and modify the resources, but cannot + /// delete. /// public const string DenyDelete = "denyDelete"; /// @@ -26,18 +23,18 @@ public static class DenyStatusMode /// public const string NotSupported = "notSupported"; /// - /// denyAssignments are not supported on resources outside the scope of - /// the deployment stack. + /// denyAssignments are not supported on resources outside the scope of the + /// deployment stack. /// public const string Inapplicable = "inapplicable"; /// - /// Authorized users can only read from a resource, but cannot modify - /// or delete it. + /// Authorized users can only read from a resource, but cannot modify or delete + /// it. /// public const string DenyWriteAndDelete = "denyWriteAndDelete"; /// - /// Deny assignment has been removed by Azure due to a resource - /// management change (management group move, etc.) + /// Deny assignment has been removed by Azure due to a resource management + /// change (management group move, etc.) /// public const string RemovedBySystem = "removedBySystem"; /// @@ -45,4 +42,4 @@ public static class DenyStatusMode /// public const string None = "None"; } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/Dependency.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/Dependency.cs similarity index 56% rename from src/Resources/Resources.Sdk/Generated/Models/Dependency.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/Dependency.cs index c7c72dfe68ee..07ffc57475fc 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/Dependency.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/Dependency.cs @@ -1,18 +1,10 @@ -// // 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.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,16 +23,25 @@ public Dependency() /// /// Initializes a new instance of the Dependency class. /// - /// The list of dependencies. - /// The ID of the dependency. - /// The dependency resource type. - /// The dependency resource name. - public Dependency(IList dependsOn = default(IList), string id = default(string), string resourceType = default(string), string resourceName = default(string)) + + /// The list of dependencies. + /// + + /// The ID of the dependency. + /// + + /// The dependency resource type. + /// + + /// The dependency resource name. + /// + public Dependency(System.Collections.Generic.IList dependsOn = default(System.Collections.Generic.IList), string id = default(string), string resourceType = default(string), string resourceName = default(string)) + { - DependsOn = dependsOn; - Id = id; - ResourceType = resourceType; - ResourceName = resourceName; + this.DependsOn = dependsOn; + this.Id = id; + this.ResourceType = resourceType; + this.ResourceName = resourceName; CustomInit(); } @@ -49,29 +50,29 @@ public Dependency() /// partial void CustomInit(); + /// /// Gets or sets the list of dependencies. /// - [JsonProperty(PropertyName = "dependsOn")] - public IList DependsOn { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "dependsOn")] + public System.Collections.Generic.IList DependsOn {get; set; } /// /// Gets or sets the ID of the dependency. /// - [JsonProperty(PropertyName = "id")] - public string Id { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; set; } /// /// Gets or sets the dependency resource type. /// - [JsonProperty(PropertyName = "resourceType")] - public string ResourceType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "resourceType")] + public string ResourceType {get; set; } /// /// Gets or sets the dependency resource name. /// - [JsonProperty(PropertyName = "resourceName")] - public string ResourceName { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "resourceName")] + public string ResourceName {get; set; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/Deployment.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/Deployment.cs similarity index 57% rename from src/Resources/Resources.Sdk/Generated/Models/Deployment.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/Deployment.cs index 6c91d9293f65..8d5594f43f96 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/Deployment.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/Deployment.cs @@ -1,19 +1,10 @@ -// // 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.Models { - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -32,15 +23,21 @@ public Deployment() /// /// Initializes a new instance of the Deployment class. /// - /// The deployment properties. - /// The location to store the deployment - /// data. - /// Deployment tags - public Deployment(DeploymentProperties properties, string location = default(string), IDictionary tags = default(IDictionary)) + + /// The location to store the deployment data. + /// + + /// The deployment properties. + /// + + /// Deployment tags + /// + public Deployment(DeploymentProperties properties, string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary)) + { - Location = location; - Properties = properties; - Tags = tags; + this.Location = location; + this.Properties = properties; + this.Tags = tags; CustomInit(); } @@ -49,40 +46,42 @@ public Deployment() /// partial void CustomInit(); + /// /// Gets or sets the location to store the deployment data. /// - [JsonProperty(PropertyName = "location")] - public string Location { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + public string Location {get; set; } /// /// Gets or sets the deployment properties. /// - [JsonProperty(PropertyName = "properties")] - public DeploymentProperties Properties { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties")] + public DeploymentProperties Properties {get; set; } /// /// Gets or sets deployment tags /// - [JsonProperty(PropertyName = "tags")] - public IDictionary Tags { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] + public System.Collections.Generic.IDictionary Tags {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Properties == null) + if (this.Properties == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Properties"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Properties"); } - if (Properties != null) + + if (this.Properties != null) { - Properties.Validate(); + this.Properties.Validate(); } + } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/DeploymentExportResult.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/DeploymentExportResult.cs similarity index 78% rename from src/Resources/Resources.Sdk/Generated/Models/DeploymentExportResult.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/DeploymentExportResult.cs index 0908d86e812e..6ee4ec4e69e9 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/DeploymentExportResult.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/DeploymentExportResult.cs @@ -1,16 +1,10 @@ -// // 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.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,10 +23,13 @@ public DeploymentExportResult() /// /// Initializes a new instance of the DeploymentExportResult class. /// - /// The template content. + + /// The template content. + /// public DeploymentExportResult(object template = default(object)) + { - Template = template; + this.Template = template; CustomInit(); } @@ -41,11 +38,11 @@ public DeploymentExportResult() /// partial void CustomInit(); + /// /// Gets or sets the template content. /// - [JsonProperty(PropertyName = "template")] - public object Template { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "template")] + public object Template {get; set; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/DeploymentExtended.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/DeploymentExtended.cs similarity index 52% rename from src/Resources/Resources.Sdk/Generated/Models/DeploymentExtended.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/DeploymentExtended.cs index 0ef01ccc101f..1cbbf1eb32a4 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/DeploymentExtended.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/DeploymentExtended.cs @@ -1,26 +1,16 @@ -// // 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.Models { - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Deployment information. /// - public partial class DeploymentExtended : IResource + public partial class DeploymentExtended : Microsoft.Rest.Azure.IResource { /// /// Initializes a new instance of the DeploymentExtended class. @@ -33,20 +23,33 @@ public DeploymentExtended() /// /// Initializes a new instance of the DeploymentExtended class. /// - /// The ID of the deployment. - /// The name of the deployment. - /// The type of the deployment. - /// the location of the deployment. - /// Deployment properties. - /// Deployment tags - public DeploymentExtended(string id = default(string), string name = default(string), string type = default(string), string location = default(string), DeploymentPropertiesExtended properties = default(DeploymentPropertiesExtended), IDictionary tags = default(IDictionary)) + + /// The ID of the deployment. + /// + + /// The name of the deployment. + /// + + /// The type of the deployment. + /// + + /// the location of the deployment. + /// + + /// Deployment properties. + /// + + /// Deployment tags + /// + public DeploymentExtended(string id = default(string), string name = default(string), string type = default(string), string location = default(string), DeploymentPropertiesExtended properties = default(DeploymentPropertiesExtended), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary)) + { - Id = id; - Name = name; - Type = type; - Location = location; - Properties = properties; - Tags = tags; + this.Id = id; + this.Name = name; + this.Type = type; + this.Location = location; + this.Properties = properties; + this.Tags = tags; CustomInit(); } @@ -55,54 +58,59 @@ public DeploymentExtended() /// partial void CustomInit(); + /// /// Gets the ID of the deployment. /// - [JsonProperty(PropertyName = "id")] - public string Id { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; private set; } /// /// Gets the name of the deployment. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; private set; } /// /// Gets the type of the deployment. /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } /// /// Gets or sets the location of the deployment. /// - [JsonProperty(PropertyName = "location")] - public string Location { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + public string Location {get; set; } /// /// Gets or sets deployment properties. /// - [JsonProperty(PropertyName = "properties")] - public DeploymentPropertiesExtended Properties { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties")] + public DeploymentPropertiesExtended Properties {get; set; } /// /// Gets or sets deployment tags /// - [JsonProperty(PropertyName = "tags")] - public IDictionary Tags { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] + public System.Collections.Generic.IDictionary Tags {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Properties != null) + + + + + if (this.Properties != null) { - Properties.Validate(); + this.Properties.Validate(); } + } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/DeploymentExtendedFilter.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/DeploymentExtendedFilter.cs similarity index 80% rename from src/Resources/Resources.Sdk/Generated/Models/DeploymentExtendedFilter.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/DeploymentExtendedFilter.cs index d163ddc8290d..216705b876ea 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/DeploymentExtendedFilter.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/DeploymentExtendedFilter.cs @@ -1,16 +1,10 @@ -// // 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.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,10 +23,13 @@ public DeploymentExtendedFilter() /// /// Initializes a new instance of the DeploymentExtendedFilter class. /// - /// The provisioning state. + + /// The provisioning state. + /// public DeploymentExtendedFilter(string provisioningState = default(string)) + { - ProvisioningState = provisioningState; + this.ProvisioningState = provisioningState; CustomInit(); } @@ -41,11 +38,11 @@ public DeploymentExtendedFilter() /// partial void CustomInit(); + /// /// Gets or sets the provisioning state. /// - [JsonProperty(PropertyName = "provisioningState")] - public string ProvisioningState { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; set; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/DeploymentMode.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/DeploymentMode.cs similarity index 79% rename from src/Resources/Resources.Sdk/Generated/Models/DeploymentMode.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/DeploymentMode.cs index 02176cd4bcfb..fc9812c9c39d 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/DeploymentMode.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/DeploymentMode.cs @@ -1,29 +1,22 @@ -// // 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.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; /// /// Defines values for DeploymentMode. /// - [JsonConverter(typeof(StringEnumConverter))] + + + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] public enum DeploymentMode { - [EnumMember(Value = "Incremental")] + [System.Runtime.Serialization.EnumMember(Value = "Incremental")] Incremental, - [EnumMember(Value = "Complete")] + [System.Runtime.Serialization.EnumMember(Value = "Complete")] Complete } internal static class DeploymentModeEnumExtension @@ -32,7 +25,6 @@ internal static string ToSerializedValue(this DeploymentMode? value) { return value == null ? null : ((DeploymentMode)value).ToSerializedValue(); } - internal static string ToSerializedValue(this DeploymentMode value) { switch( value ) @@ -44,7 +36,6 @@ internal static string ToSerializedValue(this DeploymentMode value) } return null; } - internal static DeploymentMode? ParseDeploymentMode(this string value) { switch( value ) @@ -57,4 +48,4 @@ internal static string ToSerializedValue(this DeploymentMode value) return null; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/DeploymentOperation.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/DeploymentOperation.cs similarity index 65% rename from src/Resources/Resources.Sdk/Generated/Models/DeploymentOperation.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/DeploymentOperation.cs index d583add88c56..6e40041c4bbc 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/DeploymentOperation.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/DeploymentOperation.cs @@ -1,16 +1,10 @@ -// // 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.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,14 +23,21 @@ public DeploymentOperation() /// /// Initializes a new instance of the DeploymentOperation class. /// - /// Full deployment operation ID. - /// Deployment operation ID. - /// Deployment properties. + + /// Full deployment operation ID. + /// + + /// Deployment operation ID. + /// + + /// Deployment properties. + /// public DeploymentOperation(string id = default(string), string operationId = default(string), DeploymentOperationProperties properties = default(DeploymentOperationProperties)) + { - Id = id; - OperationId = operationId; - Properties = properties; + this.Id = id; + this.OperationId = operationId; + this.Properties = properties; CustomInit(); } @@ -45,23 +46,23 @@ public DeploymentOperation() /// partial void CustomInit(); + /// /// Gets full deployment operation ID. /// - [JsonProperty(PropertyName = "id")] - public string Id { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; private set; } /// /// Gets deployment operation ID. /// - [JsonProperty(PropertyName = "operationId")] - public string OperationId { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "operationId")] + public string OperationId {get; private set; } /// /// Gets or sets deployment properties. /// - [JsonProperty(PropertyName = "properties")] - public DeploymentOperationProperties Properties { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties")] + public DeploymentOperationProperties Properties {get; set; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Management.Sdk/Generated/Models/DeploymentOperationProperties.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/DeploymentOperationProperties.cs new file mode 100644 index 000000000000..94e63a1d29f2 --- /dev/null +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/DeploymentOperationProperties.cs @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Resources.Models +{ + using System.Linq; + + /// + /// Deployment operation properties. + /// + public partial class DeploymentOperationProperties + { + /// + /// Initializes a new instance of the DeploymentOperationProperties class. + /// + public DeploymentOperationProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DeploymentOperationProperties class. + /// + + /// The name of the current provisioning operation. + /// Possible values include: 'NotSpecified', 'Create', 'Delete', 'Waiting', + /// 'AzureAsyncOperationWaiting', 'ResourceCacheWaiting', 'Action', 'Read', + /// 'EvaluateDeploymentOutput', 'DeploymentCleanup' + + /// The state of the provisioning. + /// + + /// The date and time of the operation. + /// + + /// The duration of the operation. + /// + + /// Deployment operation service request id. + /// + + /// Operation status code from the resource provider. This property may not be + /// set if a response has not yet been received. + /// + + /// Operation status message from the resource provider. This property is + /// optional. It will only be provided if an error was received from the + /// resource provider. + /// + + /// The target resource. + /// + + /// The HTTP request message. + /// + + /// The HTTP response message. + /// + public DeploymentOperationProperties(ProvisioningOperation? provisioningOperation = default(ProvisioningOperation?), string provisioningState = default(string), System.DateTime? timestamp = default(System.DateTime?), string duration = default(string), string serviceRequestId = default(string), string statusCode = default(string), StatusMessage statusMessage = default(StatusMessage), TargetResource targetResource = default(TargetResource), HttpMessage request = default(HttpMessage), HttpMessage response = default(HttpMessage)) + + { + this.ProvisioningOperation = provisioningOperation; + this.ProvisioningState = provisioningState; + this.Timestamp = timestamp; + this.Duration = duration; + this.ServiceRequestId = serviceRequestId; + this.StatusCode = statusCode; + this.StatusMessage = statusMessage; + this.TargetResource = targetResource; + this.Request = request; + this.Response = response; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets the name of the current provisioning operation. Possible values include: 'NotSpecified', 'Create', 'Delete', 'Waiting', 'AzureAsyncOperationWaiting', 'ResourceCacheWaiting', 'Action', 'Read', 'EvaluateDeploymentOutput', 'DeploymentCleanup' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningOperation")] + public ProvisioningOperation? ProvisioningOperation {get; private set; } + + /// + /// Gets the state of the provisioning. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets the date and time of the operation. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "timestamp")] + public System.DateTime? Timestamp {get; private set; } + + /// + /// Gets the duration of the operation. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "duration")] + public string Duration {get; private set; } + + /// + /// Gets deployment operation service request id. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "serviceRequestId")] + public string ServiceRequestId {get; private set; } + + /// + /// Gets operation status code from the resource provider. This property may + /// not be set if a response has not yet been received. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "statusCode")] + public string StatusCode {get; private set; } + + /// + /// Gets operation status message from the resource provider. This property is + /// optional. It will only be provided if an error was received from the + /// resource provider. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "statusMessage")] + public StatusMessage StatusMessage {get; private set; } + + /// + /// Gets the target resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "targetResource")] + public TargetResource TargetResource {get; private set; } + + /// + /// Gets the HTTP request message. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "request")] + public HttpMessage Request {get; private set; } + + /// + /// Gets the HTTP response message. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "response")] + public HttpMessage Response {get; private set; } + } +} \ No newline at end of file diff --git a/src/Resources/Resources.Management.Sdk/Generated/Models/DeploymentProperties.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/DeploymentProperties.cs new file mode 100644 index 000000000000..12480e7d295f --- /dev/null +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/DeploymentProperties.cs @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Resources.Models +{ + using System.Linq; + + /// + /// Deployment properties. + /// + public partial class DeploymentProperties + { + /// + /// Initializes a new instance of the DeploymentProperties class. + /// + public DeploymentProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DeploymentProperties class. + /// + + /// The template content. You use this element when you want to pass the + /// template syntax directly in the request rather than link to an existing + /// template. It can be a JObject or well-formed JSON string. Use either the + /// templateLink property or the template property, but not both. + /// + + /// The URI of the template. Use either the templateLink property or the + /// template property, but not both. + /// + + /// Name and value pairs that define the deployment parameters for the + /// template. You use this element when you want to provide the parameter + /// values directly in the request rather than link to an existing parameter + /// file. Use either the parametersLink property or the parameters property, + /// but not both. It can be a JObject or a well formed JSON string. + /// + + /// The URI of parameters file. You use this element to link to an existing + /// parameters file. Use either the parametersLink property or the parameters + /// property, but not both. + /// + + /// The mode that is used to deploy resources. This value can be either + /// Incremental or Complete. In Incremental mode, resources are deployed + /// without deleting existing resources that are not included in the template. + /// In Complete mode, resources are deployed and existing resources in the + /// resource group that are not included in the template are deleted. Be + /// careful when using Complete mode as you may unintentionally delete + /// resources. + /// Possible values include: 'Incremental', 'Complete' + + /// The debug setting of the deployment. + /// + + /// The deployment on error behavior. + /// + + /// Specifies whether template expressions are evaluated within the scope of + /// the parent template or nested template. Only applicable to nested + /// templates. If not specified, default value is outer. + /// + public DeploymentProperties(DeploymentMode mode, object template = default(object), TemplateLink templateLink = default(TemplateLink), object parameters = default(object), ParametersLink parametersLink = default(ParametersLink), DebugSetting debugSetting = default(DebugSetting), OnErrorDeployment onErrorDeployment = default(OnErrorDeployment), ExpressionEvaluationOptions expressionEvaluationOptions = default(ExpressionEvaluationOptions)) + + { + this.Template = template; + this.TemplateLink = templateLink; + this.Parameters = parameters; + this.ParametersLink = parametersLink; + this.Mode = mode; + this.DebugSetting = debugSetting; + this.OnErrorDeployment = onErrorDeployment; + this.ExpressionEvaluationOptions = expressionEvaluationOptions; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the template content. You use this element when you want to + /// pass the template syntax directly in the request rather than link to an + /// existing template. It can be a JObject or well-formed JSON string. Use + /// either the templateLink property or the template property, but not both. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "template")] + public object Template {get; set; } + + /// + /// Gets or sets the URI of the template. Use either the templateLink property + /// or the template property, but not both. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "templateLink")] + public TemplateLink TemplateLink {get; set; } + + /// + /// Gets or sets name and value pairs that define the deployment parameters for + /// the template. You use this element when you want to provide the parameter + /// values directly in the request rather than link to an existing parameter + /// file. Use either the parametersLink property or the parameters property, + /// but not both. It can be a JObject or a well formed JSON string. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "parameters")] + public object Parameters {get; set; } + + /// + /// Gets or sets the URI of parameters file. You use this element to link to an + /// existing parameters file. Use either the parametersLink property or the + /// parameters property, but not both. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "parametersLink")] + public ParametersLink ParametersLink {get; set; } + + /// + /// Gets or sets the mode that is used to deploy resources. This value can be + /// either Incremental or Complete. In Incremental mode, resources are deployed + /// without deleting existing resources that are not included in the template. + /// In Complete mode, resources are deployed and existing resources in the + /// resource group that are not included in the template are deleted. Be + /// careful when using Complete mode as you may unintentionally delete + /// resources. Possible values include: 'Incremental', 'Complete' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "mode")] + public DeploymentMode Mode {get; set; } + + /// + /// Gets or sets the debug setting of the deployment. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "debugSetting")] + public DebugSetting DebugSetting {get; set; } + + /// + /// Gets or sets the deployment on error behavior. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "onErrorDeployment")] + public OnErrorDeployment OnErrorDeployment {get; set; } + + /// + /// Gets or sets specifies whether template expressions are evaluated within + /// the scope of the parent template or nested template. Only applicable to + /// nested templates. If not specified, default value is outer. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "expressionEvaluationOptions")] + public ExpressionEvaluationOptions ExpressionEvaluationOptions {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + + + + if (this.ParametersLink != null) + { + this.ParametersLink.Validate(); + } + + + + + } + } +} \ No newline at end of file diff --git a/src/Resources/Resources.Management.Sdk/Generated/Models/DeploymentPropertiesExtended.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/DeploymentPropertiesExtended.cs new file mode 100644 index 000000000000..5b8725f1a69c --- /dev/null +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/DeploymentPropertiesExtended.cs @@ -0,0 +1,238 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Resources.Models +{ + using System.Linq; + + /// + /// Deployment properties with additional details. + /// + public partial class DeploymentPropertiesExtended + { + /// + /// Initializes a new instance of the DeploymentPropertiesExtended class. + /// + public DeploymentPropertiesExtended() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DeploymentPropertiesExtended class. + /// + + /// Denotes the state of provisioning. + /// Possible values include: 'NotSpecified', 'Accepted', 'Running', 'Ready', + /// 'Creating', 'Created', 'Deleting', 'Deleted', 'Canceled', 'Failed', + /// 'Succeeded', 'Updating' + + /// The correlation ID of the deployment. + /// + + /// The timestamp of the template deployment. + /// + + /// The duration of the template deployment. + /// + + /// Key/value pairs that represent deployment output. + /// + + /// The list of resource providers needed for the deployment. + /// + + /// The list of deployment dependencies. + /// + + /// The URI referencing the template. + /// + + /// Deployment parameters. + /// + + /// The URI referencing the parameters. + /// + + /// The deployment mode. Possible values are Incremental and Complete. + /// Possible values include: 'Incremental', 'Complete' + + /// The debug setting of the deployment. + /// + + /// The deployment on error behavior. + /// + + /// The hash produced for the template. + /// + + /// Array of provisioned resources. + /// + + /// Array of validated resources. + /// + + /// The deployment error. + /// + public DeploymentPropertiesExtended(string provisioningState = default(string), string correlationId = default(string), System.DateTime? timestamp = default(System.DateTime?), string duration = default(string), object outputs = default(object), System.Collections.Generic.IList providers = default(System.Collections.Generic.IList), System.Collections.Generic.IList dependencies = default(System.Collections.Generic.IList), TemplateLink templateLink = default(TemplateLink), object parameters = default(object), ParametersLink parametersLink = default(ParametersLink), DeploymentMode? mode = default(DeploymentMode?), DebugSetting debugSetting = default(DebugSetting), OnErrorDeploymentExtended onErrorDeployment = default(OnErrorDeploymentExtended), string templateHash = default(string), System.Collections.Generic.IList outputResources = default(System.Collections.Generic.IList), System.Collections.Generic.IList validatedResources = default(System.Collections.Generic.IList), ErrorResponse error = default(ErrorResponse)) + + { + this.ProvisioningState = provisioningState; + this.CorrelationId = correlationId; + this.Timestamp = timestamp; + this.Duration = duration; + this.Outputs = outputs; + this.Providers = providers; + this.Dependencies = dependencies; + this.TemplateLink = templateLink; + this.Parameters = parameters; + this.ParametersLink = parametersLink; + this.Mode = mode; + this.DebugSetting = debugSetting; + this.OnErrorDeployment = onErrorDeployment; + this.TemplateHash = templateHash; + this.OutputResources = outputResources; + this.ValidatedResources = validatedResources; + this.Error = error; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets denotes the state of provisioning. Possible values include: 'NotSpecified', 'Accepted', 'Running', 'Ready', 'Creating', 'Created', 'Deleting', 'Deleted', 'Canceled', 'Failed', 'Succeeded', 'Updating' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets the correlation ID of the deployment. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "correlationId")] + public string CorrelationId {get; private set; } + + /// + /// Gets the timestamp of the template deployment. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "timestamp")] + public System.DateTime? Timestamp {get; private set; } + + /// + /// Gets the duration of the template deployment. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "duration")] + public string Duration {get; private set; } + + /// + /// Gets key/value pairs that represent deployment output. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "outputs")] + public object Outputs {get; private set; } + + /// + /// Gets the list of resource providers needed for the deployment. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "providers")] + public System.Collections.Generic.IList Providers {get; private set; } + + /// + /// Gets the list of deployment dependencies. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "dependencies")] + public System.Collections.Generic.IList Dependencies {get; private set; } + + /// + /// Gets the URI referencing the template. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "templateLink")] + public TemplateLink TemplateLink {get; private set; } + + /// + /// Gets deployment parameters. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "parameters")] + public object Parameters {get; private set; } + + /// + /// Gets the URI referencing the parameters. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "parametersLink")] + public ParametersLink ParametersLink {get; private set; } + + /// + /// Gets the deployment mode. Possible values are Incremental and Complete. Possible values include: 'Incremental', 'Complete' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "mode")] + public DeploymentMode? Mode {get; private set; } + + /// + /// Gets the debug setting of the deployment. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "debugSetting")] + public DebugSetting DebugSetting {get; private set; } + + /// + /// Gets the deployment on error behavior. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "onErrorDeployment")] + public OnErrorDeploymentExtended OnErrorDeployment {get; private set; } + + /// + /// Gets the hash produced for the template. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "templateHash")] + public string TemplateHash {get; private set; } + + /// + /// Gets array of provisioned resources. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "outputResources")] + public System.Collections.Generic.IList OutputResources {get; private set; } + + /// + /// Gets array of validated resources. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "validatedResources")] + public System.Collections.Generic.IList ValidatedResources {get; private set; } + + /// + /// Gets the deployment error. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "error")] + public ErrorResponse Error {get; private set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + + + + + + + + + if (this.ParametersLink != null) + { + this.ParametersLink.Validate(); + } + + + + + + + + } + } +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/DeploymentScript.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/DeploymentScript.cs similarity index 54% rename from src/Resources/Resources.Sdk/Generated/Models/DeploymentScript.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/DeploymentScript.cs index 496121979f16..7a5b4c8d1ca8 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/DeploymentScript.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/DeploymentScript.cs @@ -1,19 +1,10 @@ -// // 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.Models { - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -33,25 +24,36 @@ public DeploymentScript() /// /// Initializes a new instance of the DeploymentScript class. /// - /// The location of the ACI and the storage - /// account for the deployment script. - /// String Id used to locate any resource on - /// Azure. - /// Name of this resource. - /// Type of this resource. - /// Optional property. Managed identity to be - /// used for this deployment script. Currently, only user-assigned MSI - /// is supported. - /// Resource tags. - /// The system metadata related to this - /// resource. - public DeploymentScript(string location, string id = default(string), string name = default(string), string type = default(string), ManagedServiceIdentity identity = default(ManagedServiceIdentity), IDictionary tags = default(IDictionary), SystemData systemData = default(SystemData)) - : base(id, name, type) + + /// String Id used to locate any resource on Azure. + /// + + /// Name of this resource. + /// + + /// Type of this resource. + /// + + /// Optional property. Managed identity to be used for this deployment script. + /// Currently, only user-assigned MSI is supported. + /// + + /// The location of the ACI and the storage account for the deployment script. + /// + + /// Resource tags. + /// + + /// The system metadata related to this resource. + /// + public DeploymentScript(string location, string id = default(string), string name = default(string), string type = default(string), ManagedServiceIdentity identity = default(ManagedServiceIdentity), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), SystemData systemData = default(SystemData)) + + : base(id, name, type) { - Identity = identity; - Location = location; - Tags = tags; - SystemData = systemData; + this.Identity = identity; + this.Location = location; + this.Tags = tags; + this.SystemData = systemData; CustomInit(); } @@ -60,45 +62,48 @@ public DeploymentScript() /// partial void CustomInit(); + /// - /// Gets or sets optional property. Managed identity to be used for - /// this deployment script. Currently, only user-assigned MSI is - /// supported. + /// Gets or sets optional property. Managed identity to be used for this + /// deployment script. Currently, only user-assigned MSI is supported. /// - [JsonProperty(PropertyName = "identity")] - public ManagedServiceIdentity Identity { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "identity")] + public ManagedServiceIdentity Identity {get; set; } /// - /// Gets or sets the location of the ACI and the storage account for - /// the deployment script. + /// Gets or sets the location of the ACI and the storage account for the + /// deployment script. /// - [JsonProperty(PropertyName = "location")] - public string Location { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + public string Location {get; set; } /// /// Gets or sets resource tags. /// - [JsonProperty(PropertyName = "tags")] - public IDictionary Tags { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] + public System.Collections.Generic.IDictionary Tags {get; set; } /// /// Gets the system metadata related to this resource. /// - [JsonProperty(PropertyName = "systemData")] - public SystemData SystemData { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "systemData")] + public SystemData SystemData {get; private set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Location == null) + if (this.Location == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Location"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Location"); } + + + + } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/DeploymentScriptUpdateParameter.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/DeploymentScriptUpdateParameter.cs similarity index 64% rename from src/Resources/Resources.Sdk/Generated/Models/DeploymentScriptUpdateParameter.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/DeploymentScriptUpdateParameter.cs index 4f685f8e4b96..00b63103cdb4 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/DeploymentScriptUpdateParameter.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/DeploymentScriptUpdateParameter.cs @@ -1,18 +1,10 @@ -// // 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.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -21,8 +13,7 @@ namespace Microsoft.Azure.Management.Resources.Models public partial class DeploymentScriptUpdateParameter : AzureResourceBase { /// - /// Initializes a new instance of the DeploymentScriptUpdateParameter - /// class. + /// Initializes a new instance of the DeploymentScriptUpdateParameter class. /// public DeploymentScriptUpdateParameter() { @@ -30,18 +21,25 @@ public DeploymentScriptUpdateParameter() } /// - /// Initializes a new instance of the DeploymentScriptUpdateParameter - /// class. + /// Initializes a new instance of the DeploymentScriptUpdateParameter class. /// - /// String Id used to locate any resource on - /// Azure. - /// Name of this resource. - /// Type of this resource. - /// Resource tags to be updated. - public DeploymentScriptUpdateParameter(string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary)) - : base(id, name, type) + + /// String Id used to locate any resource on Azure. + /// + + /// Name of this resource. + /// + + /// Type of this resource. + /// + + /// Resource tags to be updated. + /// + public DeploymentScriptUpdateParameter(string id = default(string), string name = default(string), string type = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary)) + + : base(id, name, type) { - Tags = tags; + this.Tags = tags; CustomInit(); } @@ -50,11 +48,11 @@ public DeploymentScriptUpdateParameter() /// partial void CustomInit(); + /// /// Gets or sets resource tags to be updated. /// - [JsonProperty(PropertyName = "tags")] - public IDictionary Tags { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] + public System.Collections.Generic.IDictionary Tags {get; set; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/DeploymentScriptsError.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/DeploymentScriptsError.cs similarity index 64% rename from src/Resources/Resources.Sdk/Generated/Models/DeploymentScriptsError.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/DeploymentScriptsError.cs index 2dbcd4f44f94..3f193d8db73d 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/DeploymentScriptsError.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/DeploymentScriptsError.cs @@ -1,16 +1,10 @@ -// // 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.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,9 +23,15 @@ public DeploymentScriptsError() /// /// Initializes a new instance of the DeploymentScriptsError class. /// + + /// Common error response for all Azure Resource Manager APIs to return error + /// details for failed operations. (This also follows the OData error response + /// format.) + /// public DeploymentScriptsError(ErrorResponse error = default(ErrorResponse)) + { - Error = error; + this.Error = error; CustomInit(); } @@ -40,10 +40,13 @@ public DeploymentScriptsError() /// partial void CustomInit(); + /// + /// Gets or sets common error response for all Azure Resource Manager APIs to + /// return error details for failed operations. (This also follows the OData + /// error response format.) /// - [JsonProperty(PropertyName = "error")] - public ErrorResponse Error { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "error")] + public ErrorResponse Error {get; set; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/DeploymentScriptsErrorException.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/DeploymentScriptsErrorException.cs similarity index 80% rename from src/Resources/Resources.Sdk/Generated/Models/DeploymentScriptsErrorException.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/DeploymentScriptsErrorException.cs index c9a7654ebab9..0bb44d38c9d2 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/DeploymentScriptsErrorException.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/DeploymentScriptsErrorException.cs @@ -1,32 +1,25 @@ -// // 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.Models { - using Microsoft.Rest; /// - /// Exception thrown for an invalid response with DeploymentScriptsError - /// information. + /// Exception thrown for an invalid response with DeploymentScriptsError information. /// - public partial class DeploymentScriptsErrorException : RestException + public partial class DeploymentScriptsErrorException : Microsoft.Rest.RestException { /// /// Gets information about the associated HTTP request. /// - public HttpRequestMessageWrapper Request { get; set; } + public Microsoft.Rest.HttpRequestMessageWrapper Request { get; set; } /// /// Gets information about the associated HTTP response. /// - public HttpResponseMessageWrapper Response { get; set; } + public Microsoft.Rest.HttpResponseMessageWrapper Response { get; set; } /// /// Gets or sets the body object. @@ -41,7 +34,7 @@ public DeploymentScriptsErrorException() } /// - /// Initializes a new instance of the DeploymentScriptsErrorException class. + /// Initializes a new instance of the DeploymentScriptsError class. /// /// The exception message. public DeploymentScriptsErrorException(string message) @@ -50,7 +43,7 @@ public DeploymentScriptsErrorException(string message) } /// - /// Initializes a new instance of the DeploymentScriptsErrorException class. + /// Initializes a new instance of the DeploymentScriptsError class. /// /// The exception message. /// Inner exception. @@ -59,4 +52,4 @@ public DeploymentScriptsErrorException(string message, System.Exception innerExc { } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Management.Sdk/Generated/Models/DeploymentStack.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/DeploymentStack.cs new file mode 100644 index 000000000000..38bc0f113e42 --- /dev/null +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/DeploymentStack.cs @@ -0,0 +1,343 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Resources.Models +{ + using System.Linq; + + /// + /// Deployment stack object. + /// + [Microsoft.Rest.Serialization.JsonTransformation] + public partial class DeploymentStack : AzureResourceBase + { + /// + /// Initializes a new instance of the DeploymentStack class. + /// + public DeploymentStack() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DeploymentStack class. + /// + + /// String Id used to locate any resource on Azure. + /// + + /// Name of this resource. + /// + + /// Type of this resource. + /// + + /// Azure Resource Manager metadata containing createdBy and modifiedBy + /// information. + /// + + /// The location of the deployment stack. It cannot be changed after creation. + /// It must be one of the supported Azure locations. + /// + + /// Deployment stack resource tags. + /// + + /// Defines how resources deployed by the stack are locked. + /// + + /// Common error response for all Azure Resource Manager APIs to return error + /// details for failed operations. (This also follows the OData error response + /// format.). + /// + + /// The template content. You use this element when you want to pass the + /// template syntax directly in the request rather than link to an existing + /// template. It can be a JObject or well-formed JSON string. Use either the + /// templateLink property or the template property, but not both. + /// + + /// The URI of the template. Use either the templateLink property or the + /// template property, but not both. + /// + + /// Name and value pairs that define the deployment parameters for the + /// template. Use this element when providing the parameter values directly in + /// the request, rather than linking to an existing parameter file. Use either + /// the parametersLink property or the parameters property, but not both. It + /// can be a JObject or a well formed JSON string. + /// + + /// The URI of parameters file. Use this element to link to an existing + /// parameters file. Use either the parametersLink property or the parameters + /// property, but not both. + /// + + /// Defines the behavior of resources that are not managed immediately after + /// the stack is updated. + /// + + /// The debug setting of the deployment. + /// + + /// The scope at which the initial deployment should be created. If a scope is + /// not specified, it will default to the scope of the deployment stack. Valid + /// scopes are: management group (format: + /// '/providers/Microsoft.Management/managementGroups/{managementGroupId}'), + /// subscription (format: '/subscriptions/{subscriptionId}'), resource group + /// (format: + /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}'). + /// + + /// Deployment stack description. + /// + + /// State of the deployment stack. + /// Possible values include: 'Creating', 'Validating', 'Waiting', 'Deploying', + /// 'Canceling', 'Locking', 'DeletingResources', 'Succeeded', 'Failed', + /// 'Canceled', 'Deleting' + + /// An array of resources that were detached during the most recent update. + /// + + /// An array of resources that were deleted during the most recent update. + /// + + /// An array of resources that failed to reach goal state during the most + /// recent update. + /// + + /// An array of resources currently managed by the deployment stack. + /// + + /// The resourceId of the deployment resource created by the deployment stack. + /// + + /// The outputs of the underlying deployment. + /// + + /// The duration of the deployment stack update. + /// + public DeploymentStack(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), DenySettings denySettings = default(DenySettings), ErrorResponse error = default(ErrorResponse), object template = default(object), DeploymentStacksTemplateLink templateLink = default(DeploymentStacksTemplateLink), object parameters = default(object), DeploymentStacksParametersLink parametersLink = default(DeploymentStacksParametersLink), DeploymentStackPropertiesActionOnUnmanage actionOnUnmanage = default(DeploymentStackPropertiesActionOnUnmanage), DeploymentStacksDebugSetting debugSetting = default(DeploymentStacksDebugSetting), string deploymentScope = default(string), string description = default(string), string provisioningState = default(string), System.Collections.Generic.IList detachedResources = default(System.Collections.Generic.IList), System.Collections.Generic.IList deletedResources = default(System.Collections.Generic.IList), System.Collections.Generic.IList failedResources = default(System.Collections.Generic.IList), System.Collections.Generic.IList resources = default(System.Collections.Generic.IList), string deploymentId = default(string), object outputs = default(object), string duration = default(string)) + + : base(id, name, type, systemData) + { + this.Location = location; + this.Tags = tags; + this.DenySettings = denySettings; + this.Error = error; + this.Template = template; + this.TemplateLink = templateLink; + this.Parameters = parameters; + this.ParametersLink = parametersLink; + this.ActionOnUnmanage = actionOnUnmanage; + this.DebugSetting = debugSetting; + this.DeploymentScope = deploymentScope; + this.Description = description; + this.ProvisioningState = provisioningState; + this.DetachedResources = detachedResources; + this.DeletedResources = deletedResources; + this.FailedResources = failedResources; + this.Resources = resources; + this.DeploymentId = deploymentId; + this.Outputs = outputs; + this.Duration = duration; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the location of the deployment stack. It cannot be changed + /// after creation. It must be one of the supported Azure locations. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + public string Location {get; set; } + + /// + /// Gets or sets deployment stack resource tags. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] + public System.Collections.Generic.IDictionary Tags {get; set; } + + /// + /// Gets or sets defines how resources deployed by the stack are locked. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.denySettings")] + public DenySettings DenySettings {get; set; } + + /// + /// Gets or sets common error response for all Azure Resource Manager APIs to + /// return error details for failed operations. (This also follows the OData + /// error response format.). + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.error")] + public ErrorResponse Error {get; set; } + + /// + /// Gets or sets the template content. You use this element when you want to + /// pass the template syntax directly in the request rather than link to an + /// existing template. It can be a JObject or well-formed JSON string. Use + /// either the templateLink property or the template property, but not both. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.template")] + public object Template {get; set; } + + /// + /// Gets or sets the URI of the template. Use either the templateLink property + /// or the template property, but not both. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.templateLink")] + public DeploymentStacksTemplateLink TemplateLink {get; set; } + + /// + /// Gets or sets name and value pairs that define the deployment parameters for + /// the template. Use this element when providing the parameter values directly + /// in the request, rather than linking to an existing parameter file. Use + /// either the parametersLink property or the parameters property, but not + /// both. It can be a JObject or a well formed JSON string. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.parameters")] + public object Parameters {get; set; } + + /// + /// Gets or sets the URI of parameters file. Use this element to link to an + /// existing parameters file. Use either the parametersLink property or the + /// parameters property, but not both. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.parametersLink")] + public DeploymentStacksParametersLink ParametersLink {get; set; } + + /// + /// Gets or sets defines the behavior of resources that are not managed + /// immediately after the stack is updated. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.actionOnUnmanage")] + public DeploymentStackPropertiesActionOnUnmanage ActionOnUnmanage {get; set; } + + /// + /// Gets or sets the debug setting of the deployment. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.debugSetting")] + public DeploymentStacksDebugSetting DebugSetting {get; set; } + + /// + /// Gets or sets the scope at which the initial deployment should be created. + /// If a scope is not specified, it will default to the scope of the deployment + /// stack. Valid scopes are: management group (format: + /// '/providers/Microsoft.Management/managementGroups/{managementGroupId}'), + /// subscription (format: '/subscriptions/{subscriptionId}'), resource group + /// (format: + /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}'). + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.deploymentScope")] + public string DeploymentScope {get; set; } + + /// + /// Gets or sets deployment stack description. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.description")] + public string Description {get; set; } + + /// + /// Gets state of the deployment stack. Possible values include: 'Creating', 'Validating', 'Waiting', 'Deploying', 'Canceling', 'Locking', 'DeletingResources', 'Succeeded', 'Failed', 'Canceled', 'Deleting' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets an array of resources that were detached during the most recent + /// update. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.detachedResources")] + public System.Collections.Generic.IList DetachedResources {get; private set; } + + /// + /// Gets an array of resources that were deleted during the most recent update. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.deletedResources")] + public System.Collections.Generic.IList DeletedResources {get; private set; } + + /// + /// Gets an array of resources that failed to reach goal state during the most + /// recent update. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.failedResources")] + public System.Collections.Generic.IList FailedResources {get; private set; } + + /// + /// Gets an array of resources currently managed by the deployment stack. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.resources")] + public System.Collections.Generic.IList Resources {get; private set; } + + /// + /// Gets the resourceId of the deployment resource created by the deployment + /// stack. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.deploymentId")] + public string DeploymentId {get; private set; } + + /// + /// Gets the outputs of the underlying deployment. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.outputs")] + public object Outputs {get; private set; } + + /// + /// Gets the duration of the deployment stack update. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.duration")] + public string Duration {get; private set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + + + if (this.DenySettings != null) + { + this.DenySettings.Validate(); + } + + + + + if (this.ParametersLink != null) + { + this.ParametersLink.Validate(); + } + if (this.ActionOnUnmanage != null) + { + this.ActionOnUnmanage.Validate(); + } + + + if (this.Description != null) + { + if (this.Description.Length > 4096) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "Description", 4096); + } + } + + + + + + + + + } + } +} \ No newline at end of file diff --git a/src/Resources/Resources.Management.Sdk/Generated/Models/DeploymentStackProperties.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/DeploymentStackProperties.cs new file mode 100644 index 000000000000..7dc8c2ed3f53 --- /dev/null +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/DeploymentStackProperties.cs @@ -0,0 +1,303 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Resources.Models +{ + using System.Linq; + + /// + /// Deployment stack properties. + /// + public partial class DeploymentStackProperties : DeploymentStacksError + { + /// + /// Initializes a new instance of the DeploymentStackProperties class. + /// + public DeploymentStackProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DeploymentStackProperties class. + /// + + /// Common error response for all Azure Resource Manager APIs to return error + /// details for failed operations. (This also follows the OData error response + /// format.). + /// + + /// The template content. You use this element when you want to pass the + /// template syntax directly in the request rather than link to an existing + /// template. It can be a JObject or well-formed JSON string. Use either the + /// templateLink property or the template property, but not both. + /// + + /// The URI of the template. Use either the templateLink property or the + /// template property, but not both. + /// + + /// Name and value pairs that define the deployment parameters for the + /// template. Use this element when providing the parameter values directly in + /// the request, rather than linking to an existing parameter file. Use either + /// the parametersLink property or the parameters property, but not both. It + /// can be a JObject or a well formed JSON string. + /// + + /// The URI of parameters file. Use this element to link to an existing + /// parameters file. Use either the parametersLink property or the parameters + /// property, but not both. + /// + + /// Defines the behavior of resources that are not managed immediately after + /// the stack is updated. + /// + + /// The debug setting of the deployment. + /// + + /// The scope at which the initial deployment should be created. If a scope is + /// not specified, it will default to the scope of the deployment stack. Valid + /// scopes are: management group (format: + /// '/providers/Microsoft.Management/managementGroups/{managementGroupId}'), + /// subscription (format: '/subscriptions/{subscriptionId}'), resource group + /// (format: + /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}'). + /// + + /// Deployment stack description. + /// + + /// Defines how resources deployed by the stack are locked. + /// + + /// State of the deployment stack. + /// Possible values include: 'Creating', 'Validating', 'Waiting', 'Deploying', + /// 'Canceling', 'Locking', 'DeletingResources', 'Succeeded', 'Failed', + /// 'Canceled', 'Deleting' + + /// An array of resources that were detached during the most recent update. + /// + + /// An array of resources that were deleted during the most recent update. + /// + + /// An array of resources that failed to reach goal state during the most + /// recent update. + /// + + /// An array of resources currently managed by the deployment stack. + /// + + /// The resourceId of the deployment resource created by the deployment stack. + /// + + /// The outputs of the underlying deployment. + /// + + /// The duration of the deployment stack update. + /// + public DeploymentStackProperties(DeploymentStackPropertiesActionOnUnmanage actionOnUnmanage, DenySettings denySettings, ErrorResponse error = default(ErrorResponse), object template = default(object), DeploymentStacksTemplateLink templateLink = default(DeploymentStacksTemplateLink), object parameters = default(object), DeploymentStacksParametersLink parametersLink = default(DeploymentStacksParametersLink), DeploymentStacksDebugSetting debugSetting = default(DeploymentStacksDebugSetting), string deploymentScope = default(string), string description = default(string), string provisioningState = default(string), System.Collections.Generic.IList detachedResources = default(System.Collections.Generic.IList), System.Collections.Generic.IList deletedResources = default(System.Collections.Generic.IList), System.Collections.Generic.IList failedResources = default(System.Collections.Generic.IList), System.Collections.Generic.IList resources = default(System.Collections.Generic.IList), string deploymentId = default(string), object outputs = default(object), string duration = default(string)) + + : base(error) + { + this.Template = template; + this.TemplateLink = templateLink; + this.Parameters = parameters; + this.ParametersLink = parametersLink; + this.ActionOnUnmanage = actionOnUnmanage; + this.DebugSetting = debugSetting; + this.DeploymentScope = deploymentScope; + this.Description = description; + this.DenySettings = denySettings; + this.ProvisioningState = provisioningState; + this.DetachedResources = detachedResources; + this.DeletedResources = deletedResources; + this.FailedResources = failedResources; + this.Resources = resources; + this.DeploymentId = deploymentId; + this.Outputs = outputs; + this.Duration = duration; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the template content. You use this element when you want to + /// pass the template syntax directly in the request rather than link to an + /// existing template. It can be a JObject or well-formed JSON string. Use + /// either the templateLink property or the template property, but not both. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "template")] + public object Template {get; set; } + + /// + /// Gets or sets the URI of the template. Use either the templateLink property + /// or the template property, but not both. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "templateLink")] + public DeploymentStacksTemplateLink TemplateLink {get; set; } + + /// + /// Gets or sets name and value pairs that define the deployment parameters for + /// the template. Use this element when providing the parameter values directly + /// in the request, rather than linking to an existing parameter file. Use + /// either the parametersLink property or the parameters property, but not + /// both. It can be a JObject or a well formed JSON string. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "parameters")] + public object Parameters {get; set; } + + /// + /// Gets or sets the URI of parameters file. Use this element to link to an + /// existing parameters file. Use either the parametersLink property or the + /// parameters property, but not both. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "parametersLink")] + public DeploymentStacksParametersLink ParametersLink {get; set; } + + /// + /// Gets or sets defines the behavior of resources that are not managed + /// immediately after the stack is updated. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "actionOnUnmanage")] + public DeploymentStackPropertiesActionOnUnmanage ActionOnUnmanage {get; set; } + + /// + /// Gets or sets the debug setting of the deployment. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "debugSetting")] + public DeploymentStacksDebugSetting DebugSetting {get; set; } + + /// + /// Gets or sets the scope at which the initial deployment should be created. + /// If a scope is not specified, it will default to the scope of the deployment + /// stack. Valid scopes are: management group (format: + /// '/providers/Microsoft.Management/managementGroups/{managementGroupId}'), + /// subscription (format: '/subscriptions/{subscriptionId}'), resource group + /// (format: + /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}'). + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "deploymentScope")] + public string DeploymentScope {get; set; } + + /// + /// Gets or sets deployment stack description. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "description")] + public string Description {get; set; } + + /// + /// Gets or sets defines how resources deployed by the stack are locked. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "denySettings")] + public DenySettings DenySettings {get; set; } + + /// + /// Gets state of the deployment stack. Possible values include: 'Creating', 'Validating', 'Waiting', 'Deploying', 'Canceling', 'Locking', 'DeletingResources', 'Succeeded', 'Failed', 'Canceled', 'Deleting' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets an array of resources that were detached during the most recent + /// update. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "detachedResources")] + public System.Collections.Generic.IList DetachedResources {get; private set; } + + /// + /// Gets an array of resources that were deleted during the most recent update. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "deletedResources")] + public System.Collections.Generic.IList DeletedResources {get; private set; } + + /// + /// Gets an array of resources that failed to reach goal state during the most + /// recent update. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "failedResources")] + public System.Collections.Generic.IList FailedResources {get; private set; } + + /// + /// Gets an array of resources currently managed by the deployment stack. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "resources")] + public System.Collections.Generic.IList Resources {get; private set; } + + /// + /// Gets the resourceId of the deployment resource created by the deployment + /// stack. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "deploymentId")] + public string DeploymentId {get; private set; } + + /// + /// Gets the outputs of the underlying deployment. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "outputs")] + public object Outputs {get; private set; } + + /// + /// Gets the duration of the deployment stack update. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "duration")] + public string Duration {get; private set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (this.ActionOnUnmanage == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "ActionOnUnmanage"); + } + if (this.DenySettings == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "DenySettings"); + } + + + + if (this.ParametersLink != null) + { + this.ParametersLink.Validate(); + } + if (this.ActionOnUnmanage != null) + { + this.ActionOnUnmanage.Validate(); + } + + + if (this.Description != null) + { + if (this.Description.Length > 4096) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "Description", 4096); + } + } + if (this.DenySettings != null) + { + this.DenySettings.Validate(); + } + + + + + + + + + } + } +} \ No newline at end of file diff --git a/src/Resources/Resources.Management.Sdk/Generated/Models/DeploymentStackPropertiesActionOnUnmanage.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/DeploymentStackPropertiesActionOnUnmanage.cs new file mode 100644 index 000000000000..c76a5e0cdc2d --- /dev/null +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/DeploymentStackPropertiesActionOnUnmanage.cs @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Resources.Models +{ + using System.Linq; + + /// + /// Defines the behavior of resources that are not managed immediately after + /// the stack is updated. + /// + public partial class DeploymentStackPropertiesActionOnUnmanage + { + /// + /// Initializes a new instance of the DeploymentStackPropertiesActionOnUnmanage class. + /// + public DeploymentStackPropertiesActionOnUnmanage() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DeploymentStackPropertiesActionOnUnmanage class. + /// + + /// Specifies the action that should be taken on the resource when the + /// deployment stack is deleted. Delete will attempt to delete the resource + /// from Azure. Detach will leave the resource in it's current state. + /// Possible values include: 'delete', 'detach' + + /// Specifies the action that should be taken on the resource when the + /// deployment stack is deleted. Delete will attempt to delete the resource + /// from Azure. Detach will leave the resource in it's current state. + /// Possible values include: 'delete', 'detach' + + /// Specifies the action that should be taken on the resource when the + /// deployment stack is deleted. Delete will attempt to delete the resource + /// from Azure. Detach will leave the resource in it's current state. + /// Possible values include: 'delete', 'detach' + public DeploymentStackPropertiesActionOnUnmanage(string resources, string resourceGroups = default(string), string managementGroups = default(string)) + + { + this.Resources = resources; + this.ResourceGroups = resourceGroups; + this.ManagementGroups = managementGroups; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets specifies the action that should be taken on the resource when + /// the deployment stack is deleted. Delete will attempt to delete the resource + /// from Azure. Detach will leave the resource in it's current state. Possible values include: 'delete', 'detach' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "resources")] + public string Resources {get; set; } + + /// + /// Gets or sets specifies the action that should be taken on the resource when + /// the deployment stack is deleted. Delete will attempt to delete the resource + /// from Azure. Detach will leave the resource in it's current state. Possible values include: 'delete', 'detach' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "resourceGroups")] + public string ResourceGroups {get; set; } + + /// + /// Gets or sets specifies the action that should be taken on the resource when + /// the deployment stack is deleted. Delete will attempt to delete the resource + /// from Azure. Detach will leave the resource in it's current state. Possible values include: 'delete', 'detach' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "managementGroups")] + public string ManagementGroups {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (this.Resources == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Resources"); + } + + + + } + } +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/DeploymentStackProvisioningState.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/DeploymentStackProvisioningState.cs similarity index 90% rename from src/Resources/Resources.Sdk/Generated/Models/DeploymentStackProvisioningState.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/DeploymentStackProvisioningState.cs index c10597c341b8..16814808e079 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/DeploymentStackProvisioningState.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/DeploymentStackProvisioningState.cs @@ -1,12 +1,7 @@ -// // 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.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Resources.Models /// /// Defines values for DeploymentStackProvisioningState. /// + + public static class DeploymentStackProvisioningState { public const string Creating = "Creating"; @@ -28,4 +25,4 @@ public static class DeploymentStackProvisioningState public const string Canceled = "Canceled"; public const string Deleting = "Deleting"; } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/DeploymentStackTemplateDefinition.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/DeploymentStackTemplateDefinition.cs similarity index 57% rename from src/Resources/Resources.Sdk/Generated/Models/DeploymentStackTemplateDefinition.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/DeploymentStackTemplateDefinition.cs index 7f26f2b76d45..918975d8729c 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/DeploymentStackTemplateDefinition.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/DeploymentStackTemplateDefinition.cs @@ -1,16 +1,10 @@ -// // 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.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.Resources.Models public partial class DeploymentStackTemplateDefinition { /// - /// Initializes a new instance of the DeploymentStackTemplateDefinition - /// class. + /// Initializes a new instance of the DeploymentStackTemplateDefinition class. /// public DeploymentStackTemplateDefinition() { @@ -28,21 +21,23 @@ public DeploymentStackTemplateDefinition() } /// - /// Initializes a new instance of the DeploymentStackTemplateDefinition - /// class. + /// Initializes a new instance of the DeploymentStackTemplateDefinition class. /// - /// The template content. Use this element to - /// pass the template syntax directly in the request rather than link - /// to an existing template. It can be a JObject or well-formed JSON - /// string. Use either the templateLink property or the template - /// property, but not both. - /// The URI of the template. Use either the - /// templateLink property or the template property, but not - /// both. + + /// The template content. Use this element to pass the template syntax directly + /// in the request rather than link to an existing template. It can be a + /// JObject or well-formed JSON string. Use either the templateLink property or + /// the template property, but not both. + /// + + /// The URI of the template. Use either the templateLink property or the + /// template property, but not both. + /// public DeploymentStackTemplateDefinition(object template = default(object), DeploymentStacksTemplateLink templateLink = default(DeploymentStacksTemplateLink)) + { - Template = template; - TemplateLink = templateLink; + this.Template = template; + this.TemplateLink = templateLink; CustomInit(); } @@ -51,22 +46,21 @@ public DeploymentStackTemplateDefinition() /// partial void CustomInit(); - /// - /// Gets or sets the template content. Use this element to pass the - /// template syntax directly in the request rather than link to an - /// existing template. It can be a JObject or well-formed JSON string. - /// Use either the templateLink property or the template property, but - /// not both. - /// - [JsonProperty(PropertyName = "template")] - public object Template { get; set; } /// - /// Gets or sets the URI of the template. Use either the templateLink + /// Gets or sets the template content. Use this element to pass the template + /// syntax directly in the request rather than link to an existing template. It + /// can be a JObject or well-formed JSON string. Use either the templateLink /// property or the template property, but not both. /// - [JsonProperty(PropertyName = "templateLink")] - public DeploymentStacksTemplateLink TemplateLink { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "template")] + public object Template {get; set; } + /// + /// Gets or sets the URI of the template. Use either the templateLink property + /// or the template property, but not both. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "templateLink")] + public DeploymentStacksTemplateLink TemplateLink {get; set; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Management.Sdk/Generated/Models/DeploymentStacksDebugSetting.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/DeploymentStacksDebugSetting.cs new file mode 100644 index 000000000000..df04d9d69a24 --- /dev/null +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/DeploymentStacksDebugSetting.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Resources.Models +{ + using System.Linq; + + /// + /// The debug setting. + /// + public partial class DeploymentStacksDebugSetting + { + /// + /// Initializes a new instance of the DeploymentStacksDebugSetting class. + /// + public DeploymentStacksDebugSetting() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DeploymentStacksDebugSetting class. + /// + + /// Specifies the type of information to log for debugging. The permitted + /// values are none, requestContent, responseContent, or both requestContent + /// and responseContent separated by a comma. The default is none. When setting + /// this value, carefully consider the type of information that is being passed + /// in during deployment. By logging information about the request or response, + /// sensitive data that is retrieved through the deployment operations could + /// potentially be exposed. + /// + public DeploymentStacksDebugSetting(string detailLevel = default(string)) + + { + this.DetailLevel = detailLevel; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets specifies the type of information to log for debugging. The + /// permitted values are none, requestContent, responseContent, or both + /// requestContent and responseContent separated by a comma. The default is + /// none. When setting this value, carefully consider the type of information + /// that is being passed in during deployment. By logging information about the + /// request or response, sensitive data that is retrieved through the + /// deployment operations could potentially be exposed. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "detailLevel")] + public string DetailLevel {get; set; } + } +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/DeploymentStacksDeleteAtManagementGroupHeaders.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/DeploymentStacksDeleteAtManagementGroupHeaders.cs similarity index 62% rename from src/Resources/Resources.Sdk/Generated/Models/DeploymentStacksDeleteAtManagementGroupHeaders.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/DeploymentStacksDeleteAtManagementGroupHeaders.cs index d0b2e89b4bd1..9c637c760504 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/DeploymentStacksDeleteAtManagementGroupHeaders.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/DeploymentStacksDeleteAtManagementGroupHeaders.cs @@ -1,26 +1,16 @@ -// // 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.Models { - using Newtonsoft.Json; using System.Linq; - /// - /// Defines headers for DeleteAtManagementGroup operation. - /// public partial class DeploymentStacksDeleteAtManagementGroupHeaders { /// - /// Initializes a new instance of the - /// DeploymentStacksDeleteAtManagementGroupHeaders class. + /// Initializes a new instance of the DeploymentStacksDeleteAtManagementGroupHeaders class. /// public DeploymentStacksDeleteAtManagementGroupHeaders() { @@ -28,12 +18,15 @@ public DeploymentStacksDeleteAtManagementGroupHeaders() } /// - /// Initializes a new instance of the - /// DeploymentStacksDeleteAtManagementGroupHeaders class. + /// Initializes a new instance of the DeploymentStacksDeleteAtManagementGroupHeaders class. /// + + /// + /// public DeploymentStacksDeleteAtManagementGroupHeaders(string location = default(string)) + { - Location = location; + this.Location = location; CustomInit(); } @@ -42,10 +35,11 @@ public DeploymentStacksDeleteAtManagementGroupHeaders() /// partial void CustomInit(); + /// + /// Gets or sets /// - [JsonProperty(PropertyName = "Location")] - public string Location { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/DeploymentStacksDeleteAtResourceGroupHeaders.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/DeploymentStacksDeleteAtResourceGroupHeaders.cs similarity index 62% rename from src/Resources/Resources.Sdk/Generated/Models/DeploymentStacksDeleteAtResourceGroupHeaders.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/DeploymentStacksDeleteAtResourceGroupHeaders.cs index b3ff45d17312..4a6eb239a187 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/DeploymentStacksDeleteAtResourceGroupHeaders.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/DeploymentStacksDeleteAtResourceGroupHeaders.cs @@ -1,26 +1,16 @@ -// // 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.Models { - using Newtonsoft.Json; using System.Linq; - /// - /// Defines headers for DeleteAtResourceGroup operation. - /// public partial class DeploymentStacksDeleteAtResourceGroupHeaders { /// - /// Initializes a new instance of the - /// DeploymentStacksDeleteAtResourceGroupHeaders class. + /// Initializes a new instance of the DeploymentStacksDeleteAtResourceGroupHeaders class. /// public DeploymentStacksDeleteAtResourceGroupHeaders() { @@ -28,12 +18,15 @@ public DeploymentStacksDeleteAtResourceGroupHeaders() } /// - /// Initializes a new instance of the - /// DeploymentStacksDeleteAtResourceGroupHeaders class. + /// Initializes a new instance of the DeploymentStacksDeleteAtResourceGroupHeaders class. /// + + /// + /// public DeploymentStacksDeleteAtResourceGroupHeaders(string location = default(string)) + { - Location = location; + this.Location = location; CustomInit(); } @@ -42,10 +35,11 @@ public DeploymentStacksDeleteAtResourceGroupHeaders() /// partial void CustomInit(); + /// + /// Gets or sets /// - [JsonProperty(PropertyName = "Location")] - public string Location { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/DeploymentStacksDeleteAtSubscriptionHeaders.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/DeploymentStacksDeleteAtSubscriptionHeaders.cs similarity index 62% rename from src/Resources/Resources.Sdk/Generated/Models/DeploymentStacksDeleteAtSubscriptionHeaders.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/DeploymentStacksDeleteAtSubscriptionHeaders.cs index 0fbf674cdc82..3dc9b3d55691 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/DeploymentStacksDeleteAtSubscriptionHeaders.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/DeploymentStacksDeleteAtSubscriptionHeaders.cs @@ -1,26 +1,16 @@ -// // 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.Models { - using Newtonsoft.Json; using System.Linq; - /// - /// Defines headers for DeleteAtSubscription operation. - /// public partial class DeploymentStacksDeleteAtSubscriptionHeaders { /// - /// Initializes a new instance of the - /// DeploymentStacksDeleteAtSubscriptionHeaders class. + /// Initializes a new instance of the DeploymentStacksDeleteAtSubscriptionHeaders class. /// public DeploymentStacksDeleteAtSubscriptionHeaders() { @@ -28,12 +18,15 @@ public DeploymentStacksDeleteAtSubscriptionHeaders() } /// - /// Initializes a new instance of the - /// DeploymentStacksDeleteAtSubscriptionHeaders class. + /// Initializes a new instance of the DeploymentStacksDeleteAtSubscriptionHeaders class. /// + + /// + /// public DeploymentStacksDeleteAtSubscriptionHeaders(string location = default(string)) + { - Location = location; + this.Location = location; CustomInit(); } @@ -42,10 +35,11 @@ public DeploymentStacksDeleteAtSubscriptionHeaders() /// partial void CustomInit(); + /// + /// Gets or sets /// - [JsonProperty(PropertyName = "Location")] - public string Location { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/DeploymentStacksDeleteDetachEnum.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/DeploymentStacksDeleteDetachEnum.cs similarity index 84% rename from src/Resources/Resources.Sdk/Generated/Models/DeploymentStacksDeleteDetachEnum.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/DeploymentStacksDeleteDetachEnum.cs index 544e9131a58a..c05ad76c944a 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/DeploymentStacksDeleteDetachEnum.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/DeploymentStacksDeleteDetachEnum.cs @@ -1,12 +1,7 @@ -// // 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.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Resources.Models /// /// Defines values for DeploymentStacksDeleteDetachEnum. /// + + public static class DeploymentStacksDeleteDetachEnum { public const string Delete = "delete"; public const string Detach = "detach"; } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/DeploymentStacksError.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/DeploymentStacksError.cs similarity index 63% rename from src/Resources/Resources.Sdk/Generated/Models/DeploymentStacksError.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/DeploymentStacksError.cs index e550230ccd3c..045dae5bb4c1 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/DeploymentStacksError.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/DeploymentStacksError.cs @@ -1,16 +1,10 @@ -// // 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.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,9 +23,15 @@ public DeploymentStacksError() /// /// Initializes a new instance of the DeploymentStacksError class. /// + + /// Common error response for all Azure Resource Manager APIs to return error + /// details for failed operations. (This also follows the OData error response + /// format.). + /// public DeploymentStacksError(ErrorResponse error = default(ErrorResponse)) + { - Error = error; + this.Error = error; CustomInit(); } @@ -40,10 +40,13 @@ public DeploymentStacksError() /// partial void CustomInit(); + /// + /// Gets or sets common error response for all Azure Resource Manager APIs to + /// return error details for failed operations. (This also follows the OData + /// error response format.). /// - [JsonProperty(PropertyName = "error")] - public ErrorResponse Error { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "error")] + public ErrorResponse Error {get; set; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/DeploymentStacksErrorException.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/DeploymentStacksErrorException.cs similarity index 80% rename from src/Resources/Resources.Sdk/Generated/Models/DeploymentStacksErrorException.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/DeploymentStacksErrorException.cs index 7b985c5cf15b..4e4783a23ad2 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/DeploymentStacksErrorException.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/DeploymentStacksErrorException.cs @@ -1,32 +1,25 @@ -// // 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.Models { - using Microsoft.Rest; /// - /// Exception thrown for an invalid response with DeploymentStacksError - /// information. + /// Exception thrown for an invalid response with DeploymentStacksError information. /// - public partial class DeploymentStacksErrorException : RestException + public partial class DeploymentStacksErrorException : Microsoft.Rest.RestException { /// /// Gets information about the associated HTTP request. /// - public HttpRequestMessageWrapper Request { get; set; } + public Microsoft.Rest.HttpRequestMessageWrapper Request { get; set; } /// /// Gets information about the associated HTTP response. /// - public HttpResponseMessageWrapper Response { get; set; } + public Microsoft.Rest.HttpResponseMessageWrapper Response { get; set; } /// /// Gets or sets the body object. @@ -41,7 +34,7 @@ public DeploymentStacksErrorException() } /// - /// Initializes a new instance of the DeploymentStacksErrorException class. + /// Initializes a new instance of the DeploymentStacksError class. /// /// The exception message. public DeploymentStacksErrorException(string message) @@ -50,7 +43,7 @@ public DeploymentStacksErrorException(string message) } /// - /// Initializes a new instance of the DeploymentStacksErrorException class. + /// Initializes a new instance of the DeploymentStacksError class. /// /// The exception message. /// Inner exception. @@ -59,4 +52,4 @@ public DeploymentStacksErrorException(string message, System.Exception innerExce { } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/DeploymentStacksParametersLink.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/DeploymentStacksParametersLink.cs similarity index 67% rename from src/Resources/Resources.Sdk/Generated/Models/DeploymentStacksParametersLink.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/DeploymentStacksParametersLink.cs index c87e9673f29c..6771b039c048 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/DeploymentStacksParametersLink.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/DeploymentStacksParametersLink.cs @@ -1,17 +1,10 @@ -// // 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.Models { - using Microsoft.Rest; - using Newtonsoft.Json; using System.Linq; /// @@ -20,8 +13,7 @@ namespace Microsoft.Azure.Management.Resources.Models public partial class DeploymentStacksParametersLink { /// - /// Initializes a new instance of the DeploymentStacksParametersLink - /// class. + /// Initializes a new instance of the DeploymentStacksParametersLink class. /// public DeploymentStacksParametersLink() { @@ -29,16 +21,19 @@ public DeploymentStacksParametersLink() } /// - /// Initializes a new instance of the DeploymentStacksParametersLink - /// class. + /// Initializes a new instance of the DeploymentStacksParametersLink class. /// - /// The URI of the parameters file. - /// If included, must match the - /// ContentVersion in the template. + + /// The URI of the parameters file. + /// + + /// If included, must match the ContentVersion in the template. + /// public DeploymentStacksParametersLink(string uri, string contentVersion = default(string)) + { - Uri = uri; - ContentVersion = contentVersion; + this.Uri = uri; + this.ContentVersion = contentVersion; CustomInit(); } @@ -47,31 +42,32 @@ public DeploymentStacksParametersLink() /// partial void CustomInit(); + /// /// Gets or sets the URI of the parameters file. /// - [JsonProperty(PropertyName = "uri")] - public string Uri { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "uri")] + public string Uri {get; set; } /// - /// Gets or sets if included, must match the ContentVersion in the - /// template. + /// Gets or sets if included, must match the ContentVersion in the template. /// - [JsonProperty(PropertyName = "contentVersion")] - public string ContentVersion { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "contentVersion")] + public string ContentVersion {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Uri == null) + if (this.Uri == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Uri"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Uri"); } + + } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/DeploymentStacksTemplateLink.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/DeploymentStacksTemplateLink.cs similarity index 50% rename from src/Resources/Resources.Sdk/Generated/Models/DeploymentStacksTemplateLink.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/DeploymentStacksTemplateLink.cs index 02d6431c187e..9dd196d42ed7 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/DeploymentStacksTemplateLink.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/DeploymentStacksTemplateLink.cs @@ -1,16 +1,10 @@ -// // 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.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.Resources.Models public partial class DeploymentStacksTemplateLink { /// - /// Initializes a new instance of the DeploymentStacksTemplateLink - /// class. + /// Initializes a new instance of the DeploymentStacksTemplateLink class. /// public DeploymentStacksTemplateLink() { @@ -28,30 +21,38 @@ public DeploymentStacksTemplateLink() } /// - /// Initializes a new instance of the DeploymentStacksTemplateLink - /// class. + /// Initializes a new instance of the DeploymentStacksTemplateLink class. /// - /// The URI of the template to deploy. Use either the - /// uri or id property, but not both. - /// The resource id of a Template Spec. Use either the - /// id or uri property, but not both. - /// The relativePath property can be used to - /// deploy a linked template at a location relative to the parent. If - /// the parent template was linked with a TemplateSpec, this will - /// reference an artifact in the TemplateSpec. If the parent was - /// linked with a URI, the child deployment will be a combination of - /// the parent and relativePath URIs - /// The query string (for example, a SAS - /// token) to be used with the templateLink URI. - /// If included, must match the - /// ContentVersion in the template. + + /// The URI of the template to deploy. Use either the uri or id property, but + /// not both. + /// + + /// The resource id of a Template Spec. Use either the id or uri property, but + /// not both. + /// + + /// The relativePath property can be used to deploy a linked template at a + /// location relative to the parent. If the parent template was linked with a + /// TemplateSpec, this will reference an artifact in the TemplateSpec. If the + /// parent was linked with a URI, the child deployment will be a combination of + /// the parent and relativePath URIs + /// + + /// The query string (for example, a SAS token) to be used with the + /// templateLink URI. + /// + + /// If included, must match the ContentVersion in the template. + /// public DeploymentStacksTemplateLink(string uri = default(string), string id = default(string), string relativePath = default(string), string queryString = default(string), string contentVersion = default(string)) + { - Uri = uri; - Id = id; - RelativePath = relativePath; - QueryString = queryString; - ContentVersion = contentVersion; + this.Uri = uri; + this.Id = id; + this.RelativePath = relativePath; + this.QueryString = queryString; + this.ContentVersion = contentVersion; CustomInit(); } @@ -60,44 +61,42 @@ public DeploymentStacksTemplateLink() /// partial void CustomInit(); + /// - /// Gets or sets the URI of the template to deploy. Use either the uri - /// or id property, but not both. + /// Gets or sets the URI of the template to deploy. Use either the uri or id + /// property, but not both. /// - [JsonProperty(PropertyName = "uri")] - public string Uri { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "uri")] + public string Uri {get; set; } /// - /// Gets or sets the resource id of a Template Spec. Use either the id - /// or uri property, but not both. + /// Gets or sets the resource id of a Template Spec. Use either the id or uri + /// property, but not both. /// - [JsonProperty(PropertyName = "id")] - public string Id { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; set; } /// - /// Gets or sets the relativePath property can be used to deploy a - /// linked template at a location relative to the parent. If the parent - /// template was linked with a TemplateSpec, this will reference an - /// artifact in the TemplateSpec. If the parent was linked with a URI, - /// the child deployment will be a combination of the parent and - /// relativePath URIs + /// Gets or sets the relativePath property can be used to deploy a linked + /// template at a location relative to the parent. If the parent template was + /// linked with a TemplateSpec, this will reference an artifact in the + /// TemplateSpec. If the parent was linked with a URI, the child deployment + /// will be a combination of the parent and relativePath URIs /// - [JsonProperty(PropertyName = "relativePath")] - public string RelativePath { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "relativePath")] + public string RelativePath {get; set; } /// - /// Gets or sets the query string (for example, a SAS token) to be used - /// with the templateLink URI. + /// Gets or sets the query string (for example, a SAS token) to be used with + /// the templateLink URI. /// - [JsonProperty(PropertyName = "queryString")] - public string QueryString { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "queryString")] + public string QueryString {get; set; } /// - /// Gets or sets if included, must match the ContentVersion in the - /// template. + /// Gets or sets if included, must match the ContentVersion in the template. /// - [JsonProperty(PropertyName = "contentVersion")] - public string ContentVersion { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "contentVersion")] + public string ContentVersion {get; set; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/DeploymentValidateResult.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/DeploymentValidateResult.cs similarity index 72% rename from src/Resources/Resources.Sdk/Generated/Models/DeploymentValidateResult.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/DeploymentValidateResult.cs index f74b24563bc4..3c8e092bb9cc 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/DeploymentValidateResult.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/DeploymentValidateResult.cs @@ -1,16 +1,10 @@ -// // 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.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,13 +23,17 @@ public DeploymentValidateResult() /// /// Initializes a new instance of the DeploymentValidateResult class. /// - /// The deployment validation error. - /// The template deployment - /// properties. + + /// The deployment validation error. + /// + + /// The template deployment properties. + /// public DeploymentValidateResult(ErrorResponse error = default(ErrorResponse), DeploymentPropertiesExtended properties = default(DeploymentPropertiesExtended)) + { - Error = error; - Properties = properties; + this.Error = error; + this.Properties = properties; CustomInit(); } @@ -44,30 +42,31 @@ public DeploymentValidateResult() /// partial void CustomInit(); + /// /// Gets the deployment validation error. /// - [JsonProperty(PropertyName = "error")] - public ErrorResponse Error { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "error")] + public ErrorResponse Error {get; private set; } /// /// Gets or sets the template deployment properties. /// - [JsonProperty(PropertyName = "properties")] - public DeploymentPropertiesExtended Properties { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties")] + public DeploymentPropertiesExtended Properties {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Properties != null) + + if (this.Properties != null) { - Properties.Validate(); + this.Properties.Validate(); } } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/DeploymentWhatIf.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/DeploymentWhatIf.cs similarity index 66% rename from src/Resources/Resources.Sdk/Generated/Models/DeploymentWhatIf.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/DeploymentWhatIf.cs index 33ff083d5da9..78a32c4433ab 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/DeploymentWhatIf.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/DeploymentWhatIf.cs @@ -1,17 +1,10 @@ -// // 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.Models { - using Microsoft.Rest; - using Newtonsoft.Json; using System.Linq; /// @@ -30,13 +23,17 @@ public DeploymentWhatIf() /// /// Initializes a new instance of the DeploymentWhatIf class. /// - /// The deployment properties. - /// The location to store the deployment - /// data. + + /// The location to store the deployment data. + /// + + /// The deployment properties. + /// public DeploymentWhatIf(DeploymentWhatIfProperties properties, string location = default(string)) + { - Location = location; - Properties = properties; + this.Location = location; + this.Properties = properties; CustomInit(); } @@ -45,34 +42,35 @@ public DeploymentWhatIf() /// partial void CustomInit(); + /// /// Gets or sets the location to store the deployment data. /// - [JsonProperty(PropertyName = "location")] - public string Location { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + public string Location {get; set; } /// /// Gets or sets the deployment properties. /// - [JsonProperty(PropertyName = "properties")] - public DeploymentWhatIfProperties Properties { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties")] + public DeploymentWhatIfProperties Properties {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Properties == null) + if (this.Properties == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Properties"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Properties"); } - if (Properties != null) + + if (this.Properties != null) { - Properties.Validate(); + this.Properties.Validate(); } } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/DeploymentWhatIfProperties.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/DeploymentWhatIfProperties.cs similarity index 51% rename from src/Resources/Resources.Sdk/Generated/Models/DeploymentWhatIfProperties.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/DeploymentWhatIfProperties.cs index b2c2f3669582..e100a29e7324 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/DeploymentWhatIfProperties.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/DeploymentWhatIfProperties.cs @@ -1,16 +1,10 @@ -// // 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.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,46 +23,56 @@ public DeploymentWhatIfProperties() /// /// Initializes a new instance of the DeploymentWhatIfProperties class. /// - /// The mode that is used to deploy resources. This - /// value can be either Incremental or Complete. In Incremental mode, - /// resources are deployed without deleting existing resources that are - /// not included in the template. In Complete mode, resources are - /// deployed and existing resources in the resource group that are not - /// included in the template are deleted. Be careful when using - /// Complete mode as you may unintentionally delete resources. Possible - /// values include: 'Incremental', 'Complete' - /// The template content. You use this element - /// when you want to pass the template syntax directly in the request - /// rather than link to an existing template. It can be a JObject or - /// well-formed JSON string. Use either the templateLink property or - /// the template property, but not both. - /// The URI of the template. Use either the - /// templateLink property or the template property, but not - /// both. - /// Name and value pairs that define the - /// deployment parameters for the template. You use this element when - /// you want to provide the parameter values directly in the request - /// rather than link to an existing parameter file. Use either the - /// parametersLink property or the parameters property, but not both. - /// It can be a JObject or a well formed JSON string. - /// The URI of parameters file. You use - /// this element to link to an existing parameters file. Use either the - /// parametersLink property or the parameters property, but not - /// both. - /// The debug setting of the - /// deployment. - /// The deployment on error - /// behavior. - /// Specifies whether - /// template expressions are evaluated within the scope of the parent - /// template or nested template. Only applicable to nested templates. - /// If not specified, default value is outer. - /// Optional What-If operation - /// settings. + + /// The template content. You use this element when you want to pass the + /// template syntax directly in the request rather than link to an existing + /// template. It can be a JObject or well-formed JSON string. Use either the + /// templateLink property or the template property, but not both. + /// + + /// The URI of the template. Use either the templateLink property or the + /// template property, but not both. + /// + + /// Name and value pairs that define the deployment parameters for the + /// template. You use this element when you want to provide the parameter + /// values directly in the request rather than link to an existing parameter + /// file. Use either the parametersLink property or the parameters property, + /// but not both. It can be a JObject or a well formed JSON string. + /// + + /// The URI of parameters file. You use this element to link to an existing + /// parameters file. Use either the parametersLink property or the parameters + /// property, but not both. + /// + + /// The mode that is used to deploy resources. This value can be either + /// Incremental or Complete. In Incremental mode, resources are deployed + /// without deleting existing resources that are not included in the template. + /// In Complete mode, resources are deployed and existing resources in the + /// resource group that are not included in the template are deleted. Be + /// careful when using Complete mode as you may unintentionally delete + /// resources. + /// Possible values include: 'Incremental', 'Complete' + + /// The debug setting of the deployment. + /// + + /// The deployment on error behavior. + /// + + /// Specifies whether template expressions are evaluated within the scope of + /// the parent template or nested template. Only applicable to nested + /// templates. If not specified, default value is outer. + /// + + /// Optional What-If operation settings. + /// public DeploymentWhatIfProperties(DeploymentMode mode, object template = default(object), TemplateLink templateLink = default(TemplateLink), object parameters = default(object), ParametersLink parametersLink = default(ParametersLink), DebugSetting debugSetting = default(DebugSetting), OnErrorDeployment onErrorDeployment = default(OnErrorDeployment), ExpressionEvaluationOptions expressionEvaluationOptions = default(ExpressionEvaluationOptions), DeploymentWhatIfSettings whatIfSettings = default(DeploymentWhatIfSettings)) - : base(mode, template, templateLink, parameters, parametersLink, debugSetting, onErrorDeployment, expressionEvaluationOptions) + + : base(mode, template, templateLink, parameters, parametersLink, debugSetting, onErrorDeployment, expressionEvaluationOptions) { - WhatIfSettings = whatIfSettings; + this.WhatIfSettings = whatIfSettings; CustomInit(); } @@ -77,21 +81,22 @@ public DeploymentWhatIfProperties() /// partial void CustomInit(); + /// /// Gets or sets optional What-If operation settings. /// - [JsonProperty(PropertyName = "whatIfSettings")] - public DeploymentWhatIfSettings WhatIfSettings { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "whatIfSettings")] + public DeploymentWhatIfSettings WhatIfSettings {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public override void Validate() { base.Validate(); + } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/DeploymentWhatIfSettings.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/DeploymentWhatIfSettings.cs similarity index 69% rename from src/Resources/Resources.Sdk/Generated/Models/DeploymentWhatIfSettings.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/DeploymentWhatIfSettings.cs index f53ef756a91c..15b43878b32b 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/DeploymentWhatIfSettings.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/DeploymentWhatIfSettings.cs @@ -1,16 +1,10 @@ -// // 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.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,12 +23,13 @@ public DeploymentWhatIfSettings() /// /// Initializes a new instance of the DeploymentWhatIfSettings class. /// - /// The format of the What-If results. - /// Possible values include: 'ResourceIdOnly', - /// 'FullResourcePayloads' + + /// The format of the What-If results + /// Possible values include: 'ResourceIdOnly', 'FullResourcePayloads' public DeploymentWhatIfSettings(WhatIfResultFormat? resultFormat = default(WhatIfResultFormat?)) + { - ResultFormat = resultFormat; + this.ResultFormat = resultFormat; CustomInit(); } @@ -43,12 +38,11 @@ public DeploymentWhatIfSettings() /// partial void CustomInit(); + /// - /// Gets or sets the format of the What-If results. Possible values - /// include: 'ResourceIdOnly', 'FullResourcePayloads' + /// Gets or sets the format of the What-If results Possible values include: 'ResourceIdOnly', 'FullResourcePayloads' /// - [JsonProperty(PropertyName = "resultFormat")] - public WhatIfResultFormat? ResultFormat { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "resultFormat")] + public WhatIfResultFormat? ResultFormat {get; set; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Management.Sdk/Generated/Models/DeploymentsWhatIfAtManagementGroupScopeHeaders.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/DeploymentsWhatIfAtManagementGroupScopeHeaders.cs new file mode 100644 index 000000000000..04f722c59838 --- /dev/null +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/DeploymentsWhatIfAtManagementGroupScopeHeaders.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Resources.Models +{ + using System.Linq; + + public partial class DeploymentsWhatIfAtManagementGroupScopeHeaders + { + /// + /// Initializes a new instance of the DeploymentsWhatIfAtManagementGroupScopeHeaders class. + /// + public DeploymentsWhatIfAtManagementGroupScopeHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DeploymentsWhatIfAtManagementGroupScopeHeaders class. + /// + + /// + /// + + /// + /// + public DeploymentsWhatIfAtManagementGroupScopeHeaders(string location = default(string), string retryAfter = default(string)) + + { + this.Location = location; + this.RetryAfter = retryAfter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public string RetryAfter {get; set; } + } +} \ No newline at end of file diff --git a/src/Resources/Resources.Management.Sdk/Generated/Models/DeploymentsWhatIfAtSubscriptionScopeHeaders.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/DeploymentsWhatIfAtSubscriptionScopeHeaders.cs new file mode 100644 index 000000000000..43ea5a8c01e2 --- /dev/null +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/DeploymentsWhatIfAtSubscriptionScopeHeaders.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Resources.Models +{ + using System.Linq; + + public partial class DeploymentsWhatIfAtSubscriptionScopeHeaders + { + /// + /// Initializes a new instance of the DeploymentsWhatIfAtSubscriptionScopeHeaders class. + /// + public DeploymentsWhatIfAtSubscriptionScopeHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DeploymentsWhatIfAtSubscriptionScopeHeaders class. + /// + + /// + /// + + /// + /// + public DeploymentsWhatIfAtSubscriptionScopeHeaders(string location = default(string), string retryAfter = default(string)) + + { + this.Location = location; + this.RetryAfter = retryAfter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public string RetryAfter {get; set; } + } +} \ No newline at end of file diff --git a/src/Resources/Resources.Management.Sdk/Generated/Models/DeploymentsWhatIfAtTenantScopeHeaders.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/DeploymentsWhatIfAtTenantScopeHeaders.cs new file mode 100644 index 000000000000..a8334569a6c5 --- /dev/null +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/DeploymentsWhatIfAtTenantScopeHeaders.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Resources.Models +{ + using System.Linq; + + public partial class DeploymentsWhatIfAtTenantScopeHeaders + { + /// + /// Initializes a new instance of the DeploymentsWhatIfAtTenantScopeHeaders class. + /// + public DeploymentsWhatIfAtTenantScopeHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DeploymentsWhatIfAtTenantScopeHeaders class. + /// + + /// + /// + + /// + /// + public DeploymentsWhatIfAtTenantScopeHeaders(string location = default(string), string retryAfter = default(string)) + + { + this.Location = location; + this.RetryAfter = retryAfter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public string RetryAfter {get; set; } + } +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/DeploymentsWhatIfHeaders.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/DeploymentsWhatIfHeaders.cs similarity index 57% rename from src/Resources/Resources.Sdk/Generated/Models/DeploymentsWhatIfHeaders.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/DeploymentsWhatIfHeaders.cs index 288e8dd566d0..1c9d24794ac7 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/DeploymentsWhatIfHeaders.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/DeploymentsWhatIfHeaders.cs @@ -1,21 +1,12 @@ -// // 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.Models { - using Newtonsoft.Json; using System.Linq; - /// - /// Defines headers for WhatIf operation. - /// public partial class DeploymentsWhatIfHeaders { /// @@ -29,14 +20,17 @@ public DeploymentsWhatIfHeaders() /// /// Initializes a new instance of the DeploymentsWhatIfHeaders class. /// - /// URL to get status of this long-running - /// operation. - /// Number of seconds to wait before polling - /// for status. + + /// + /// + + /// + /// public DeploymentsWhatIfHeaders(string location = default(string), string retryAfter = default(string)) + { - Location = location; - RetryAfter = retryAfter; + this.Location = location; + this.RetryAfter = retryAfter; CustomInit(); } @@ -45,17 +39,17 @@ public DeploymentsWhatIfHeaders() /// partial void CustomInit(); + /// - /// Gets or sets URL to get status of this long-running operation. + /// Gets or sets /// - [JsonProperty(PropertyName = "Location")] - public string Location { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } /// - /// Gets or sets number of seconds to wait before polling for status. + /// Gets or sets /// - [JsonProperty(PropertyName = "Retry-After")] - public string RetryAfter { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public string RetryAfter {get; set; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/EnvironmentVariable.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/EnvironmentVariable.cs similarity index 69% rename from src/Resources/Resources.Sdk/Generated/Models/EnvironmentVariable.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/EnvironmentVariable.cs index 510ce7edbe83..89db9d4f1921 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/EnvironmentVariable.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/EnvironmentVariable.cs @@ -1,22 +1,14 @@ -// // 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.Models { - using Microsoft.Rest; - using Newtonsoft.Json; using System.Linq; /// - /// The environment variable to pass to the script in the container - /// instance. + /// The environment variable to pass to the script in the container instance. /// public partial class EnvironmentVariable { @@ -31,15 +23,21 @@ public EnvironmentVariable() /// /// Initializes a new instance of the EnvironmentVariable class. /// - /// The name of the environment variable. - /// The value of the environment variable. - /// The value of the secure environment - /// variable. + + /// The name of the environment variable. + /// + + /// The value of the environment variable. + /// + + /// The value of the secure environment variable. + /// public EnvironmentVariable(string name, string value = default(string), string secureValue = default(string)) + { - Name = name; - Value = value; - SecureValue = secureValue; + this.Name = name; + this.Value = value; + this.SecureValue = secureValue; CustomInit(); } @@ -48,36 +46,39 @@ public EnvironmentVariable() /// partial void CustomInit(); + /// /// Gets or sets the name of the environment variable. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// /// Gets or sets the value of the environment variable. /// - [JsonProperty(PropertyName = "value")] - public string Value { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "value")] + public string Value {get; set; } /// /// Gets or sets the value of the secure environment variable. /// - [JsonProperty(PropertyName = "secureValue")] - public string SecureValue { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "secureValue")] + public string SecureValue {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Name == null) + if (this.Name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Name"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Name"); } + + + } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/ErrorAdditionalInfo.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/ErrorAdditionalInfo.cs similarity index 72% rename from src/Resources/Resources.Sdk/Generated/Models/ErrorAdditionalInfo.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/ErrorAdditionalInfo.cs index 9b576c5aa6a6..8ac0d1cbbb8f 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/ErrorAdditionalInfo.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/ErrorAdditionalInfo.cs @@ -1,16 +1,10 @@ -// // 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.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,12 +23,17 @@ public ErrorAdditionalInfo() /// /// Initializes a new instance of the ErrorAdditionalInfo class. /// - /// The additional info type. - /// The additional info. + + /// The additional info type. + /// + + /// The additional info. + /// public ErrorAdditionalInfo(string type = default(string), object info = default(object)) + { - Type = type; - Info = info; + this.Type = type; + this.Info = info; CustomInit(); } @@ -43,17 +42,17 @@ public ErrorAdditionalInfo() /// partial void CustomInit(); + /// /// Gets the additional info type. /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } /// /// Gets the additional info. /// - [JsonProperty(PropertyName = "info")] - public object Info { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "info")] + public object Info {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/ErrorDefinition.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/ErrorDefinition.cs similarity index 58% rename from src/Resources/Resources.Sdk/Generated/Models/ErrorDefinition.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/ErrorDefinition.cs index 47d3b9c64c41..2c98d409e6db 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/ErrorDefinition.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/ErrorDefinition.cs @@ -1,18 +1,10 @@ -// // 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.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,15 +23,22 @@ public ErrorDefinition() /// /// Initializes a new instance of the ErrorDefinition class. /// - /// Service specific error code which serves as the - /// substatus for the HTTP error code. - /// Description of the error. - /// Internal error details. - public ErrorDefinition(string code = default(string), string message = default(string), IList details = default(IList)) + + /// Service specific error code which serves as the substatus for the HTTP + /// error code. + /// + + /// Description of the error. + /// + + /// Internal error details. + /// + public ErrorDefinition(string code = default(string), string message = default(string), System.Collections.Generic.IList details = default(System.Collections.Generic.IList)) + { - Code = code; - Message = message; - Details = details; + this.Code = code; + this.Message = message; + this.Details = details; CustomInit(); } @@ -48,24 +47,24 @@ public ErrorDefinition() /// partial void CustomInit(); + /// - /// Gets service specific error code which serves as the substatus for - /// the HTTP error code. + /// Gets service specific error code which serves as the substatus for the HTTP + /// error code. /// - [JsonProperty(PropertyName = "code")] - public string Code { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "code")] + public string Code {get; private set; } /// /// Gets description of the error. /// - [JsonProperty(PropertyName = "message")] - public string Message { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "message")] + public string Message {get; private set; } /// /// Gets or sets internal error details. /// - [JsonProperty(PropertyName = "details")] - public IList Details { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "details")] + public System.Collections.Generic.IList Details {get; set; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Management.Sdk/Generated/Models/ErrorDetail.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/ErrorDetail.cs new file mode 100644 index 000000000000..6af7910e1a0b --- /dev/null +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/ErrorDetail.cs @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Resources.Models +{ + using System.Linq; + + /// + /// The error detail. + /// + public partial class ErrorDetail + { + /// + /// Initializes a new instance of the ErrorDetail class. + /// + public ErrorDetail() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ErrorDetail class. + /// + + /// The error code. + /// + + /// The error message. + /// + + /// The error target. + /// + + /// The error details. + /// + + /// The error additional info. + /// + public ErrorDetail(string code = default(string), string message = default(string), string target = default(string), System.Collections.Generic.IList details = default(System.Collections.Generic.IList), System.Collections.Generic.IList additionalInfo = default(System.Collections.Generic.IList)) + + { + this.Code = code; + this.Message = message; + this.Target = target; + this.Details = details; + this.AdditionalInfo = additionalInfo; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets the error code. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "code")] + public string Code {get; private set; } + + /// + /// Gets the error message. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "message")] + public string Message {get; private set; } + + /// + /// Gets the error target. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "target")] + public string Target {get; private set; } + + /// + /// Gets the error details. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "details")] + public System.Collections.Generic.IList Details {get; private set; } + + /// + /// Gets the error additional info. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "additionalInfo")] + public System.Collections.Generic.IList AdditionalInfo {get; private set; } + } +} \ No newline at end of file diff --git a/src/Resources/Resources.Management.Sdk/Generated/Models/ErrorResponse.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/ErrorResponse.cs new file mode 100644 index 000000000000..b320f7c2f1d4 --- /dev/null +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/ErrorResponse.cs @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Resources.Models +{ + using System.Linq; + + /// + /// Common error response for all Azure Resource Manager APIs to return error + /// details for failed operations. (This also follows the OData error response + /// format.) + /// + /// + /// Common error response for all Azure Resource Manager APIs to return error + /// details for failed operations. (This also follows the OData error response + /// format.) + /// + public partial class ErrorResponse + { + /// + /// Initializes a new instance of the ErrorResponse class. + /// + public ErrorResponse() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ErrorResponse class. + /// + + /// The error code. + /// + + /// The error message. + /// + + /// The error target. + /// + + /// The error details. + /// + + /// The error additional info. + /// + public ErrorResponse(string code = default(string), string message = default(string), string target = default(string), System.Collections.Generic.IList details = default(System.Collections.Generic.IList), System.Collections.Generic.IList additionalInfo = default(System.Collections.Generic.IList)) + + { + this.Code = code; + this.Message = message; + this.Target = target; + this.Details = details; + this.AdditionalInfo = additionalInfo; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets the error code. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "code")] + public string Code {get; private set; } + + /// + /// Gets the error message. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "message")] + public string Message {get; private set; } + + /// + /// Gets the error target. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "target")] + public string Target {get; private set; } + + /// + /// Gets the error details. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "details")] + public System.Collections.Generic.IList Details {get; private set; } + + /// + /// Gets the error additional info. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "additionalInfo")] + public System.Collections.Generic.IList AdditionalInfo {get; private set; } + } +} \ No newline at end of file diff --git a/src/Resources/Resources.Management.Sdk/Generated/Models/ErrorResponseAutoGenerated.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/ErrorResponseAutoGenerated.cs new file mode 100644 index 000000000000..e9fc056ed28f --- /dev/null +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/ErrorResponseAutoGenerated.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Resources.Models +{ + using System.Linq; + + /// + /// Common error response for all Azure Resource Manager APIs to return error + /// details for failed operations. (This also follows the OData error response + /// format.). + /// + /// + /// Common error response for all Azure Resource Manager APIs to return error + /// details for failed operations. (This also follows the OData error response + /// format.). + /// + public partial class ErrorResponseAutoGenerated + { + /// + /// Initializes a new instance of the ErrorResponseAutoGenerated class. + /// + public ErrorResponseAutoGenerated() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ErrorResponseAutoGenerated class. + /// + + /// The error object. + /// + public ErrorResponseAutoGenerated(ErrorDetail error = default(ErrorDetail)) + + { + this.Error = error; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the error object. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "error")] + public ErrorDetail Error {get; set; } + } +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/DeploymentStackPropertiesException.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/ErrorResponseAutoGeneratedException.cs similarity index 53% rename from src/Resources/Resources.Sdk/Generated/Models/DeploymentStackPropertiesException.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/ErrorResponseAutoGeneratedException.cs index 4f85f7af990f..a61491fa600a 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/DeploymentStackPropertiesException.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/ErrorResponseAutoGeneratedException.cs @@ -1,62 +1,55 @@ -// // 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.Models { - using Microsoft.Rest; /// - /// Exception thrown for an invalid response with DeploymentStackProperties - /// information. + /// Exception thrown for an invalid response with ErrorResponseAutoGenerated information. /// - public partial class DeploymentStackPropertiesException : RestException + public partial class ErrorResponseAutoGeneratedException : Microsoft.Rest.RestException { /// /// Gets information about the associated HTTP request. /// - public HttpRequestMessageWrapper Request { get; set; } + public Microsoft.Rest.HttpRequestMessageWrapper Request { get; set; } /// /// Gets information about the associated HTTP response. /// - public HttpResponseMessageWrapper Response { get; set; } + public Microsoft.Rest.HttpResponseMessageWrapper Response { get; set; } /// /// Gets or sets the body object. /// - public DeploymentStackProperties Body { get; set; } + public ErrorResponseAutoGenerated Body { get; set; } /// - /// Initializes a new instance of the DeploymentStackPropertiesException class. + /// Initializes a new instance of the ErrorResponseAutoGeneratedException class. /// - public DeploymentStackPropertiesException() + public ErrorResponseAutoGeneratedException() { } /// - /// Initializes a new instance of the DeploymentStackPropertiesException class. + /// Initializes a new instance of the ErrorResponseAutoGenerated class. /// /// The exception message. - public DeploymentStackPropertiesException(string message) + public ErrorResponseAutoGeneratedException(string message) : this(message, null) { } /// - /// Initializes a new instance of the DeploymentStackPropertiesException class. + /// Initializes a new instance of the ErrorResponseAutoGenerated class. /// /// The exception message. /// Inner exception. - public DeploymentStackPropertiesException(string message, System.Exception innerException) + public ErrorResponseAutoGeneratedException(string message, System.Exception innerException) : base(message, innerException) { } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/ErrorResponseException.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/ErrorResponseException.cs similarity index 75% rename from src/Resources/Resources.Sdk/Generated/Models/ErrorResponseException.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/ErrorResponseException.cs index d0b2f68bb1d0..67fc301f8169 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/ErrorResponseException.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/ErrorResponseException.cs @@ -1,32 +1,25 @@ -// // 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.Models { - using Microsoft.Rest; /// - /// Exception thrown for an invalid response with ErrorResponse - /// information. + /// Exception thrown for an invalid response with ErrorResponse information. /// - public partial class ErrorResponseException : RestException + public partial class ErrorResponseException : Microsoft.Rest.RestException { /// /// Gets information about the associated HTTP request. /// - public HttpRequestMessageWrapper Request { get; set; } + public Microsoft.Rest.HttpRequestMessageWrapper Request { get; set; } /// /// Gets information about the associated HTTP response. /// - public HttpResponseMessageWrapper Response { get; set; } + public Microsoft.Rest.HttpResponseMessageWrapper Response { get; set; } /// /// Gets or sets the body object. @@ -41,7 +34,7 @@ public ErrorResponseException() } /// - /// Initializes a new instance of the ErrorResponseException class. + /// Initializes a new instance of the ErrorResponse class. /// /// The exception message. public ErrorResponseException(string message) @@ -50,7 +43,7 @@ public ErrorResponseException(string message) } /// - /// Initializes a new instance of the ErrorResponseException class. + /// Initializes a new instance of the ErrorResponse class. /// /// The exception message. /// Inner exception. @@ -59,4 +52,4 @@ public ErrorResponseException(string message, System.Exception innerException) { } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/ExportTemplateRequest.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/ExportTemplateRequest.cs similarity index 52% rename from src/Resources/Resources.Sdk/Generated/Models/ExportTemplateRequest.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/ExportTemplateRequest.cs index 8f7821992196..cb03fea6c04d 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/ExportTemplateRequest.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/ExportTemplateRequest.cs @@ -1,18 +1,10 @@ -// // 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.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,18 +23,20 @@ public ExportTemplateRequest() /// /// Initializes a new instance of the ExportTemplateRequest class. /// - /// The IDs of the resources to filter the - /// export by. To export all resources, supply an array with single - /// entry '*'. - /// The export template options. A CSV-formatted - /// list containing zero or more of the following: - /// 'IncludeParameterDefaultValue', 'IncludeComments', - /// 'SkipResourceNameParameterization', - /// 'SkipAllParameterization' - public ExportTemplateRequest(IList resources = default(IList), string options = default(string)) + + /// The IDs of the resources to filter the export by. To export all resources, + /// supply an array with single entry '*'. + /// + + /// The export template options. A CSV-formatted list containing zero or more + /// of the following: 'IncludeParameterDefaultValue', 'IncludeComments', + /// 'SkipResourceNameParameterization', 'SkipAllParameterization' + /// + public ExportTemplateRequest(System.Collections.Generic.IList resources = default(System.Collections.Generic.IList), string options = default(string)) + { - Resources = resources; - Options = options; + this.Resources = resources; + this.Options = options; CustomInit(); } @@ -51,21 +45,21 @@ public ExportTemplateRequest() /// partial void CustomInit(); + /// - /// Gets or sets the IDs of the resources to filter the export by. To - /// export all resources, supply an array with single entry '*'. + /// Gets or sets the IDs of the resources to filter the export by. To export + /// all resources, supply an array with single entry '*'. /// - [JsonProperty(PropertyName = "resources")] - public IList Resources { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "resources")] + public System.Collections.Generic.IList Resources {get; set; } /// - /// Gets or sets the export template options. A CSV-formatted list - /// containing zero or more of the following: - /// 'IncludeParameterDefaultValue', 'IncludeComments', - /// 'SkipResourceNameParameterization', 'SkipAllParameterization' + /// Gets or sets the export template options. A CSV-formatted list containing + /// zero or more of the following: 'IncludeParameterDefaultValue', + /// 'IncludeComments', 'SkipResourceNameParameterization', + /// 'SkipAllParameterization' /// - [JsonProperty(PropertyName = "options")] - public string Options { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "options")] + public string Options {get; set; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/ExpressionEvaluationOptions.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/ExpressionEvaluationOptions.cs similarity index 65% rename from src/Resources/Resources.Sdk/Generated/Models/ExpressionEvaluationOptions.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/ExpressionEvaluationOptions.cs index 4cd9fda3a3a7..18efa387250e 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/ExpressionEvaluationOptions.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/ExpressionEvaluationOptions.cs @@ -1,27 +1,20 @@ -// // 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.Models { - using Newtonsoft.Json; using System.Linq; /// - /// Specifies whether template expressions are evaluated within the scope - /// of the parent template or nested template. + /// Specifies whether template expressions are evaluated within the scope of + /// the parent template or nested template. /// public partial class ExpressionEvaluationOptions { /// - /// Initializes a new instance of the ExpressionEvaluationOptions - /// class. + /// Initializes a new instance of the ExpressionEvaluationOptions class. /// public ExpressionEvaluationOptions() { @@ -29,15 +22,16 @@ public ExpressionEvaluationOptions() } /// - /// Initializes a new instance of the ExpressionEvaluationOptions - /// class. + /// Initializes a new instance of the ExpressionEvaluationOptions class. /// - /// The scope to be used for evaluation of - /// parameters, variables and functions in a nested template. Possible - /// values include: 'NotSpecified', 'Outer', 'Inner' + + /// The scope to be used for evaluation of parameters, variables and functions + /// in a nested template. + /// Possible values include: 'NotSpecified', 'Outer', 'Inner' public ExpressionEvaluationOptions(string scope = default(string)) + { - Scope = scope; + this.Scope = scope; CustomInit(); } @@ -46,13 +40,12 @@ public ExpressionEvaluationOptions() /// partial void CustomInit(); + /// - /// Gets or sets the scope to be used for evaluation of parameters, - /// variables and functions in a nested template. Possible values - /// include: 'NotSpecified', 'Outer', 'Inner' + /// Gets or sets the scope to be used for evaluation of parameters, variables + /// and functions in a nested template. Possible values include: 'NotSpecified', 'Outer', 'Inner' /// - [JsonProperty(PropertyName = "scope")] - public string Scope { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "scope")] + public string Scope {get; set; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/ExpressionEvaluationOptionsScopeType.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/ExpressionEvaluationOptionsScopeType.cs similarity index 85% rename from src/Resources/Resources.Sdk/Generated/Models/ExpressionEvaluationOptionsScopeType.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/ExpressionEvaluationOptionsScopeType.cs index 7e125e11bcb8..fb483bcc1a9d 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/ExpressionEvaluationOptionsScopeType.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/ExpressionEvaluationOptionsScopeType.cs @@ -1,12 +1,7 @@ -// // 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.Models { @@ -14,10 +9,12 @@ namespace Microsoft.Azure.Management.Resources.Models /// /// Defines values for ExpressionEvaluationOptionsScopeType. /// + + public static class ExpressionEvaluationOptionsScopeType { public const string NotSpecified = "NotSpecified"; public const string Outer = "Outer"; public const string Inner = "Inner"; } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/ExtendedLocation.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/ExtendedLocation.cs similarity index 69% rename from src/Resources/Resources.Sdk/Generated/Models/ExtendedLocation.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/ExtendedLocation.cs index f656ba694e97..d311389c4f21 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/ExtendedLocation.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/ExtendedLocation.cs @@ -1,16 +1,10 @@ -// // 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.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,13 +23,17 @@ public ExtendedLocation() /// /// Initializes a new instance of the ExtendedLocation class. /// - /// The extended location type. Possible values - /// include: 'EdgeZone' - /// The extended location name. + + /// The extended location type. + /// Possible values include: 'EdgeZone' + + /// The extended location name. + /// public ExtendedLocation(string type = default(string), string name = default(string)) + { - Type = type; - Name = name; + this.Type = type; + this.Name = name; CustomInit(); } @@ -44,18 +42,17 @@ public ExtendedLocation() /// partial void CustomInit(); + /// - /// Gets or sets the extended location type. Possible values include: - /// 'EdgeZone' + /// Gets or sets the extended location type. Possible values include: 'EdgeZone' /// - [JsonProperty(PropertyName = "type")] - public string Type { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; set; } /// /// Gets or sets the extended location name. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/ExtendedLocationType.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/ExtendedLocationType.cs similarity index 82% rename from src/Resources/Resources.Sdk/Generated/Models/ExtendedLocationType.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/ExtendedLocationType.cs index 3bcdf0f751c1..6aa3e6a5515a 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/ExtendedLocationType.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/ExtendedLocationType.cs @@ -1,12 +1,7 @@ -// // 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.Models { @@ -14,8 +9,10 @@ namespace Microsoft.Azure.Management.Resources.Models /// /// Defines values for ExtendedLocationType. /// + + public static class ExtendedLocationType { public const string EdgeZone = "EdgeZone"; } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/FeatureProperties.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/FeatureProperties.cs similarity index 78% rename from src/Resources/Resources.Sdk/Generated/Models/FeatureProperties.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/FeatureProperties.cs index 3e7d244fc1f1..d02b51bef0ee 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/FeatureProperties.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/FeatureProperties.cs @@ -1,16 +1,10 @@ -// // 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.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,11 +23,13 @@ public FeatureProperties() /// /// Initializes a new instance of the FeatureProperties class. /// - /// The registration state of the feature for the - /// subscription. + + /// The registration state of the feature for the subscription. + /// public FeatureProperties(string state = default(string)) + { - State = state; + this.State = state; CustomInit(); } @@ -42,12 +38,11 @@ public FeatureProperties() /// partial void CustomInit(); + /// - /// Gets or sets the registration state of the feature for the - /// subscription. + /// Gets or sets the registration state of the feature for the subscription. /// - [JsonProperty(PropertyName = "state")] - public string State { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "state")] + public string State {get; set; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/FeatureResult.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/FeatureResult.cs similarity index 67% rename from src/Resources/Resources.Sdk/Generated/Models/FeatureResult.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/FeatureResult.cs index 5f334c5dac82..a9d1a7ffb26e 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/FeatureResult.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/FeatureResult.cs @@ -1,16 +1,10 @@ -// // 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.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,17 +23,25 @@ public FeatureResult() /// /// Initializes a new instance of the FeatureResult class. /// - /// The name of the feature. - /// Properties of the previewed - /// feature. - /// The resource ID of the feature. - /// The resource type of the feature. + + /// The name of the feature. + /// + + /// Properties of the previewed feature. + /// + + /// The resource ID of the feature. + /// + + /// The resource type of the feature. + /// public FeatureResult(string name = default(string), FeatureProperties properties = default(FeatureProperties), string id = default(string), string type = default(string)) + { - Name = name; - Properties = properties; - Id = id; - Type = type; + this.Name = name; + this.Properties = properties; + this.Id = id; + this.Type = type; CustomInit(); } @@ -48,29 +50,29 @@ public FeatureResult() /// partial void CustomInit(); + /// /// Gets or sets the name of the feature. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// /// Gets or sets properties of the previewed feature. /// - [JsonProperty(PropertyName = "properties")] - public FeatureProperties Properties { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties")] + public FeatureProperties Properties {get; set; } /// /// Gets or sets the resource ID of the feature. /// - [JsonProperty(PropertyName = "id")] - public string Id { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; set; } /// /// Gets or sets the resource type of the feature. /// - [JsonProperty(PropertyName = "type")] - public string Type { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; set; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Management.Sdk/Generated/Models/GenericResource.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/GenericResource.cs new file mode 100644 index 000000000000..9581c71b5b77 --- /dev/null +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/GenericResource.cs @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Resources.Models +{ + using System.Linq; + + /// + /// Resource information. + /// + public partial class GenericResource : Resource + { + /// + /// Initializes a new instance of the GenericResource class. + /// + public GenericResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the GenericResource class. + /// + + /// Resource ID + /// + + /// Resource name + /// + + /// Resource type + /// + + /// Resource location + /// + + /// Resource extended location. + /// + + /// Resource tags + /// + + /// The plan of the resource. + /// + + /// The resource properties. + /// + + /// The kind of the resource. + /// + + /// ID of the resource that manages this resource. + /// + + /// The SKU of the resource. + /// + + /// The identity of the resource. + /// + public GenericResource(string id = default(string), string name = default(string), string type = default(string), string location = default(string), ExtendedLocation extendedLocation = default(ExtendedLocation), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), Plan plan = default(Plan), object properties = default(object), string kind = default(string), string managedBy = default(string), Sku sku = default(Sku), Identity identity = default(Identity)) + + : base(id, name, type, location, extendedLocation, tags) + { + this.Plan = plan; + this.Properties = properties; + this.Kind = kind; + this.ManagedBy = managedBy; + this.Sku = sku; + this.Identity = identity; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the plan of the resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "plan")] + public Plan Plan {get; set; } + + /// + /// Gets or sets the resource properties. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties")] + public object Properties {get; set; } + + /// + /// Gets or sets the kind of the resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "kind")] + public string Kind {get; set; } + + /// + /// Gets or sets iD of the resource that manages this resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "managedBy")] + public string ManagedBy {get; set; } + + /// + /// Gets or sets the SKU of the resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "sku")] + public Sku Sku {get; set; } + + /// + /// Gets or sets the identity of the resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "identity")] + public Identity Identity {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + + + if (this.Kind != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(this.Kind, "^[-\\w\\._,\\(\\)]+$")) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "Kind", "^[-\\w\\._,\\(\\)]+$"); + } + } + + + + } + } +} \ No newline at end of file diff --git a/src/Resources/Resources.Management.Sdk/Generated/Models/GenericResourceExpanded.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/GenericResourceExpanded.cs new file mode 100644 index 000000000000..02e40c4caa28 --- /dev/null +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/GenericResourceExpanded.cs @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Resources.Models +{ + using System.Linq; + + /// + /// Resource information. + /// + public partial class GenericResourceExpanded : GenericResource + { + /// + /// Initializes a new instance of the GenericResourceExpanded class. + /// + public GenericResourceExpanded() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the GenericResourceExpanded class. + /// + + /// Resource ID + /// + + /// Resource name + /// + + /// Resource type + /// + + /// Resource location + /// + + /// Resource extended location. + /// + + /// Resource tags + /// + + /// The plan of the resource. + /// + + /// The resource properties. + /// + + /// The kind of the resource. + /// + + /// ID of the resource that manages this resource. + /// + + /// The SKU of the resource. + /// + + /// The identity of the resource. + /// + + /// The created time of the resource. This is only present if requested via the + /// $expand query parameter. + /// + + /// The changed time of the resource. This is only present if requested via the + /// $expand query parameter. + /// + + /// The provisioning state of the resource. This is only present if requested + /// via the $expand query parameter. + /// + public GenericResourceExpanded(string id = default(string), string name = default(string), string type = default(string), string location = default(string), ExtendedLocation extendedLocation = default(ExtendedLocation), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), Plan plan = default(Plan), object properties = default(object), string kind = default(string), string managedBy = default(string), Sku sku = default(Sku), Identity identity = default(Identity), System.DateTime? createdTime = default(System.DateTime?), System.DateTime? changedTime = default(System.DateTime?), string provisioningState = default(string)) + + : base(id, name, type, location, extendedLocation, tags, plan, properties, kind, managedBy, sku, identity) + { + this.CreatedTime = createdTime; + this.ChangedTime = changedTime; + this.ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets the created time of the resource. This is only present if requested + /// via the $expand query parameter. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "createdTime")] + public System.DateTime? CreatedTime {get; private set; } + + /// + /// Gets the changed time of the resource. This is only present if requested + /// via the $expand query parameter. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "changedTime")] + public System.DateTime? ChangedTime {get; private set; } + + /// + /// Gets the provisioning state of the resource. This is only present if + /// requested via the $expand query parameter. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + + } + } +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/GenericResourceFilter.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/GenericResourceFilter.cs similarity index 65% rename from src/Resources/Resources.Sdk/Generated/Models/GenericResourceFilter.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/GenericResourceFilter.cs index 6268d6f7dd00..71a5edaae8f4 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/GenericResourceFilter.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/GenericResourceFilter.cs @@ -1,16 +1,10 @@ -// // 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.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,14 +23,21 @@ public GenericResourceFilter() /// /// Initializes a new instance of the GenericResourceFilter class. /// - /// The resource type. - /// The tag name. - /// The tag value. + + /// The resource type. + /// + + /// The tag name. + /// + + /// The tag value. + /// public GenericResourceFilter(string resourceType = default(string), string tagname = default(string), string tagvalue = default(string)) + { - ResourceType = resourceType; - Tagname = tagname; - Tagvalue = tagvalue; + this.ResourceType = resourceType; + this.Tagname = tagname; + this.Tagvalue = tagvalue; CustomInit(); } @@ -45,23 +46,23 @@ public GenericResourceFilter() /// partial void CustomInit(); + /// /// Gets or sets the resource type. /// - [JsonProperty(PropertyName = "resourceType")] - public string ResourceType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "resourceType")] + public string ResourceType {get; set; } /// /// Gets or sets the tag name. /// - [JsonProperty(PropertyName = "tagname")] - public string Tagname { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "tagname")] + public string Tagname {get; set; } /// /// Gets or sets the tag value. /// - [JsonProperty(PropertyName = "tagvalue")] - public string Tagvalue { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "tagvalue")] + public string Tagvalue {get; set; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/HttpMessage.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/HttpMessage.cs similarity index 74% rename from src/Resources/Resources.Sdk/Generated/Models/HttpMessage.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/HttpMessage.cs index ecf41f58911b..c99fc8f33488 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/HttpMessage.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/HttpMessage.cs @@ -1,16 +1,10 @@ -// // 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.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,10 +23,13 @@ public HttpMessage() /// /// Initializes a new instance of the HttpMessage class. /// - /// HTTP message content. + + /// HTTP message content. + /// public HttpMessage(object content = default(object)) + { - Content = content; + this.Content = content; CustomInit(); } @@ -41,11 +38,11 @@ public HttpMessage() /// partial void CustomInit(); + /// - /// Gets or sets HTTP message content. + /// Gets or sets hTTP message content. /// - [JsonProperty(PropertyName = "content")] - public object Content { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "content")] + public object Content {get; set; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Management.Sdk/Generated/Models/Identity.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/Identity.cs new file mode 100644 index 000000000000..5434506fd773 --- /dev/null +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/Identity.cs @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Resources.Models +{ + using System.Linq; + + /// + /// Identity for the resource. + /// + public partial class Identity + { + /// + /// Initializes a new instance of the Identity class. + /// + public Identity() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Identity class. + /// + + /// The principal ID of resource identity. + /// + + /// The tenant ID of resource. + /// + + /// The identity type. + /// Possible values include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, + /// UserAssigned', 'None' + + /// The list of user identities associated with the resource. The user identity + /// dictionary key references will be ARM resource ids in the form: + /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + /// + public Identity(string principalId = default(string), string tenantId = default(string), ResourceIdentityType? type = default(ResourceIdentityType?), System.Collections.Generic.IDictionary userAssignedIdentities = default(System.Collections.Generic.IDictionary)) + + { + this.PrincipalId = principalId; + this.TenantId = tenantId; + this.Type = type; + this.UserAssignedIdentities = userAssignedIdentities; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets the principal ID of resource identity. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "principalId")] + public string PrincipalId {get; private set; } + + /// + /// Gets the tenant ID of resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "tenantId")] + public string TenantId {get; private set; } + + /// + /// Gets or sets the identity type. Possible values include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', 'None' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public ResourceIdentityType? Type {get; set; } + + /// + /// Gets or sets the list of user identities associated with the resource. The + /// user identity dictionary key references will be ARM resource ids in the + /// form: + /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "userAssignedIdentities")] + public System.Collections.Generic.IDictionary UserAssignedIdentities {get; set; } + } +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/IdentityUserAssignedIdentitiesValue.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/IdentityUserAssignedIdentitiesValue.cs similarity index 64% rename from src/Resources/Resources.Sdk/Generated/Models/IdentityUserAssignedIdentitiesValue.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/IdentityUserAssignedIdentitiesValue.cs index a8ea6ac51861..f3d350bd38fb 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/IdentityUserAssignedIdentitiesValue.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/IdentityUserAssignedIdentitiesValue.cs @@ -1,23 +1,16 @@ -// // 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.Models { - using Newtonsoft.Json; using System.Linq; public partial class IdentityUserAssignedIdentitiesValue { /// - /// Initializes a new instance of the - /// IdentityUserAssignedIdentitiesValue class. + /// Initializes a new instance of the IdentityUserAssignedIdentitiesValue class. /// public IdentityUserAssignedIdentitiesValue() { @@ -25,17 +18,19 @@ public IdentityUserAssignedIdentitiesValue() } /// - /// Initializes a new instance of the - /// IdentityUserAssignedIdentitiesValue class. + /// Initializes a new instance of the IdentityUserAssignedIdentitiesValue class. /// - /// The principal id of user assigned - /// identity. - /// The client id of user assigned - /// identity. + + /// The principal id of user assigned identity. + /// + + /// The client id of user assigned identity. + /// public IdentityUserAssignedIdentitiesValue(string principalId = default(string), string clientId = default(string)) + { - PrincipalId = principalId; - ClientId = clientId; + this.PrincipalId = principalId; + this.ClientId = clientId; CustomInit(); } @@ -44,17 +39,17 @@ public IdentityUserAssignedIdentitiesValue() /// partial void CustomInit(); + /// /// Gets the principal id of user assigned identity. /// - [JsonProperty(PropertyName = "principalId")] - public string PrincipalId { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "principalId")] + public string PrincipalId {get; private set; } /// /// Gets the client id of user assigned identity. /// - [JsonProperty(PropertyName = "clientId")] - public string ClientId { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "clientId")] + public string ClientId {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/LinkedTemplateArtifact.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/LinkedTemplateArtifact.cs similarity index 66% rename from src/Resources/Resources.Sdk/Generated/Models/LinkedTemplateArtifact.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/LinkedTemplateArtifact.cs index e5b60f483be3..4a3d42a6c95a 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/LinkedTemplateArtifact.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/LinkedTemplateArtifact.cs @@ -1,22 +1,15 @@ -// // 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.Models { - using Microsoft.Rest; - using Newtonsoft.Json; using System.Linq; /// - /// Represents a Template Spec artifact containing an embedded Azure - /// Resource Manager template for use as a linked template. + /// Represents a Template Spec artifact containing an embedded Azure Resource + /// Manager template for use as a linked template. /// public partial class LinkedTemplateArtifact { @@ -31,13 +24,17 @@ public LinkedTemplateArtifact() /// /// Initializes a new instance of the LinkedTemplateArtifact class. /// - /// A filesystem safe relative path of the - /// artifact. - /// The Azure Resource Manager template. + + /// A filesystem safe relative path of the artifact. + /// + + /// The Azure Resource Manager template. + /// public LinkedTemplateArtifact(string path, object template) + { - Path = path; - Template = template; + this.Path = path; + this.Template = template; CustomInit(); } @@ -46,34 +43,36 @@ public LinkedTemplateArtifact(string path, object template) /// partial void CustomInit(); + /// /// Gets or sets a filesystem safe relative path of the artifact. /// - [JsonProperty(PropertyName = "path")] - public string Path { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "path")] + public string Path {get; set; } /// /// Gets or sets the Azure Resource Manager template. /// - [JsonProperty(PropertyName = "template")] - public object Template { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "template")] + public object Template {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Path == null) + if (this.Path == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Path"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Path"); } - if (Template == null) + if (this.Template == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Template"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Template"); } + + } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/Location.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/Location.cs similarity index 55% rename from src/Resources/Resources.Sdk/Generated/Models/Location.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/Location.cs index 47fa3b6aef5e..db3ee2fd03b3 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/Location.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/Location.cs @@ -1,16 +1,10 @@ -// // 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.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,27 +23,38 @@ public Location() /// /// Initializes a new instance of the Location class. /// - /// The fully qualified ID of the location. For - /// example, - /// /subscriptions/00000000-0000-0000-0000-000000000000/locations/westus. - /// The subscription ID. - /// The location name. - /// The location type. Possible values include: - /// 'Region', 'EdgeZone' - /// The display name of the location. - /// The display name of the location - /// and its region. - /// Metadata of the location, such as lat/long, - /// paired region, and others. + + /// The fully qualified ID of the location. For example, + /// /subscriptions/00000000-0000-0000-0000-000000000000/locations/westus. + /// + + /// The subscription ID. + /// + + /// The location name. + /// + + /// The location type. + /// Possible values include: 'Region', 'EdgeZone' + + /// The display name of the location. + /// + + /// The display name of the location and its region. + /// + + /// Metadata of the location, such as lat/long, paired region, and others. + /// public Location(string id = default(string), string subscriptionId = default(string), string name = default(string), LocationType? type = default(LocationType?), string displayName = default(string), string regionalDisplayName = default(string), LocationMetadata metadata = default(LocationMetadata)) + { - Id = id; - SubscriptionId = subscriptionId; - Name = name; - Type = type; - DisplayName = displayName; - RegionalDisplayName = regionalDisplayName; - Metadata = metadata; + this.Id = id; + this.SubscriptionId = subscriptionId; + this.Name = name; + this.Type = type; + this.DisplayName = displayName; + this.RegionalDisplayName = regionalDisplayName; + this.Metadata = metadata; CustomInit(); } @@ -58,50 +63,49 @@ public Location() /// partial void CustomInit(); + /// /// Gets the fully qualified ID of the location. For example, /// /subscriptions/00000000-0000-0000-0000-000000000000/locations/westus. /// - [JsonProperty(PropertyName = "id")] - public string Id { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; private set; } /// /// Gets the subscription ID. /// - [JsonProperty(PropertyName = "subscriptionId")] - public string SubscriptionId { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "subscriptionId")] + public string SubscriptionId {get; private set; } /// /// Gets the location name. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; private set; } /// - /// Gets the location type. Possible values include: 'Region', - /// 'EdgeZone' + /// Gets the location type. Possible values include: 'Region', 'EdgeZone' /// - [JsonProperty(PropertyName = "type")] - public LocationType? Type { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public LocationType? Type {get; private set; } /// /// Gets the display name of the location. /// - [JsonProperty(PropertyName = "displayName")] - public string DisplayName { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "displayName")] + public string DisplayName {get; private set; } /// /// Gets the display name of the location and its region. /// - [JsonProperty(PropertyName = "regionalDisplayName")] - public string RegionalDisplayName { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "regionalDisplayName")] + public string RegionalDisplayName {get; private set; } /// - /// Gets or sets metadata of the location, such as lat/long, paired - /// region, and others. + /// Gets or sets metadata of the location, such as lat/long, paired region, and + /// others. /// - [JsonProperty(PropertyName = "metadata")] - public LocationMetadata Metadata { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "metadata")] + public LocationMetadata Metadata {get; set; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/LocationMetadata.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/LocationMetadata.cs similarity index 53% rename from src/Resources/Resources.Sdk/Generated/Models/LocationMetadata.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/LocationMetadata.cs index 7f4f4e2dd7ac..d767d3946e06 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/LocationMetadata.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/LocationMetadata.cs @@ -1,18 +1,10 @@ -// // 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.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,30 +23,41 @@ public LocationMetadata() /// /// Initializes a new instance of the LocationMetadata class. /// - /// The type of the region. Possible values - /// include: 'Physical', 'Logical' - /// The category of the region. Possible - /// values include: 'Recommended', 'Extended', 'Other' - /// The geography group of the - /// location. - /// The longitude of the location. - /// The latitude of the location. - /// The physical location of the Azure - /// location. - /// The regions paired to this - /// region. - /// The home location of an edge - /// zone. - public LocationMetadata(string regionType = default(string), string regionCategory = default(string), string geographyGroup = default(string), string longitude = default(string), string latitude = default(string), string physicalLocation = default(string), IList pairedRegion = default(IList), string homeLocation = default(string)) + + /// The type of the region. + /// Possible values include: 'Physical', 'Logical' + + /// The category of the region. + /// Possible values include: 'Recommended', 'Extended', 'Other' + + /// The geography group of the location. + /// + + /// The longitude of the location. + /// + + /// The latitude of the location. + /// + + /// The physical location of the Azure location. + /// + + /// The regions paired to this region. + /// + + /// The home location of an edge zone. + /// + public LocationMetadata(string regionType = default(string), string regionCategory = default(string), string geographyGroup = default(string), string longitude = default(string), string latitude = default(string), string physicalLocation = default(string), System.Collections.Generic.IList pairedRegion = default(System.Collections.Generic.IList), string homeLocation = default(string)) + { - RegionType = regionType; - RegionCategory = regionCategory; - GeographyGroup = geographyGroup; - Longitude = longitude; - Latitude = latitude; - PhysicalLocation = physicalLocation; - PairedRegion = pairedRegion; - HomeLocation = homeLocation; + this.RegionType = regionType; + this.RegionCategory = regionCategory; + this.GeographyGroup = geographyGroup; + this.Longitude = longitude; + this.Latitude = latitude; + this.PhysicalLocation = physicalLocation; + this.PairedRegion = pairedRegion; + this.HomeLocation = homeLocation; CustomInit(); } @@ -63,55 +66,53 @@ public LocationMetadata() /// partial void CustomInit(); + /// - /// Gets the type of the region. Possible values include: 'Physical', - /// 'Logical' + /// Gets the type of the region. Possible values include: 'Physical', 'Logical' /// - [JsonProperty(PropertyName = "regionType")] - public string RegionType { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "regionType")] + public string RegionType {get; private set; } /// - /// Gets the category of the region. Possible values include: - /// 'Recommended', 'Extended', 'Other' + /// Gets the category of the region. Possible values include: 'Recommended', 'Extended', 'Other' /// - [JsonProperty(PropertyName = "regionCategory")] - public string RegionCategory { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "regionCategory")] + public string RegionCategory {get; private set; } /// /// Gets the geography group of the location. /// - [JsonProperty(PropertyName = "geographyGroup")] - public string GeographyGroup { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "geographyGroup")] + public string GeographyGroup {get; private set; } /// /// Gets the longitude of the location. /// - [JsonProperty(PropertyName = "longitude")] - public string Longitude { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "longitude")] + public string Longitude {get; private set; } /// /// Gets the latitude of the location. /// - [JsonProperty(PropertyName = "latitude")] - public string Latitude { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "latitude")] + public string Latitude {get; private set; } /// /// Gets the physical location of the Azure location. /// - [JsonProperty(PropertyName = "physicalLocation")] - public string PhysicalLocation { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "physicalLocation")] + public string PhysicalLocation {get; private set; } /// /// Gets or sets the regions paired to this region. /// - [JsonProperty(PropertyName = "pairedRegion")] - public IList PairedRegion { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "pairedRegion")] + public System.Collections.Generic.IList PairedRegion {get; set; } /// /// Gets the home location of an edge zone. /// - [JsonProperty(PropertyName = "homeLocation")] - public string HomeLocation { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "homeLocation")] + public string HomeLocation {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/LocationType.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/LocationType.cs similarity index 79% rename from src/Resources/Resources.Sdk/Generated/Models/LocationType.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/LocationType.cs index 9d5dd38d273c..399c7ee6c62c 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/LocationType.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/LocationType.cs @@ -1,29 +1,22 @@ -// // 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.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; /// /// Defines values for LocationType. /// - [JsonConverter(typeof(StringEnumConverter))] + + + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] public enum LocationType { - [EnumMember(Value = "Region")] + [System.Runtime.Serialization.EnumMember(Value = "Region")] Region, - [EnumMember(Value = "EdgeZone")] + [System.Runtime.Serialization.EnumMember(Value = "EdgeZone")] EdgeZone } internal static class LocationTypeEnumExtension @@ -32,7 +25,6 @@ internal static string ToSerializedValue(this LocationType? value) { return value == null ? null : ((LocationType)value).ToSerializedValue(); } - internal static string ToSerializedValue(this LocationType value) { switch( value ) @@ -44,7 +36,6 @@ internal static string ToSerializedValue(this LocationType value) } return null; } - internal static LocationType? ParseLocationType(this string value) { switch( value ) @@ -57,4 +48,4 @@ internal static string ToSerializedValue(this LocationType value) return null; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Management.Sdk/Generated/Models/LogProperties.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/LogProperties.cs new file mode 100644 index 000000000000..1345f160ef06 --- /dev/null +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/LogProperties.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Resources.Models +{ + using System.Linq; + + /// + /// Script log properties. + /// + public partial class LogProperties + { + /// + /// Initializes a new instance of the LogProperties class. + /// + public LogProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the LogProperties class. + /// + + /// Script execution logs in text format. + /// + public LogProperties(string log = default(string)) + + { + this.Log = log; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets script execution logs in text format. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "log")] + public string Log {get; private set; } + } +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/ManagedByTenant.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/ManagedByTenant.cs similarity index 80% rename from src/Resources/Resources.Sdk/Generated/Models/ManagedByTenant.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/ManagedByTenant.cs index d6c47b93e26a..1db6dae8a7de 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/ManagedByTenant.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/ManagedByTenant.cs @@ -1,16 +1,10 @@ -// // 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.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,11 +23,13 @@ public ManagedByTenant() /// /// Initializes a new instance of the ManagedByTenant class. /// - /// The tenant ID of the managing tenant. This - /// is a GUID. + + /// The tenant ID of the managing tenant. This is a GUID. + /// public ManagedByTenant(string tenantId = default(string)) + { - TenantId = tenantId; + this.TenantId = tenantId; CustomInit(); } @@ -42,11 +38,11 @@ public ManagedByTenant() /// partial void CustomInit(); + /// /// Gets the tenant ID of the managing tenant. This is a GUID. /// - [JsonProperty(PropertyName = "tenantId")] - public string TenantId { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "tenantId")] + public string TenantId {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/ManagedResourceReference.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/ManagedResourceReference.cs similarity index 58% rename from src/Resources/Resources.Sdk/Generated/Models/ManagedResourceReference.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/ManagedResourceReference.cs index 0b0a9801b20a..b4f2f29a840d 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/ManagedResourceReference.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/ManagedResourceReference.cs @@ -1,16 +1,10 @@ -// // 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.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,20 +23,23 @@ public ManagedResourceReference() /// /// Initializes a new instance of the ManagedResourceReference class. /// - /// The resourceId of a resource managed by the - /// deployment stack. - /// Current management state of the resource in - /// the deployment stack. Possible values include: 'Managed', - /// 'removeDenyFailed', 'deleteFailed', 'None' - /// denyAssignment settings applied to the - /// resource. Possible values include: 'denyDelete', 'notSupported', - /// 'inapplicable', 'denyWriteAndDelete', 'removedBySystem', - /// 'None' + + /// The resourceId of a resource managed by the deployment stack. + /// + + /// Current management state of the resource in the deployment stack. + /// Possible values include: 'Managed', 'removeDenyFailed', 'deleteFailed', + /// 'None' + + /// denyAssignment settings applied to the resource. + /// Possible values include: 'denyDelete', 'notSupported', 'inapplicable', + /// 'denyWriteAndDelete', 'removedBySystem', 'None' public ManagedResourceReference(string id = default(string), string status = default(string), string denyStatus = default(string)) - : base(id) + + : base(id) { - Status = status; - DenyStatus = denyStatus; + this.Status = status; + this.DenyStatus = denyStatus; CustomInit(); } @@ -51,21 +48,18 @@ public ManagedResourceReference() /// partial void CustomInit(); + /// - /// Gets or sets current management state of the resource in the - /// deployment stack. Possible values include: 'Managed', - /// 'removeDenyFailed', 'deleteFailed', 'None' + /// Gets or sets current management state of the resource in the deployment + /// stack. Possible values include: 'Managed', 'removeDenyFailed', 'deleteFailed', 'None' /// - [JsonProperty(PropertyName = "status")] - public string Status { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "status")] + public string Status {get; set; } /// - /// Gets or sets denyAssignment settings applied to the resource. - /// Possible values include: 'denyDelete', 'notSupported', - /// 'inapplicable', 'denyWriteAndDelete', 'removedBySystem', 'None' + /// Gets or sets denyAssignment settings applied to the resource. Possible values include: 'denyDelete', 'notSupported', 'inapplicable', 'denyWriteAndDelete', 'removedBySystem', 'None' /// - [JsonProperty(PropertyName = "denyStatus")] - public string DenyStatus { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "denyStatus")] + public string DenyStatus {get; set; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/ManagedServiceIdentity.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/ManagedServiceIdentity.cs similarity index 52% rename from src/Resources/Resources.Sdk/Generated/Models/ManagedServiceIdentity.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/ManagedServiceIdentity.cs index 469d9f4dff40..3ef53615e6b5 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/ManagedServiceIdentity.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/ManagedServiceIdentity.cs @@ -1,18 +1,10 @@ -// // 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.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,17 +23,22 @@ public ManagedServiceIdentity() /// /// Initializes a new instance of the ManagedServiceIdentity class. /// - /// Type of the managed identity. Possible values - /// include: 'UserAssigned' - /// ID of the Azure Active Directory. - /// The list of user-assigned - /// managed identities associated with the resource. Key is the Azure - /// resource Id of the managed identity. - public ManagedServiceIdentity(string type = default(string), string tenantId = default(string), IDictionary userAssignedIdentities = default(IDictionary)) + + /// Type of the managed identity. + /// Possible values include: 'UserAssigned' + + /// ID of the Azure Active Directory. + /// + + /// The list of user-assigned managed identities associated with the resource. + /// Key is the Azure resource Id of the managed identity. + /// + public ManagedServiceIdentity(string type = default(string), string tenantId = default(string), System.Collections.Generic.IDictionary userAssignedIdentities = default(System.Collections.Generic.IDictionary)) + { - Type = type; - TenantId = tenantId; - UserAssignedIdentities = userAssignedIdentities; + this.Type = type; + this.TenantId = tenantId; + this.UserAssignedIdentities = userAssignedIdentities; CustomInit(); } @@ -50,26 +47,24 @@ public ManagedServiceIdentity() /// partial void CustomInit(); + /// - /// Gets or sets type of the managed identity. Possible values include: - /// 'UserAssigned' + /// Gets or sets type of the managed identity. Possible values include: 'UserAssigned' /// - [JsonProperty(PropertyName = "type")] - public string Type { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; set; } /// - /// Gets ID of the Azure Active Directory. + /// Gets iD of the Azure Active Directory. /// - [JsonProperty(PropertyName = "tenantId")] - public string TenantId { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "tenantId")] + public string TenantId {get; private set; } /// - /// Gets or sets the list of user-assigned managed identities - /// associated with the resource. Key is the Azure resource Id of the - /// managed identity. + /// Gets or sets the list of user-assigned managed identities associated with + /// the resource. Key is the Azure resource Id of the managed identity. /// - [JsonProperty(PropertyName = "userAssignedIdentities")] - public IDictionary UserAssignedIdentities { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "userAssignedIdentities")] + public System.Collections.Generic.IDictionary UserAssignedIdentities {get; set; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/ManagedServiceIdentityType.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/ManagedServiceIdentityType.cs similarity index 83% rename from src/Resources/Resources.Sdk/Generated/Models/ManagedServiceIdentityType.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/ManagedServiceIdentityType.cs index 7f5fedf2f06e..b8661d37ed25 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/ManagedServiceIdentityType.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/ManagedServiceIdentityType.cs @@ -1,12 +1,7 @@ -// // 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.Models { @@ -14,8 +9,10 @@ namespace Microsoft.Azure.Management.Resources.Models /// /// Defines values for ManagedServiceIdentityType. /// + + public static class ManagedServiceIdentityType { public const string UserAssigned = "UserAssigned"; } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/OnErrorDeployment.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/OnErrorDeployment.cs similarity index 66% rename from src/Resources/Resources.Sdk/Generated/Models/OnErrorDeployment.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/OnErrorDeployment.cs index c809da6ff4f2..ddc63d68406a 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/OnErrorDeployment.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/OnErrorDeployment.cs @@ -1,16 +1,10 @@ -// // 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.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,15 +23,18 @@ public OnErrorDeployment() /// /// Initializes a new instance of the OnErrorDeployment class. /// - /// The deployment on error behavior type. Possible - /// values are LastSuccessful and SpecificDeployment. Possible values - /// include: 'LastSuccessful', 'SpecificDeployment' - /// The deployment to be used on error - /// case. + + /// The deployment on error behavior type. Possible values are LastSuccessful + /// and SpecificDeployment. + /// Possible values include: 'LastSuccessful', 'SpecificDeployment' + + /// The deployment to be used on error case. + /// public OnErrorDeployment(OnErrorDeploymentType? type = default(OnErrorDeploymentType?), string deploymentName = default(string)) + { - Type = type; - DeploymentName = deploymentName; + this.Type = type; + this.DeploymentName = deploymentName; CustomInit(); } @@ -46,19 +43,18 @@ public OnErrorDeployment() /// partial void CustomInit(); + /// - /// Gets or sets the deployment on error behavior type. Possible values - /// are LastSuccessful and SpecificDeployment. Possible values include: - /// 'LastSuccessful', 'SpecificDeployment' + /// Gets or sets the deployment on error behavior type. Possible values are + /// LastSuccessful and SpecificDeployment. Possible values include: 'LastSuccessful', 'SpecificDeployment' /// - [JsonProperty(PropertyName = "type")] - public OnErrorDeploymentType? Type { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public OnErrorDeploymentType? Type {get; set; } /// /// Gets or sets the deployment to be used on error case. /// - [JsonProperty(PropertyName = "deploymentName")] - public string DeploymentName { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "deploymentName")] + public string DeploymentName {get; set; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/OnErrorDeploymentExtended.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/OnErrorDeploymentExtended.cs similarity index 64% rename from src/Resources/Resources.Sdk/Generated/Models/OnErrorDeploymentExtended.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/OnErrorDeploymentExtended.cs index 8ebd52469a03..147e475ad3a8 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/OnErrorDeploymentExtended.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/OnErrorDeploymentExtended.cs @@ -1,16 +1,10 @@ -// // 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.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,18 +23,22 @@ public OnErrorDeploymentExtended() /// /// Initializes a new instance of the OnErrorDeploymentExtended class. /// - /// The state of the provisioning for - /// the on error deployment. - /// The deployment on error behavior type. Possible - /// values are LastSuccessful and SpecificDeployment. Possible values - /// include: 'LastSuccessful', 'SpecificDeployment' - /// The deployment to be used on error - /// case. + + /// The state of the provisioning for the on error deployment. + /// + + /// The deployment on error behavior type. Possible values are LastSuccessful + /// and SpecificDeployment. + /// Possible values include: 'LastSuccessful', 'SpecificDeployment' + + /// The deployment to be used on error case. + /// public OnErrorDeploymentExtended(string provisioningState = default(string), OnErrorDeploymentType? type = default(OnErrorDeploymentType?), string deploymentName = default(string)) + { - ProvisioningState = provisioningState; - Type = type; - DeploymentName = deploymentName; + this.ProvisioningState = provisioningState; + this.Type = type; + this.DeploymentName = deploymentName; CustomInit(); } @@ -49,25 +47,24 @@ public OnErrorDeploymentExtended() /// partial void CustomInit(); + /// /// Gets the state of the provisioning for the on error deployment. /// - [JsonProperty(PropertyName = "provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets or sets the deployment on error behavior type. Possible values - /// are LastSuccessful and SpecificDeployment. Possible values include: - /// 'LastSuccessful', 'SpecificDeployment' + /// Gets or sets the deployment on error behavior type. Possible values are + /// LastSuccessful and SpecificDeployment. Possible values include: 'LastSuccessful', 'SpecificDeployment' /// - [JsonProperty(PropertyName = "type")] - public OnErrorDeploymentType? Type { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public OnErrorDeploymentType? Type {get; set; } /// /// Gets or sets the deployment to be used on error case. /// - [JsonProperty(PropertyName = "deploymentName")] - public string DeploymentName { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "deploymentName")] + public string DeploymentName {get; set; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/OnErrorDeploymentType.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/OnErrorDeploymentType.cs similarity index 80% rename from src/Resources/Resources.Sdk/Generated/Models/OnErrorDeploymentType.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/OnErrorDeploymentType.cs index 9d1e065e3374..1c6342512a5c 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/OnErrorDeploymentType.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/OnErrorDeploymentType.cs @@ -1,29 +1,22 @@ -// // 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.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; /// /// Defines values for OnErrorDeploymentType. /// - [JsonConverter(typeof(StringEnumConverter))] + + + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] public enum OnErrorDeploymentType { - [EnumMember(Value = "LastSuccessful")] + [System.Runtime.Serialization.EnumMember(Value = "LastSuccessful")] LastSuccessful, - [EnumMember(Value = "SpecificDeployment")] + [System.Runtime.Serialization.EnumMember(Value = "SpecificDeployment")] SpecificDeployment } internal static class OnErrorDeploymentTypeEnumExtension @@ -32,7 +25,6 @@ internal static string ToSerializedValue(this OnErrorDeploymentType? value) { return value == null ? null : ((OnErrorDeploymentType)value).ToSerializedValue(); } - internal static string ToSerializedValue(this OnErrorDeploymentType value) { switch( value ) @@ -44,7 +36,6 @@ internal static string ToSerializedValue(this OnErrorDeploymentType value) } return null; } - internal static OnErrorDeploymentType? ParseOnErrorDeploymentType(this string value) { switch( value ) @@ -57,4 +48,4 @@ internal static string ToSerializedValue(this OnErrorDeploymentType value) return null; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/Operation.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/Operation.cs similarity index 72% rename from src/Resources/Resources.Sdk/Generated/Models/Operation.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/Operation.cs index c46249662c82..11171880d969 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/Operation.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/Operation.cs @@ -1,16 +1,10 @@ -// // 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.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,14 +23,17 @@ public Operation() /// /// Initializes a new instance of the Operation class. /// - /// Operation name: - /// {provider}/{resource}/{operation} - /// The object that represents the - /// operation. + + /// Operation name: {provider}/{resource}/{operation} + /// + + /// The object that represents the operation. + /// public Operation(string name = default(string), OperationDisplay display = default(OperationDisplay)) + { - Name = name; - Display = display; + this.Name = name; + this.Display = display; CustomInit(); } @@ -45,17 +42,17 @@ public Operation() /// partial void CustomInit(); + /// /// Gets or sets operation name: {provider}/{resource}/{operation} /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// /// Gets or sets the object that represents the operation. /// - [JsonProperty(PropertyName = "display")] - public OperationDisplay Display { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "display")] + public OperationDisplay Display {get; set; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/OperationDisplay.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/OperationDisplay.cs similarity index 67% rename from src/Resources/Resources.Sdk/Generated/Models/OperationDisplay.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/OperationDisplay.cs index 85ddb518a0c3..91715806fe30 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/OperationDisplay.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/OperationDisplay.cs @@ -1,16 +1,10 @@ -// // 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.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,19 +23,25 @@ public OperationDisplay() /// /// Initializes a new instance of the OperationDisplay class. /// - /// Service provider: - /// Microsoft.Resources - /// Resource on which the operation is - /// performed: Profile, endpoint, etc. - /// Operation type: Read, write, delete, - /// etc. - /// Description of the operation. + + /// Service provider: Microsoft.Resources + /// + + /// Resource on which the operation is performed: Profile, endpoint, etc. + /// + + /// Operation type: Read, write, delete, etc. + /// + + /// Description of the operation. + /// public OperationDisplay(string provider = default(string), string resource = default(string), string operation = default(string), string description = default(string)) + { - Provider = provider; - Resource = resource; - Operation = operation; - Description = description; + this.Provider = provider; + this.Resource = resource; + this.Operation = operation; + this.Description = description; CustomInit(); } @@ -50,30 +50,30 @@ public OperationDisplay() /// partial void CustomInit(); + /// /// Gets or sets service provider: Microsoft.Resources /// - [JsonProperty(PropertyName = "provider")] - public string Provider { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "provider")] + public string Provider {get; set; } /// /// Gets or sets resource on which the operation is performed: Profile, /// endpoint, etc. /// - [JsonProperty(PropertyName = "resource")] - public string Resource { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "resource")] + public string Resource {get; set; } /// /// Gets or sets operation type: Read, write, delete, etc. /// - [JsonProperty(PropertyName = "operation")] - public string Operation { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "operation")] + public string Operation {get; set; } /// /// Gets or sets description of the operation. /// - [JsonProperty(PropertyName = "description")] - public string Description { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "description")] + public string Description {get; set; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/OperationListResult.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/OperationListResult.cs similarity index 60% rename from src/Resources/Resources.Sdk/Generated/Models/OperationListResult.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/OperationListResult.cs index 66868b952642..0395f1f928ce 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/OperationListResult.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/OperationListResult.cs @@ -1,24 +1,15 @@ -// // 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.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// - /// Result of the request to list Microsoft.Resources operations. It - /// contains a list of operations and a URL link to get the next set of - /// results. + /// Result of the request to list Microsoft.Resources operations. It contains a + /// list of operations and a URL link to get the next set of results. /// public partial class OperationListResult { @@ -33,13 +24,17 @@ public OperationListResult() /// /// Initializes a new instance of the OperationListResult class. /// - /// List of Microsoft.Resources operations. - /// URL to get the next set of operation list - /// results if there are any. - public OperationListResult(IList value = default(IList), string nextLink = default(string)) + + /// List of Microsoft.Resources operations. + /// + + /// URL to get the next set of operation list results if there are any. + /// + public OperationListResult(System.Collections.Generic.IList value = default(System.Collections.Generic.IList), string nextLink = default(string)) + { - Value = value; - NextLink = nextLink; + this.Value = value; + this.NextLink = nextLink; CustomInit(); } @@ -48,18 +43,18 @@ public OperationListResult() /// partial void CustomInit(); + /// /// Gets or sets list of Microsoft.Resources operations. /// - [JsonProperty(PropertyName = "value")] - public IList Value { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "value")] + public System.Collections.Generic.IList Value {get; set; } /// - /// Gets or sets URL to get the next set of operation list results if - /// there are any. + /// Gets or sets uRL to get the next set of operation list results if there are + /// any. /// - [JsonProperty(PropertyName = "nextLink")] - public string NextLink { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "nextLink")] + public string NextLink {get; set; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Management.Sdk/Generated/Models/Page.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/Page.cs new file mode 100644 index 000000000000..da05c5e9a887 --- /dev/null +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/Page.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Resources.Models +{ + + /// + /// Defines a page in Azure responses. + /// + /// Type of the page content items + [Newtonsoft.Json.JsonObject] + public class Page : Microsoft.Rest.Azure.IPage + { + /// + /// Gets the link to the next page. + /// + [Newtonsoft.Json.JsonProperty("nextLink")] + public System.String NextPageLink { get; private set; } + + [Newtonsoft.Json.JsonProperty("value")] + private System.Collections.Generic.IList Items{ get; set; } + + /// + /// Returns an enumerator that iterates through the collection. + /// + /// A an enumerator that can be used to iterate through the collection. + public System.Collections.Generic.IEnumerator GetEnumerator() + { + return (Items == null) ? System.Linq.Enumerable.Empty().GetEnumerator() : Items.GetEnumerator(); + } + + /// + /// Returns an enumerator that iterates through the collection. + /// + /// A an enumerator that can be used to iterate through the collection. + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + } +} \ No newline at end of file diff --git a/src/Resources/Resources.Management.Sdk/Generated/Models/Page1.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/Page1.cs new file mode 100644 index 000000000000..c146f5d57c41 --- /dev/null +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/Page1.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Resources.Models +{ + + /// + /// Defines a page in Azure responses. + /// + /// Type of the page content items + [Newtonsoft.Json.JsonObject] + public class Page1 : Microsoft.Rest.Azure.IPage + { + /// + /// Gets the link to the next page. + /// + [Newtonsoft.Json.JsonProperty("nextLink")] + public System.String NextPageLink { get; private set; } + + [Newtonsoft.Json.JsonProperty("value")] + private System.Collections.Generic.IList Items{ get; set; } + + /// + /// Returns an enumerator that iterates through the collection. + /// + /// A an enumerator that can be used to iterate through the collection. + public System.Collections.Generic.IEnumerator GetEnumerator() + { + return (Items == null) ? System.Linq.Enumerable.Empty().GetEnumerator() : Items.GetEnumerator(); + } + + /// + /// Returns an enumerator that iterates through the collection. + /// + /// A an enumerator that can be used to iterate through the collection. + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + } +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/PairedRegion.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/PairedRegion.cs similarity index 68% rename from src/Resources/Resources.Sdk/Generated/Models/PairedRegion.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/PairedRegion.cs index dfc030411242..814c5255076f 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/PairedRegion.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/PairedRegion.cs @@ -1,16 +1,10 @@ -// // 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.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,16 +23,22 @@ public PairedRegion() /// /// Initializes a new instance of the PairedRegion class. /// - /// The name of the paired region. - /// The fully qualified ID of the location. For - /// example, - /// /subscriptions/00000000-0000-0000-0000-000000000000/locations/westus. - /// The subscription ID. + + /// The name of the paired region. + /// + + /// The fully qualified ID of the location. For example, + /// /subscriptions/00000000-0000-0000-0000-000000000000/locations/westus. + /// + + /// The subscription ID. + /// public PairedRegion(string name = default(string), string id = default(string), string subscriptionId = default(string)) + { - Name = name; - Id = id; - SubscriptionId = subscriptionId; + this.Name = name; + this.Id = id; + this.SubscriptionId = subscriptionId; CustomInit(); } @@ -47,24 +47,24 @@ public PairedRegion() /// partial void CustomInit(); + /// /// Gets the name of the paired region. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; private set; } /// /// Gets the fully qualified ID of the location. For example, /// /subscriptions/00000000-0000-0000-0000-000000000000/locations/westus. /// - [JsonProperty(PropertyName = "id")] - public string Id { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; private set; } /// /// Gets the subscription ID. /// - [JsonProperty(PropertyName = "subscriptionId")] - public string SubscriptionId { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "subscriptionId")] + public string SubscriptionId {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/ParametersLink.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/ParametersLink.cs similarity index 68% rename from src/Resources/Resources.Sdk/Generated/Models/ParametersLink.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/ParametersLink.cs index f40f464ee8f6..ae61afebcef9 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/ParametersLink.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/ParametersLink.cs @@ -1,17 +1,10 @@ -// // 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.Models { - using Microsoft.Rest; - using Newtonsoft.Json; using System.Linq; /// @@ -30,13 +23,17 @@ public ParametersLink() /// /// Initializes a new instance of the ParametersLink class. /// - /// The URI of the parameters file. - /// If included, must match the - /// ContentVersion in the template. + + /// The URI of the parameters file. + /// + + /// If included, must match the ContentVersion in the template. + /// public ParametersLink(string uri, string contentVersion = default(string)) + { - Uri = uri; - ContentVersion = contentVersion; + this.Uri = uri; + this.ContentVersion = contentVersion; CustomInit(); } @@ -45,31 +42,32 @@ public ParametersLink() /// partial void CustomInit(); + /// /// Gets or sets the URI of the parameters file. /// - [JsonProperty(PropertyName = "uri")] - public string Uri { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "uri")] + public string Uri {get; set; } /// - /// Gets or sets if included, must match the ContentVersion in the - /// template. + /// Gets or sets if included, must match the ContentVersion in the template. /// - [JsonProperty(PropertyName = "contentVersion")] - public string ContentVersion { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "contentVersion")] + public string ContentVersion {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Uri == null) + if (this.Uri == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Uri"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Uri"); } + + } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/Peers.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/Peers.cs similarity index 70% rename from src/Resources/Resources.Sdk/Generated/Models/Peers.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/Peers.cs index 0bf2470fc11d..6c9bc9d853e4 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/Peers.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/Peers.cs @@ -1,16 +1,10 @@ -// // 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.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,12 +23,17 @@ public Peers() /// /// Initializes a new instance of the Peers class. /// - /// The subscription ID. - /// The availabilityZone. + + /// The subscription ID. + /// + + /// The availabilityZone. + /// public Peers(string subscriptionId = default(string), string availabilityZone = default(string)) + { - SubscriptionId = subscriptionId; - AvailabilityZone = availabilityZone; + this.SubscriptionId = subscriptionId; + this.AvailabilityZone = availabilityZone; CustomInit(); } @@ -43,17 +42,17 @@ public Peers() /// partial void CustomInit(); + /// /// Gets the subscription ID. /// - [JsonProperty(PropertyName = "subscriptionId")] - public string SubscriptionId { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "subscriptionId")] + public string SubscriptionId {get; private set; } /// /// Gets the availabilityZone. /// - [JsonProperty(PropertyName = "availabilityZone")] - public string AvailabilityZone { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "availabilityZone")] + public string AvailabilityZone {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Management.Sdk/Generated/Models/Permission.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/Permission.cs new file mode 100644 index 000000000000..d2f8a64dae3c --- /dev/null +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/Permission.cs @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Resources.Models +{ + using System.Linq; + + /// + /// Role definition permissions. + /// + public partial class Permission + { + /// + /// Initializes a new instance of the Permission class. + /// + public Permission() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Permission class. + /// + + /// Allowed actions. + /// + + /// Denied actions. + /// + + /// Allowed Data actions. + /// + + /// Denied Data actions. + /// + public Permission(System.Collections.Generic.IList actions = default(System.Collections.Generic.IList), System.Collections.Generic.IList notActions = default(System.Collections.Generic.IList), System.Collections.Generic.IList dataActions = default(System.Collections.Generic.IList), System.Collections.Generic.IList notDataActions = default(System.Collections.Generic.IList)) + + { + this.Actions = actions; + this.NotActions = notActions; + this.DataActions = dataActions; + this.NotDataActions = notDataActions; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets allowed actions. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "actions")] + public System.Collections.Generic.IList Actions {get; set; } + + /// + /// Gets or sets denied actions. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "notActions")] + public System.Collections.Generic.IList NotActions {get; set; } + + /// + /// Gets or sets allowed Data actions. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "dataActions")] + public System.Collections.Generic.IList DataActions {get; set; } + + /// + /// Gets or sets denied Data actions. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "notDataActions")] + public System.Collections.Generic.IList NotDataActions {get; set; } + } +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/Plan.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/Plan.cs similarity index 55% rename from src/Resources/Resources.Sdk/Generated/Models/Plan.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/Plan.cs index 63a8e7ff5dee..413a68b5ab02 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/Plan.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/Plan.cs @@ -1,16 +1,10 @@ -// // 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.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,18 +23,29 @@ public Plan() /// /// Initializes a new instance of the Plan class. /// - /// The plan ID. - /// The publisher ID. - /// The offer ID. - /// The promotion code. - /// The plan's version. + + /// The plan ID. + /// + + /// The publisher ID. + /// + + /// The offer ID. + /// + + /// The promotion code. + /// + + /// The plan's version. + /// public Plan(string name = default(string), string publisher = default(string), string product = default(string), string promotionCode = default(string), string version = default(string)) + { - Name = name; - Publisher = publisher; - Product = product; - PromotionCode = promotionCode; - Version = version; + this.Name = name; + this.Publisher = publisher; + this.Product = product; + this.PromotionCode = promotionCode; + this.Version = version; CustomInit(); } @@ -49,35 +54,35 @@ public Plan() /// partial void CustomInit(); + /// /// Gets or sets the plan ID. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// /// Gets or sets the publisher ID. /// - [JsonProperty(PropertyName = "publisher")] - public string Publisher { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "publisher")] + public string Publisher {get; set; } /// /// Gets or sets the offer ID. /// - [JsonProperty(PropertyName = "product")] - public string Product { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "product")] + public string Product {get; set; } /// /// Gets or sets the promotion code. /// - [JsonProperty(PropertyName = "promotionCode")] - public string PromotionCode { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "promotionCode")] + public string PromotionCode {get; set; } /// - /// Gets or sets the plan's version. + /// Gets or sets the plan's version. /// - [JsonProperty(PropertyName = "version")] - public string Version { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "version")] + public string Version {get; set; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/PrivateLinkAssociation.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/PrivateLinkAssociation.cs similarity index 63% rename from src/Resources/Resources.Sdk/Generated/Models/PrivateLinkAssociation.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/PrivateLinkAssociation.cs index cbcac68b15a1..5e0b92b57d3c 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/PrivateLinkAssociation.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/PrivateLinkAssociation.cs @@ -1,21 +1,13 @@ -// // 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.Models { - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Newtonsoft.Json; using System.Linq; - public partial class PrivateLinkAssociation : IResource + public partial class PrivateLinkAssociation : Microsoft.Rest.Azure.IResource { /// /// Initializes a new instance of the PrivateLinkAssociation class. @@ -28,17 +20,25 @@ public PrivateLinkAssociation() /// /// Initializes a new instance of the PrivateLinkAssociation class. /// - /// The private link association - /// properties. - /// The plaResourceID. - /// The operation type. - /// The pla name. + + /// The private link association properties. + /// + + /// The plaResourceID. + /// + + /// The operation type. + /// + + /// The pla name. + /// public PrivateLinkAssociation(PrivateLinkAssociationPropertiesExpanded properties = default(PrivateLinkAssociationPropertiesExpanded), string id = default(string), string type = default(string), string name = default(string)) + { - Properties = properties; - Id = id; - Type = type; - Name = name; + this.Properties = properties; + this.Id = id; + this.Type = type; + this.Name = name; CustomInit(); } @@ -47,29 +47,29 @@ public PrivateLinkAssociation() /// partial void CustomInit(); + /// /// Gets or sets the private link association properties. /// - [JsonProperty(PropertyName = "properties")] - public PrivateLinkAssociationPropertiesExpanded Properties { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties")] + public PrivateLinkAssociationPropertiesExpanded Properties {get; set; } /// /// Gets the plaResourceID. /// - [JsonProperty(PropertyName = "id")] - public string Id { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; private set; } /// /// Gets the operation type. /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } /// /// Gets the pla name. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/PrivateLinkAssociationGetResult.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/PrivateLinkAssociationGetResult.cs similarity index 68% rename from src/Resources/Resources.Sdk/Generated/Models/PrivateLinkAssociationGetResult.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/PrivateLinkAssociationGetResult.cs index 6a6182a53363..cd6625bbc91d 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/PrivateLinkAssociationGetResult.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/PrivateLinkAssociationGetResult.cs @@ -1,18 +1,10 @@ -// // 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.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -21,8 +13,7 @@ namespace Microsoft.Azure.Management.Resources.Models public partial class PrivateLinkAssociationGetResult { /// - /// Initializes a new instance of the PrivateLinkAssociationGetResult - /// class. + /// Initializes a new instance of the PrivateLinkAssociationGetResult class. /// public PrivateLinkAssociationGetResult() { @@ -30,13 +21,15 @@ public PrivateLinkAssociationGetResult() } /// - /// Initializes a new instance of the PrivateLinkAssociationGetResult - /// class. + /// Initializes a new instance of the PrivateLinkAssociationGetResult class. /// - /// private link association information. - public PrivateLinkAssociationGetResult(IList value = default(IList)) + + /// private link association information. + /// + public PrivateLinkAssociationGetResult(System.Collections.Generic.IList value = default(System.Collections.Generic.IList)) + { - Value = value; + this.Value = value; CustomInit(); } @@ -45,11 +38,11 @@ public PrivateLinkAssociationGetResult() /// partial void CustomInit(); + /// /// Gets or sets private link association information. /// - [JsonProperty(PropertyName = "value")] - public IList Value { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "value")] + public System.Collections.Generic.IList Value {get; set; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/PrivateLinkAssociationObject.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/PrivateLinkAssociationObject.cs similarity index 72% rename from src/Resources/Resources.Sdk/Generated/Models/PrivateLinkAssociationObject.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/PrivateLinkAssociationObject.cs index 216895cf681d..4ff6aba00195 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/PrivateLinkAssociationObject.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/PrivateLinkAssociationObject.cs @@ -1,23 +1,16 @@ -// // 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.Models { - using Newtonsoft.Json; using System.Linq; public partial class PrivateLinkAssociationObject { /// - /// Initializes a new instance of the PrivateLinkAssociationObject - /// class. + /// Initializes a new instance of the PrivateLinkAssociationObject class. /// public PrivateLinkAssociationObject() { @@ -25,14 +18,15 @@ public PrivateLinkAssociationObject() } /// - /// Initializes a new instance of the PrivateLinkAssociationObject - /// class. + /// Initializes a new instance of the PrivateLinkAssociationObject class. /// - /// The properties of the - /// PrivateLinkAssociation. + + /// The properties of the PrivateLinkAssociation. + /// public PrivateLinkAssociationObject(PrivateLinkAssociationProperties properties = default(PrivateLinkAssociationProperties)) + { - Properties = properties; + this.Properties = properties; CustomInit(); } @@ -41,11 +35,11 @@ public PrivateLinkAssociationObject() /// partial void CustomInit(); + /// /// Gets or sets the properties of the PrivateLinkAssociation. /// - [JsonProperty(PropertyName = "properties")] - public PrivateLinkAssociationProperties Properties { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties")] + public PrivateLinkAssociationProperties Properties {get; set; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/PrivateLinkAssociationProperties.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/PrivateLinkAssociationProperties.cs similarity index 61% rename from src/Resources/Resources.Sdk/Generated/Models/PrivateLinkAssociationProperties.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/PrivateLinkAssociationProperties.cs index 3721b5b0c862..1976897e96c2 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/PrivateLinkAssociationProperties.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/PrivateLinkAssociationProperties.cs @@ -1,23 +1,16 @@ -// // 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.Models { - using Newtonsoft.Json; using System.Linq; public partial class PrivateLinkAssociationProperties { /// - /// Initializes a new instance of the PrivateLinkAssociationProperties - /// class. + /// Initializes a new instance of the PrivateLinkAssociationProperties class. /// public PrivateLinkAssociationProperties() { @@ -25,16 +18,19 @@ public PrivateLinkAssociationProperties() } /// - /// Initializes a new instance of the PrivateLinkAssociationProperties - /// class. + /// Initializes a new instance of the PrivateLinkAssociationProperties class. /// - /// The rmpl Resource ID. - /// Possible values include: - /// 'Enabled', 'Disabled' + + /// The rmpl Resource ID. + /// + + /// + /// Possible values include: 'Enabled', 'Disabled' public PrivateLinkAssociationProperties(string privateLink = default(string), string publicNetworkAccess = default(string)) + { - PrivateLink = privateLink; - PublicNetworkAccess = publicNetworkAccess; + this.PrivateLink = privateLink; + this.PublicNetworkAccess = publicNetworkAccess; CustomInit(); } @@ -43,17 +39,17 @@ public PrivateLinkAssociationProperties() /// partial void CustomInit(); + /// /// Gets or sets the rmpl Resource ID. /// - [JsonProperty(PropertyName = "privateLink")] - public string PrivateLink { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "privateLink")] + public string PrivateLink {get; set; } /// - /// Gets or sets possible values include: 'Enabled', 'Disabled' + /// Gets or sets Possible values include: 'Enabled', 'Disabled' /// - [JsonProperty(PropertyName = "publicNetworkAccess")] - public string PublicNetworkAccess { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "publicNetworkAccess")] + public string PublicNetworkAccess {get; set; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Management.Sdk/Generated/Models/PrivateLinkAssociationPropertiesExpanded.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/PrivateLinkAssociationPropertiesExpanded.cs new file mode 100644 index 000000000000..b32375e9269f --- /dev/null +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/PrivateLinkAssociationPropertiesExpanded.cs @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Resources.Models +{ + using System.Linq; + + /// + /// Private Link Association Properties. + /// + public partial class PrivateLinkAssociationPropertiesExpanded + { + /// + /// Initializes a new instance of the PrivateLinkAssociationPropertiesExpanded class. + /// + public PrivateLinkAssociationPropertiesExpanded() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PrivateLinkAssociationPropertiesExpanded class. + /// + + /// The rmpl Resource ID. + /// + + /// + /// Possible values include: 'Enabled', 'Disabled' + + /// The TenantID. + /// + + /// The scope of the private link association. + /// + public PrivateLinkAssociationPropertiesExpanded(string privateLink = default(string), string publicNetworkAccess = default(string), string tenantId = default(string), string scope = default(string)) + + { + this.PrivateLink = privateLink; + this.PublicNetworkAccess = publicNetworkAccess; + this.TenantId = tenantId; + this.Scope = scope; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the rmpl Resource ID. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "privateLink")] + public string PrivateLink {get; set; } + + /// + /// Gets or sets Possible values include: 'Enabled', 'Disabled' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "publicNetworkAccess")] + public string PublicNetworkAccess {get; set; } + + /// + /// Gets or sets the TenantID. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "tenantID")] + public string TenantId {get; set; } + + /// + /// Gets or sets the scope of the private link association. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "scope")] + public string Scope {get; set; } + } +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/PropertyChangeType.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/PropertyChangeType.cs similarity index 76% rename from src/Resources/Resources.Sdk/Generated/Models/PropertyChangeType.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/PropertyChangeType.cs index 45b0c96155cc..6ac9fac742ec 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/PropertyChangeType.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/PropertyChangeType.cs @@ -1,55 +1,47 @@ -// // 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.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; /// /// Defines values for PropertyChangeType. /// - [JsonConverter(typeof(StringEnumConverter))] + + + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] public enum PropertyChangeType { /// - /// The property does not exist in the current state but is present in - /// the desired state. The property will be created when the deployment - /// is executed. + /// The property does not exist in the current state but is present in the + /// desired state. The property will be created when the deployment is + /// executed. /// - [EnumMember(Value = "Create")] + [System.Runtime.Serialization.EnumMember(Value = "Create")] Create, /// - /// The property exists in the current state and is missing from the - /// desired state. It will be deleted when the deployment is executed. + /// The property exists in the current state and is missing from the desired + /// state. It will be deleted when the deployment is executed. /// - [EnumMember(Value = "Delete")] + [System.Runtime.Serialization.EnumMember(Value = "Delete")] Delete, /// - /// The property exists in both current and desired state and is - /// different. The value of the property will change when the - /// deployment is executed. + /// The property exists in both current and desired state and is different. The + /// value of the property will change when the deployment is executed. /// - [EnumMember(Value = "Modify")] + [System.Runtime.Serialization.EnumMember(Value = "Modify")] Modify, /// /// The property is an array and contains nested changes. /// - [EnumMember(Value = "Array")] + [System.Runtime.Serialization.EnumMember(Value = "Array")] Array, /// /// The property will not be set or updated. /// - [EnumMember(Value = "NoEffect")] + [System.Runtime.Serialization.EnumMember(Value = "NoEffect")] NoEffect } internal static class PropertyChangeTypeEnumExtension @@ -58,7 +50,6 @@ internal static string ToSerializedValue(this PropertyChangeType? value) { return value == null ? null : ((PropertyChangeType)value).ToSerializedValue(); } - internal static string ToSerializedValue(this PropertyChangeType value) { switch( value ) @@ -76,7 +67,6 @@ internal static string ToSerializedValue(this PropertyChangeType value) } return null; } - internal static PropertyChangeType? ParsePropertyChangeType(this string value) { switch( value ) @@ -95,4 +85,4 @@ internal static string ToSerializedValue(this PropertyChangeType value) return null; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/Provider.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/Provider.cs similarity index 50% rename from src/Resources/Resources.Sdk/Generated/Models/Provider.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/Provider.cs index ddb0d2af0369..d74ed809a521 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/Provider.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/Provider.cs @@ -1,18 +1,10 @@ -// // 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.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,26 +23,34 @@ public Provider() /// /// Initializes a new instance of the Provider class. /// - /// The provider ID. - /// The namespace of the resource - /// provider. - /// The registration state of the - /// resource provider. - /// The registration policy of the - /// resource provider. - /// The collection of provider resource - /// types. - /// The provider - /// authorization consent state. Possible values include: - /// 'NotSpecified', 'Required', 'NotRequired', 'Consented' - public Provider(string id = default(string), string namespaceProperty = default(string), string registrationState = default(string), string registrationPolicy = default(string), IList resourceTypes = default(IList), string providerAuthorizationConsentState = default(string)) + + /// The provider ID. + /// + + /// The namespace of the resource provider. + /// + + /// The registration state of the resource provider. + /// + + /// The registration policy of the resource provider. + /// + + /// The collection of provider resource types. + /// + + /// The provider authorization consent state. + /// Possible values include: 'NotSpecified', 'Required', 'NotRequired', + /// 'Consented' + public Provider(string id = default(string), string namespaceProperty = default(string), string registrationState = default(string), string registrationPolicy = default(string), System.Collections.Generic.IList resourceTypes = default(System.Collections.Generic.IList), string providerAuthorizationConsentState = default(string)) + { - Id = id; - NamespaceProperty = namespaceProperty; - RegistrationState = registrationState; - RegistrationPolicy = registrationPolicy; - ResourceTypes = resourceTypes; - ProviderAuthorizationConsentState = providerAuthorizationConsentState; + this.Id = id; + this.NamespaceProperty = namespaceProperty; + this.RegistrationState = registrationState; + this.RegistrationPolicy = registrationPolicy; + this.ResourceTypes = resourceTypes; + this.ProviderAuthorizationConsentState = providerAuthorizationConsentState; CustomInit(); } @@ -59,43 +59,41 @@ public Provider() /// partial void CustomInit(); + /// /// Gets the provider ID. /// - [JsonProperty(PropertyName = "id")] - public string Id { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; private set; } /// /// Gets or sets the namespace of the resource provider. /// - [JsonProperty(PropertyName = "namespace")] - public string NamespaceProperty { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "namespace")] + public string NamespaceProperty {get; set; } /// /// Gets the registration state of the resource provider. /// - [JsonProperty(PropertyName = "registrationState")] - public string RegistrationState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "registrationState")] + public string RegistrationState {get; private set; } /// /// Gets the registration policy of the resource provider. /// - [JsonProperty(PropertyName = "registrationPolicy")] - public string RegistrationPolicy { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "registrationPolicy")] + public string RegistrationPolicy {get; private set; } /// /// Gets the collection of provider resource types. /// - [JsonProperty(PropertyName = "resourceTypes")] - public IList ResourceTypes { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "resourceTypes")] + public System.Collections.Generic.IList ResourceTypes {get; private set; } /// - /// Gets or sets the provider authorization consent state. Possible - /// values include: 'NotSpecified', 'Required', 'NotRequired', - /// 'Consented' + /// Gets or sets the provider authorization consent state. Possible values include: 'NotSpecified', 'Required', 'NotRequired', 'Consented' /// - [JsonProperty(PropertyName = "providerAuthorizationConsentState")] - public string ProviderAuthorizationConsentState { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "providerAuthorizationConsentState")] + public string ProviderAuthorizationConsentState {get; set; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/ProviderAuthorizationConsentState.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/ProviderAuthorizationConsentState.cs similarity index 86% rename from src/Resources/Resources.Sdk/Generated/Models/ProviderAuthorizationConsentState.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/ProviderAuthorizationConsentState.cs index a572220ba6cd..d0451217f956 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/ProviderAuthorizationConsentState.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/ProviderAuthorizationConsentState.cs @@ -1,12 +1,7 @@ -// // 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.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Resources.Models /// /// Defines values for ProviderAuthorizationConsentState. /// + + public static class ProviderAuthorizationConsentState { public const string NotSpecified = "NotSpecified"; @@ -21,4 +18,4 @@ public static class ProviderAuthorizationConsentState public const string NotRequired = "NotRequired"; public const string Consented = "Consented"; } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/ProviderConsentDefinition.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/ProviderConsentDefinition.cs similarity index 75% rename from src/Resources/Resources.Sdk/Generated/Models/ProviderConsentDefinition.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/ProviderConsentDefinition.cs index 06c5d39fd2f1..082e87291af7 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/ProviderConsentDefinition.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/ProviderConsentDefinition.cs @@ -1,16 +1,10 @@ -// // 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.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,11 +23,13 @@ public ProviderConsentDefinition() /// /// Initializes a new instance of the ProviderConsentDefinition class. /// - /// A value indicating whether - /// authorization is consented or not. + + /// A value indicating whether authorization is consented or not. + /// public ProviderConsentDefinition(bool? consentToAuthorization = default(bool?)) + { - ConsentToAuthorization = consentToAuthorization; + this.ConsentToAuthorization = consentToAuthorization; CustomInit(); } @@ -42,12 +38,11 @@ public ProviderConsentDefinition() /// partial void CustomInit(); + /// - /// Gets or sets a value indicating whether authorization is consented - /// or not. + /// Gets or sets a value indicating whether authorization is consented or not. /// - [JsonProperty(PropertyName = "consentToAuthorization")] - public bool? ConsentToAuthorization { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "consentToAuthorization")] + public bool? ConsentToAuthorization {get; set; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/ProviderExtendedLocation.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/ProviderExtendedLocation.cs similarity index 61% rename from src/Resources/Resources.Sdk/Generated/Models/ProviderExtendedLocation.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/ProviderExtendedLocation.cs index be16e49c4b6f..46b8f86e8fab 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/ProviderExtendedLocation.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/ProviderExtendedLocation.cs @@ -1,18 +1,10 @@ -// // 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.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,15 +23,21 @@ public ProviderExtendedLocation() /// /// Initializes a new instance of the ProviderExtendedLocation class. /// - /// The azure location. - /// The extended location type. - /// The extended locations for the - /// azure location. - public ProviderExtendedLocation(string location = default(string), string type = default(string), IList extendedLocations = default(IList)) + + /// The azure location. + /// + + /// The extended location type. + /// + + /// The extended locations for the azure location. + /// + public ProviderExtendedLocation(string location = default(string), string type = default(string), System.Collections.Generic.IList extendedLocations = default(System.Collections.Generic.IList)) + { - Location = location; - Type = type; - ExtendedLocations = extendedLocations; + this.Location = location; + this.Type = type; + this.ExtendedLocations = extendedLocations; CustomInit(); } @@ -48,23 +46,23 @@ public ProviderExtendedLocation() /// partial void CustomInit(); + /// /// Gets or sets the azure location. /// - [JsonProperty(PropertyName = "location")] - public string Location { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + public string Location {get; set; } /// /// Gets or sets the extended location type. /// - [JsonProperty(PropertyName = "type")] - public string Type { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; set; } /// /// Gets or sets the extended locations for the azure location. /// - [JsonProperty(PropertyName = "extendedLocations")] - public IList ExtendedLocations { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "extendedLocations")] + public System.Collections.Generic.IList ExtendedLocations {get; set; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/ProviderPermission.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/ProviderPermission.cs similarity index 58% rename from src/Resources/Resources.Sdk/Generated/Models/ProviderPermission.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/ProviderPermission.cs index d6359588ddd0..cd97d612a093 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/ProviderPermission.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/ProviderPermission.cs @@ -1,16 +1,10 @@ -// // 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.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,19 +23,26 @@ public ProviderPermission() /// /// Initializes a new instance of the ProviderPermission class. /// - /// The application id. - /// Role definition properties. - /// Role definition - /// properties. - /// The provider - /// authorization consent state. Possible values include: - /// 'NotSpecified', 'Required', 'NotRequired', 'Consented' + + /// The application id. + /// + + /// Role definition properties. + /// + + /// Role definition properties. + /// + + /// The provider authorization consent state. + /// Possible values include: 'NotSpecified', 'Required', 'NotRequired', + /// 'Consented' public ProviderPermission(string applicationId = default(string), RoleDefinition roleDefinition = default(RoleDefinition), RoleDefinition managedByRoleDefinition = default(RoleDefinition), string providerAuthorizationConsentState = default(string)) + { - ApplicationId = applicationId; - RoleDefinition = roleDefinition; - ManagedByRoleDefinition = managedByRoleDefinition; - ProviderAuthorizationConsentState = providerAuthorizationConsentState; + this.ApplicationId = applicationId; + this.RoleDefinition = roleDefinition; + this.ManagedByRoleDefinition = managedByRoleDefinition; + this.ProviderAuthorizationConsentState = providerAuthorizationConsentState; CustomInit(); } @@ -50,31 +51,29 @@ public ProviderPermission() /// partial void CustomInit(); + /// /// Gets or sets the application id. /// - [JsonProperty(PropertyName = "applicationId")] - public string ApplicationId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "applicationId")] + public string ApplicationId {get; set; } /// /// Gets or sets role definition properties. /// - [JsonProperty(PropertyName = "roleDefinition")] - public RoleDefinition RoleDefinition { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "roleDefinition")] + public RoleDefinition RoleDefinition {get; set; } /// /// Gets or sets role definition properties. /// - [JsonProperty(PropertyName = "managedByRoleDefinition")] - public RoleDefinition ManagedByRoleDefinition { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "managedByRoleDefinition")] + public RoleDefinition ManagedByRoleDefinition {get; set; } /// - /// Gets or sets the provider authorization consent state. Possible - /// values include: 'NotSpecified', 'Required', 'NotRequired', - /// 'Consented' + /// Gets or sets the provider authorization consent state. Possible values include: 'NotSpecified', 'Required', 'NotRequired', 'Consented' /// - [JsonProperty(PropertyName = "providerAuthorizationConsentState")] - public string ProviderAuthorizationConsentState { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "providerAuthorizationConsentState")] + public string ProviderAuthorizationConsentState {get; set; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/ProviderPermissionListResult.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/ProviderPermissionListResult.cs similarity index 64% rename from src/Resources/Resources.Sdk/Generated/Models/ProviderPermissionListResult.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/ProviderPermissionListResult.cs index 14d50192c074..f29e8a3f38b2 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/ProviderPermissionListResult.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/ProviderPermissionListResult.cs @@ -1,18 +1,10 @@ -// // 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.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -21,8 +13,7 @@ namespace Microsoft.Azure.Management.Resources.Models public partial class ProviderPermissionListResult { /// - /// Initializes a new instance of the ProviderPermissionListResult - /// class. + /// Initializes a new instance of the ProviderPermissionListResult class. /// public ProviderPermissionListResult() { @@ -30,16 +21,19 @@ public ProviderPermissionListResult() } /// - /// Initializes a new instance of the ProviderPermissionListResult - /// class. + /// Initializes a new instance of the ProviderPermissionListResult class. /// - /// An array of provider permissions. - /// The URL to use for getting the next set of - /// results. - public ProviderPermissionListResult(IList value = default(IList), string nextLink = default(string)) + + /// An array of provider permissions. + /// + + /// The URL to use for getting the next set of results. + /// + public ProviderPermissionListResult(System.Collections.Generic.IList value = default(System.Collections.Generic.IList), string nextLink = default(string)) + { - Value = value; - NextLink = nextLink; + this.Value = value; + this.NextLink = nextLink; CustomInit(); } @@ -48,17 +42,17 @@ public ProviderPermissionListResult() /// partial void CustomInit(); + /// /// Gets or sets an array of provider permissions. /// - [JsonProperty(PropertyName = "value")] - public IList Value { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "value")] + public System.Collections.Generic.IList Value {get; set; } /// /// Gets the URL to use for getting the next set of results. /// - [JsonProperty(PropertyName = "nextLink")] - public string NextLink { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "nextLink")] + public string NextLink {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/ProviderRegistrationRequest.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/ProviderRegistrationRequest.cs similarity index 78% rename from src/Resources/Resources.Sdk/Generated/Models/ProviderRegistrationRequest.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/ProviderRegistrationRequest.cs index d531f0407973..e217f81b7943 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/ProviderRegistrationRequest.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/ProviderRegistrationRequest.cs @@ -1,16 +1,10 @@ -// // 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.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.Resources.Models public partial class ProviderRegistrationRequest { /// - /// Initializes a new instance of the ProviderRegistrationRequest - /// class. + /// Initializes a new instance of the ProviderRegistrationRequest class. /// public ProviderRegistrationRequest() { @@ -28,14 +21,15 @@ public ProviderRegistrationRequest() } /// - /// Initializes a new instance of the ProviderRegistrationRequest - /// class. + /// Initializes a new instance of the ProviderRegistrationRequest class. /// - /// The provider - /// consent. + + /// The provider consent. + /// public ProviderRegistrationRequest(ProviderConsentDefinition thirdPartyProviderConsent = default(ProviderConsentDefinition)) + { - ThirdPartyProviderConsent = thirdPartyProviderConsent; + this.ThirdPartyProviderConsent = thirdPartyProviderConsent; CustomInit(); } @@ -44,11 +38,11 @@ public ProviderRegistrationRequest() /// partial void CustomInit(); + /// /// Gets or sets the provider consent. /// - [JsonProperty(PropertyName = "thirdPartyProviderConsent")] - public ProviderConsentDefinition ThirdPartyProviderConsent { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "thirdPartyProviderConsent")] + public ProviderConsentDefinition ThirdPartyProviderConsent {get; set; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Management.Sdk/Generated/Models/ProviderResourceType.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/ProviderResourceType.cs new file mode 100644 index 000000000000..aab9bb27484a --- /dev/null +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/ProviderResourceType.cs @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Resources.Models +{ + using System.Linq; + + /// + /// Resource type managed by the resource provider. + /// + public partial class ProviderResourceType + { + /// + /// Initializes a new instance of the ProviderResourceType class. + /// + public ProviderResourceType() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ProviderResourceType class. + /// + + /// The resource type. + /// + + /// The collection of locations where this resource type can be created. + /// + + /// The location mappings that are supported by this resource type. + /// + + /// The aliases that are supported by this resource type. + /// + + /// The API version. + /// + + /// The default API version. + /// + + /// + /// + + /// The API profiles for the resource provider. + /// + + /// The additional capabilities offered by this resource type. + /// + + /// The properties. + /// + public ProviderResourceType(string resourceType = default(string), System.Collections.Generic.IList locations = default(System.Collections.Generic.IList), System.Collections.Generic.IList locationMappings = default(System.Collections.Generic.IList), System.Collections.Generic.IList aliases = default(System.Collections.Generic.IList), System.Collections.Generic.IList apiVersions = default(System.Collections.Generic.IList), string defaultApiVersion = default(string), System.Collections.Generic.IList zoneMappings = default(System.Collections.Generic.IList), System.Collections.Generic.IList apiProfiles = default(System.Collections.Generic.IList), string capabilities = default(string), System.Collections.Generic.IDictionary properties = default(System.Collections.Generic.IDictionary)) + + { + this.ResourceType = resourceType; + this.Locations = locations; + this.LocationMappings = locationMappings; + this.Aliases = aliases; + this.ApiVersions = apiVersions; + this.DefaultApiVersion = defaultApiVersion; + this.ZoneMappings = zoneMappings; + this.ApiProfiles = apiProfiles; + this.Capabilities = capabilities; + this.Properties = properties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the resource type. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "resourceType")] + public string ResourceType {get; set; } + + /// + /// Gets or sets the collection of locations where this resource type can be + /// created. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "locations")] + public System.Collections.Generic.IList Locations {get; set; } + + /// + /// Gets or sets the location mappings that are supported by this resource + /// type. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "locationMappings")] + public System.Collections.Generic.IList LocationMappings {get; set; } + + /// + /// Gets or sets the aliases that are supported by this resource type. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "aliases")] + public System.Collections.Generic.IList Aliases {get; set; } + + /// + /// Gets or sets the API version. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "apiVersions")] + public System.Collections.Generic.IList ApiVersions {get; set; } + + /// + /// Gets the default API version. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "defaultApiVersion")] + public string DefaultApiVersion {get; private set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "zoneMappings")] + public System.Collections.Generic.IList ZoneMappings {get; set; } + + /// + /// Gets the API profiles for the resource provider. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "apiProfiles")] + public System.Collections.Generic.IList ApiProfiles {get; private set; } + + /// + /// Gets or sets the additional capabilities offered by this resource type. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "capabilities")] + public string Capabilities {get; set; } + + /// + /// Gets or sets the properties. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties")] + public System.Collections.Generic.IDictionary Properties {get; set; } + } +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/ProviderResourceTypeListResult.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/ProviderResourceTypeListResult.cs similarity index 61% rename from src/Resources/Resources.Sdk/Generated/Models/ProviderResourceTypeListResult.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/ProviderResourceTypeListResult.cs index 7c292c7f3189..8591359b7995 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/ProviderResourceTypeListResult.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/ProviderResourceTypeListResult.cs @@ -1,18 +1,10 @@ -// // 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.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -21,8 +13,7 @@ namespace Microsoft.Azure.Management.Resources.Models public partial class ProviderResourceTypeListResult { /// - /// Initializes a new instance of the ProviderResourceTypeListResult - /// class. + /// Initializes a new instance of the ProviderResourceTypeListResult class. /// public ProviderResourceTypeListResult() { @@ -30,16 +21,19 @@ public ProviderResourceTypeListResult() } /// - /// Initializes a new instance of the ProviderResourceTypeListResult - /// class. + /// Initializes a new instance of the ProviderResourceTypeListResult class. /// - /// An array of resource types. - /// The URL to use for getting the next set of - /// results. - public ProviderResourceTypeListResult(IList value = default(IList), string nextLink = default(string)) + + /// An array of resource types. + /// + + /// The URL to use for getting the next set of results. + /// + public ProviderResourceTypeListResult(System.Collections.Generic.IList value = default(System.Collections.Generic.IList), string nextLink = default(string)) + { - Value = value; - NextLink = nextLink; + this.Value = value; + this.NextLink = nextLink; CustomInit(); } @@ -48,17 +42,17 @@ public ProviderResourceTypeListResult() /// partial void CustomInit(); + /// /// Gets or sets an array of resource types. /// - [JsonProperty(PropertyName = "value")] - public IList Value { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "value")] + public System.Collections.Generic.IList Value {get; set; } /// /// Gets the URL to use for getting the next set of results. /// - [JsonProperty(PropertyName = "nextLink")] - public string NextLink { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "nextLink")] + public string NextLink {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/ProvisioningOperation.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/ProvisioningOperation.cs similarity index 82% rename from src/Resources/Resources.Sdk/Generated/Models/ProvisioningOperation.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/ProvisioningOperation.cs index fff9c6c61743..e70ebe3eb05d 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/ProvisioningOperation.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/ProvisioningOperation.cs @@ -1,76 +1,69 @@ -// // 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.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; /// /// Defines values for ProvisioningOperation. /// - [JsonConverter(typeof(StringEnumConverter))] + + + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] public enum ProvisioningOperation { /// /// The provisioning operation is not specified. /// - [EnumMember(Value = "NotSpecified")] + [System.Runtime.Serialization.EnumMember(Value = "NotSpecified")] NotSpecified, /// /// The provisioning operation is create. /// - [EnumMember(Value = "Create")] + [System.Runtime.Serialization.EnumMember(Value = "Create")] Create, /// /// The provisioning operation is delete. /// - [EnumMember(Value = "Delete")] + [System.Runtime.Serialization.EnumMember(Value = "Delete")] Delete, /// /// The provisioning operation is waiting. /// - [EnumMember(Value = "Waiting")] + [System.Runtime.Serialization.EnumMember(Value = "Waiting")] Waiting, /// /// The provisioning operation is waiting Azure async operation. /// - [EnumMember(Value = "AzureAsyncOperationWaiting")] + [System.Runtime.Serialization.EnumMember(Value = "AzureAsyncOperationWaiting")] AzureAsyncOperationWaiting, /// /// The provisioning operation is waiting for resource cache. /// - [EnumMember(Value = "ResourceCacheWaiting")] + [System.Runtime.Serialization.EnumMember(Value = "ResourceCacheWaiting")] ResourceCacheWaiting, /// /// The provisioning operation is action. /// - [EnumMember(Value = "Action")] + [System.Runtime.Serialization.EnumMember(Value = "Action")] Action, /// /// The provisioning operation is read. /// - [EnumMember(Value = "Read")] + [System.Runtime.Serialization.EnumMember(Value = "Read")] Read, /// /// The provisioning operation is evaluate output. /// - [EnumMember(Value = "EvaluateDeploymentOutput")] + [System.Runtime.Serialization.EnumMember(Value = "EvaluateDeploymentOutput")] EvaluateDeploymentOutput, /// - /// The provisioning operation is cleanup. This operation is part of - /// the 'complete' mode deployment. + /// The provisioning operation is cleanup. This operation is part of the + /// 'complete' mode deployment. /// - [EnumMember(Value = "DeploymentCleanup")] + [System.Runtime.Serialization.EnumMember(Value = "DeploymentCleanup")] DeploymentCleanup } internal static class ProvisioningOperationEnumExtension @@ -79,7 +72,6 @@ internal static string ToSerializedValue(this ProvisioningOperation? value) { return value == null ? null : ((ProvisioningOperation)value).ToSerializedValue(); } - internal static string ToSerializedValue(this ProvisioningOperation value) { switch( value ) @@ -107,7 +99,6 @@ internal static string ToSerializedValue(this ProvisioningOperation value) } return null; } - internal static ProvisioningOperation? ParseProvisioningOperation(this string value) { switch( value ) @@ -136,4 +127,4 @@ internal static string ToSerializedValue(this ProvisioningOperation value) return null; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/ProvisioningState.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/ProvisioningState.cs similarity index 90% rename from src/Resources/Resources.Sdk/Generated/Models/ProvisioningState.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/ProvisioningState.cs index 3a889667c981..0be408e24be1 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/ProvisioningState.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/ProvisioningState.cs @@ -1,12 +1,7 @@ -// // 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.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Resources.Models /// /// Defines values for ProvisioningState. /// + + public static class ProvisioningState { public const string NotSpecified = "NotSpecified"; @@ -29,4 +26,4 @@ public static class ProvisioningState public const string Succeeded = "Succeeded"; public const string Updating = "Updating"; } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/ProxyResource.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/ProxyResource.cs similarity index 62% rename from src/Resources/Resources.Sdk/Generated/Models/ProxyResource.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/ProxyResource.cs index 3b65e15c1911..d237e8cbb60f 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/ProxyResource.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/ProxyResource.cs @@ -1,24 +1,16 @@ -// // 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.Models { - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Newtonsoft.Json; using System.Linq; /// /// An Azure proxy resource. /// - public partial class ProxyResource : IResource + public partial class ProxyResource : Microsoft.Rest.Azure.IResource { /// /// Initializes a new instance of the ProxyResource class. @@ -31,14 +23,21 @@ public ProxyResource() /// /// Initializes a new instance of the ProxyResource class. /// - /// Azure resource Id. - /// Azure resource name. - /// Azure resource type. + + /// Azure resource Id. + /// + + /// Azure resource name. + /// + + /// Azure resource type. + /// public ProxyResource(string id = default(string), string name = default(string), string type = default(string)) + { - Id = id; - Name = name; - Type = type; + this.Id = id; + this.Name = name; + this.Type = type; CustomInit(); } @@ -47,23 +46,23 @@ public ProxyResource() /// partial void CustomInit(); + /// /// Gets azure resource Id. /// - [JsonProperty(PropertyName = "id")] - public string Id { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; private set; } /// /// Gets azure resource name. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; private set; } /// /// Gets azure resource type. /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/PublicNetworkAccessOptions.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/PublicNetworkAccessOptions.cs similarity index 84% rename from src/Resources/Resources.Sdk/Generated/Models/PublicNetworkAccessOptions.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/PublicNetworkAccessOptions.cs index c26e7e4bc0f7..ff8269c6ea05 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/PublicNetworkAccessOptions.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/PublicNetworkAccessOptions.cs @@ -1,12 +1,7 @@ -// // 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.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Resources.Models /// /// Defines values for PublicNetworkAccessOptions. /// + + public static class PublicNetworkAccessOptions { public const string Enabled = "Enabled"; public const string Disabled = "Disabled"; } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/RegionCategory.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/RegionCategory.cs similarity index 84% rename from src/Resources/Resources.Sdk/Generated/Models/RegionCategory.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/RegionCategory.cs index 5a89727a4b6c..da7926727844 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/RegionCategory.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/RegionCategory.cs @@ -1,12 +1,7 @@ -// // 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.Models { @@ -14,10 +9,12 @@ namespace Microsoft.Azure.Management.Resources.Models /// /// Defines values for RegionCategory. /// + + public static class RegionCategory { public const string Recommended = "Recommended"; public const string Extended = "Extended"; public const string Other = "Other"; } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/RegionType.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/RegionType.cs similarity index 83% rename from src/Resources/Resources.Sdk/Generated/Models/RegionType.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/RegionType.cs index 5ae824119ae2..c9b5c94ea608 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/RegionType.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/RegionType.cs @@ -1,12 +1,7 @@ -// // 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.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Resources.Models /// /// Defines values for RegionType. /// + + public static class RegionType { public const string Physical = "Physical"; public const string Logical = "Logical"; } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/Resource.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/Resource.cs similarity index 51% rename from src/Resources/Resources.Sdk/Generated/Models/Resource.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/Resource.cs index 2905bf975c1f..9c8b0bf803d7 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/Resource.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/Resource.cs @@ -1,26 +1,16 @@ -// // 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.Models { - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Specified resource. /// - public partial class Resource : IResource + public partial class Resource : Microsoft.Rest.Azure.IResource { /// /// Initializes a new instance of the Resource class. @@ -33,20 +23,33 @@ public Resource() /// /// Initializes a new instance of the Resource class. /// - /// Resource ID - /// Resource name - /// Resource type - /// Resource location - /// Resource extended location. - /// Resource tags - public Resource(string id = default(string), string name = default(string), string type = default(string), string location = default(string), ExtendedLocation extendedLocation = default(ExtendedLocation), IDictionary tags = default(IDictionary)) + + /// Resource ID + /// + + /// Resource name + /// + + /// Resource type + /// + + /// Resource location + /// + + /// Resource extended location. + /// + + /// Resource tags + /// + public Resource(string id = default(string), string name = default(string), string type = default(string), string location = default(string), ExtendedLocation extendedLocation = default(ExtendedLocation), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary)) + { - Id = id; - Name = name; - Type = type; - Location = location; - ExtendedLocation = extendedLocation; - Tags = tags; + this.Id = id; + this.Name = name; + this.Type = type; + this.Location = location; + this.ExtendedLocation = extendedLocation; + this.Tags = tags; CustomInit(); } @@ -55,41 +58,41 @@ public Resource() /// partial void CustomInit(); + /// /// Gets resource ID /// - [JsonProperty(PropertyName = "id")] - public string Id { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; private set; } /// /// Gets resource name /// - [JsonProperty(PropertyName = "name")] - public string Name { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; private set; } /// /// Gets resource type /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } /// /// Gets or sets resource location /// - [JsonProperty(PropertyName = "location")] - public string Location { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + public string Location {get; set; } /// /// Gets or sets resource extended location. /// - [JsonProperty(PropertyName = "extendedLocation")] - public ExtendedLocation ExtendedLocation { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "extendedLocation")] + public ExtendedLocation ExtendedLocation {get; set; } /// /// Gets or sets resource tags /// - [JsonProperty(PropertyName = "tags")] - public IDictionary Tags { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] + public System.Collections.Generic.IDictionary Tags {get; set; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/ResourceGroup.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/ResourceGroup.cs similarity index 50% rename from src/Resources/Resources.Sdk/Generated/Models/ResourceGroup.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/ResourceGroup.cs index b99712836505..2796d6f1d9f5 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/ResourceGroup.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/ResourceGroup.cs @@ -1,26 +1,16 @@ -// // 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.Models { - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Resource group information. /// - public partial class ResourceGroup : IResource + public partial class ResourceGroup : Microsoft.Rest.Azure.IResource { /// /// Initializes a new instance of the ResourceGroup class. @@ -33,25 +23,38 @@ public ResourceGroup() /// /// Initializes a new instance of the ResourceGroup class. /// - /// The location of the resource group. It - /// cannot be changed after the resource group has been created. It - /// must be one of the supported Azure locations. - /// The ID of the resource group. - /// The name of the resource group. - /// The type of the resource group. - /// The resource group properties. - /// The ID of the resource that manages this - /// resource group. - /// The tags attached to the resource group. - public ResourceGroup(string location, string id = default(string), string name = default(string), string type = default(string), ResourceGroupProperties properties = default(ResourceGroupProperties), string managedBy = default(string), IDictionary tags = default(IDictionary)) + + /// The ID of the resource group. + /// + + /// The name of the resource group. + /// + + /// The type of the resource group. + /// + + /// The resource group properties. + /// + + /// The location of the resource group. It cannot be changed after the resource + /// group has been created. It must be one of the supported Azure locations. + /// + + /// The ID of the resource that manages this resource group. + /// + + /// The tags attached to the resource group. + /// + public ResourceGroup(string location, string id = default(string), string name = default(string), string type = default(string), ResourceGroupProperties properties = default(ResourceGroupProperties), string managedBy = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary)) + { - Id = id; - Name = name; - Type = type; - Properties = properties; - Location = location; - ManagedBy = managedBy; - Tags = tags; + this.Id = id; + this.Name = name; + this.Type = type; + this.Properties = properties; + this.Location = location; + this.ManagedBy = managedBy; + this.Tags = tags; CustomInit(); } @@ -60,63 +63,69 @@ public ResourceGroup() /// partial void CustomInit(); + /// /// Gets the ID of the resource group. /// - [JsonProperty(PropertyName = "id")] - public string Id { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; private set; } /// /// Gets the name of the resource group. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; private set; } /// /// Gets the type of the resource group. /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } /// /// Gets or sets the resource group properties. /// - [JsonProperty(PropertyName = "properties")] - public ResourceGroupProperties Properties { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties")] + public ResourceGroupProperties Properties {get; set; } /// - /// Gets or sets the location of the resource group. It cannot be - /// changed after the resource group has been created. It must be one - /// of the supported Azure locations. + /// Gets or sets the location of the resource group. It cannot be changed after + /// the resource group has been created. It must be one of the supported Azure + /// locations. /// - [JsonProperty(PropertyName = "location")] - public string Location { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + public string Location {get; set; } /// - /// Gets or sets the ID of the resource that manages this resource - /// group. + /// Gets or sets the ID of the resource that manages this resource group. /// - [JsonProperty(PropertyName = "managedBy")] - public string ManagedBy { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "managedBy")] + public string ManagedBy {get; set; } /// /// Gets or sets the tags attached to the resource group. /// - [JsonProperty(PropertyName = "tags")] - public IDictionary Tags { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] + public System.Collections.Generic.IDictionary Tags {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Location == null) + if (this.Location == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Location"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Location"); } + + + + + + + } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/ResourceGroupExportResult.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/ResourceGroupExportResult.cs similarity index 72% rename from src/Resources/Resources.Sdk/Generated/Models/ResourceGroupExportResult.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/ResourceGroupExportResult.cs index 9f42c16800a5..1e833da24835 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/ResourceGroupExportResult.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/ResourceGroupExportResult.cs @@ -1,16 +1,10 @@ -// // 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.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,12 +23,17 @@ public ResourceGroupExportResult() /// /// Initializes a new instance of the ResourceGroupExportResult class. /// - /// The template content. - /// The template export error. + + /// The template content. + /// + + /// The template export error. + /// public ResourceGroupExportResult(object template = default(object), ErrorResponse error = default(ErrorResponse)) + { - Template = template; - Error = error; + this.Template = template; + this.Error = error; CustomInit(); } @@ -43,17 +42,17 @@ public ResourceGroupExportResult() /// partial void CustomInit(); + /// /// Gets or sets the template content. /// - [JsonProperty(PropertyName = "template")] - public object Template { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "template")] + public object Template {get; set; } /// /// Gets or sets the template export error. /// - [JsonProperty(PropertyName = "error")] - public ErrorResponse Error { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "error")] + public ErrorResponse Error {get; set; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/ResourceGroupFilter.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/ResourceGroupFilter.cs similarity index 71% rename from src/Resources/Resources.Sdk/Generated/Models/ResourceGroupFilter.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/ResourceGroupFilter.cs index 55c768a704ad..14130ef41f65 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/ResourceGroupFilter.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/ResourceGroupFilter.cs @@ -1,16 +1,10 @@ -// // 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.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,12 +23,17 @@ public ResourceGroupFilter() /// /// Initializes a new instance of the ResourceGroupFilter class. /// - /// The tag name. - /// The tag value. + + /// The tag name. + /// + + /// The tag value. + /// public ResourceGroupFilter(string tagName = default(string), string tagValue = default(string)) + { - TagName = tagName; - TagValue = tagValue; + this.TagName = tagName; + this.TagValue = tagValue; CustomInit(); } @@ -43,17 +42,17 @@ public ResourceGroupFilter() /// partial void CustomInit(); + /// /// Gets or sets the tag name. /// - [JsonProperty(PropertyName = "tagName")] - public string TagName { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "tagName")] + public string TagName {get; set; } /// /// Gets or sets the tag value. /// - [JsonProperty(PropertyName = "tagValue")] - public string TagValue { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "tagValue")] + public string TagValue {get; set; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/ResourceGroupPatchable.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/ResourceGroupPatchable.cs similarity index 62% rename from src/Resources/Resources.Sdk/Generated/Models/ResourceGroupPatchable.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/ResourceGroupPatchable.cs index 403383791071..4f23dd170c79 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/ResourceGroupPatchable.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/ResourceGroupPatchable.cs @@ -1,18 +1,10 @@ -// // 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.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,17 +23,25 @@ public ResourceGroupPatchable() /// /// Initializes a new instance of the ResourceGroupPatchable class. /// - /// The name of the resource group. - /// The resource group properties. - /// The ID of the resource that manages this - /// resource group. - /// The tags attached to the resource group. - public ResourceGroupPatchable(string name = default(string), ResourceGroupProperties properties = default(ResourceGroupProperties), string managedBy = default(string), IDictionary tags = default(IDictionary)) + + /// The name of the resource group. + /// + + /// The resource group properties. + /// + + /// The ID of the resource that manages this resource group. + /// + + /// The tags attached to the resource group. + /// + public ResourceGroupPatchable(string name = default(string), ResourceGroupProperties properties = default(ResourceGroupProperties), string managedBy = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary)) + { - Name = name; - Properties = properties; - ManagedBy = managedBy; - Tags = tags; + this.Name = name; + this.Properties = properties; + this.ManagedBy = managedBy; + this.Tags = tags; CustomInit(); } @@ -50,30 +50,29 @@ public ResourceGroupPatchable() /// partial void CustomInit(); + /// /// Gets or sets the name of the resource group. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// /// Gets or sets the resource group properties. /// - [JsonProperty(PropertyName = "properties")] - public ResourceGroupProperties Properties { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties")] + public ResourceGroupProperties Properties {get; set; } /// - /// Gets or sets the ID of the resource that manages this resource - /// group. + /// Gets or sets the ID of the resource that manages this resource group. /// - [JsonProperty(PropertyName = "managedBy")] - public string ManagedBy { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "managedBy")] + public string ManagedBy {get; set; } /// /// Gets or sets the tags attached to the resource group. /// - [JsonProperty(PropertyName = "tags")] - public IDictionary Tags { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] + public System.Collections.Generic.IDictionary Tags {get; set; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/ResourceGroupProperties.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/ResourceGroupProperties.cs similarity index 79% rename from src/Resources/Resources.Sdk/Generated/Models/ResourceGroupProperties.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/ResourceGroupProperties.cs index e621acb230ae..8218c00946ef 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/ResourceGroupProperties.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/ResourceGroupProperties.cs @@ -1,16 +1,10 @@ -// // 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.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,10 +23,13 @@ public ResourceGroupProperties() /// /// Initializes a new instance of the ResourceGroupProperties class. /// - /// The provisioning state. + + /// The provisioning state. + /// public ResourceGroupProperties(string provisioningState = default(string)) + { - ProvisioningState = provisioningState; + this.ProvisioningState = provisioningState; CustomInit(); } @@ -41,11 +38,11 @@ public ResourceGroupProperties() /// partial void CustomInit(); + /// /// Gets the provisioning state. /// - [JsonProperty(PropertyName = "provisioningState")] - public string ProvisioningState { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/ResourceIdentityType.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/ResourceIdentityType.cs similarity index 80% rename from src/Resources/Resources.Sdk/Generated/Models/ResourceIdentityType.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/ResourceIdentityType.cs index 6f1e79cc9860..c59df0e0a8ed 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/ResourceIdentityType.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/ResourceIdentityType.cs @@ -1,33 +1,26 @@ -// // 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.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; /// /// Defines values for ResourceIdentityType. /// - [JsonConverter(typeof(StringEnumConverter))] + + + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] public enum ResourceIdentityType { - [EnumMember(Value = "SystemAssigned")] + [System.Runtime.Serialization.EnumMember(Value = "SystemAssigned")] SystemAssigned, - [EnumMember(Value = "UserAssigned")] + [System.Runtime.Serialization.EnumMember(Value = "UserAssigned")] UserAssigned, - [EnumMember(Value = "SystemAssigned, UserAssigned")] + [System.Runtime.Serialization.EnumMember(Value = "SystemAssigned, UserAssigned")] SystemAssignedUserAssigned, - [EnumMember(Value = "None")] + [System.Runtime.Serialization.EnumMember(Value = "None")] None } internal static class ResourceIdentityTypeEnumExtension @@ -36,7 +29,6 @@ internal static string ToSerializedValue(this ResourceIdentityType? value) { return value == null ? null : ((ResourceIdentityType)value).ToSerializedValue(); } - internal static string ToSerializedValue(this ResourceIdentityType value) { switch( value ) @@ -52,7 +44,6 @@ internal static string ToSerializedValue(this ResourceIdentityType value) } return null; } - internal static ResourceIdentityType? ParseResourceIdentityType(this string value) { switch( value ) @@ -69,4 +60,4 @@ internal static string ToSerializedValue(this ResourceIdentityType value) return null; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/ResourceManagementPrivateLink.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/ResourceManagementPrivateLink.cs similarity index 56% rename from src/Resources/Resources.Sdk/Generated/Models/ResourceManagementPrivateLink.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/ResourceManagementPrivateLink.cs index f5a3d3a1af55..1575b0544628 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/ResourceManagementPrivateLink.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/ResourceManagementPrivateLink.cs @@ -1,25 +1,16 @@ -// // 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.Models { - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Newtonsoft.Json; using System.Linq; - public partial class ResourceManagementPrivateLink : IResource + public partial class ResourceManagementPrivateLink : Microsoft.Rest.Azure.IResource { /// - /// Initializes a new instance of the ResourceManagementPrivateLink - /// class. + /// Initializes a new instance of the ResourceManagementPrivateLink class. /// public ResourceManagementPrivateLink() { @@ -27,20 +18,31 @@ public ResourceManagementPrivateLink() } /// - /// Initializes a new instance of the ResourceManagementPrivateLink - /// class. + /// Initializes a new instance of the ResourceManagementPrivateLink class. /// - /// The rmplResourceID. - /// The rmpl Name. - /// The operation type. - /// the region of the rmpl + + /// + /// + + /// The rmplResourceID. + /// + + /// The rmpl Name. + /// + + /// The operation type. + /// + + /// the region of the rmpl + /// public ResourceManagementPrivateLink(ResourceManagementPrivateLinkEndpointConnections properties = default(ResourceManagementPrivateLinkEndpointConnections), string id = default(string), string name = default(string), string type = default(string), string location = default(string)) + { - Properties = properties; - Id = id; - Name = name; - Type = type; - Location = location; + this.Properties = properties; + this.Id = id; + this.Name = name; + this.Type = type; + this.Location = location; CustomInit(); } @@ -49,34 +51,35 @@ public ResourceManagementPrivateLink() /// partial void CustomInit(); + /// + /// Gets or sets /// - [JsonProperty(PropertyName = "properties")] - public ResourceManagementPrivateLinkEndpointConnections Properties { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties")] + public ResourceManagementPrivateLinkEndpointConnections Properties {get; set; } /// /// Gets the rmplResourceID. /// - [JsonProperty(PropertyName = "id")] - public string Id { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; private set; } /// /// Gets the rmpl Name. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; private set; } /// /// Gets the operation type. /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } /// /// Gets or sets the region of the rmpl /// - [JsonProperty(PropertyName = "location")] - public string Location { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + public string Location {get; set; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/ResourceManagementPrivateLinkEndpointConnections.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/ResourceManagementPrivateLinkEndpointConnections.cs similarity index 58% rename from src/Resources/Resources.Sdk/Generated/Models/ResourceManagementPrivateLinkEndpointConnections.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/ResourceManagementPrivateLinkEndpointConnections.cs index 35334fd4d04a..8fddbabc1e38 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/ResourceManagementPrivateLinkEndpointConnections.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/ResourceManagementPrivateLinkEndpointConnections.cs @@ -1,25 +1,16 @@ -// // 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.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; public partial class ResourceManagementPrivateLinkEndpointConnections { /// - /// Initializes a new instance of the - /// ResourceManagementPrivateLinkEndpointConnections class. + /// Initializes a new instance of the ResourceManagementPrivateLinkEndpointConnections class. /// public ResourceManagementPrivateLinkEndpointConnections() { @@ -27,14 +18,15 @@ public ResourceManagementPrivateLinkEndpointConnections() } /// - /// Initializes a new instance of the - /// ResourceManagementPrivateLinkEndpointConnections class. + /// Initializes a new instance of the ResourceManagementPrivateLinkEndpointConnections class. /// - /// The private endpoint - /// connections. - public ResourceManagementPrivateLinkEndpointConnections(IList privateEndpointConnections = default(IList)) + + /// The private endpoint connections. + /// + public ResourceManagementPrivateLinkEndpointConnections(System.Collections.Generic.IList privateEndpointConnections = default(System.Collections.Generic.IList)) + { - PrivateEndpointConnections = privateEndpointConnections; + this.PrivateEndpointConnections = privateEndpointConnections; CustomInit(); } @@ -43,11 +35,11 @@ public ResourceManagementPrivateLinkEndpointConnections() /// partial void CustomInit(); + /// /// Gets or sets the private endpoint connections. /// - [JsonProperty(PropertyName = "privateEndpointConnections")] - public IList PrivateEndpointConnections { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "privateEndpointConnections")] + public System.Collections.Generic.IList PrivateEndpointConnections {get; set; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/ResourceManagementPrivateLinkListResult.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/ResourceManagementPrivateLinkListResult.cs similarity index 57% rename from src/Resources/Resources.Sdk/Generated/Models/ResourceManagementPrivateLinkListResult.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/ResourceManagementPrivateLinkListResult.cs index f72c407034de..01d011b48eba 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/ResourceManagementPrivateLinkListResult.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/ResourceManagementPrivateLinkListResult.cs @@ -1,25 +1,16 @@ -// // 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.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; public partial class ResourceManagementPrivateLinkListResult { /// - /// Initializes a new instance of the - /// ResourceManagementPrivateLinkListResult class. + /// Initializes a new instance of the ResourceManagementPrivateLinkListResult class. /// public ResourceManagementPrivateLinkListResult() { @@ -27,14 +18,15 @@ public ResourceManagementPrivateLinkListResult() } /// - /// Initializes a new instance of the - /// ResourceManagementPrivateLinkListResult class. + /// Initializes a new instance of the ResourceManagementPrivateLinkListResult class. /// - /// An array of resource management private - /// links. - public ResourceManagementPrivateLinkListResult(IList value = default(IList)) + + /// An array of resource management private links. + /// + public ResourceManagementPrivateLinkListResult(System.Collections.Generic.IList value = default(System.Collections.Generic.IList)) + { - Value = value; + this.Value = value; CustomInit(); } @@ -43,11 +35,11 @@ public ResourceManagementPrivateLinkListResult() /// partial void CustomInit(); + /// /// Gets or sets an array of resource management private links. /// - [JsonProperty(PropertyName = "value")] - public IList Value { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "value")] + public System.Collections.Generic.IList Value {get; set; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/ResourceManagementPrivateLinkLocation.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/ResourceManagementPrivateLinkLocation.cs similarity index 68% rename from src/Resources/Resources.Sdk/Generated/Models/ResourceManagementPrivateLinkLocation.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/ResourceManagementPrivateLinkLocation.cs index 2d504557cbca..3fad5ac6ebc8 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/ResourceManagementPrivateLinkLocation.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/ResourceManagementPrivateLinkLocation.cs @@ -1,23 +1,16 @@ -// // 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.Models { - using Newtonsoft.Json; using System.Linq; public partial class ResourceManagementPrivateLinkLocation { /// - /// Initializes a new instance of the - /// ResourceManagementPrivateLinkLocation class. + /// Initializes a new instance of the ResourceManagementPrivateLinkLocation class. /// public ResourceManagementPrivateLinkLocation() { @@ -25,14 +18,15 @@ public ResourceManagementPrivateLinkLocation() } /// - /// Initializes a new instance of the - /// ResourceManagementPrivateLinkLocation class. + /// Initializes a new instance of the ResourceManagementPrivateLinkLocation class. /// - /// the region to create private link - /// association. + + /// the region to create private link association. + /// public ResourceManagementPrivateLinkLocation(string location = default(string)) + { - Location = location; + this.Location = location; CustomInit(); } @@ -41,11 +35,11 @@ public ResourceManagementPrivateLinkLocation() /// partial void CustomInit(); + /// /// Gets or sets the region to create private link association. /// - [JsonProperty(PropertyName = "location")] - public string Location { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + public string Location {get; set; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/ResourceName.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/ResourceName.cs similarity index 63% rename from src/Resources/Resources.Sdk/Generated/Models/ResourceName.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/ResourceName.cs index f15694ce573b..4d875d07690f 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/ResourceName.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/ResourceName.cs @@ -1,17 +1,10 @@ -// // 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.Models { - using Microsoft.Rest; - using Newtonsoft.Json; using System.Linq; /// @@ -30,12 +23,17 @@ public ResourceName() /// /// Initializes a new instance of the ResourceName class. /// - /// Name of the resource - /// The type of the resource + + /// Name of the resource + /// + + /// The type of the resource + /// public ResourceName(string name, string type) + { - Name = name; - Type = type; + this.Name = name; + this.Type = type; CustomInit(); } @@ -44,34 +42,36 @@ public ResourceName(string name, string type) /// partial void CustomInit(); + /// /// Gets or sets name of the resource /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// /// Gets or sets the type of the resource /// - [JsonProperty(PropertyName = "type")] - public string Type { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Name == null) + if (this.Name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Name"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Name"); } - if (Type == null) + if (this.Type == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Type"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Type"); } + + } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/ResourceNameStatus.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/ResourceNameStatus.cs similarity index 83% rename from src/Resources/Resources.Sdk/Generated/Models/ResourceNameStatus.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/ResourceNameStatus.cs index 39b9ba4281e5..2d1210cd86ae 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/ResourceNameStatus.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/ResourceNameStatus.cs @@ -1,12 +1,7 @@ -// // 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.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Resources.Models /// /// Defines values for ResourceNameStatus. /// + + public static class ResourceNameStatus { public const string Allowed = "Allowed"; public const string Reserved = "Reserved"; } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/ResourceProviderOperationDisplayProperties.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/ResourceProviderOperationDisplayProperties.cs similarity index 53% rename from src/Resources/Resources.Sdk/Generated/Models/ResourceProviderOperationDisplayProperties.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/ResourceProviderOperationDisplayProperties.cs index 3676dc4111f6..40b939025650 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/ResourceProviderOperationDisplayProperties.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/ResourceProviderOperationDisplayProperties.cs @@ -1,26 +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.Models { - using Newtonsoft.Json; using System.Linq; /// - /// Resource provider operation's display properties. + /// Resource provider operation's display properties. /// public partial class ResourceProviderOperationDisplayProperties { /// - /// Initializes a new instance of the - /// ResourceProviderOperationDisplayProperties class. + /// Initializes a new instance of the ResourceProviderOperationDisplayProperties class. /// public ResourceProviderOperationDisplayProperties() { @@ -28,21 +21,31 @@ public ResourceProviderOperationDisplayProperties() } /// - /// Initializes a new instance of the - /// ResourceProviderOperationDisplayProperties class. + /// Initializes a new instance of the ResourceProviderOperationDisplayProperties class. /// - /// Operation description. - /// Operation provider. - /// Operation resource. - /// Resource provider operation. - /// Operation description. + + /// Operation description. + /// + + /// Operation provider. + /// + + /// Operation resource. + /// + + /// Resource provider operation. + /// + + /// Operation description. + /// public ResourceProviderOperationDisplayProperties(string publisher = default(string), string provider = default(string), string resource = default(string), string operation = default(string), string description = default(string)) + { - Publisher = publisher; - Provider = provider; - Resource = resource; - Operation = operation; - Description = description; + this.Publisher = publisher; + this.Provider = provider; + this.Resource = resource; + this.Operation = operation; + this.Description = description; CustomInit(); } @@ -51,35 +54,35 @@ public ResourceProviderOperationDisplayProperties() /// partial void CustomInit(); + /// /// Gets or sets operation description. /// - [JsonProperty(PropertyName = "publisher")] - public string Publisher { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "publisher")] + public string Publisher {get; set; } /// /// Gets or sets operation provider. /// - [JsonProperty(PropertyName = "provider")] - public string Provider { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "provider")] + public string Provider {get; set; } /// /// Gets or sets operation resource. /// - [JsonProperty(PropertyName = "resource")] - public string Resource { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "resource")] + public string Resource {get; set; } /// /// Gets or sets resource provider operation. /// - [JsonProperty(PropertyName = "operation")] - public string Operation { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "operation")] + public string Operation {get; set; } /// /// Gets or sets operation description. /// - [JsonProperty(PropertyName = "description")] - public string Description { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "description")] + public string Description {get; set; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/ResourceReference.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/ResourceReference.cs similarity index 80% rename from src/Resources/Resources.Sdk/Generated/Models/ResourceReference.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/ResourceReference.cs index eea5593977c1..384d944bf91e 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/ResourceReference.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/ResourceReference.cs @@ -1,16 +1,10 @@ -// // 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.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,11 +23,13 @@ public ResourceReference() /// /// Initializes a new instance of the ResourceReference class. /// - /// The resourceId of a resource managed by the - /// deployment stack. + + /// The resourceId of a resource managed by the deployment stack. + /// public ResourceReference(string id = default(string)) + { - Id = id; + this.Id = id; CustomInit(); } @@ -42,11 +38,11 @@ public ResourceReference() /// partial void CustomInit(); + /// /// Gets the resourceId of a resource managed by the deployment stack. /// - [JsonProperty(PropertyName = "id")] - public string Id { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/ResourceReferenceExtended.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/ResourceReferenceExtended.cs similarity index 62% rename from src/Resources/Resources.Sdk/Generated/Models/ResourceReferenceExtended.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/ResourceReferenceExtended.cs index 84542017664f..ec38694df11f 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/ResourceReferenceExtended.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/ResourceReferenceExtended.cs @@ -1,16 +1,10 @@ -// // 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.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,12 +23,19 @@ public ResourceReferenceExtended() /// /// Initializes a new instance of the ResourceReferenceExtended class. /// - /// The resourceId of a resource managed by the - /// deployment stack. + + /// The resourceId of a resource managed by the deployment stack. + /// + + /// Common error response for all Azure Resource Manager APIs to return error + /// details for failed operations. (This also follows the OData error response + /// format.). + /// public ResourceReferenceExtended(string id = default(string), ErrorResponse error = default(ErrorResponse)) + { - Id = id; - Error = error; + this.Id = id; + this.Error = error; CustomInit(); } @@ -43,16 +44,19 @@ public ResourceReferenceExtended() /// partial void CustomInit(); + /// /// Gets the resourceId of a resource managed by the deployment stack. /// - [JsonProperty(PropertyName = "id")] - public string Id { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; private set; } /// + /// Gets or sets common error response for all Azure Resource Manager APIs to + /// return error details for failed operations. (This also follows the OData + /// error response format.). /// - [JsonProperty(PropertyName = "error")] - public ErrorResponse Error { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "error")] + public ErrorResponse Error {get; set; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/ResourceStatusMode.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/ResourceStatusMode.cs similarity index 84% rename from src/Resources/Resources.Sdk/Generated/Models/ResourceStatusMode.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/ResourceStatusMode.cs index 30684b16d74d..a8138b4490d1 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/ResourceStatusMode.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/ResourceStatusMode.cs @@ -1,12 +1,7 @@ -// // 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.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Resources.Models /// /// Defines values for ResourceStatusMode. /// + + public static class ResourceStatusMode { /// @@ -25,8 +22,8 @@ public static class ResourceStatusMode /// public const string RemoveDenyFailed = "removeDenyFailed"; /// - /// Unable to delete the resource from Azure. The delete will be - /// retried on the next stack deployment, or can be deleted manually. + /// Unable to delete the resource from Azure. The delete will be retried on the + /// next stack deployment, or can be deleted manually. /// public const string DeleteFailed = "deleteFailed"; /// @@ -34,4 +31,4 @@ public static class ResourceStatusMode /// public const string None = "None"; } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/ResourcesMoveInfo.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/ResourcesMoveInfo.cs similarity index 62% rename from src/Resources/Resources.Sdk/Generated/Models/ResourcesMoveInfo.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/ResourcesMoveInfo.cs index 0c095c68891d..ac305a6b5e9f 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/ResourcesMoveInfo.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/ResourcesMoveInfo.cs @@ -1,18 +1,10 @@ -// // 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.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,13 +23,17 @@ public ResourcesMoveInfo() /// /// Initializes a new instance of the ResourcesMoveInfo class. /// - /// The IDs of the resources. - /// The target resource - /// group. - public ResourcesMoveInfo(IList resources = default(IList), string targetResourceGroup = default(string)) + + /// The IDs of the resources. + /// + + /// The target resource group. + /// + public ResourcesMoveInfo(System.Collections.Generic.IList resources = default(System.Collections.Generic.IList), string targetResourceGroup = default(string)) + { - Resources = resources; - TargetResourceGroup = targetResourceGroup; + this.Resources = resources; + this.TargetResourceGroup = targetResourceGroup; CustomInit(); } @@ -46,17 +42,17 @@ public ResourcesMoveInfo() /// partial void CustomInit(); + /// /// Gets or sets the IDs of the resources. /// - [JsonProperty(PropertyName = "resources")] - public IList Resources { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "resources")] + public System.Collections.Generic.IList Resources {get; set; } /// /// Gets or sets the target resource group. /// - [JsonProperty(PropertyName = "targetResourceGroup")] - public string TargetResourceGroup { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "targetResourceGroup")] + public string TargetResourceGroup {get; set; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/RoleDefinition.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/RoleDefinition.cs similarity index 58% rename from src/Resources/Resources.Sdk/Generated/Models/RoleDefinition.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/RoleDefinition.cs index 288eecc8f2dc..ceb08dffda70 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/RoleDefinition.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/RoleDefinition.cs @@ -1,18 +1,10 @@ -// // 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.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,18 +23,29 @@ public RoleDefinition() /// /// Initializes a new instance of the RoleDefinition class. /// - /// The role definition ID. - /// The role definition name. - /// If this is a service role. - /// Role definition permissions. - /// Role definition assignable scopes. - public RoleDefinition(string id = default(string), string name = default(string), bool? isServiceRole = default(bool?), IList permissions = default(IList), IList scopes = default(IList)) + + /// The role definition ID. + /// + + /// The role definition name. + /// + + /// If this is a service role. + /// + + /// Role definition permissions. + /// + + /// Role definition assignable scopes. + /// + public RoleDefinition(string id = default(string), string name = default(string), bool? isServiceRole = default(bool?), System.Collections.Generic.IList permissions = default(System.Collections.Generic.IList), System.Collections.Generic.IList scopes = default(System.Collections.Generic.IList)) + { - Id = id; - Name = name; - IsServiceRole = isServiceRole; - Permissions = permissions; - Scopes = scopes; + this.Id = id; + this.Name = name; + this.IsServiceRole = isServiceRole; + this.Permissions = permissions; + this.Scopes = scopes; CustomInit(); } @@ -51,35 +54,35 @@ public RoleDefinition() /// partial void CustomInit(); + /// /// Gets or sets the role definition ID. /// - [JsonProperty(PropertyName = "id")] - public string Id { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; set; } /// /// Gets or sets the role definition name. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// /// Gets or sets if this is a service role. /// - [JsonProperty(PropertyName = "isServiceRole")] - public bool? IsServiceRole { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "isServiceRole")] + public bool? IsServiceRole {get; set; } /// /// Gets or sets role definition permissions. /// - [JsonProperty(PropertyName = "permissions")] - public IList Permissions { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "permissions")] + public System.Collections.Generic.IList Permissions {get; set; } /// /// Gets or sets role definition assignable scopes. /// - [JsonProperty(PropertyName = "scopes")] - public IList Scopes { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "scopes")] + public System.Collections.Generic.IList Scopes {get; set; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/ScopedDeployment.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/ScopedDeployment.cs similarity index 55% rename from src/Resources/Resources.Sdk/Generated/Models/ScopedDeployment.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/ScopedDeployment.cs index 85c4c3df1ed4..3e2c747acf4a 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/ScopedDeployment.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/ScopedDeployment.cs @@ -1,19 +1,10 @@ -// // 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.Models { - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -32,15 +23,21 @@ public ScopedDeployment() /// /// Initializes a new instance of the ScopedDeployment class. /// - /// The location to store the deployment - /// data. - /// The deployment properties. - /// Deployment tags - public ScopedDeployment(string location, DeploymentProperties properties, IDictionary tags = default(IDictionary)) + + /// The location to store the deployment data. + /// + + /// The deployment properties. + /// + + /// Deployment tags + /// + public ScopedDeployment(string location, DeploymentProperties properties, System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary)) + { - Location = location; - Properties = properties; - Tags = tags; + this.Location = location; + this.Properties = properties; + this.Tags = tags; CustomInit(); } @@ -49,44 +46,46 @@ public ScopedDeployment() /// partial void CustomInit(); + /// /// Gets or sets the location to store the deployment data. /// - [JsonProperty(PropertyName = "location")] - public string Location { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + public string Location {get; set; } /// /// Gets or sets the deployment properties. /// - [JsonProperty(PropertyName = "properties")] - public DeploymentProperties Properties { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties")] + public DeploymentProperties Properties {get; set; } /// /// Gets or sets deployment tags /// - [JsonProperty(PropertyName = "tags")] - public IDictionary Tags { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] + public System.Collections.Generic.IDictionary Tags {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Location == null) + if (this.Location == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Location"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Location"); } - if (Properties == null) + if (this.Properties == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Properties"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Properties"); } - if (Properties != null) + + if (this.Properties != null) { - Properties.Validate(); + this.Properties.Validate(); } + } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/ScopedDeploymentWhatIf.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/ScopedDeploymentWhatIf.cs similarity index 63% rename from src/Resources/Resources.Sdk/Generated/Models/ScopedDeploymentWhatIf.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/ScopedDeploymentWhatIf.cs index 07462fdb5014..5e393396a189 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/ScopedDeploymentWhatIf.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/ScopedDeploymentWhatIf.cs @@ -1,17 +1,10 @@ -// // 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.Models { - using Microsoft.Rest; - using Newtonsoft.Json; using System.Linq; /// @@ -30,13 +23,17 @@ public ScopedDeploymentWhatIf() /// /// Initializes a new instance of the ScopedDeploymentWhatIf class. /// - /// The location to store the deployment - /// data. - /// The deployment properties. + + /// The location to store the deployment data. + /// + + /// The deployment properties. + /// public ScopedDeploymentWhatIf(string location, DeploymentWhatIfProperties properties) + { - Location = location; - Properties = properties; + this.Location = location; + this.Properties = properties; CustomInit(); } @@ -45,38 +42,39 @@ public ScopedDeploymentWhatIf(string location, DeploymentWhatIfProperties proper /// partial void CustomInit(); + /// /// Gets or sets the location to store the deployment data. /// - [JsonProperty(PropertyName = "location")] - public string Location { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + public string Location {get; set; } /// /// Gets or sets the deployment properties. /// - [JsonProperty(PropertyName = "properties")] - public DeploymentWhatIfProperties Properties { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties")] + public DeploymentWhatIfProperties Properties {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Location == null) + if (this.Location == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Location"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Location"); } - if (Properties == null) + if (this.Properties == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Properties"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Properties"); } - if (Properties != null) + + if (this.Properties != null) { - Properties.Validate(); + this.Properties.Validate(); } } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/ScriptLog.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/ScriptLog.cs similarity index 70% rename from src/Resources/Resources.Sdk/Generated/Models/ScriptLog.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/ScriptLog.cs index 764fc8b8e63d..c7167306f04e 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/ScriptLog.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/ScriptLog.cs @@ -1,24 +1,16 @@ -// // 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.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; using System.Linq; /// /// Script execution log object. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class ScriptLog : AzureResourceBase { /// @@ -32,15 +24,23 @@ public ScriptLog() /// /// Initializes a new instance of the ScriptLog class. /// - /// String Id used to locate any resource on - /// Azure. - /// Name of this resource. - /// Type of this resource. - /// Script execution logs in text format. + + /// String Id used to locate any resource on Azure. + /// + + /// Name of this resource. + /// + + /// Type of this resource. + /// + + /// Script execution logs in text format. + /// public ScriptLog(string id = default(string), string name = default(string), string type = default(string), string log = default(string)) - : base(id, name, type) + + : base(id, name, type) { - Log = log; + this.Log = log; CustomInit(); } @@ -49,11 +49,11 @@ public ScriptLog() /// partial void CustomInit(); + /// /// Gets script execution logs in text format. /// - [JsonProperty(PropertyName = "properties.log")] - public string Log { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.log")] + public string Log {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/ScriptLogsList.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/ScriptLogsList.cs similarity index 69% rename from src/Resources/Resources.Sdk/Generated/Models/ScriptLogsList.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/ScriptLogsList.cs index 0626cbdca3b7..a29a1fe45b02 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/ScriptLogsList.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/ScriptLogsList.cs @@ -1,18 +1,10 @@ -// // 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.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,10 +23,13 @@ public ScriptLogsList() /// /// Initializes a new instance of the ScriptLogsList class. /// - /// Deployment scripts logs. - public ScriptLogsList(IList value = default(IList)) + + /// Deployment scripts logs. + /// + public ScriptLogsList(System.Collections.Generic.IList value = default(System.Collections.Generic.IList)) + { - Value = value; + this.Value = value; CustomInit(); } @@ -43,11 +38,11 @@ public ScriptLogsList() /// partial void CustomInit(); + /// /// Gets or sets deployment scripts logs. /// - [JsonProperty(PropertyName = "value")] - public IList Value { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "value")] + public System.Collections.Generic.IList Value {get; set; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/ScriptProvisioningState.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/ScriptProvisioningState.cs similarity index 88% rename from src/Resources/Resources.Sdk/Generated/Models/ScriptProvisioningState.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/ScriptProvisioningState.cs index a95bb8b2af1a..450ce3219b5d 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/ScriptProvisioningState.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/ScriptProvisioningState.cs @@ -1,12 +1,7 @@ -// // 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.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Resources.Models /// /// Defines values for ScriptProvisioningState. /// + + public static class ScriptProvisioningState { public const string Creating = "Creating"; @@ -23,4 +20,4 @@ public static class ScriptProvisioningState public const string Failed = "Failed"; public const string Canceled = "Canceled"; } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/ScriptStatus.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/ScriptStatus.cs similarity index 61% rename from src/Resources/Resources.Sdk/Generated/Models/ScriptStatus.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/ScriptStatus.cs index a865808ec11a..17a03e7555c2 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/ScriptStatus.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/ScriptStatus.cs @@ -1,16 +1,10 @@ -// // 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.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,22 +23,33 @@ public ScriptStatus() /// /// Initializes a new instance of the ScriptStatus class. /// - /// ACI resource Id. - /// Storage account resource Id. - /// Start time of the script execution. - /// End time of the script execution. - /// Time the deployment script resource - /// will expire. - /// Error that is relayed from the script - /// execution. + + /// ACI resource Id. + /// + + /// Storage account resource Id. + /// + + /// Start time of the script execution. + /// + + /// End time of the script execution. + /// + + /// Time the deployment script resource will expire. + /// + + /// Error that is relayed from the script execution. + /// public ScriptStatus(string containerInstanceId = default(string), string storageAccountId = default(string), System.DateTime? startTime = default(System.DateTime?), System.DateTime? endTime = default(System.DateTime?), System.DateTime? expirationTime = default(System.DateTime?), ErrorResponse error = default(ErrorResponse)) + { - ContainerInstanceId = containerInstanceId; - StorageAccountId = storageAccountId; - StartTime = startTime; - EndTime = endTime; - ExpirationTime = expirationTime; - Error = error; + this.ContainerInstanceId = containerInstanceId; + this.StorageAccountId = storageAccountId; + this.StartTime = startTime; + this.EndTime = endTime; + this.ExpirationTime = expirationTime; + this.Error = error; CustomInit(); } @@ -53,41 +58,41 @@ public ScriptStatus() /// partial void CustomInit(); + /// - /// Gets ACI resource Id. + /// Gets aCI resource Id. /// - [JsonProperty(PropertyName = "containerInstanceId")] - public string ContainerInstanceId { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "containerInstanceId")] + public string ContainerInstanceId {get; private set; } /// /// Gets storage account resource Id. /// - [JsonProperty(PropertyName = "storageAccountId")] - public string StorageAccountId { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "storageAccountId")] + public string StorageAccountId {get; private set; } /// /// Gets start time of the script execution. /// - [JsonProperty(PropertyName = "startTime")] - public System.DateTime? StartTime { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "startTime")] + public System.DateTime? StartTime {get; private set; } /// /// Gets end time of the script execution. /// - [JsonProperty(PropertyName = "endTime")] - public System.DateTime? EndTime { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "endTime")] + public System.DateTime? EndTime {get; private set; } /// /// Gets time the deployment script resource will expire. /// - [JsonProperty(PropertyName = "expirationTime")] - public System.DateTime? ExpirationTime { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "expirationTime")] + public System.DateTime? ExpirationTime {get; private set; } /// /// Gets or sets error that is relayed from the script execution. /// - [JsonProperty(PropertyName = "error")] - public ErrorResponse Error { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "error")] + public ErrorResponse Error {get; set; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Management.Sdk/Generated/Models/ScriptType.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/ScriptType.cs new file mode 100644 index 000000000000..555c8366cbdf --- /dev/null +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/ScriptType.cs @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Resources.Models +{ + + /// + /// Defines values for ScriptType. + /// + + + public static class ScriptType + { + public const string AzurePowerShell = "AzurePowerShell"; + public const string AzureCLI = "AzureCLI"; + } +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/Sku.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/Sku.cs similarity index 56% rename from src/Resources/Resources.Sdk/Generated/Models/Sku.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/Sku.cs index eb2190ab218b..b8ccbef0a42f 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/Sku.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/Sku.cs @@ -1,16 +1,10 @@ -// // 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.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,20 +23,33 @@ public Sku() /// /// Initializes a new instance of the Sku class. /// - /// The SKU name. - /// The SKU tier. - /// The SKU size. - /// The SKU family. - /// The SKU model. - /// The SKU capacity. + + /// The SKU name. + /// + + /// The SKU tier. + /// + + /// The SKU size. + /// + + /// The SKU family. + /// + + /// The SKU model. + /// + + /// The SKU capacity. + /// public Sku(string name = default(string), string tier = default(string), string size = default(string), string family = default(string), string model = default(string), int? capacity = default(int?)) + { - Name = name; - Tier = tier; - Size = size; - Family = family; - Model = model; - Capacity = capacity; + this.Name = name; + this.Tier = tier; + this.Size = size; + this.Family = family; + this.Model = model; + this.Capacity = capacity; CustomInit(); } @@ -51,41 +58,41 @@ public Sku() /// partial void CustomInit(); + /// /// Gets or sets the SKU name. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// /// Gets or sets the SKU tier. /// - [JsonProperty(PropertyName = "tier")] - public string Tier { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "tier")] + public string Tier {get; set; } /// /// Gets or sets the SKU size. /// - [JsonProperty(PropertyName = "size")] - public string Size { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "size")] + public string Size {get; set; } /// /// Gets or sets the SKU family. /// - [JsonProperty(PropertyName = "family")] - public string Family { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "family")] + public string Family {get; set; } /// /// Gets or sets the SKU model. /// - [JsonProperty(PropertyName = "model")] - public string Model { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "model")] + public string Model {get; set; } /// /// Gets or sets the SKU capacity. /// - [JsonProperty(PropertyName = "capacity")] - public int? Capacity { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "capacity")] + public int? Capacity {get; set; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/spendingLimit.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/SpendingLimit.cs similarity index 79% rename from src/Resources/Resources.Sdk/Generated/Models/spendingLimit.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/SpendingLimit.cs index 63832fad471f..871d4cb65981 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/spendingLimit.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/SpendingLimit.cs @@ -1,31 +1,24 @@ -// // 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.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; /// /// Defines values for SpendingLimit. /// - [JsonConverter(typeof(StringEnumConverter))] + + + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] public enum SpendingLimit { - [EnumMember(Value = "On")] + [System.Runtime.Serialization.EnumMember(Value = "On")] On, - [EnumMember(Value = "Off")] + [System.Runtime.Serialization.EnumMember(Value = "Off")] Off, - [EnumMember(Value = "CurrentPeriodOff")] + [System.Runtime.Serialization.EnumMember(Value = "CurrentPeriodOff")] CurrentPeriodOff } internal static class SpendingLimitEnumExtension @@ -34,7 +27,6 @@ internal static string ToSerializedValue(this SpendingLimit? value) { return value == null ? null : ((SpendingLimit)value).ToSerializedValue(); } - internal static string ToSerializedValue(this SpendingLimit value) { switch( value ) @@ -48,7 +40,6 @@ internal static string ToSerializedValue(this SpendingLimit value) } return null; } - internal static SpendingLimit? ParseSpendingLimit(this string value) { switch( value ) @@ -63,4 +54,4 @@ internal static string ToSerializedValue(this SpendingLimit value) return null; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/StatusMessage.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/StatusMessage.cs similarity index 78% rename from src/Resources/Resources.Sdk/Generated/Models/StatusMessage.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/StatusMessage.cs index ade05a8230a5..1acf501237c5 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/StatusMessage.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/StatusMessage.cs @@ -1,16 +1,10 @@ -// // 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.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,12 +23,17 @@ public StatusMessage() /// /// Initializes a new instance of the StatusMessage class. /// - /// Status of the deployment operation. - /// The error reported by the operation. + + /// Status of the deployment operation. + /// + + /// The error reported by the operation. + /// public StatusMessage(string status = default(string), ErrorResponse error = default(ErrorResponse)) + { - Status = status; - Error = error; + this.Status = status; + this.Error = error; CustomInit(); } @@ -43,17 +42,17 @@ public StatusMessage() /// partial void CustomInit(); + /// /// Gets or sets status of the deployment operation. /// - [JsonProperty(PropertyName = "status")] - public string Status { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "status")] + public string Status {get; set; } /// /// Gets or sets the error reported by the operation. /// - [JsonProperty(PropertyName = "error")] - public ErrorResponse Error { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "error")] + public ErrorResponse Error {get; set; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/StorageAccountConfiguration.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/StorageAccountConfiguration.cs similarity index 70% rename from src/Resources/Resources.Sdk/Generated/Models/StorageAccountConfiguration.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/StorageAccountConfiguration.cs index 0a24bf927f1c..573f7f21cbcf 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/StorageAccountConfiguration.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/StorageAccountConfiguration.cs @@ -1,27 +1,20 @@ -// // 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.Models { - using Newtonsoft.Json; using System.Linq; /// - /// Settings to use an existing storage account. Valid storage account - /// kinds are: Storage, StorageV2 and FileStorage + /// Settings to use an existing storage account. Valid storage account kinds + /// are: Storage, StorageV2 and FileStorage /// public partial class StorageAccountConfiguration { /// - /// Initializes a new instance of the StorageAccountConfiguration - /// class. + /// Initializes a new instance of the StorageAccountConfiguration class. /// public StorageAccountConfiguration() { @@ -29,16 +22,19 @@ public StorageAccountConfiguration() } /// - /// Initializes a new instance of the StorageAccountConfiguration - /// class. + /// Initializes a new instance of the StorageAccountConfiguration class. /// - /// The storage account name. - /// The storage account access - /// key. + + /// The storage account name. + /// + + /// The storage account access key. + /// public StorageAccountConfiguration(string storageAccountName = default(string), string storageAccountKey = default(string)) + { - StorageAccountName = storageAccountName; - StorageAccountKey = storageAccountKey; + this.StorageAccountName = storageAccountName; + this.StorageAccountKey = storageAccountKey; CustomInit(); } @@ -47,17 +43,17 @@ public StorageAccountConfiguration() /// partial void CustomInit(); + /// /// Gets or sets the storage account name. /// - [JsonProperty(PropertyName = "storageAccountName")] - public string StorageAccountName { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "storageAccountName")] + public string StorageAccountName {get; set; } /// /// Gets or sets the storage account access key. /// - [JsonProperty(PropertyName = "storageAccountKey")] - public string StorageAccountKey { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "storageAccountKey")] + public string StorageAccountKey {get; set; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/SubResource.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/SubResource.cs similarity index 72% rename from src/Resources/Resources.Sdk/Generated/Models/SubResource.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/SubResource.cs index 29132ad19264..179f96e4f38d 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/SubResource.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/SubResource.cs @@ -1,24 +1,16 @@ -// // 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.Models { - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Newtonsoft.Json; using System.Linq; /// /// Sub-resource. /// - public partial class SubResource : IResource + public partial class SubResource : Microsoft.Rest.Azure.IResource { /// /// Initializes a new instance of the SubResource class. @@ -31,10 +23,13 @@ public SubResource() /// /// Initializes a new instance of the SubResource class. /// - /// Resource ID + + /// Resource ID + /// public SubResource(string id = default(string)) + { - Id = id; + this.Id = id; CustomInit(); } @@ -43,11 +38,11 @@ public SubResource() /// partial void CustomInit(); + /// /// Gets or sets resource ID /// - [JsonProperty(PropertyName = "id")] - public string Id { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; set; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Management.Sdk/Generated/Models/Subscription.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/Subscription.cs new file mode 100644 index 000000000000..08259033bc5e --- /dev/null +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/Subscription.cs @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Resources.Models +{ + using System.Linq; + + /// + /// Subscription information. + /// + public partial class Subscription + { + /// + /// Initializes a new instance of the Subscription class. + /// + public Subscription() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Subscription class. + /// + + /// The fully qualified ID for the subscription. For example, + /// /subscriptions/00000000-0000-0000-0000-000000000000. + /// + + /// The subscription ID. + /// + + /// The subscription display name. + /// + + /// The subscription tenant ID. + /// + + /// The subscription state. Possible values are Enabled, Warned, PastDue, + /// Disabled, and Deleted. + /// Possible values include: 'Enabled', 'Warned', 'PastDue', 'Disabled', + /// 'Deleted' + + /// The subscription policies. + /// + + /// The authorization source of the request. Valid values are one or more + /// combinations of Legacy, RoleBased, Bypassed, Direct and Management. For + /// example, 'Legacy, RoleBased'. + /// + + /// An array containing the tenants managing the subscription. + /// + + /// The tags attached to the subscription. + /// + public Subscription(string id = default(string), string subscriptionId = default(string), string displayName = default(string), string tenantId = default(string), SubscriptionState? state = default(SubscriptionState?), SubscriptionPolicies subscriptionPolicies = default(SubscriptionPolicies), string authorizationSource = default(string), System.Collections.Generic.IList managedByTenants = default(System.Collections.Generic.IList), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary)) + + { + this.Id = id; + this.SubscriptionId = subscriptionId; + this.DisplayName = displayName; + this.TenantId = tenantId; + this.State = state; + this.SubscriptionPolicies = subscriptionPolicies; + this.AuthorizationSource = authorizationSource; + this.ManagedByTenants = managedByTenants; + this.Tags = tags; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets the fully qualified ID for the subscription. For example, + /// /subscriptions/00000000-0000-0000-0000-000000000000. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; private set; } + + /// + /// Gets the subscription ID. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "subscriptionId")] + public string SubscriptionId {get; private set; } + + /// + /// Gets the subscription display name. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "displayName")] + public string DisplayName {get; private set; } + + /// + /// Gets the subscription tenant ID. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "tenantId")] + public string TenantId {get; private set; } + + /// + /// Gets the subscription state. Possible values are Enabled, Warned, PastDue, + /// Disabled, and Deleted. Possible values include: 'Enabled', 'Warned', 'PastDue', 'Disabled', 'Deleted' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "state")] + public SubscriptionState? State {get; private set; } + + /// + /// Gets or sets the subscription policies. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "subscriptionPolicies")] + public SubscriptionPolicies SubscriptionPolicies {get; set; } + + /// + /// Gets or sets the authorization source of the request. Valid values are one + /// or more combinations of Legacy, RoleBased, Bypassed, Direct and Management. + /// For example, 'Legacy, RoleBased'. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "authorizationSource")] + public string AuthorizationSource {get; set; } + + /// + /// Gets or sets an array containing the tenants managing the subscription. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "managedByTenants")] + public System.Collections.Generic.IList ManagedByTenants {get; set; } + + /// + /// Gets or sets the tags attached to the subscription. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] + public System.Collections.Generic.IDictionary Tags {get; set; } + } +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/SubscriptionFeatureRegistration.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/SubscriptionFeatureRegistration.cs similarity index 69% rename from src/Resources/Resources.Sdk/Generated/Models/SubscriptionFeatureRegistration.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/SubscriptionFeatureRegistration.cs index aade1d4e50fd..be682a0a1196 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/SubscriptionFeatureRegistration.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/SubscriptionFeatureRegistration.cs @@ -1,16 +1,10 @@ -// // 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.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.Resources.Models public partial class SubscriptionFeatureRegistration : ProxyResource { /// - /// Initializes a new instance of the SubscriptionFeatureRegistration - /// class. + /// Initializes a new instance of the SubscriptionFeatureRegistration class. /// public SubscriptionFeatureRegistration() { @@ -28,16 +21,25 @@ public SubscriptionFeatureRegistration() } /// - /// Initializes a new instance of the SubscriptionFeatureRegistration - /// class. + /// Initializes a new instance of the SubscriptionFeatureRegistration class. /// - /// Azure resource Id. - /// Azure resource name. - /// Azure resource type. + + /// Azure resource Id. + /// + + /// Azure resource name. + /// + + /// Azure resource type. + /// + + /// + /// public SubscriptionFeatureRegistration(string id = default(string), string name = default(string), string type = default(string), SubscriptionFeatureRegistrationProperties properties = default(SubscriptionFeatureRegistrationProperties)) - : base(id, name, type) + + : base(id, name, type) { - Properties = properties; + this.Properties = properties; CustomInit(); } @@ -46,23 +48,24 @@ public SubscriptionFeatureRegistration() /// partial void CustomInit(); + /// + /// Gets or sets /// - [JsonProperty(PropertyName = "properties")] - public SubscriptionFeatureRegistrationProperties Properties { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties")] + public SubscriptionFeatureRegistrationProperties Properties {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Properties != null) + if (this.Properties != null) { - Properties.Validate(); + this.Properties.Validate(); } } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/SubscriptionFeatureRegistrationApprovalType.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/SubscriptionFeatureRegistrationApprovalType.cs similarity index 86% rename from src/Resources/Resources.Sdk/Generated/Models/SubscriptionFeatureRegistrationApprovalType.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/SubscriptionFeatureRegistrationApprovalType.cs index 80de797cc43f..ecdaa0eaa985 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/SubscriptionFeatureRegistrationApprovalType.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/SubscriptionFeatureRegistrationApprovalType.cs @@ -1,12 +1,7 @@ -// // 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.Models { @@ -14,10 +9,12 @@ namespace Microsoft.Azure.Management.Resources.Models /// /// Defines values for SubscriptionFeatureRegistrationApprovalType. /// + + public static class SubscriptionFeatureRegistrationApprovalType { public const string NotSpecified = "NotSpecified"; public const string ApprovalRequired = "ApprovalRequired"; public const string AutoApproval = "AutoApproval"; } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Management.Sdk/Generated/Models/SubscriptionFeatureRegistrationProperties.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/SubscriptionFeatureRegistrationProperties.cs new file mode 100644 index 000000000000..f3165b8195a7 --- /dev/null +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/SubscriptionFeatureRegistrationProperties.cs @@ -0,0 +1,208 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Resources.Models +{ + using System.Linq; + + public partial class SubscriptionFeatureRegistrationProperties + { + /// + /// Initializes a new instance of the SubscriptionFeatureRegistrationProperties class. + /// + public SubscriptionFeatureRegistrationProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SubscriptionFeatureRegistrationProperties class. + /// + + /// The tenantId. + /// + + /// The subscriptionId. + /// + + /// The featureName. + /// + + /// The featureDisplayName. + /// + + /// The providerNamespace. + /// + + /// The state. + /// Possible values include: 'NotSpecified', 'NotRegistered', 'Pending', + /// 'Registering', 'Registered', 'Unregistering', 'Unregistered' + + /// Authorization Profile + /// + + /// Key-value pairs for meta data. + /// + + /// The feature release date. + /// + + /// The feature registration date. + /// + + /// The feature documentation link. + /// + + /// The feature approval type. + /// Possible values include: 'NotSpecified', 'ApprovalRequired', 'AutoApproval' + + /// Indicates whether feature should be displayed in Portal. + /// + + /// The feature description. + /// + public SubscriptionFeatureRegistrationProperties(string tenantId = default(string), string subscriptionId = default(string), string featureName = default(string), string displayName = default(string), string providerNamespace = default(string), string state = default(string), AuthorizationProfile authorizationProfile = default(AuthorizationProfile), System.Collections.Generic.IDictionary metadata = default(System.Collections.Generic.IDictionary), System.DateTime? releaseDate = default(System.DateTime?), System.DateTime? registrationDate = default(System.DateTime?), string documentationLink = default(string), string approvalType = default(string), bool? shouldFeatureDisplayInPortal = default(bool?), string description = default(string)) + + { + this.TenantId = tenantId; + this.SubscriptionId = subscriptionId; + this.FeatureName = featureName; + this.DisplayName = displayName; + this.ProviderNamespace = providerNamespace; + this.State = state; + this.AuthorizationProfile = authorizationProfile; + this.Metadata = metadata; + this.ReleaseDate = releaseDate; + this.RegistrationDate = registrationDate; + this.DocumentationLink = documentationLink; + this.ApprovalType = approvalType; + this.ShouldFeatureDisplayInPortal = shouldFeatureDisplayInPortal; + this.Description = description; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets the tenantId. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "tenantId")] + public string TenantId {get; private set; } + + /// + /// Gets the subscriptionId. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "subscriptionId")] + public string SubscriptionId {get; private set; } + + /// + /// Gets the featureName. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "featureName")] + public string FeatureName {get; private set; } + + /// + /// Gets the featureDisplayName. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "displayName")] + public string DisplayName {get; private set; } + + /// + /// Gets the providerNamespace. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "providerNamespace")] + public string ProviderNamespace {get; private set; } + + /// + /// Gets or sets the state. Possible values include: 'NotSpecified', 'NotRegistered', 'Pending', 'Registering', 'Registered', 'Unregistering', 'Unregistered' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "state")] + public string State {get; set; } + + /// + /// Gets or sets authorization Profile + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "authorizationProfile")] + public AuthorizationProfile AuthorizationProfile {get; set; } + + /// + /// Gets or sets key-value pairs for meta data. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "metadata")] + public System.Collections.Generic.IDictionary Metadata {get; set; } + + /// + /// Gets the feature release date. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "releaseDate")] + public System.DateTime? ReleaseDate {get; private set; } + + /// + /// Gets the feature registration date. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "registrationDate")] + public System.DateTime? RegistrationDate {get; private set; } + + /// + /// Gets the feature documentation link. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "documentationLink")] + public string DocumentationLink {get; private set; } + + /// + /// Gets the feature approval type. Possible values include: 'NotSpecified', 'ApprovalRequired', 'AutoApproval' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "approvalType")] + public string ApprovalType {get; private set; } + + /// + /// Gets or sets indicates whether feature should be displayed in Portal. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "shouldFeatureDisplayInPortal")] + public bool? ShouldFeatureDisplayInPortal {get; set; } + + /// + /// Gets or sets the feature description. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "description")] + public string Description {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + + + + + + + + + if (this.DocumentationLink != null) + { + if (this.DocumentationLink.Length > 1000) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "DocumentationLink", 1000); + } + } + + if (this.Description != null) + { + if (this.Description.Length > 1000) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "Description", 1000); + } + } + } + } +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/SubscriptionFeatureRegistrationState.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/SubscriptionFeatureRegistrationState.cs similarity index 89% rename from src/Resources/Resources.Sdk/Generated/Models/SubscriptionFeatureRegistrationState.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/SubscriptionFeatureRegistrationState.cs index de45586cf429..b8ab470038bc 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/SubscriptionFeatureRegistrationState.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/SubscriptionFeatureRegistrationState.cs @@ -1,12 +1,7 @@ -// // 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.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Resources.Models /// /// Defines values for SubscriptionFeatureRegistrationState. /// + + public static class SubscriptionFeatureRegistrationState { public const string NotSpecified = "NotSpecified"; @@ -24,4 +21,4 @@ public static class SubscriptionFeatureRegistrationState public const string Unregistering = "Unregistering"; public const string Unregistered = "Unregistered"; } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/SubscriptionPolicies.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/SubscriptionPolicies.cs similarity index 55% rename from src/Resources/Resources.Sdk/Generated/Models/SubscriptionPolicies.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/SubscriptionPolicies.cs index 67e5f0400ea7..ac82df33b1ed 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/SubscriptionPolicies.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/SubscriptionPolicies.cs @@ -1,16 +1,10 @@ -// // 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.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,18 +23,23 @@ public SubscriptionPolicies() /// /// Initializes a new instance of the SubscriptionPolicies class. /// - /// The subscription location - /// placement ID. The ID indicates which regions are visible for a - /// subscription. For example, a subscription with a location placement - /// Id of Public_2014-09-01 has access to Azure public regions. - /// The subscription quota ID. + + /// The subscription location placement ID. The ID indicates which regions are + /// visible for a subscription. For example, a subscription with a location + /// placement Id of Public_2014-09-01 has access to Azure public regions. + /// + + /// The subscription quota ID. + /// + /// The subscription spending limit. - /// Possible values include: 'On', 'Off', 'CurrentPeriodOff' + /// Possible values include: 'On', 'Off', 'CurrentPeriodOff' public SubscriptionPolicies(string locationPlacementId = default(string), string quotaId = default(string), SpendingLimit? spendingLimit = default(SpendingLimit?)) + { - LocationPlacementId = locationPlacementId; - QuotaId = quotaId; - SpendingLimit = spendingLimit; + this.LocationPlacementId = locationPlacementId; + this.QuotaId = quotaId; + this.SpendingLimit = spendingLimit; CustomInit(); } @@ -49,27 +48,25 @@ public SubscriptionPolicies() /// partial void CustomInit(); + /// - /// Gets the subscription location placement ID. The ID indicates which - /// regions are visible for a subscription. For example, a subscription - /// with a location placement Id of Public_2014-09-01 has access to - /// Azure public regions. + /// Gets the subscription location placement ID. The ID indicates which regions + /// are visible for a subscription. For example, a subscription with a location + /// placement Id of Public_2014-09-01 has access to Azure public regions. /// - [JsonProperty(PropertyName = "locationPlacementId")] - public string LocationPlacementId { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "locationPlacementId")] + public string LocationPlacementId {get; private set; } /// /// Gets the subscription quota ID. /// - [JsonProperty(PropertyName = "quotaId")] - public string QuotaId { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "quotaId")] + public string QuotaId {get; private set; } /// - /// Gets the subscription spending limit. Possible values include: - /// 'On', 'Off', 'CurrentPeriodOff' + /// Gets the subscription spending limit. Possible values include: 'On', 'Off', 'CurrentPeriodOff' /// - [JsonProperty(PropertyName = "spendingLimit")] - public SpendingLimit? SpendingLimit { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "spendingLimit")] + public SpendingLimit? SpendingLimit {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/SubscriptionState.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/SubscriptionState.cs similarity index 80% rename from src/Resources/Resources.Sdk/Generated/Models/SubscriptionState.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/SubscriptionState.cs index 8538abe29cdb..9c56957d3289 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/SubscriptionState.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/SubscriptionState.cs @@ -1,35 +1,28 @@ -// // 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.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; /// /// Defines values for SubscriptionState. /// - [JsonConverter(typeof(StringEnumConverter))] + + + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] public enum SubscriptionState { - [EnumMember(Value = "Enabled")] + [System.Runtime.Serialization.EnumMember(Value = "Enabled")] Enabled, - [EnumMember(Value = "Warned")] + [System.Runtime.Serialization.EnumMember(Value = "Warned")] Warned, - [EnumMember(Value = "PastDue")] + [System.Runtime.Serialization.EnumMember(Value = "PastDue")] PastDue, - [EnumMember(Value = "Disabled")] + [System.Runtime.Serialization.EnumMember(Value = "Disabled")] Disabled, - [EnumMember(Value = "Deleted")] + [System.Runtime.Serialization.EnumMember(Value = "Deleted")] Deleted } internal static class SubscriptionStateEnumExtension @@ -38,7 +31,6 @@ internal static string ToSerializedValue(this SubscriptionState? value) { return value == null ? null : ((SubscriptionState)value).ToSerializedValue(); } - internal static string ToSerializedValue(this SubscriptionState value) { switch( value ) @@ -56,7 +48,6 @@ internal static string ToSerializedValue(this SubscriptionState value) } return null; } - internal static SubscriptionState? ParseSubscriptionState(this string value) { switch( value ) @@ -75,4 +66,4 @@ internal static string ToSerializedValue(this SubscriptionState value) return null; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/SystemData.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/SystemData.cs similarity index 57% rename from src/Resources/Resources.Sdk/Generated/Models/SystemData.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/SystemData.cs index 29deca79cb0a..e9df26dbad30 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/SystemData.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/SystemData.cs @@ -1,16 +1,10 @@ -// // 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.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,28 +23,33 @@ public SystemData() /// /// Initializes a new instance of the SystemData class. /// - /// The identity that created the - /// resource. - /// The type of identity that created the - /// resource. Possible values include: 'User', 'Application', - /// 'ManagedIdentity', 'Key' - /// The timestamp of resource creation - /// (UTC). - /// The identity that last modified the - /// resource. - /// The type of identity that last - /// modified the resource. Possible values include: 'User', - /// 'Application', 'ManagedIdentity', 'Key' - /// The timestamp of resource last - /// modification (UTC) + + /// The identity that created the resource. + /// + + /// The type of identity that created the resource. + /// Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' + + /// The timestamp of resource creation (UTC). + /// + + /// The identity that last modified the resource. + /// + + /// The type of identity that last modified the resource. + /// Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' + + /// The timestamp of resource last modification (UTC) + /// public SystemData(string createdBy = default(string), string createdByType = default(string), System.DateTime? createdAt = default(System.DateTime?), string lastModifiedBy = default(string), string lastModifiedByType = default(string), System.DateTime? lastModifiedAt = default(System.DateTime?)) + { - CreatedBy = createdBy; - CreatedByType = createdByType; - CreatedAt = createdAt; - LastModifiedBy = lastModifiedBy; - LastModifiedByType = lastModifiedByType; - LastModifiedAt = lastModifiedAt; + this.CreatedBy = createdBy; + this.CreatedByType = createdByType; + this.CreatedAt = createdAt; + this.LastModifiedBy = lastModifiedBy; + this.LastModifiedByType = lastModifiedByType; + this.LastModifiedAt = lastModifiedAt; CustomInit(); } @@ -59,45 +58,41 @@ public SystemData() /// partial void CustomInit(); + /// /// Gets or sets the identity that created the resource. /// - [JsonProperty(PropertyName = "createdBy")] - public string CreatedBy { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "createdBy")] + public string CreatedBy {get; set; } /// - /// Gets or sets the type of identity that created the resource. - /// Possible values include: 'User', 'Application', 'ManagedIdentity', - /// 'Key' + /// Gets or sets the type of identity that created the resource. Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' /// - [JsonProperty(PropertyName = "createdByType")] - public string CreatedByType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "createdByType")] + public string CreatedByType {get; set; } /// /// Gets or sets the timestamp of resource creation (UTC). /// - [JsonProperty(PropertyName = "createdAt")] - public System.DateTime? CreatedAt { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "createdAt")] + public System.DateTime? CreatedAt {get; set; } /// /// Gets or sets the identity that last modified the resource. /// - [JsonProperty(PropertyName = "lastModifiedBy")] - public string LastModifiedBy { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "lastModifiedBy")] + public string LastModifiedBy {get; set; } /// - /// Gets or sets the type of identity that last modified the resource. - /// Possible values include: 'User', 'Application', 'ManagedIdentity', - /// 'Key' + /// Gets or sets the type of identity that last modified the resource. Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' /// - [JsonProperty(PropertyName = "lastModifiedByType")] - public string LastModifiedByType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "lastModifiedByType")] + public string LastModifiedByType {get; set; } /// /// Gets or sets the timestamp of resource last modification (UTC) /// - [JsonProperty(PropertyName = "lastModifiedAt")] - public System.DateTime? LastModifiedAt { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "lastModifiedAt")] + public System.DateTime? LastModifiedAt {get; set; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/TagCount.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/TagCount.cs similarity index 71% rename from src/Resources/Resources.Sdk/Generated/Models/TagCount.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/TagCount.cs index 19335dd0108f..6c613019e0ef 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/TagCount.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/TagCount.cs @@ -1,16 +1,10 @@ -// // 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.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,12 +23,17 @@ public TagCount() /// /// Initializes a new instance of the TagCount class. /// - /// Type of count. - /// Value of count. + + /// Type of count. + /// + + /// Value of count. + /// public TagCount(string type = default(string), int? value = default(int?)) + { - Type = type; - Value = value; + this.Type = type; + this.Value = value; CustomInit(); } @@ -43,17 +42,17 @@ public TagCount() /// partial void CustomInit(); + /// /// Gets or sets type of count. /// - [JsonProperty(PropertyName = "type")] - public string Type { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; set; } /// /// Gets or sets value of count. /// - [JsonProperty(PropertyName = "value")] - public int? Value { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "value")] + public int? Value {get; set; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/TagDetails.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/TagDetails.cs similarity index 51% rename from src/Resources/Resources.Sdk/Generated/Models/TagDetails.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/TagDetails.cs index f4508512e44e..3e4ee9bfde5d 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/TagDetails.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/TagDetails.cs @@ -1,26 +1,16 @@ -// // 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.Models { - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Tag details. /// - public partial class TagDetails : IResource + public partial class TagDetails : Microsoft.Rest.Azure.IResource { /// /// Initializes a new instance of the TagDetails class. @@ -33,18 +23,26 @@ public TagDetails() /// /// Initializes a new instance of the TagDetails class. /// - /// The tag name ID. - /// The tag name. - /// The total number of resources that use the - /// resource tag. When a tag is initially created and has no associated - /// resources, the value is 0. - /// The list of tag values. - public TagDetails(string id = default(string), string tagName = default(string), TagCount count = default(TagCount), IList values = default(IList)) + + /// The tag name ID. + /// + + /// The tag name. + /// + + /// The total number of resources that use the resource tag. When a tag is + /// initially created and has no associated resources, the value is 0. + /// + + /// The list of tag values. + /// + public TagDetails(string id = default(string), string tagName = default(string), TagCount count = default(TagCount), System.Collections.Generic.IList values = default(System.Collections.Generic.IList)) + { - Id = id; - TagName = tagName; - Count = count; - Values = values; + this.Id = id; + this.TagName = tagName; + this.Count = count; + this.Values = values; CustomInit(); } @@ -53,31 +51,30 @@ public TagDetails() /// partial void CustomInit(); + /// /// Gets the tag name ID. /// - [JsonProperty(PropertyName = "id")] - public string Id { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; private set; } /// /// Gets or sets the tag name. /// - [JsonProperty(PropertyName = "tagName")] - public string TagName { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "tagName")] + public string TagName {get; set; } /// - /// Gets or sets the total number of resources that use the resource - /// tag. When a tag is initially created and has no associated - /// resources, the value is 0. + /// Gets or sets the total number of resources that use the resource tag. When + /// a tag is initially created and has no associated resources, the value is 0. /// - [JsonProperty(PropertyName = "count")] - public TagCount Count { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "count")] + public TagCount Count {get; set; } /// /// Gets or sets the list of tag values. /// - [JsonProperty(PropertyName = "values")] - public IList Values { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "values")] + public System.Collections.Generic.IList Values {get; set; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/TagValue.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/TagValue.cs similarity index 61% rename from src/Resources/Resources.Sdk/Generated/Models/TagValue.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/TagValue.cs index 7ac6158c91e9..1df144be86a5 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/TagValue.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/TagValue.cs @@ -1,24 +1,16 @@ -// // 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.Models { - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Newtonsoft.Json; using System.Linq; /// /// Tag information. /// - public partial class TagValue : IResource + public partial class TagValue : Microsoft.Rest.Azure.IResource { /// /// Initializes a new instance of the TagValue class. @@ -31,14 +23,21 @@ public TagValue() /// /// Initializes a new instance of the TagValue class. /// - /// The tag value ID. - /// The tag value. - /// The tag value count. + + /// The tag value ID. + /// + + /// The tag value. + /// + + /// The tag value count. + /// public TagValue(string id = default(string), string tagValueProperty = default(string), TagCount count = default(TagCount)) + { - Id = id; - TagValueProperty = tagValueProperty; - Count = count; + this.Id = id; + this.TagValueProperty = tagValueProperty; + this.Count = count; CustomInit(); } @@ -47,23 +46,23 @@ public TagValue() /// partial void CustomInit(); + /// /// Gets the tag value ID. /// - [JsonProperty(PropertyName = "id")] - public string Id { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; private set; } /// /// Gets or sets the tag value. /// - [JsonProperty(PropertyName = "tagValue")] - public string TagValueProperty { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "tagValue")] + public string TagValueProperty {get; set; } /// /// Gets or sets the tag value count. /// - [JsonProperty(PropertyName = "count")] - public TagCount Count { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "count")] + public TagCount Count {get; set; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/Tags.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/Tags.cs similarity index 64% rename from src/Resources/Resources.Sdk/Generated/Models/Tags.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/Tags.cs index 08a4e5de157b..34cfab1e082d 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/Tags.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/Tags.cs @@ -1,18 +1,10 @@ -// // 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.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,9 +23,13 @@ public Tags() /// /// Initializes a new instance of the Tags class. /// - public Tags(IDictionary tagsProperty = default(IDictionary)) + + /// Dictionary of <string> + /// + public Tags(System.Collections.Generic.IDictionary tagsProperty = default(System.Collections.Generic.IDictionary)) + { - TagsProperty = tagsProperty; + this.TagsProperty = tagsProperty; CustomInit(); } @@ -42,10 +38,11 @@ public Tags() /// partial void CustomInit(); + /// + /// Gets or sets dictionary of <string> /// - [JsonProperty(PropertyName = "tags")] - public IDictionary TagsProperty { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] + public System.Collections.Generic.IDictionary TagsProperty {get; set; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/TagsPatchOperation.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/TagsPatchOperation.cs similarity index 61% rename from src/Resources/Resources.Sdk/Generated/Models/TagsPatchOperation.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/TagsPatchOperation.cs index b006fa06dc76..13e3514eaad8 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/TagsPatchOperation.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/TagsPatchOperation.cs @@ -1,12 +1,7 @@ -// // 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.Models { @@ -14,22 +9,24 @@ namespace Microsoft.Azure.Management.Resources.Models /// /// Defines values for TagsPatchOperation. /// + + public static class TagsPatchOperation { /// - /// The 'replace' option replaces the entire set of existing tags with - /// a new set. + /// The 'replace' option replaces the entire set of existing tags with a new + /// set. /// public const string Replace = "Replace"; /// - /// The 'merge' option allows adding tags with new names and updating - /// the values of tags with existing names. + /// The 'merge' option allows adding tags with new names and updating the + /// values of tags with existing names. /// public const string Merge = "Merge"; /// - /// The 'delete' option allows selectively deleting tags based on given - /// names or name/value pairs. + /// The 'delete' option allows selectively deleting tags based on given names + /// or name/value pairs. /// public const string Delete = "Delete"; } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/TagsPatchResource.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/TagsPatchResource.cs similarity index 69% rename from src/Resources/Resources.Sdk/Generated/Models/TagsPatchResource.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/TagsPatchResource.cs index 6f986ea33358..ac5e2db75dc6 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/TagsPatchResource.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/TagsPatchResource.cs @@ -1,16 +1,10 @@ -// // 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.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,13 +23,17 @@ public TagsPatchResource() /// /// Initializes a new instance of the TagsPatchResource class. /// + /// The operation type for the patch API. - /// Possible values include: 'Replace', 'Merge', 'Delete' - /// The set of tags. + /// Possible values include: 'Replace', 'Merge', 'Delete' + + /// The set of tags. + /// public TagsPatchResource(string operation = default(string), Tags properties = default(Tags)) + { - Operation = operation; - Properties = properties; + this.Operation = operation; + this.Properties = properties; CustomInit(); } @@ -44,18 +42,17 @@ public TagsPatchResource() /// partial void CustomInit(); + /// - /// Gets or sets the operation type for the patch API. Possible values - /// include: 'Replace', 'Merge', 'Delete' + /// Gets or sets the operation type for the patch API. Possible values include: 'Replace', 'Merge', 'Delete' /// - [JsonProperty(PropertyName = "operation")] - public string Operation { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "operation")] + public string Operation {get; set; } /// /// Gets or sets the set of tags. /// - [JsonProperty(PropertyName = "properties")] - public Tags Properties { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties")] + public Tags Properties {get; set; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/TagsResource.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/TagsResource.cs similarity index 63% rename from src/Resources/Resources.Sdk/Generated/Models/TagsResource.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/TagsResource.cs index 353b790824fa..c5aa4bc916a3 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/TagsResource.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/TagsResource.cs @@ -1,24 +1,16 @@ -// // 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.Models { - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Newtonsoft.Json; using System.Linq; /// /// Wrapper resource for tags API requests and responses. /// - public partial class TagsResource : IResource + public partial class TagsResource : Microsoft.Rest.Azure.IResource { /// /// Initializes a new instance of the TagsResource class. @@ -31,16 +23,25 @@ public TagsResource() /// /// Initializes a new instance of the TagsResource class. /// - /// The set of tags. - /// The ID of the tags wrapper resource. - /// The name of the tags wrapper resource. - /// The type of the tags wrapper resource. + + /// The ID of the tags wrapper resource. + /// + + /// The name of the tags wrapper resource. + /// + + /// The type of the tags wrapper resource. + /// + + /// The set of tags. + /// public TagsResource(Tags properties, string id = default(string), string name = default(string), string type = default(string)) + { - Id = id; - Name = name; - Type = type; - Properties = properties; + this.Id = id; + this.Name = name; + this.Type = type; + this.Properties = properties; CustomInit(); } @@ -49,42 +50,46 @@ public TagsResource() /// partial void CustomInit(); + /// /// Gets the ID of the tags wrapper resource. /// - [JsonProperty(PropertyName = "id")] - public string Id { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; private set; } /// /// Gets the name of the tags wrapper resource. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; private set; } /// /// Gets the type of the tags wrapper resource. /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } /// /// Gets or sets the set of tags. /// - [JsonProperty(PropertyName = "properties")] - public Tags Properties { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties")] + public Tags Properties {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Properties == null) + if (this.Properties == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Properties"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Properties"); } + + + + } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/TargetResource.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/TargetResource.cs similarity index 70% rename from src/Resources/Resources.Sdk/Generated/Models/TargetResource.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/TargetResource.cs index a1b3e6e165a8..1cacb9a124e7 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/TargetResource.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/TargetResource.cs @@ -1,16 +1,10 @@ -// // 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.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,14 +23,21 @@ public TargetResource() /// /// Initializes a new instance of the TargetResource class. /// - /// The ID of the resource. - /// The name of the resource. - /// The type of the resource. + + /// The ID of the resource. + /// + + /// The name of the resource. + /// + + /// The type of the resource. + /// public TargetResource(string id = default(string), string resourceName = default(string), string resourceType = default(string)) + { - Id = id; - ResourceName = resourceName; - ResourceType = resourceType; + this.Id = id; + this.ResourceName = resourceName; + this.ResourceType = resourceType; CustomInit(); } @@ -45,23 +46,23 @@ public TargetResource() /// partial void CustomInit(); + /// /// Gets or sets the ID of the resource. /// - [JsonProperty(PropertyName = "id")] - public string Id { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; set; } /// /// Gets or sets the name of the resource. /// - [JsonProperty(PropertyName = "resourceName")] - public string ResourceName { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "resourceName")] + public string ResourceName {get; set; } /// /// Gets or sets the type of the resource. /// - [JsonProperty(PropertyName = "resourceType")] - public string ResourceType { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "resourceType")] + public string ResourceType {get; set; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/TemplateHashResult.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/TemplateHashResult.cs similarity index 70% rename from src/Resources/Resources.Sdk/Generated/Models/TemplateHashResult.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/TemplateHashResult.cs index 9b70cdd45a53..a401b91830f6 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/TemplateHashResult.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/TemplateHashResult.cs @@ -1,21 +1,15 @@ -// // 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.Models { - using Newtonsoft.Json; using System.Linq; /// - /// Result of the request to calculate template hash. It contains a string - /// of minified template and its hash. + /// Result of the request to calculate template hash. It contains a string of + /// minified template and its hash. /// public partial class TemplateHashResult { @@ -30,13 +24,17 @@ public TemplateHashResult() /// /// Initializes a new instance of the TemplateHashResult class. /// - /// The minified template - /// string. - /// The template hash. + + /// The minified template string. + /// + + /// The template hash. + /// public TemplateHashResult(string minifiedTemplate = default(string), string templateHash = default(string)) + { - MinifiedTemplate = minifiedTemplate; - TemplateHash = templateHash; + this.MinifiedTemplate = minifiedTemplate; + this.TemplateHash = templateHash; CustomInit(); } @@ -45,17 +43,17 @@ public TemplateHashResult() /// partial void CustomInit(); + /// /// Gets or sets the minified template string. /// - [JsonProperty(PropertyName = "minifiedTemplate")] - public string MinifiedTemplate { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "minifiedTemplate")] + public string MinifiedTemplate {get; set; } /// /// Gets or sets the template hash. /// - [JsonProperty(PropertyName = "templateHash")] - public string TemplateHash { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "templateHash")] + public string TemplateHash {get; set; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/TemplateLink.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/TemplateLink.cs similarity index 50% rename from src/Resources/Resources.Sdk/Generated/Models/TemplateLink.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/TemplateLink.cs index 619ee7b26213..be765c4775a4 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/TemplateLink.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/TemplateLink.cs @@ -1,16 +1,10 @@ -// // 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.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,27 +23,36 @@ public TemplateLink() /// /// Initializes a new instance of the TemplateLink class. /// - /// The URI of the template to deploy. Use either the - /// uri or id property, but not both. - /// The resource id of a Template Spec. Use either the - /// id or uri property, but not both. - /// The relativePath property can be used to - /// deploy a linked template at a location relative to the parent. If - /// the parent template was linked with a TemplateSpec, this will - /// reference an artifact in the TemplateSpec. If the parent was - /// linked with a URI, the child deployment will be a combination of - /// the parent and relativePath URIs - /// If included, must match the - /// ContentVersion in the template. - /// The query string (for example, a SAS - /// token) to be used with the templateLink URI. + + /// The URI of the template to deploy. Use either the uri or id property, but + /// not both. + /// + + /// The resource id of a Template Spec. Use either the id or uri property, but + /// not both. + /// + + /// The relativePath property can be used to deploy a linked template at a + /// location relative to the parent. If the parent template was linked with a + /// TemplateSpec, this will reference an artifact in the TemplateSpec. If the + /// parent was linked with a URI, the child deployment will be a combination of + /// the parent and relativePath URIs + /// + + /// If included, must match the ContentVersion in the template. + /// + + /// The query string (for example, a SAS token) to be used with the + /// templateLink URI. + /// public TemplateLink(string uri = default(string), string id = default(string), string relativePath = default(string), string contentVersion = default(string), string queryString = default(string)) + { - Uri = uri; - Id = id; - RelativePath = relativePath; - ContentVersion = contentVersion; - QueryString = queryString; + this.Uri = uri; + this.Id = id; + this.RelativePath = relativePath; + this.ContentVersion = contentVersion; + this.QueryString = queryString; CustomInit(); } @@ -58,44 +61,42 @@ public TemplateLink() /// partial void CustomInit(); + /// - /// Gets or sets the URI of the template to deploy. Use either the uri - /// or id property, but not both. + /// Gets or sets the URI of the template to deploy. Use either the uri or id + /// property, but not both. /// - [JsonProperty(PropertyName = "uri")] - public string Uri { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "uri")] + public string Uri {get; set; } /// - /// Gets or sets the resource id of a Template Spec. Use either the id - /// or uri property, but not both. + /// Gets or sets the resource id of a Template Spec. Use either the id or uri + /// property, but not both. /// - [JsonProperty(PropertyName = "id")] - public string Id { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; set; } /// - /// Gets or sets the relativePath property can be used to deploy a - /// linked template at a location relative to the parent. If the parent - /// template was linked with a TemplateSpec, this will reference an - /// artifact in the TemplateSpec. If the parent was linked with a URI, - /// the child deployment will be a combination of the parent and - /// relativePath URIs + /// Gets or sets the relativePath property can be used to deploy a linked + /// template at a location relative to the parent. If the parent template was + /// linked with a TemplateSpec, this will reference an artifact in the + /// TemplateSpec. If the parent was linked with a URI, the child deployment + /// will be a combination of the parent and relativePath URIs /// - [JsonProperty(PropertyName = "relativePath")] - public string RelativePath { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "relativePath")] + public string RelativePath {get; set; } /// - /// Gets or sets if included, must match the ContentVersion in the - /// template. + /// Gets or sets if included, must match the ContentVersion in the template. /// - [JsonProperty(PropertyName = "contentVersion")] - public string ContentVersion { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "contentVersion")] + public string ContentVersion {get; set; } /// - /// Gets or sets the query string (for example, a SAS token) to be used - /// with the templateLink URI. + /// Gets or sets the query string (for example, a SAS token) to be used with + /// the templateLink URI. /// - [JsonProperty(PropertyName = "queryString")] - public string QueryString { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "queryString")] + public string QueryString {get; set; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Management.Sdk/Generated/Models/TemplateSpec.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/TemplateSpec.cs new file mode 100644 index 000000000000..3ec6e30e6b34 --- /dev/null +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/TemplateSpec.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Resources.Models +{ + using System.Linq; + + /// + /// Template Spec object. + /// + [Microsoft.Rest.Serialization.JsonTransformation] + public partial class TemplateSpec : AzureResourceBase + { + /// + /// Initializes a new instance of the TemplateSpec class. + /// + public TemplateSpec() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the TemplateSpec class. + /// + + /// String Id used to locate any resource on Azure. + /// + + /// Name of this resource. + /// + + /// Type of this resource. + /// + + /// Azure Resource Manager metadata containing createdBy and modifiedBy + /// information. + /// + + /// The location of the Template Spec. It cannot be changed after Template Spec + /// creation. It must be one of the supported Azure locations. + /// + + /// Resource tags. + /// + + /// Template Spec description. + /// + + /// Template Spec display name. + /// + + /// The Template Spec metadata. Metadata is an open-ended object and is + /// typically a collection of key-value pairs. + /// + + /// High-level information about the versions within this Template Spec. The + /// keys are the version names. Only populated if the $expand query parameter + /// is set to 'versions'. + /// + public TemplateSpec(string location, string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string description = default(string), string displayName = default(string), object metadata = default(object), System.Collections.Generic.IDictionary versions = default(System.Collections.Generic.IDictionary)) + + : base(id, name, type, systemData) + { + this.Location = location; + this.Tags = tags; + this.Description = description; + this.DisplayName = displayName; + this.Metadata = metadata; + this.Versions = versions; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the location of the Template Spec. It cannot be changed after + /// Template Spec creation. It must be one of the supported Azure locations. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + public string Location {get; set; } + + /// + /// Gets or sets resource tags. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] + public System.Collections.Generic.IDictionary Tags {get; set; } + + /// + /// Gets or sets template Spec description. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.description")] + public string Description {get; set; } + + /// + /// Gets or sets template Spec display name. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.displayName")] + public string DisplayName {get; set; } + + /// + /// Gets or sets the Template Spec metadata. Metadata is an open-ended object + /// and is typically a collection of key-value pairs. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.metadata")] + public object Metadata {get; set; } + + /// + /// Gets high-level information about the versions within this Template Spec. + /// The keys are the version names. Only populated if the $expand query + /// parameter is set to 'versions'. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.versions")] + public System.Collections.Generic.IDictionary Versions {get; private set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (this.Location == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Location"); + } + + + if (this.Description != null) + { + if (this.Description.Length > 4096) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "Description", 4096); + } + } + if (this.DisplayName != null) + { + if (this.DisplayName.Length > 64) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "DisplayName", 64); + } + } + + + } + } +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/TemplateSpecExpandKind.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/TemplateSpecExpandKind.cs similarity index 85% rename from src/Resources/Resources.Sdk/Generated/Models/TemplateSpecExpandKind.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/TemplateSpecExpandKind.cs index 8a358e96ac73..0bfbabb59a28 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/TemplateSpecExpandKind.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/TemplateSpecExpandKind.cs @@ -1,12 +1,7 @@ -// // 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.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Resources.Models /// /// Defines values for TemplateSpecExpandKind. /// + + public static class TemplateSpecExpandKind { /// @@ -21,4 +18,4 @@ public static class TemplateSpecExpandKind /// public const string Versions = "versions"; } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Management.Sdk/Generated/Models/TemplateSpecProperties.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/TemplateSpecProperties.cs new file mode 100644 index 000000000000..794ab1f0e840 --- /dev/null +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/TemplateSpecProperties.cs @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Resources.Models +{ + using System.Linq; + + /// + /// Template Spec properties. + /// + public partial class TemplateSpecProperties + { + /// + /// Initializes a new instance of the TemplateSpecProperties class. + /// + public TemplateSpecProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the TemplateSpecProperties class. + /// + + /// Template Spec description. + /// + + /// Template Spec display name. + /// + + /// The Template Spec metadata. Metadata is an open-ended object and is + /// typically a collection of key-value pairs. + /// + + /// High-level information about the versions within this Template Spec. The + /// keys are the version names. Only populated if the $expand query parameter + /// is set to 'versions'. + /// + public TemplateSpecProperties(string description = default(string), string displayName = default(string), object metadata = default(object), System.Collections.Generic.IDictionary versions = default(System.Collections.Generic.IDictionary)) + + { + this.Description = description; + this.DisplayName = displayName; + this.Metadata = metadata; + this.Versions = versions; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets template Spec description. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "description")] + public string Description {get; set; } + + /// + /// Gets or sets template Spec display name. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "displayName")] + public string DisplayName {get; set; } + + /// + /// Gets or sets the Template Spec metadata. Metadata is an open-ended object + /// and is typically a collection of key-value pairs. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "metadata")] + public object Metadata {get; set; } + + /// + /// Gets high-level information about the versions within this Template Spec. + /// The keys are the version names. Only populated if the $expand query + /// parameter is set to 'versions'. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "versions")] + public System.Collections.Generic.IDictionary Versions {get; private set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (this.Description != null) + { + if (this.Description.Length > 4096) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "Description", 4096); + } + } + if (this.DisplayName != null) + { + if (this.DisplayName.Length > 64) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "DisplayName", 64); + } + } + + + } + } +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/TemplateSpecUpdateModel.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/TemplateSpecUpdateModel.cs similarity index 63% rename from src/Resources/Resources.Sdk/Generated/Models/TemplateSpecUpdateModel.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/TemplateSpecUpdateModel.cs index 76e5f297a020..bcf2e4c36240 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/TemplateSpecUpdateModel.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/TemplateSpecUpdateModel.cs @@ -1,23 +1,14 @@ -// // 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.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// - /// Template Spec properties to be updated (only tags are currently - /// supported). + /// Template Spec properties to be updated (only tags are currently supported). /// public partial class TemplateSpecUpdateModel : AzureResourceBase { @@ -32,17 +23,27 @@ public TemplateSpecUpdateModel() /// /// Initializes a new instance of the TemplateSpecUpdateModel class. /// - /// String Id used to locate any resource on - /// Azure. - /// Name of this resource. - /// Type of this resource. - /// Azure Resource Manager metadata containing - /// createdBy and modifiedBy information. - /// Resource tags. - public TemplateSpecUpdateModel(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), IDictionary tags = default(IDictionary)) - : base(id, name, type, systemData) + + /// String Id used to locate any resource on Azure. + /// + + /// Name of this resource. + /// + + /// Type of this resource. + /// + + /// Azure Resource Manager metadata containing createdBy and modifiedBy + /// information. + /// + + /// Resource tags. + /// + public TemplateSpecUpdateModel(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary)) + + : base(id, name, type, systemData) { - Tags = tags; + this.Tags = tags; CustomInit(); } @@ -51,11 +52,11 @@ public TemplateSpecUpdateModel() /// partial void CustomInit(); + /// /// Gets or sets resource tags. /// - [JsonProperty(PropertyName = "tags")] - public IDictionary Tags { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] + public System.Collections.Generic.IDictionary Tags {get; set; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Management.Sdk/Generated/Models/TemplateSpecVersion.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/TemplateSpecVersion.cs new file mode 100644 index 000000000000..b433b55f962b --- /dev/null +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/TemplateSpecVersion.cs @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Resources.Models +{ + using System.Linq; + + /// + /// Template Spec Version object. + /// + [Microsoft.Rest.Serialization.JsonTransformation] + public partial class TemplateSpecVersion : AzureResourceBase + { + /// + /// Initializes a new instance of the TemplateSpecVersion class. + /// + public TemplateSpecVersion() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the TemplateSpecVersion class. + /// + + /// String Id used to locate any resource on Azure. + /// + + /// Name of this resource. + /// + + /// Type of this resource. + /// + + /// Azure Resource Manager metadata containing createdBy and modifiedBy + /// information. + /// + + /// The location of the Template Spec Version. It must match the location of + /// the parent Template Spec. + /// + + /// Resource tags. + /// + + /// Template Spec version description. + /// + + /// An array of linked template artifacts. + /// + + /// The version metadata. Metadata is an open-ended object and is typically a + /// collection of key-value pairs. + /// + + /// The main Azure Resource Manager template content. + /// + + /// The Azure Resource Manager template UI definition content. + /// + public TemplateSpecVersion(string location, string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string description = default(string), System.Collections.Generic.IList linkedTemplates = default(System.Collections.Generic.IList), object metadata = default(object), object mainTemplate = default(object), object uiFormDefinition = default(object)) + + : base(id, name, type, systemData) + { + this.Location = location; + this.Tags = tags; + this.Description = description; + this.LinkedTemplates = linkedTemplates; + this.Metadata = metadata; + this.MainTemplate = mainTemplate; + this.UiFormDefinition = uiFormDefinition; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the location of the Template Spec Version. It must match the + /// location of the parent Template Spec. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + public string Location {get; set; } + + /// + /// Gets or sets resource tags. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] + public System.Collections.Generic.IDictionary Tags {get; set; } + + /// + /// Gets or sets template Spec version description. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.description")] + public string Description {get; set; } + + /// + /// Gets or sets an array of linked template artifacts. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.linkedTemplates")] + public System.Collections.Generic.IList LinkedTemplates {get; set; } + + /// + /// Gets or sets the version metadata. Metadata is an open-ended object and is + /// typically a collection of key-value pairs. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.metadata")] + public object Metadata {get; set; } + + /// + /// Gets or sets the main Azure Resource Manager template content. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.mainTemplate")] + public object MainTemplate {get; set; } + + /// + /// Gets or sets the Azure Resource Manager template UI definition content. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.uiFormDefinition")] + public object UiFormDefinition {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (this.Location == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Location"); + } + + + if (this.Description != null) + { + if (this.Description.Length > 4096) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "Description", 4096); + } + } + if (this.LinkedTemplates != null) + { + foreach (var element in this.LinkedTemplates) + { + if (element != null) + { + element.Validate(); + } + } + } + + + + } + } +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/TemplateSpecVersionInfo.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/TemplateSpecVersionInfo.cs similarity index 68% rename from src/Resources/Resources.Sdk/Generated/Models/TemplateSpecVersionInfo.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/TemplateSpecVersionInfo.cs index 60808c5fcd96..80641494c9ba 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/TemplateSpecVersionInfo.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/TemplateSpecVersionInfo.cs @@ -1,16 +1,10 @@ -// // 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.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,17 +23,21 @@ public TemplateSpecVersionInfo() /// /// Initializes a new instance of the TemplateSpecVersionInfo class. /// - /// Template Spec version - /// description. - /// The timestamp of when the version was - /// created. - /// The timestamp of when the version was - /// last modified. + + /// Template Spec version description. + /// + + /// The timestamp of when the version was created. + /// + + /// The timestamp of when the version was last modified. + /// public TemplateSpecVersionInfo(string description = default(string), System.DateTime? timeCreated = default(System.DateTime?), System.DateTime? timeModified = default(System.DateTime?)) + { - Description = description; - TimeCreated = timeCreated; - TimeModified = timeModified; + this.Description = description; + this.TimeCreated = timeCreated; + this.TimeModified = timeModified; CustomInit(); } @@ -48,23 +46,23 @@ public TemplateSpecVersionInfo() /// partial void CustomInit(); + /// /// Gets template Spec version description. /// - [JsonProperty(PropertyName = "description")] - public string Description { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "description")] + public string Description {get; private set; } /// /// Gets the timestamp of when the version was created. /// - [JsonProperty(PropertyName = "timeCreated")] - public System.DateTime? TimeCreated { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "timeCreated")] + public System.DateTime? TimeCreated {get; private set; } /// /// Gets the timestamp of when the version was last modified. /// - [JsonProperty(PropertyName = "timeModified")] - public System.DateTime? TimeModified { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "timeModified")] + public System.DateTime? TimeModified {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Management.Sdk/Generated/Models/TemplateSpecVersionProperties.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/TemplateSpecVersionProperties.cs new file mode 100644 index 000000000000..592fd32b9c48 --- /dev/null +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/TemplateSpecVersionProperties.cs @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Resources.Models +{ + using System.Linq; + + /// + /// Template Spec Version properties. + /// + public partial class TemplateSpecVersionProperties + { + /// + /// Initializes a new instance of the TemplateSpecVersionProperties class. + /// + public TemplateSpecVersionProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the TemplateSpecVersionProperties class. + /// + + /// Template Spec version description. + /// + + /// An array of linked template artifacts. + /// + + /// The version metadata. Metadata is an open-ended object and is typically a + /// collection of key-value pairs. + /// + + /// The main Azure Resource Manager template content. + /// + + /// The Azure Resource Manager template UI definition content. + /// + public TemplateSpecVersionProperties(string description = default(string), System.Collections.Generic.IList linkedTemplates = default(System.Collections.Generic.IList), object metadata = default(object), object mainTemplate = default(object), object uiFormDefinition = default(object)) + + { + this.Description = description; + this.LinkedTemplates = linkedTemplates; + this.Metadata = metadata; + this.MainTemplate = mainTemplate; + this.UiFormDefinition = uiFormDefinition; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets template Spec version description. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "description")] + public string Description {get; set; } + + /// + /// Gets or sets an array of linked template artifacts. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "linkedTemplates")] + public System.Collections.Generic.IList LinkedTemplates {get; set; } + + /// + /// Gets or sets the version metadata. Metadata is an open-ended object and is + /// typically a collection of key-value pairs. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "metadata")] + public object Metadata {get; set; } + + /// + /// Gets or sets the main Azure Resource Manager template content. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "mainTemplate")] + public object MainTemplate {get; set; } + + /// + /// Gets or sets the Azure Resource Manager template UI definition content. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "uiFormDefinition")] + public object UiFormDefinition {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (this.Description != null) + { + if (this.Description.Length > 4096) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "Description", 4096); + } + } + if (this.LinkedTemplates != null) + { + foreach (var element in this.LinkedTemplates) + { + if (element != null) + { + element.Validate(); + } + } + } + + + + } + } +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/TemplateSpecVersionUpdateModel.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/TemplateSpecVersionUpdateModel.cs similarity index 62% rename from src/Resources/Resources.Sdk/Generated/Models/TemplateSpecVersionUpdateModel.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/TemplateSpecVersionUpdateModel.cs index 0496f11d2e16..ac99e87d23ca 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/TemplateSpecVersionUpdateModel.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/TemplateSpecVersionUpdateModel.cs @@ -1,18 +1,10 @@ -// // 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.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -22,8 +14,7 @@ namespace Microsoft.Azure.Management.Resources.Models public partial class TemplateSpecVersionUpdateModel : AzureResourceBase { /// - /// Initializes a new instance of the TemplateSpecVersionUpdateModel - /// class. + /// Initializes a new instance of the TemplateSpecVersionUpdateModel class. /// public TemplateSpecVersionUpdateModel() { @@ -31,20 +22,29 @@ public TemplateSpecVersionUpdateModel() } /// - /// Initializes a new instance of the TemplateSpecVersionUpdateModel - /// class. + /// Initializes a new instance of the TemplateSpecVersionUpdateModel class. /// - /// String Id used to locate any resource on - /// Azure. - /// Name of this resource. - /// Type of this resource. - /// Azure Resource Manager metadata containing - /// createdBy and modifiedBy information. - /// Resource tags. - public TemplateSpecVersionUpdateModel(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), IDictionary tags = default(IDictionary)) - : base(id, name, type, systemData) + + /// String Id used to locate any resource on Azure. + /// + + /// Name of this resource. + /// + + /// Type of this resource. + /// + + /// Azure Resource Manager metadata containing createdBy and modifiedBy + /// information. + /// + + /// Resource tags. + /// + public TemplateSpecVersionUpdateModel(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary)) + + : base(id, name, type, systemData) { - Tags = tags; + this.Tags = tags; CustomInit(); } @@ -53,11 +53,11 @@ public TemplateSpecVersionUpdateModel() /// partial void CustomInit(); + /// /// Gets or sets resource tags. /// - [JsonProperty(PropertyName = "tags")] - public IDictionary Tags { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] + public System.Collections.Generic.IDictionary Tags {get; set; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/TemplateSpecsError.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/TemplateSpecsError.cs similarity index 63% rename from src/Resources/Resources.Sdk/Generated/Models/TemplateSpecsError.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/TemplateSpecsError.cs index cc3ace2cd1ed..326afb229199 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/TemplateSpecsError.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/TemplateSpecsError.cs @@ -1,16 +1,10 @@ -// // 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.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,9 +23,15 @@ public TemplateSpecsError() /// /// Initializes a new instance of the TemplateSpecsError class. /// + + /// Common error response for all Azure Resource Manager APIs to return error + /// details for failed operations. (This also follows the OData error response + /// format.) + /// public TemplateSpecsError(ErrorResponse error = default(ErrorResponse)) + { - Error = error; + this.Error = error; CustomInit(); } @@ -40,10 +40,13 @@ public TemplateSpecsError() /// partial void CustomInit(); + /// + /// Gets or sets common error response for all Azure Resource Manager APIs to + /// return error details for failed operations. (This also follows the OData + /// error response format.) /// - [JsonProperty(PropertyName = "error")] - public ErrorResponse Error { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "error")] + public ErrorResponse Error {get; set; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/TemplateSpecsErrorException.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/TemplateSpecsErrorException.cs similarity index 80% rename from src/Resources/Resources.Sdk/Generated/Models/TemplateSpecsErrorException.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/TemplateSpecsErrorException.cs index 74f35c046511..b08d86aab4e1 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/TemplateSpecsErrorException.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/TemplateSpecsErrorException.cs @@ -1,32 +1,25 @@ -// // 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.Models { - using Microsoft.Rest; /// - /// Exception thrown for an invalid response with TemplateSpecsError - /// information. + /// Exception thrown for an invalid response with TemplateSpecsError information. /// - public partial class TemplateSpecsErrorException : RestException + public partial class TemplateSpecsErrorException : Microsoft.Rest.RestException { /// /// Gets information about the associated HTTP request. /// - public HttpRequestMessageWrapper Request { get; set; } + public Microsoft.Rest.HttpRequestMessageWrapper Request { get; set; } /// /// Gets information about the associated HTTP response. /// - public HttpResponseMessageWrapper Response { get; set; } + public Microsoft.Rest.HttpResponseMessageWrapper Response { get; set; } /// /// Gets or sets the body object. @@ -41,7 +34,7 @@ public TemplateSpecsErrorException() } /// - /// Initializes a new instance of the TemplateSpecsErrorException class. + /// Initializes a new instance of the TemplateSpecsError class. /// /// The exception message. public TemplateSpecsErrorException(string message) @@ -50,7 +43,7 @@ public TemplateSpecsErrorException(string message) } /// - /// Initializes a new instance of the TemplateSpecsErrorException class. + /// Initializes a new instance of the TemplateSpecsError class. /// /// The exception message. /// Inner exception. @@ -59,4 +52,4 @@ public TemplateSpecsErrorException(string message, System.Exception innerExcepti { } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/TenantCategory.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/TenantCategory.cs similarity index 79% rename from src/Resources/Resources.Sdk/Generated/Models/TenantCategory.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/TenantCategory.cs index 2d6d083c1436..0d2ba1e65c59 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/TenantCategory.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/TenantCategory.cs @@ -1,31 +1,24 @@ -// // 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.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; /// /// Defines values for TenantCategory. /// - [JsonConverter(typeof(StringEnumConverter))] + + + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] public enum TenantCategory { - [EnumMember(Value = "Home")] + [System.Runtime.Serialization.EnumMember(Value = "Home")] Home, - [EnumMember(Value = "ProjectedBy")] + [System.Runtime.Serialization.EnumMember(Value = "ProjectedBy")] ProjectedBy, - [EnumMember(Value = "ManagedBy")] + [System.Runtime.Serialization.EnumMember(Value = "ManagedBy")] ManagedBy } internal static class TenantCategoryEnumExtension @@ -34,7 +27,6 @@ internal static string ToSerializedValue(this TenantCategory? value) { return value == null ? null : ((TenantCategory)value).ToSerializedValue(); } - internal static string ToSerializedValue(this TenantCategory value) { switch( value ) @@ -48,7 +40,6 @@ internal static string ToSerializedValue(this TenantCategory value) } return null; } - internal static TenantCategory? ParseTenantCategory(this string value) { switch( value ) @@ -63,4 +54,4 @@ internal static string ToSerializedValue(this TenantCategory value) return null; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Management.Sdk/Generated/Models/TenantIdDescription.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/TenantIdDescription.cs new file mode 100644 index 000000000000..b48fcb261fc5 --- /dev/null +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/TenantIdDescription.cs @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Resources.Models +{ + using System.Linq; + + /// + /// Tenant Id information. + /// + public partial class TenantIdDescription + { + /// + /// Initializes a new instance of the TenantIdDescription class. + /// + public TenantIdDescription() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the TenantIdDescription class. + /// + + /// The fully qualified ID of the tenant. For example, + /// /tenants/00000000-0000-0000-0000-000000000000. + /// + + /// The tenant ID. For example, 00000000-0000-0000-0000-000000000000. + /// + + /// Category of the tenant. + /// Possible values include: 'Home', 'ProjectedBy', 'ManagedBy' + + /// Country/region name of the address for the tenant. + /// + + /// Country/region abbreviation for the tenant. + /// + + /// The display name of the tenant. + /// + + /// The list of domains for the tenant. + /// + + /// The default domain for the tenant. + /// + + /// The tenant type. Only available for 'Home' tenant category. + /// + + /// The tenant's branding logo URL. Only available for 'Home' tenant category. + /// + public TenantIdDescription(string id = default(string), string tenantId = default(string), TenantCategory? tenantCategory = default(TenantCategory?), string country = default(string), string countryCode = default(string), string displayName = default(string), System.Collections.Generic.IList domains = default(System.Collections.Generic.IList), string defaultDomain = default(string), string tenantType = default(string), string tenantBrandingLogoUrl = default(string)) + + { + this.Id = id; + this.TenantId = tenantId; + this.TenantCategory = tenantCategory; + this.Country = country; + this.CountryCode = countryCode; + this.DisplayName = displayName; + this.Domains = domains; + this.DefaultDomain = defaultDomain; + this.TenantType = tenantType; + this.TenantBrandingLogoUrl = tenantBrandingLogoUrl; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets the fully qualified ID of the tenant. For example, + /// /tenants/00000000-0000-0000-0000-000000000000. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; private set; } + + /// + /// Gets the tenant ID. For example, 00000000-0000-0000-0000-000000000000. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "tenantId")] + public string TenantId {get; private set; } + + /// + /// Gets category of the tenant. Possible values include: 'Home', 'ProjectedBy', 'ManagedBy' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "tenantCategory")] + public TenantCategory? TenantCategory {get; private set; } + + /// + /// Gets country/region name of the address for the tenant. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "country")] + public string Country {get; private set; } + + /// + /// Gets country/region abbreviation for the tenant. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "countryCode")] + public string CountryCode {get; private set; } + + /// + /// Gets the display name of the tenant. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "displayName")] + public string DisplayName {get; private set; } + + /// + /// Gets the list of domains for the tenant. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "domains")] + public System.Collections.Generic.IList Domains {get; private set; } + + /// + /// Gets the default domain for the tenant. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "defaultDomain")] + public string DefaultDomain {get; private set; } + + /// + /// Gets the tenant type. Only available for 'Home' tenant category. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "tenantType")] + public string TenantType {get; private set; } + + /// + /// Gets the tenant's branding logo URL. Only available for 'Home' tenant + /// category. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "tenantBrandingLogoUrl")] + public string TenantBrandingLogoUrl {get; private set; } + } +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/UnmanageActionManagementGroupMode.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/UnmanageActionManagementGroupMode.cs similarity index 84% rename from src/Resources/Resources.Sdk/Generated/Models/UnmanageActionManagementGroupMode.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/UnmanageActionManagementGroupMode.cs index 03656a2c18bb..31a4319c5f00 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/UnmanageActionManagementGroupMode.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/UnmanageActionManagementGroupMode.cs @@ -1,12 +1,7 @@ -// // 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.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Resources.Models /// /// Defines values for UnmanageActionManagementGroupMode. /// + + public static class UnmanageActionManagementGroupMode { public const string Delete = "delete"; public const string Detach = "detach"; } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/UnmanageActionResourceGroupMode.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/UnmanageActionResourceGroupMode.cs similarity index 84% rename from src/Resources/Resources.Sdk/Generated/Models/UnmanageActionResourceGroupMode.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/UnmanageActionResourceGroupMode.cs index fdb0592fb200..e64511a17fbf 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/UnmanageActionResourceGroupMode.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/UnmanageActionResourceGroupMode.cs @@ -1,12 +1,7 @@ -// // 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.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Resources.Models /// /// Defines values for UnmanageActionResourceGroupMode. /// + + public static class UnmanageActionResourceGroupMode { public const string Delete = "delete"; public const string Detach = "detach"; } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/UnmanageActionResourceMode.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/UnmanageActionResourceMode.cs similarity index 84% rename from src/Resources/Resources.Sdk/Generated/Models/UnmanageActionResourceMode.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/UnmanageActionResourceMode.cs index 0def28b2dd00..b81bec9fba7e 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/UnmanageActionResourceMode.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/UnmanageActionResourceMode.cs @@ -1,12 +1,7 @@ -// // 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.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Resources.Models /// /// Defines values for UnmanageActionResourceMode. /// + + public static class UnmanageActionResourceMode { public const string Delete = "delete"; public const string Detach = "detach"; } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/UserAssignedIdentity.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/UserAssignedIdentity.cs similarity index 72% rename from src/Resources/Resources.Sdk/Generated/Models/UserAssignedIdentity.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/UserAssignedIdentity.cs index b8dba2f8a421..96adc29d1be1 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/UserAssignedIdentity.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/UserAssignedIdentity.cs @@ -1,16 +1,10 @@ -// // 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.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,14 +23,17 @@ public UserAssignedIdentity() /// /// Initializes a new instance of the UserAssignedIdentity class. /// - /// Azure Active Directory principal ID - /// associated with this identity. - /// Client App Id associated with this - /// identity. + + /// Azure Active Directory principal ID associated with this identity. + /// + + /// Client App Id associated with this identity. + /// public UserAssignedIdentity(string principalId = default(string), string clientId = default(string)) + { - PrincipalId = principalId; - ClientId = clientId; + this.PrincipalId = principalId; + this.ClientId = clientId; CustomInit(); } @@ -45,18 +42,17 @@ public UserAssignedIdentity() /// partial void CustomInit(); + /// - /// Gets azure Active Directory principal ID associated with this - /// identity. + /// Gets azure Active Directory principal ID associated with this identity. /// - [JsonProperty(PropertyName = "principalId")] - public string PrincipalId { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "principalId")] + public string PrincipalId {get; private set; } /// /// Gets client App Id associated with this identity. /// - [JsonProperty(PropertyName = "clientId")] - public string ClientId { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "clientId")] + public string ClientId {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/WhatIfChange.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/WhatIfChange.cs similarity index 51% rename from src/Resources/Resources.Sdk/Generated/Models/WhatIfChange.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/WhatIfChange.cs index 9a6b8e69da80..af7748d237be 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/WhatIfChange.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/WhatIfChange.cs @@ -1,24 +1,14 @@ -// // 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.Models { - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// - /// Information about a single resource change predicted by What-If - /// operation. + /// Information about a single resource change predicted by What-If operation. /// public partial class WhatIfChange { @@ -33,27 +23,35 @@ public WhatIfChange() /// /// Initializes a new instance of the WhatIfChange class. /// - /// Resource ID - /// Type of change that will be made to the - /// resource when the deployment is executed. Possible values include: - /// 'Create', 'Delete', 'Ignore', 'Deploy', 'NoChange', 'Modify', - /// 'Unsupported' - /// The explanation about why the - /// resource is unsupported by What-If. - /// The snapshot of the resource before the - /// deployment is executed. - /// The predicted snapshot of the resource after - /// the deployment is executed. - /// The predicted changes to resource - /// properties. - public WhatIfChange(string resourceId, ChangeType changeType, string unsupportedReason = default(string), object before = default(object), object after = default(object), IList delta = default(IList)) + + /// Resource ID + /// + + /// Type of change that will be made to the resource when the deployment is + /// executed. + /// Possible values include: 'Create', 'Delete', 'Ignore', 'Deploy', + /// 'NoChange', 'Modify', 'Unsupported' + + /// The explanation about why the resource is unsupported by What-If. + /// + + /// The snapshot of the resource before the deployment is executed. + /// + + /// The predicted snapshot of the resource after the deployment is executed. + /// + + /// The predicted changes to resource properties. + /// + public WhatIfChange(string resourceId, ChangeType changeType, string unsupportedReason = default(string), object before = default(object), object after = default(object), System.Collections.Generic.IList delta = default(System.Collections.Generic.IList)) + { - ResourceId = resourceId; - ChangeType = changeType; - UnsupportedReason = unsupportedReason; - Before = before; - After = after; - Delta = delta; + this.ResourceId = resourceId; + this.ChangeType = changeType; + this.UnsupportedReason = unsupportedReason; + this.Before = before; + this.After = after; + this.Delta = delta; CustomInit(); } @@ -62,62 +60,66 @@ public WhatIfChange() /// partial void CustomInit(); + /// /// Gets or sets resource ID /// - [JsonProperty(PropertyName = "resourceId")] - public string ResourceId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "resourceId")] + public string ResourceId {get; set; } /// - /// Gets or sets type of change that will be made to the resource when - /// the deployment is executed. Possible values include: 'Create', - /// 'Delete', 'Ignore', 'Deploy', 'NoChange', 'Modify', 'Unsupported' + /// Gets or sets type of change that will be made to the resource when the + /// deployment is executed. Possible values include: 'Create', 'Delete', 'Ignore', 'Deploy', 'NoChange', 'Modify', 'Unsupported' /// - [JsonProperty(PropertyName = "changeType")] - public ChangeType ChangeType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "changeType")] + public ChangeType ChangeType {get; set; } /// - /// Gets or sets the explanation about why the resource is unsupported - /// by What-If. + /// Gets or sets the explanation about why the resource is unsupported by + /// What-If. /// - [JsonProperty(PropertyName = "unsupportedReason")] - public string UnsupportedReason { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "unsupportedReason")] + public string UnsupportedReason {get; set; } /// /// Gets or sets the snapshot of the resource before the deployment is /// executed. /// - [JsonProperty(PropertyName = "before")] - public object Before { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "before")] + public object Before {get; set; } /// - /// Gets or sets the predicted snapshot of the resource after the - /// deployment is executed. + /// Gets or sets the predicted snapshot of the resource after the deployment is + /// executed. /// - [JsonProperty(PropertyName = "after")] - public object After { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "after")] + public object After {get; set; } /// /// Gets or sets the predicted changes to resource properties. /// - [JsonProperty(PropertyName = "delta")] - public IList Delta { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "delta")] + public System.Collections.Generic.IList Delta {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (ResourceId == null) + if (this.ResourceId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "ResourceId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "ResourceId"); } - if (Delta != null) + + + + + + if (this.Delta != null) { - foreach (var element in Delta) + foreach (var element in this.Delta) { if (element != null) { @@ -127,4 +129,4 @@ public virtual void Validate() } } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Management.Sdk/Generated/Models/WhatIfOperationProperties.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/WhatIfOperationProperties.cs new file mode 100644 index 000000000000..e58196d3c803 --- /dev/null +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/WhatIfOperationProperties.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Resources.Models +{ + using System.Linq; + + /// + /// Deployment operation properties. + /// + public partial class WhatIfOperationProperties + { + /// + /// Initializes a new instance of the WhatIfOperationProperties class. + /// + public WhatIfOperationProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the WhatIfOperationProperties class. + /// + + /// List of resource changes predicted by What-If operation. + /// + public WhatIfOperationProperties(System.Collections.Generic.IList changes = default(System.Collections.Generic.IList)) + + { + this.Changes = changes; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets list of resource changes predicted by What-If operation. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "changes")] + public System.Collections.Generic.IList Changes {get; set; } + } +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/WhatIfOperationResult.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/WhatIfOperationResult.cs similarity index 62% rename from src/Resources/Resources.Sdk/Generated/Models/WhatIfOperationResult.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/WhatIfOperationResult.cs index 2769453cb3b3..fdeb5bf79388 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/WhatIfOperationResult.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/WhatIfOperationResult.cs @@ -1,27 +1,17 @@ -// // 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.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// - /// Result of the What-If operation. Contains a list of predicted changes - /// and a URL link to get to the next set of results. + /// Result of the What-If operation. Contains a list of predicted changes and a + /// URL link to get to the next set of results. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class WhatIfOperationResult { /// @@ -35,15 +25,21 @@ public WhatIfOperationResult() /// /// Initializes a new instance of the WhatIfOperationResult class. /// - /// Status of the What-If operation. - /// List of resource changes predicted by What-If - /// operation. - /// Error when What-If operation fails. - public WhatIfOperationResult(string status = default(string), IList changes = default(IList), ErrorResponse error = default(ErrorResponse)) + + /// Status of the What-If operation. + /// + + /// Error when What-If operation fails. + /// + + /// List of resource changes predicted by What-If operation. + /// + public WhatIfOperationResult(string status = default(string), ErrorResponse error = default(ErrorResponse), System.Collections.Generic.IList changes = default(System.Collections.Generic.IList)) + { - Status = status; - Changes = changes; - Error = error; + this.Status = status; + this.Error = error; + this.Changes = changes; CustomInit(); } @@ -52,24 +48,23 @@ public WhatIfOperationResult() /// partial void CustomInit(); + /// /// Gets or sets status of the What-If operation. /// - [JsonProperty(PropertyName = "status")] - public string Status { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "status")] + public string Status {get; set; } /// - /// Gets or sets list of resource changes predicted by What-If - /// operation. + /// Gets or sets error when What-If operation fails. /// - [JsonProperty(PropertyName = "properties.changes")] - public IList Changes { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "error")] + public ErrorResponse Error {get; set; } /// - /// Gets or sets error when What-If operation fails. + /// Gets or sets list of resource changes predicted by What-If operation. /// - [JsonProperty(PropertyName = "error")] - public ErrorResponse Error { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.changes")] + public System.Collections.Generic.IList Changes {get; set; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/WhatIfPropertyChange.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/WhatIfPropertyChange.cs similarity index 55% rename from src/Resources/Resources.Sdk/Generated/Models/WhatIfPropertyChange.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/WhatIfPropertyChange.cs index 21981587ac60..755fae24d1bb 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/WhatIfPropertyChange.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/WhatIfPropertyChange.cs @@ -1,19 +1,10 @@ -// // 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.Models { - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -32,22 +23,29 @@ public WhatIfPropertyChange() /// /// Initializes a new instance of the WhatIfPropertyChange class. /// - /// The path of the property. + + /// The path of the property. + /// + /// The type of property change. - /// Possible values include: 'Create', 'Delete', 'Modify', 'Array', - /// 'NoEffect' - /// The value of the property before the - /// deployment is executed. - /// The value of the property after the deployment - /// is executed. - /// Nested property changes. - public WhatIfPropertyChange(string path, PropertyChangeType propertyChangeType, object before = default(object), object after = default(object), IList children = default(IList)) + /// Possible values include: 'Create', 'Delete', 'Modify', 'Array', 'NoEffect' + + /// The value of the property before the deployment is executed. + /// + + /// The value of the property after the deployment is executed. + /// + + /// Nested property changes. + /// + public WhatIfPropertyChange(string path, PropertyChangeType propertyChangeType, object before = default(object), object after = default(object), System.Collections.Generic.IList children = default(System.Collections.Generic.IList)) + { - Path = path; - PropertyChangeType = propertyChangeType; - Before = before; - After = after; - Children = children; + this.Path = path; + this.PropertyChangeType = propertyChangeType; + this.Before = before; + this.After = after; + this.Children = children; CustomInit(); } @@ -56,54 +54,55 @@ public WhatIfPropertyChange() /// partial void CustomInit(); + /// /// Gets or sets the path of the property. /// - [JsonProperty(PropertyName = "path")] - public string Path { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "path")] + public string Path {get; set; } /// - /// Gets or sets the type of property change. Possible values include: - /// 'Create', 'Delete', 'Modify', 'Array', 'NoEffect' + /// Gets or sets the type of property change. Possible values include: 'Create', 'Delete', 'Modify', 'Array', 'NoEffect' /// - [JsonProperty(PropertyName = "propertyChangeType")] - public PropertyChangeType PropertyChangeType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "propertyChangeType")] + public PropertyChangeType PropertyChangeType {get; set; } /// - /// Gets or sets the value of the property before the deployment is - /// executed. + /// Gets or sets the value of the property before the deployment is executed. /// - [JsonProperty(PropertyName = "before")] - public object Before { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "before")] + public object Before {get; set; } /// - /// Gets or sets the value of the property after the deployment is - /// executed. + /// Gets or sets the value of the property after the deployment is executed. /// - [JsonProperty(PropertyName = "after")] - public object After { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "after")] + public object After {get; set; } /// /// Gets or sets nested property changes. /// - [JsonProperty(PropertyName = "children")] - public IList Children { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "children")] + public System.Collections.Generic.IList Children {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Path == null) + if (this.Path == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Path"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Path"); } - if (Children != null) + + + + + if (this.Children != null) { - foreach (var element in Children) + foreach (var element in this.Children) { if (element != null) { @@ -113,4 +112,4 @@ public virtual void Validate() } } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/WhatIfResultFormat.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/WhatIfResultFormat.cs similarity index 80% rename from src/Resources/Resources.Sdk/Generated/Models/WhatIfResultFormat.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/WhatIfResultFormat.cs index 6538818337fb..a6dbc9fa08b9 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/WhatIfResultFormat.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/WhatIfResultFormat.cs @@ -1,29 +1,22 @@ -// // 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.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; /// /// Defines values for WhatIfResultFormat. /// - [JsonConverter(typeof(StringEnumConverter))] + + + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] public enum WhatIfResultFormat { - [EnumMember(Value = "ResourceIdOnly")] + [System.Runtime.Serialization.EnumMember(Value = "ResourceIdOnly")] ResourceIdOnly, - [EnumMember(Value = "FullResourcePayloads")] + [System.Runtime.Serialization.EnumMember(Value = "FullResourcePayloads")] FullResourcePayloads } internal static class WhatIfResultFormatEnumExtension @@ -32,7 +25,6 @@ internal static string ToSerializedValue(this WhatIfResultFormat? value) { return value == null ? null : ((WhatIfResultFormat)value).ToSerializedValue(); } - internal static string ToSerializedValue(this WhatIfResultFormat value) { switch( value ) @@ -44,7 +36,6 @@ internal static string ToSerializedValue(this WhatIfResultFormat value) } return null; } - internal static WhatIfResultFormat? ParseWhatIfResultFormat(this string value) { switch( value ) @@ -57,4 +48,4 @@ internal static string ToSerializedValue(this WhatIfResultFormat value) return null; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Models/ZoneMapping.cs b/src/Resources/Resources.Management.Sdk/Generated/Models/ZoneMapping.cs similarity index 63% rename from src/Resources/Resources.Sdk/Generated/Models/ZoneMapping.cs rename to src/Resources/Resources.Management.Sdk/Generated/Models/ZoneMapping.cs index cba653880677..841f877440c9 100644 --- a/src/Resources/Resources.Sdk/Generated/Models/ZoneMapping.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Models/ZoneMapping.cs @@ -1,18 +1,10 @@ -// // 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.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; public partial class ZoneMapping @@ -28,11 +20,17 @@ public ZoneMapping() /// /// Initializes a new instance of the ZoneMapping class. /// - /// The location of the zone mapping. - public ZoneMapping(string location = default(string), IList zones = default(IList)) + + /// The location of the zone mapping. + /// + + /// + /// + public ZoneMapping(string location = default(string), System.Collections.Generic.IList zones = default(System.Collections.Generic.IList)) + { - Location = location; - Zones = zones; + this.Location = location; + this.Zones = zones; CustomInit(); } @@ -41,16 +39,17 @@ public ZoneMapping() /// partial void CustomInit(); + /// /// Gets or sets the location of the zone mapping. /// - [JsonProperty(PropertyName = "location")] - public string Location { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + public string Location {get; set; } /// + /// Gets or sets /// - [JsonProperty(PropertyName = "zones")] - public IList Zones { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "zones")] + public System.Collections.Generic.IList Zones {get; set; } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/Operations.cs b/src/Resources/Resources.Management.Sdk/Generated/Operations.cs similarity index 58% rename from src/Resources/Resources.Sdk/Generated/Operations.cs rename to src/Resources/Resources.Management.Sdk/Generated/Operations.cs index 1cfe6cbb5016..9d207e0e5585 100644 --- a/src/Resources/Resources.Sdk/Generated/Operations.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/Operations.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; /// /// Operations operations. /// - internal partial class Operations : IServiceOperations, IOperations + internal partial class Operations : Microsoft.Rest.IServiceOperations, IOperations { /// /// Initializes a new instance of the Operations class. @@ -36,13 +24,13 @@ internal partial class Operations : IServiceOperations /// /// Thrown when a required parameter is null /// - internal Operations(ResourceManagementClient client) + internal Operations (ResourceManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -59,13 +47,13 @@ internal Operations(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 /// /// @@ -74,54 +62,62 @@ internal Operations(ResourceManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - 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("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("/") ? "" : "/")), "providers/Microsoft.Resources/operations").ToString(); - 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) @@ -133,55 +129,56 @@ internal Operations(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) @@ -191,9 +188,10 @@ internal Operations(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(); @@ -204,25 +202,29 @@ internal Operations(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; - } + + + + + } /// /// Lists all of the available Microsoft.Resources REST API operations. /// @@ -235,13 +237,13 @@ internal Operations(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 /// /// @@ -250,51 +252,54 @@ internal Operations(ResourceManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(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, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", 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) @@ -306,55 +311,56 @@ internal Operations(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) @@ -364,9 +370,10 @@ internal Operations(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(); @@ -377,24 +384,28 @@ internal Operations(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; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Management.Sdk/Generated/OperationsExtensions.cs b/src/Resources/Resources.Management.Sdk/Generated/OperationsExtensions.cs new file mode 100644 index 000000000000..eb8dd7383f74 --- /dev/null +++ b/src/Resources/Resources.Management.Sdk/Generated/OperationsExtensions.cs @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.Management.Resources +{ + using Microsoft.Rest.Azure; + using Models; + + /// + /// Extension methods for Operations + /// + public static partial class OperationsExtensions + { + /// + /// Lists all of the available Microsoft.Resources REST API operations. + /// + /// + /// The operations group for this extension method. + /// + public static Microsoft.Rest.Azure.IPage List(this IOperations operations) + { + return ((IOperations)operations).ListAsync().GetAwaiter().GetResult(); + } + + /// + /// Lists all of the available Microsoft.Resources REST API operations. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Lists all of the available Microsoft.Resources REST API operations. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IOperations operations, string nextPageLink) + { + return ((IOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists all of the available Microsoft.Resources REST API operations. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + } +} diff --git a/src/Resources/Resources.Sdk/Generated/PrivateLinkAssociationOperations.cs b/src/Resources/Resources.Management.Sdk/Generated/PrivateLinkAssociationOperations.cs similarity index 57% rename from src/Resources/Resources.Sdk/Generated/PrivateLinkAssociationOperations.cs rename to src/Resources/Resources.Management.Sdk/Generated/PrivateLinkAssociationOperations.cs index 996f2405f143..f2614e0003d3 100644 --- a/src/Resources/Resources.Sdk/Generated/PrivateLinkAssociationOperations.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/PrivateLinkAssociationOperations.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; /// /// PrivateLinkAssociationOperations operations. /// - internal partial class PrivateLinkAssociationOperations : IServiceOperations, IPrivateLinkAssociationOperations + internal partial class PrivateLinkAssociationOperations : Microsoft.Rest.IServiceOperations, IPrivateLinkAssociationOperations { /// /// Initializes a new instance of the PrivateLinkAssociationOperations class. @@ -36,13 +24,13 @@ internal partial class PrivateLinkAssociationOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal PrivateLinkAssociationOperations(ResourcePrivateLinkClient client) + internal PrivateLinkAssociationOperations (ResourcePrivateLinkClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -68,13 +56,13 @@ internal PrivateLinkAssociationOperations(ResourcePrivateLinkClient 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,82 +71,92 @@ internal PrivateLinkAssociationOperations(ResourcePrivateLinkClient client) /// /// A response object containing the response body and response headers. /// - public async Task> PutWithHttpMessagesAsync(string groupId, string plaId, PrivateLinkAssociationObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> PutWithHttpMessagesAsync(string groupId, string plaId, PrivateLinkAssociationObject parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.ApiVersion == null) + + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } + + if (this.Client.ApiVersion == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + 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 (plaId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "plaId"); - } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "plaId"); } + // 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("plaId", plaId); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Put", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Put", 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.Authorization/privateLinkAssociations/{plaId}").ToString(); _url = _url.Replace("{groupId}", System.Uri.EscapeDataString(groupId)); _url = _url.Replace("{plaId}", System.Uri.EscapeDataString(plaId)); - 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("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _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) @@ -170,61 +168,62 @@ internal PrivateLinkAssociationOperations(ResourcePrivateLinkClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + 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 && (int)_statusCode != 201) { - 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) @@ -234,9 +233,10 @@ internal PrivateLinkAssociationOperations(ResourcePrivateLinkClient 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(); @@ -247,16 +247,16 @@ internal PrivateLinkAssociationOperations(ResourcePrivateLinkClient 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); } } // Deserialize Response @@ -265,25 +265,29 @@ internal PrivateLinkAssociationOperations(ResourcePrivateLinkClient 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; - } + + + + + } /// /// Get a single private link association /// @@ -299,13 +303,13 @@ internal PrivateLinkAssociationOperations(ResourcePrivateLinkClient 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 /// /// @@ -314,77 +318,86 @@ internal PrivateLinkAssociationOperations(ResourcePrivateLinkClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string groupId, string plaId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string groupId, string plaId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - 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 (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 (plaId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "plaId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "plaId"); } + // 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("plaId", plaId); + + 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("/") ? "" : "/")), "providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Authorization/privateLinkAssociations/{plaId}").ToString(); _url = _url.Replace("{groupId}", System.Uri.EscapeDataString(groupId)); _url = _url.Replace("{plaId}", System.Uri.EscapeDataString(plaId)); - 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) @@ -396,55 +409,56 @@ internal PrivateLinkAssociationOperations(ResourcePrivateLinkClient 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) @@ -454,9 +468,10 @@ internal PrivateLinkAssociationOperations(ResourcePrivateLinkClient 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(); @@ -467,25 +482,29 @@ internal PrivateLinkAssociationOperations(ResourcePrivateLinkClient 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; - } + + + + + } /// /// Delete a PrivateLinkAssociation /// @@ -501,10 +520,10 @@ internal PrivateLinkAssociationOperations(ResourcePrivateLinkClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -513,77 +532,86 @@ internal PrivateLinkAssociationOperations(ResourcePrivateLinkClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteWithHttpMessagesAsync(string groupId, string plaId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string groupId, string plaId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - 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 (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 (plaId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "plaId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "plaId"); } + // 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("plaId", plaId); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Delete", 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.Authorization/privateLinkAssociations/{plaId}").ToString(); _url = _url.Replace("{groupId}", System.Uri.EscapeDataString(groupId)); _url = _url.Replace("{plaId}", System.Uri.EscapeDataString(plaId)); - 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("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _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 +623,56 @@ internal PrivateLinkAssociationOperations(ResourcePrivateLinkClient 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 && (int)_statusCode != 204) { - 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,20 +682,25 @@ internal PrivateLinkAssociationOperations(ResourcePrivateLinkClient 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(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Get a private link association for a management group scope /// @@ -679,13 +713,13 @@ internal PrivateLinkAssociationOperations(ResourcePrivateLinkClient 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 /// /// @@ -694,71 +728,79 @@ internal PrivateLinkAssociationOperations(ResourcePrivateLinkClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListWithHttpMessagesAsync(string groupId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> ListWithHttpMessagesAsync(string groupId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - 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 (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); } } // 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("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("/") ? "" : "/")), "providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Authorization/privateLinkAssociations").ToString(); _url = _url.Replace("{groupId}", System.Uri.EscapeDataString(groupId)); - 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) @@ -770,55 +812,56 @@ internal PrivateLinkAssociationOperations(ResourcePrivateLinkClient 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) @@ -828,9 +871,10 @@ internal PrivateLinkAssociationOperations(ResourcePrivateLinkClient 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(); @@ -841,24 +885,28 @@ internal PrivateLinkAssociationOperations(ResourcePrivateLinkClient 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; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Management.Sdk/Generated/PrivateLinkAssociationOperationsExtensions.cs b/src/Resources/Resources.Management.Sdk/Generated/PrivateLinkAssociationOperationsExtensions.cs new file mode 100644 index 000000000000..40540047b28c --- /dev/null +++ b/src/Resources/Resources.Management.Sdk/Generated/PrivateLinkAssociationOperationsExtensions.cs @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.Management.Resources +{ + using Microsoft.Rest.Azure; + using Models; + + /// + /// Extension methods for PrivateLinkAssociationOperations + /// + public static partial class PrivateLinkAssociationOperationsExtensions + { + /// + /// Create a PrivateLinkAssociation + /// + /// + /// The operations group for this extension method. + /// + /// + /// The management group ID. + /// + /// + /// The ID of the PLA + /// + public static PrivateLinkAssociation Put(this IPrivateLinkAssociationOperations operations, string groupId, string plaId, PrivateLinkAssociationObject parameters) + { + return ((IPrivateLinkAssociationOperations)operations).PutAsync(groupId, plaId, parameters).GetAwaiter().GetResult(); + } + + /// + /// Create a PrivateLinkAssociation + /// + /// + /// The operations group for this extension method. + /// + /// + /// The management group ID. + /// + /// + /// The ID of the PLA + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task PutAsync(this IPrivateLinkAssociationOperations operations, string groupId, string plaId, PrivateLinkAssociationObject parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.PutWithHttpMessagesAsync(groupId, plaId, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Get a single private link association + /// + /// + /// The operations group for this extension method. + /// + /// + /// The management group ID. + /// + /// + /// The ID of the PLA + /// + public static PrivateLinkAssociation Get(this IPrivateLinkAssociationOperations operations, string groupId, string plaId) + { + return ((IPrivateLinkAssociationOperations)operations).GetAsync(groupId, plaId).GetAwaiter().GetResult(); + } + + /// + /// Get a single private link association + /// + /// + /// The operations group for this extension method. + /// + /// + /// The management group ID. + /// + /// + /// The ID of the PLA + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IPrivateLinkAssociationOperations operations, string groupId, string plaId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(groupId, plaId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Delete a PrivateLinkAssociation + /// + /// + /// The operations group for this extension method. + /// + /// + /// The management group ID. + /// + /// + /// The ID of the PLA + /// + public static void Delete(this IPrivateLinkAssociationOperations operations, string groupId, string plaId) + { + ((IPrivateLinkAssociationOperations)operations).DeleteAsync(groupId, plaId).GetAwaiter().GetResult(); + } + + /// + /// Delete a PrivateLinkAssociation + /// + /// + /// The operations group for this extension method. + /// + /// + /// The management group ID. + /// + /// + /// The ID of the PLA + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IPrivateLinkAssociationOperations operations, string groupId, string plaId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(groupId, plaId, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Get a private link association for a management group scope + /// + /// + /// The operations group for this extension method. + /// + /// + /// The management group ID. + /// + public static PrivateLinkAssociationGetResult List(this IPrivateLinkAssociationOperations operations, string groupId) + { + return ((IPrivateLinkAssociationOperations)operations).ListAsync(groupId).GetAwaiter().GetResult(); + } + + /// + /// Get a private link association for a management group scope + /// + /// + /// The operations group for this extension method. + /// + /// + /// The management group ID. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task ListAsync(this IPrivateLinkAssociationOperations operations, string groupId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(groupId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + } +} diff --git a/src/Resources/Resources.Sdk/Generated/ProviderResourceTypesOperations.cs b/src/Resources/Resources.Management.Sdk/Generated/ProviderResourceTypesOperations.cs similarity index 60% rename from src/Resources/Resources.Sdk/Generated/ProviderResourceTypesOperations.cs rename to src/Resources/Resources.Management.Sdk/Generated/ProviderResourceTypesOperations.cs index 317c80613639..1b48e626a5d8 100644 --- a/src/Resources/Resources.Sdk/Generated/ProviderResourceTypesOperations.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/ProviderResourceTypesOperations.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; /// /// ProviderResourceTypesOperations operations. /// - internal partial class ProviderResourceTypesOperations : IServiceOperations, IProviderResourceTypesOperations + internal partial class ProviderResourceTypesOperations : Microsoft.Rest.IServiceOperations, IProviderResourceTypesOperations { /// /// Initializes a new instance of the ProviderResourceTypesOperations class. @@ -36,13 +24,13 @@ internal partial class ProviderResourceTypesOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal ProviderResourceTypesOperations(ResourceManagementClient client) + internal ProviderResourceTypesOperations (ResourceManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -53,26 +41,26 @@ internal ProviderResourceTypesOperations(ResourceManagementClient client) /// /// List the resource types for a specified resource provider. /// - /// - /// The namespace of the resource provider. - /// /// /// The $expand query parameter. For example, to include property aliases in /// response, use $expand=resourceTypes/aliases. /// + /// + /// The namespace of the resource provider. + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -81,70 +69,81 @@ internal ProviderResourceTypesOperations(ResourceManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListWithHttpMessagesAsync(string resourceProviderNamespace, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> ListWithHttpMessagesAsync(string resourceProviderNamespace, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + + if (resourceProviderNamespace == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceProviderNamespace"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceProviderNamespace"); } - 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("expand", expand); tracingParameters.Add("resourceProviderNamespace", resourceProviderNamespace); + + 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}/providers/{resourceProviderNamespace}/resourceTypes").ToString(); _url = _url.Replace("{resourceProviderNamespace}", System.Uri.EscapeDataString(resourceProviderNamespace)); - _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 (expand != null) { _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand))); } - 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) @@ -156,55 +155,56 @@ internal ProviderResourceTypesOperations(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) @@ -214,9 +214,10 @@ internal ProviderResourceTypesOperations(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(); @@ -227,24 +228,28 @@ internal ProviderResourceTypesOperations(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; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Management.Sdk/Generated/ProviderResourceTypesOperationsExtensions.cs b/src/Resources/Resources.Management.Sdk/Generated/ProviderResourceTypesOperationsExtensions.cs new file mode 100644 index 000000000000..ac17e804c56a --- /dev/null +++ b/src/Resources/Resources.Management.Sdk/Generated/ProviderResourceTypesOperationsExtensions.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.Management.Resources +{ + using Microsoft.Rest.Azure; + using Models; + + /// + /// Extension methods for ProviderResourceTypesOperations + /// + public static partial class ProviderResourceTypesOperationsExtensions + { + /// + /// List the resource types for a specified resource provider. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The $expand query parameter. For example, to include property aliases in + /// response, use $expand=resourceTypes/aliases. + /// + /// + /// The namespace of the resource provider. + /// + public static ProviderResourceTypeListResult List(this IProviderResourceTypesOperations operations, string resourceProviderNamespace, string expand = default(string)) + { + return ((IProviderResourceTypesOperations)operations).ListAsync(resourceProviderNamespace, expand).GetAwaiter().GetResult(); + } + + /// + /// List the resource types for a specified resource provider. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The $expand query parameter. For example, to include property aliases in + /// response, use $expand=resourceTypes/aliases. + /// + /// + /// The namespace of the resource provider. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task ListAsync(this IProviderResourceTypesOperations operations, string resourceProviderNamespace, string expand = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceProviderNamespace, expand, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + } +} diff --git a/src/Resources/Resources.Sdk/Generated/ProvidersOperations.cs b/src/Resources/Resources.Management.Sdk/Generated/ProvidersOperations.cs similarity index 57% rename from src/Resources/Resources.Sdk/Generated/ProvidersOperations.cs rename to src/Resources/Resources.Management.Sdk/Generated/ProvidersOperations.cs index 75f8a919dc6e..ed393b331c52 100644 --- a/src/Resources/Resources.Sdk/Generated/ProvidersOperations.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/ProvidersOperations.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; /// /// ProvidersOperations operations. /// - internal partial class ProvidersOperations : IServiceOperations, IProvidersOperations + internal partial class ProvidersOperations : Microsoft.Rest.IServiceOperations, IProvidersOperations { /// /// Initializes a new instance of the ProvidersOperations class. @@ -36,13 +24,13 @@ internal partial class ProvidersOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal ProvidersOperations(ResourceManagementClient client) + internal ProvidersOperations (ResourceManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -62,13 +50,13 @@ internal ProvidersOperations(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 /// /// @@ -77,65 +65,75 @@ internal ProvidersOperations(ResourceManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UnregisterWithHttpMessagesAsync(string resourceProviderNamespace, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> UnregisterWithHttpMessagesAsync(string resourceProviderNamespace, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceProviderNamespace == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceProviderNamespace"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceProviderNamespace"); } - 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("resourceProviderNamespace", resourceProviderNamespace); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Unregister", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Unregister", 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/{resourceProviderNamespace}/unregister").ToString(); _url = _url.Replace("{resourceProviderNamespace}", System.Uri.EscapeDataString(resourceProviderNamespace)); - _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("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _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) @@ -147,55 +145,56 @@ internal ProvidersOperations(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) @@ -205,9 +204,10 @@ internal ProvidersOperations(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(); @@ -218,25 +218,29 @@ internal ProvidersOperations(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; - } + + + + + } /// /// Registers a management group with a resource provider. Use this operation /// to register a resource provider with resource types that can be deployed at @@ -256,10 +260,10 @@ internal ProvidersOperations(ResourceManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -268,77 +272,86 @@ internal ProvidersOperations(ResourceManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task RegisterAtManagementGroupScopeWithHttpMessagesAsync(string resourceProviderNamespace, string groupId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task RegisterAtManagementGroupScopeWithHttpMessagesAsync(string resourceProviderNamespace, string groupId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceProviderNamespace == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceProviderNamespace"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceProviderNamespace"); } - 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 (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); } } // 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("resourceProviderNamespace", resourceProviderNamespace); tracingParameters.Add("groupId", groupId); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "RegisterAtManagementGroupScope", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "RegisterAtManagementGroupScope", 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/{resourceProviderNamespace}/register").ToString(); _url = _url.Replace("{resourceProviderNamespace}", System.Uri.EscapeDataString(resourceProviderNamespace)); _url = _url.Replace("{groupId}", System.Uri.EscapeDataString(groupId)); - 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("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _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) @@ -350,55 +363,56 @@ internal ProvidersOperations(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) @@ -408,20 +422,25 @@ internal ProvidersOperations(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(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Get the provider permissions. /// @@ -434,13 +453,13 @@ internal ProvidersOperations(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 /// /// @@ -449,65 +468,75 @@ internal ProvidersOperations(ResourceManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ProviderPermissionsWithHttpMessagesAsync(string resourceProviderNamespace, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> ProviderPermissionsWithHttpMessagesAsync(string resourceProviderNamespace, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceProviderNamespace == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceProviderNamespace"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceProviderNamespace"); } - 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("resourceProviderNamespace", resourceProviderNamespace); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ProviderPermissions", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ProviderPermissions", 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/{resourceProviderNamespace}/providerPermissions").ToString(); _url = _url.Replace("{resourceProviderNamespace}", System.Uri.EscapeDataString(resourceProviderNamespace)); - _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) @@ -519,55 +548,56 @@ internal ProvidersOperations(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) @@ -577,9 +607,10 @@ internal ProvidersOperations(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(); @@ -590,25 +621,29 @@ internal ProvidersOperations(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; - } + + + + + } /// /// Registers a subscription with a resource provider. /// @@ -624,13 +659,13 @@ internal ProvidersOperations(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 /// /// @@ -639,66 +674,77 @@ internal ProvidersOperations(ResourceManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> RegisterWithHttpMessagesAsync(string resourceProviderNamespace, ProviderRegistrationRequest properties = default(ProviderRegistrationRequest), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> RegisterWithHttpMessagesAsync(string resourceProviderNamespace, ProviderRegistrationRequest properties = default(ProviderRegistrationRequest), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + + if (resourceProviderNamespace == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceProviderNamespace"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceProviderNamespace"); } - 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("resourceProviderNamespace", resourceProviderNamespace); + tracingParameters.Add("properties", properties); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Register", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Register", 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/{resourceProviderNamespace}/register").ToString(); _url = _url.Replace("{resourceProviderNamespace}", System.Uri.EscapeDataString(resourceProviderNamespace)); - _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("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _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) @@ -710,61 +756,62 @@ internal ProvidersOperations(ResourceManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(properties != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(properties, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(properties, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + 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) @@ -774,9 +821,10 @@ internal ProvidersOperations(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(); @@ -787,25 +835,29 @@ internal ProvidersOperations(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 resource providers for a subscription. /// @@ -821,13 +873,13 @@ internal ProvidersOperations(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 /// /// @@ -836,64 +888,74 @@ internal ProvidersOperations(ResourceManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - 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("expand", expand); + + 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}/providers").ToString(); - _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 (expand != null) { _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand))); } - 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) @@ -905,55 +967,56 @@ internal ProvidersOperations(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) @@ -963,9 +1026,10 @@ internal ProvidersOperations(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(); @@ -976,25 +1040,29 @@ internal ProvidersOperations(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 resource providers for the tenant. /// @@ -1010,13 +1078,13 @@ internal ProvidersOperations(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 /// /// @@ -1025,59 +1093,68 @@ internal ProvidersOperations(ResourceManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListAtTenantScopeWithHttpMessagesAsync(string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListAtTenantScopeWithHttpMessagesAsync(string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - 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("expand", expand); + + 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").ToString(); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (expand != null) { _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand))); } - 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) @@ -1089,55 +1166,56 @@ internal ProvidersOperations(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) @@ -1147,9 +1225,10 @@ internal ProvidersOperations(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(); @@ -1160,48 +1239,52 @@ internal ProvidersOperations(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 the specified resource provider. /// - /// - /// The namespace of the resource provider. - /// /// /// The $expand query parameter. For example, to include property aliases in /// response, use $expand=resourceTypes/aliases. /// + /// + /// The namespace of the resource provider. + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1210,70 +1293,81 @@ internal ProvidersOperations(ResourceManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceProviderNamespace, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceProviderNamespace, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + + if (resourceProviderNamespace == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceProviderNamespace"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceProviderNamespace"); } - 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("expand", expand); tracingParameters.Add("resourceProviderNamespace", resourceProviderNamespace); + + 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}/providers/{resourceProviderNamespace}").ToString(); _url = _url.Replace("{resourceProviderNamespace}", System.Uri.EscapeDataString(resourceProviderNamespace)); - _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 (expand != null) { _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand))); } - 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) @@ -1285,55 +1379,56 @@ internal ProvidersOperations(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) @@ -1343,9 +1438,10 @@ internal ProvidersOperations(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(); @@ -1356,48 +1452,52 @@ internal ProvidersOperations(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 the specified resource provider at the tenant level. /// - /// - /// The namespace of the resource provider. - /// /// /// The $expand query parameter. For example, to include property aliases in /// response, use $expand=resourceTypes/aliases. /// + /// + /// The namespace of the resource provider. + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1406,65 +1506,75 @@ internal ProvidersOperations(ResourceManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetAtTenantScopeWithHttpMessagesAsync(string resourceProviderNamespace, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetAtTenantScopeWithHttpMessagesAsync(string resourceProviderNamespace, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + + if (resourceProviderNamespace == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceProviderNamespace"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceProviderNamespace"); } - 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("expand", expand); tracingParameters.Add("resourceProviderNamespace", resourceProviderNamespace); + + 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/{resourceProviderNamespace}").ToString(); _url = _url.Replace("{resourceProviderNamespace}", System.Uri.EscapeDataString(resourceProviderNamespace)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (expand != null) { _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand))); } - 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) @@ -1476,55 +1586,56 @@ internal ProvidersOperations(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) @@ -1534,9 +1645,10 @@ internal ProvidersOperations(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(); @@ -1547,25 +1659,29 @@ internal ProvidersOperations(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 resource providers for a subscription. /// @@ -1578,13 +1694,13 @@ internal ProvidersOperations(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 /// /// @@ -1593,51 +1709,54 @@ internal ProvidersOperations(ResourceManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(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, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", 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) @@ -1649,55 +1768,56 @@ internal ProvidersOperations(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) @@ -1707,9 +1827,10 @@ internal ProvidersOperations(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(); @@ -1720,25 +1841,29 @@ internal ProvidersOperations(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 resource providers for the tenant. /// @@ -1751,13 +1876,13 @@ internal ProvidersOperations(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 /// /// @@ -1766,51 +1891,54 @@ internal ProvidersOperations(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>> ListAtTenantScopeNextWithHttpMessagesAsync(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, "ListAtTenantScopeNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAtTenantScopeNext", 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) @@ -1822,55 +1950,56 @@ internal ProvidersOperations(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) @@ -1880,9 +2009,10 @@ internal ProvidersOperations(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(); @@ -1893,24 +2023,28 @@ internal ProvidersOperations(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; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Management.Sdk/Generated/ProvidersOperationsExtensions.cs b/src/Resources/Resources.Management.Sdk/Generated/ProvidersOperationsExtensions.cs new file mode 100644 index 000000000000..f6ea696e03e0 --- /dev/null +++ b/src/Resources/Resources.Management.Sdk/Generated/ProvidersOperationsExtensions.cs @@ -0,0 +1,385 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.Management.Resources +{ + using Microsoft.Rest.Azure; + using Models; + + /// + /// Extension methods for ProvidersOperations + /// + public static partial class ProvidersOperationsExtensions + { + /// + /// Unregisters a subscription from a resource provider. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The namespace of the resource provider to unregister. + /// + public static Provider Unregister(this IProvidersOperations operations, string resourceProviderNamespace) + { + return ((IProvidersOperations)operations).UnregisterAsync(resourceProviderNamespace).GetAwaiter().GetResult(); + } + + /// + /// Unregisters a subscription from a resource provider. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The namespace of the resource provider to unregister. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UnregisterAsync(this IProvidersOperations operations, string resourceProviderNamespace, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.UnregisterWithHttpMessagesAsync(resourceProviderNamespace, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Registers a management group with a resource provider. Use this operation + /// to register a resource provider with resource types that can be deployed at + /// the management group scope. It does not recursively register subscriptions + /// within the management group. Instead, you must register subscriptions + /// individually. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The namespace of the resource provider to register. + /// + /// + /// The management group ID. + /// + public static void RegisterAtManagementGroupScope(this IProvidersOperations operations, string resourceProviderNamespace, string groupId) + { + ((IProvidersOperations)operations).RegisterAtManagementGroupScopeAsync(resourceProviderNamespace, groupId).GetAwaiter().GetResult(); + } + + /// + /// Registers a management group with a resource provider. Use this operation + /// to register a resource provider with resource types that can be deployed at + /// the management group scope. It does not recursively register subscriptions + /// within the management group. Instead, you must register subscriptions + /// individually. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The namespace of the resource provider to register. + /// + /// + /// The management group ID. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task RegisterAtManagementGroupScopeAsync(this IProvidersOperations operations, string resourceProviderNamespace, string groupId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.RegisterAtManagementGroupScopeWithHttpMessagesAsync(resourceProviderNamespace, groupId, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Get the provider permissions. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The namespace of the resource provider. + /// + public static ProviderPermissionListResult ProviderPermissions(this IProvidersOperations operations, string resourceProviderNamespace) + { + return ((IProvidersOperations)operations).ProviderPermissionsAsync(resourceProviderNamespace).GetAwaiter().GetResult(); + } + + /// + /// Get the provider permissions. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The namespace of the resource provider. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task ProviderPermissionsAsync(this IProvidersOperations operations, string resourceProviderNamespace, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ProviderPermissionsWithHttpMessagesAsync(resourceProviderNamespace, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Registers a subscription with a resource provider. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The namespace of the resource provider to register. + /// + public static Provider Register(this IProvidersOperations operations, string resourceProviderNamespace, ProviderRegistrationRequest properties = default(ProviderRegistrationRequest)) + { + return ((IProvidersOperations)operations).RegisterAsync(resourceProviderNamespace, properties).GetAwaiter().GetResult(); + } + + /// + /// Registers a subscription with a resource provider. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The namespace of the resource provider to register. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task RegisterAsync(this IProvidersOperations operations, string resourceProviderNamespace, ProviderRegistrationRequest properties = default(ProviderRegistrationRequest), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.RegisterWithHttpMessagesAsync(resourceProviderNamespace, properties, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets all resource providers for a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The properties to include in the results. For example, use + /// &$expand=metadata in the query string to retrieve resource provider + /// metadata. To include property aliases in response, use + /// $expand=resourceTypes/aliases. + /// + public static Microsoft.Rest.Azure.IPage List(this IProvidersOperations operations, string expand = default(string)) + { + return ((IProvidersOperations)operations).ListAsync(expand).GetAwaiter().GetResult(); + } + + /// + /// Gets all resource providers for a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The properties to include in the results. For example, use + /// &$expand=metadata in the query string to retrieve resource provider + /// metadata. To include property aliases in response, use + /// $expand=resourceTypes/aliases. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IProvidersOperations operations, string expand = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(expand, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets all resource providers for the tenant. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The properties to include in the results. For example, use + /// &$expand=metadata in the query string to retrieve resource provider + /// metadata. To include property aliases in response, use + /// $expand=resourceTypes/aliases. + /// + public static Microsoft.Rest.Azure.IPage ListAtTenantScope(this IProvidersOperations operations, string expand = default(string)) + { + return ((IProvidersOperations)operations).ListAtTenantScopeAsync(expand).GetAwaiter().GetResult(); + } + + /// + /// Gets all resource providers for the tenant. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The properties to include in the results. For example, use + /// &$expand=metadata in the query string to retrieve resource provider + /// metadata. To include property aliases in response, use + /// $expand=resourceTypes/aliases. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAtTenantScopeAsync(this IProvidersOperations operations, string expand = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListAtTenantScopeWithHttpMessagesAsync(expand, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets the specified resource provider. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The $expand query parameter. For example, to include property aliases in + /// response, use $expand=resourceTypes/aliases. + /// + /// + /// The namespace of the resource provider. + /// + public static Provider Get(this IProvidersOperations operations, string resourceProviderNamespace, string expand = default(string)) + { + return ((IProvidersOperations)operations).GetAsync(resourceProviderNamespace, expand).GetAwaiter().GetResult(); + } + + /// + /// Gets the specified resource provider. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The $expand query parameter. For example, to include property aliases in + /// response, use $expand=resourceTypes/aliases. + /// + /// + /// The namespace of the resource provider. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IProvidersOperations operations, string resourceProviderNamespace, string expand = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceProviderNamespace, expand, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets the specified resource provider at the tenant level. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The $expand query parameter. For example, to include property aliases in + /// response, use $expand=resourceTypes/aliases. + /// + /// + /// The namespace of the resource provider. + /// + public static Provider GetAtTenantScope(this IProvidersOperations operations, string resourceProviderNamespace, string expand = default(string)) + { + return ((IProvidersOperations)operations).GetAtTenantScopeAsync(resourceProviderNamespace, expand).GetAwaiter().GetResult(); + } + + /// + /// Gets the specified resource provider at the tenant level. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The $expand query parameter. For example, to include property aliases in + /// response, use $expand=resourceTypes/aliases. + /// + /// + /// The namespace of the resource provider. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAtTenantScopeAsync(this IProvidersOperations operations, string resourceProviderNamespace, string expand = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetAtTenantScopeWithHttpMessagesAsync(resourceProviderNamespace, expand, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets all resource providers for a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IProvidersOperations operations, string nextPageLink) + { + return ((IProvidersOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets all resource providers for a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IProvidersOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets all resource providers for the tenant. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListAtTenantScopeNext(this IProvidersOperations operations, string nextPageLink) + { + return ((IProvidersOperations)operations).ListAtTenantScopeNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets all resource providers for the tenant. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAtTenantScopeNextAsync(this IProvidersOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListAtTenantScopeNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + } +} diff --git a/src/Resources/Resources.Sdk/Generated/ResourceGroupsOperations.cs b/src/Resources/Resources.Management.Sdk/Generated/ResourceGroupsOperations.cs similarity index 56% rename from src/Resources/Resources.Sdk/Generated/ResourceGroupsOperations.cs rename to src/Resources/Resources.Management.Sdk/Generated/ResourceGroupsOperations.cs index 55cab691fb4a..efb025b3a451 100644 --- a/src/Resources/Resources.Sdk/Generated/ResourceGroupsOperations.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/ResourceGroupsOperations.cs @@ -1,32 +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 Microsoft.Rest.Azure.OData; 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; /// /// ResourceGroupsOperations operations. /// - internal partial class ResourceGroupsOperations : IServiceOperations, IResourceGroupsOperations + internal partial class ResourceGroupsOperations : Microsoft.Rest.IServiceOperations, IResourceGroupsOperations { /// /// Initializes a new instance of the ResourceGroupsOperations class. @@ -37,13 +24,13 @@ internal partial class ResourceGroupsOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal ResourceGroupsOperations(ResourceManagementClient client) + internal ResourceGroupsOperations (ResourceManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -63,10 +50,10 @@ internal ResourceGroupsOperations(ResourceManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -75,80 +62,89 @@ internal ResourceGroupsOperations(ResourceManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CheckExistenceWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CheckExistenceWithHttpMessagesAsync(string resourceGroupName, 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 (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("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CheckExistence", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "CheckExistence", 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}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _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("HEAD"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("HEAD"); _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) @@ -160,55 +156,56 @@ internal ResourceGroupsOperations(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, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, 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 != 204 && (int)_statusCode != 404) { - 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) @@ -218,21 +215,25 @@ internal ResourceGroupsOperations(ResourceManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; - _result.Body = _statusCode == System.Net.HttpStatusCode.NoContent; + _result.Body = (_statusCode == System.Net.HttpStatusCode.NoContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Creates or updates a resource group. /// @@ -250,13 +251,13 @@ internal ResourceGroupsOperations(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 /// /// @@ -265,89 +266,98 @@ internal ResourceGroupsOperations(ResourceManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, ResourceGroup parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, ResourceGroup parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + + if (parameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); + } + if (parameters != null) + { + parameters.Validate(); + } 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 (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (parameters != null) + if (this.Client.ApiVersion == null) { - parameters.Validate(); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (Client.ApiVersion == null) - { - throw new ValidationException(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("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", 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}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _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("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _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) @@ -359,61 +369,62 @@ internal ResourceGroupsOperations(ResourceManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + 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 && (int)_statusCode != 201) { - 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) @@ -423,9 +434,10 @@ internal ResourceGroupsOperations(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(); @@ -436,16 +448,16 @@ internal ResourceGroupsOperations(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); } } // Deserialize Response @@ -454,33 +466,32 @@ internal ResourceGroupsOperations(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; - } + + + + + } /// - /// Deletes a resource group. + /// When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of its template deployments and currently stored operations. /// - /// - /// When you delete a resource group, all of its resources are also deleted. - /// Deleting a resource group deletes all of its template deployments and - /// currently stored operations. - /// /// /// The name of the resource group to delete. The name is case insensitive. /// @@ -490,16 +501,16 @@ internal ResourceGroupsOperations(ResourceManagementClient client) /// forceDeletionTypes=Microsoft.Compute/virtualMachines,Microsoft.Compute/virtualMachineScaleSets /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string forceDeletionTypes = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string forceDeletionTypes = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, forceDeletionTypes, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, forceDeletionTypes, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -514,13 +525,13 @@ internal ResourceGroupsOperations(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 /// /// @@ -529,80 +540,89 @@ internal ResourceGroupsOperations(ResourceManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, 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 (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("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}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _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) @@ -614,55 +634,56 @@ internal ResourceGroupsOperations(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) @@ -672,9 +693,10 @@ internal ResourceGroupsOperations(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(); @@ -685,33 +707,34 @@ internal ResourceGroupsOperations(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; - } + + + + + } /// - /// Updates a resource group. - /// - /// /// Resource groups can be updated through a simple PATCH operation to a group /// address. The format of the request is the same as that for creating a /// resource group. If a field is unspecified, the current value is retained. - /// + /// /// /// The name of the resource group to update. The name is case insensitive. /// @@ -724,13 +747,13 @@ internal ResourceGroupsOperations(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 /// /// @@ -739,85 +762,94 @@ internal ResourceGroupsOperations(ResourceManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, ResourceGroupPatchable parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, ResourceGroupPatchable parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + + if (parameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); + } 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 (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - 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("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Update", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Update", 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}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _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("PATCH"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); _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) @@ -829,61 +861,62 @@ internal ResourceGroupsOperations(ResourceManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + 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) @@ -893,9 +926,10 @@ internal ResourceGroupsOperations(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(); @@ -906,25 +940,29 @@ internal ResourceGroupsOperations(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; - } + + + + + } /// /// Captures the specified resource group as a template. /// @@ -935,23 +973,23 @@ internal ResourceGroupsOperations(ResourceManagementClient client) /// Parameters for exporting the template. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> ExportTemplateWithHttpMessagesAsync(string resourceGroupName, ExportTemplateRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> ExportTemplateWithHttpMessagesAsync(string resourceGroupName, ExportTemplateRequest parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginExportTemplateWithHttpMessagesAsync(resourceGroupName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginExportTemplateWithHttpMessagesAsync(resourceGroupName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// /// Gets all the resource groups for a subscription. /// /// - /// OData parameters to apply to the operation. + /// /// /// /// Headers that will be added to request. @@ -959,13 +997,13 @@ internal ResourceGroupsOperations(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 /// /// @@ -974,68 +1012,78 @@ internal ResourceGroupsOperations(ResourceManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - 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("odataQuery", odataQuery); + + 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").ToString(); - _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 (odataQuery != null) { - var _odataFilter = odataQuery.ToString(); - if (!string.IsNullOrEmpty(_odataFilter)) + var _resourceGroupFilter = odataQuery.ToString(); + if (!string.IsNullOrEmpty(_resourceGroupFilter)) { - _queryParameters.Add(_odataFilter); + _queryParameters.Add(_resourceGroupFilter); } } - 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) @@ -1047,55 +1095,56 @@ internal ResourceGroupsOperations(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) @@ -1105,9 +1154,10 @@ internal ResourceGroupsOperations(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(); @@ -1118,33 +1168,34 @@ internal ResourceGroupsOperations(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; - } + + + + + } /// - /// Deletes a resource group. - /// - /// /// When you delete a resource group, all of its resources are also deleted. /// Deleting a resource group deletes all of its template deployments and /// currently stored operations. - /// + /// /// /// The name of the resource group to delete. The name is case insensitive. /// @@ -1159,10 +1210,10 @@ internal ResourceGroupsOperations(ResourceManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1171,85 +1222,95 @@ internal ResourceGroupsOperations(ResourceManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string forceDeletionTypes = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string forceDeletionTypes = default(string), 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 (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("forceDeletionTypes", forceDeletionTypes); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", 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}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _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 (forceDeletionTypes != null) { _queryParameters.Add(string.Format("forceDeletionTypes={0}", System.Uri.EscapeDataString(forceDeletionTypes))); } - 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("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _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) @@ -1261,55 +1322,56 @@ internal ResourceGroupsOperations(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 && (int)_statusCode != 202) { - 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) @@ -1319,20 +1381,25 @@ internal ResourceGroupsOperations(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(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Captures the specified resource group as a template. /// @@ -1348,13 +1415,13 @@ internal ResourceGroupsOperations(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 /// /// @@ -1363,81 +1430,91 @@ internal ResourceGroupsOperations(ResourceManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginExportTemplateWithHttpMessagesAsync(string resourceGroupName, ExportTemplateRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginExportTemplateWithHttpMessagesAsync(string resourceGroupName, ExportTemplateRequest parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } + + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + 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 (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (parameters == null) + if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + 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("resourceGroupName", resourceGroupName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginExportTemplate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginExportTemplate", 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}/exportTemplate").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - 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("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _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) @@ -1449,61 +1526,62 @@ internal ResourceGroupsOperations(ResourceManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + 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 && (int)_statusCode != 202) { - 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) @@ -1513,9 +1591,10 @@ internal ResourceGroupsOperations(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(); @@ -1526,25 +1605,29 @@ internal ResourceGroupsOperations(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 the resource groups for a subscription. /// @@ -1557,13 +1640,13 @@ internal ResourceGroupsOperations(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 /// /// @@ -1572,51 +1655,54 @@ internal ResourceGroupsOperations(ResourceManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(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, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", 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) @@ -1628,55 +1714,56 @@ internal ResourceGroupsOperations(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) @@ -1686,9 +1773,10 @@ internal ResourceGroupsOperations(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(); @@ -1699,24 +1787,28 @@ internal ResourceGroupsOperations(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; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Management.Sdk/Generated/ResourceGroupsOperationsExtensions.cs b/src/Resources/Resources.Management.Sdk/Generated/ResourceGroupsOperationsExtensions.cs new file mode 100644 index 000000000000..66b6830ebb99 --- /dev/null +++ b/src/Resources/Resources.Management.Sdk/Generated/ResourceGroupsOperationsExtensions.cs @@ -0,0 +1,376 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.Management.Resources +{ + using Microsoft.Rest.Azure; + using Models; + + /// + /// Extension methods for ResourceGroupsOperations + /// + public static partial class ResourceGroupsOperationsExtensions + { + /// + /// Checks whether a resource group exists. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group to check. The name is case insensitive. + /// + public static bool CheckExistence(this IResourceGroupsOperations operations, string resourceGroupName) + { + return ((IResourceGroupsOperations)operations).CheckExistenceAsync(resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Checks whether a resource group exists. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group to check. The name is case insensitive. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CheckExistenceAsync(this IResourceGroupsOperations operations, string resourceGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CheckExistenceWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Creates or updates a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group to create or update. Can include + /// alphanumeric, underscore, parentheses, hyphen, period (except at end), and + /// Unicode characters that match the allowed characters. + /// + public static ResourceGroup CreateOrUpdate(this IResourceGroupsOperations operations, string resourceGroupName, ResourceGroup parameters) + { + return ((IResourceGroupsOperations)operations).CreateOrUpdateAsync(resourceGroupName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group to create or update. Can include + /// alphanumeric, underscore, parentheses, hyphen, period (except at end), and + /// Unicode characters that match the allowed characters. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IResourceGroupsOperations operations, string resourceGroupName, ResourceGroup parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// When you delete a resource group, all of its resources are also deleted. + /// Deleting a resource group deletes all of its template deployments and + /// currently stored operations. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group to delete. The name is case insensitive. + /// + /// + /// The resource types you want to force delete. Currently, only the following + /// is supported: + /// forceDeletionTypes=Microsoft.Compute/virtualMachines,Microsoft.Compute/virtualMachineScaleSets + /// + public static void Delete(this IResourceGroupsOperations operations, string resourceGroupName, string forceDeletionTypes = default(string)) + { + ((IResourceGroupsOperations)operations).DeleteAsync(resourceGroupName, forceDeletionTypes).GetAwaiter().GetResult(); + } + + /// + /// When you delete a resource group, all of its resources are also deleted. + /// Deleting a resource group deletes all of its template deployments and + /// currently stored operations. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group to delete. The name is case insensitive. + /// + /// + /// The resource types you want to force delete. Currently, only the following + /// is supported: + /// forceDeletionTypes=Microsoft.Compute/virtualMachines,Microsoft.Compute/virtualMachineScaleSets + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IResourceGroupsOperations operations, string resourceGroupName, string forceDeletionTypes = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, forceDeletionTypes, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Gets a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group to get. The name is case insensitive. + /// + public static ResourceGroup Get(this IResourceGroupsOperations operations, string resourceGroupName) + { + return ((IResourceGroupsOperations)operations).GetAsync(resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Gets a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group to get. The name is case insensitive. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IResourceGroupsOperations operations, string resourceGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Resource groups can be updated through a simple PATCH operation to a group + /// address. The format of the request is the same as that for creating a + /// resource group. If a field is unspecified, the current value is retained. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group to update. The name is case insensitive. + /// + public static ResourceGroup Update(this IResourceGroupsOperations operations, string resourceGroupName, ResourceGroupPatchable parameters) + { + return ((IResourceGroupsOperations)operations).UpdateAsync(resourceGroupName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Resource groups can be updated through a simple PATCH operation to a group + /// address. The format of the request is the same as that for creating a + /// resource group. If a field is unspecified, the current value is retained. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group to update. The name is case insensitive. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UpdateAsync(this IResourceGroupsOperations operations, string resourceGroupName, ResourceGroupPatchable parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Captures the specified resource group as a template. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + public static ResourceGroupExportResult ExportTemplate(this IResourceGroupsOperations operations, string resourceGroupName, ExportTemplateRequest parameters) + { + return ((IResourceGroupsOperations)operations).ExportTemplateAsync(resourceGroupName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Captures the specified resource group as a template. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task ExportTemplateAsync(this IResourceGroupsOperations operations, string resourceGroupName, ExportTemplateRequest parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ExportTemplateWithHttpMessagesAsync(resourceGroupName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets all the resource groups for a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// + /// + public static Microsoft.Rest.Azure.IPage List(this IResourceGroupsOperations operations, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery)) + { + return ((IResourceGroupsOperations)operations).ListAsync(odataQuery).GetAwaiter().GetResult(); + } + + /// + /// Gets all the resource groups for a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IResourceGroupsOperations operations, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(odataQuery, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// When you delete a resource group, all of its resources are also deleted. + /// Deleting a resource group deletes all of its template deployments and + /// currently stored operations. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group to delete. The name is case insensitive. + /// + /// + /// The resource types you want to force delete. Currently, only the following + /// is supported: + /// forceDeletionTypes=Microsoft.Compute/virtualMachines,Microsoft.Compute/virtualMachineScaleSets + /// + public static void BeginDelete(this IResourceGroupsOperations operations, string resourceGroupName, string forceDeletionTypes = default(string)) + { + ((IResourceGroupsOperations)operations).BeginDeleteAsync(resourceGroupName, forceDeletionTypes).GetAwaiter().GetResult(); + } + + /// + /// When you delete a resource group, all of its resources are also deleted. + /// Deleting a resource group deletes all of its template deployments and + /// currently stored operations. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group to delete. The name is case insensitive. + /// + /// + /// The resource types you want to force delete. Currently, only the following + /// is supported: + /// forceDeletionTypes=Microsoft.Compute/virtualMachines,Microsoft.Compute/virtualMachineScaleSets + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IResourceGroupsOperations operations, string resourceGroupName, string forceDeletionTypes = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, forceDeletionTypes, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Captures the specified resource group as a template. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + public static ResourceGroupExportResult BeginExportTemplate(this IResourceGroupsOperations operations, string resourceGroupName, ExportTemplateRequest parameters) + { + return ((IResourceGroupsOperations)operations).BeginExportTemplateAsync(resourceGroupName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Captures the specified resource group as a template. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginExportTemplateAsync(this IResourceGroupsOperations operations, string resourceGroupName, ExportTemplateRequest parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginExportTemplateWithHttpMessagesAsync(resourceGroupName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets all the resource groups for a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IResourceGroupsOperations operations, string nextPageLink) + { + return ((IResourceGroupsOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets all the resource groups for a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IResourceGroupsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + } +} diff --git a/src/Resources/Resources.Sdk/Generated/ResourceManagementClient.cs b/src/Resources/Resources.Management.Sdk/Generated/ResourceManagementClient.cs similarity index 64% rename from src/Resources/Resources.Sdk/Generated/ResourceManagementClient.cs rename to src/Resources/Resources.Management.Sdk/Generated/ResourceManagementClient.cs index 0cd029e9ae3f..5690e0096a74 100644 --- a/src/Resources/Resources.Sdk/Generated/ResourceManagementClient.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/ResourceManagementClient.cs @@ -1,119 +1,97 @@ -// // 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 Microsoft.Rest.Serialization; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; /// /// Provides operations for working with resources and resource groups. /// - public partial class ResourceManagementClient : ServiceClient, IResourceManagementClient, IAzureClient + public partial class ResourceManagementClient : Microsoft.Rest.ServiceClient, IResourceManagementClient, IAzureClient { /// /// The base URI of the service. /// public System.Uri BaseUri { get; set; } - /// /// Gets or sets json serialization settings. /// - public JsonSerializerSettings SerializationSettings { get; private set; } - + public Newtonsoft.Json.JsonSerializerSettings SerializationSettings { get; private set; } /// /// Gets or sets json deserialization settings. /// - public JsonSerializerSettings DeserializationSettings { get; private set; } - + public Newtonsoft.Json.JsonSerializerSettings DeserializationSettings { get; private set; } /// /// Credentials needed for the client to connect to Azure. /// - public ServiceClientCredentials Credentials { get; private set; } + public Microsoft.Rest.ServiceClientCredentials Credentials { get; private set; } /// - /// The Microsoft Azure subscription ID. + /// The API version to use for this operation. /// - public string SubscriptionId { get; set; } + public string ApiVersion { get; private set; } /// - /// The API version to use for this operation. + /// The Microsoft Azure subscription ID. /// - public string ApiVersion { get; private set; } + public string SubscriptionId { get; set;} /// /// The preferred language for the response. /// - public string AcceptLanguage { get; set; } + public string AcceptLanguage { get; set;} /// - /// The retry timeout in seconds for Long Running Operations. Default value is - /// 30. + /// The retry timeout in seconds for Long Running Operations. Default + /// /// value is 30. /// - public int? LongRunningOperationRetryTimeout { get; set; } + public int? LongRunningOperationRetryTimeout { get; set;} /// - /// Whether a unique x-ms-client-request-id should be generated. When set to - /// true a unique x-ms-client-request-id value is generated and included in - /// each request. Default is true. + /// Whether a unique x-ms-client-request-id should be generated. When + /// /// set to true a unique x-ms-client-request-id value is generated and + /// /// included in each request. Default is true. /// - public bool? GenerateClientRequestId { get; set; } + public bool? GenerateClientRequestId { get; set;} /// - /// Gets the IOperations. + /// Gets the IOperations /// public virtual IOperations Operations { get; private set; } - /// - /// Gets the IDeploymentsOperations. + /// Gets the IDeploymentsOperations /// public virtual IDeploymentsOperations Deployments { get; private set; } - /// - /// Gets the IProvidersOperations. + /// Gets the IProvidersOperations /// public virtual IProvidersOperations Providers { get; private set; } - /// - /// Gets the IProviderResourceTypesOperations. + /// Gets the IProviderResourceTypesOperations /// public virtual IProviderResourceTypesOperations ProviderResourceTypes { get; private set; } - /// - /// Gets the IResourcesOperations. + /// Gets the IResourcesOperations /// public virtual IResourcesOperations Resources { get; private set; } - /// - /// Gets the IResourceGroupsOperations. + /// Gets the IResourceGroupsOperations /// public virtual IResourceGroupsOperations ResourceGroups { get; private set; } - /// - /// Gets the ITagsOperations. + /// Gets the ITagsOperations /// public virtual ITagsOperations Tags { get; private set; } - /// - /// Gets the IDeploymentOperations. + /// Gets the IDeploymentOperations /// public virtual IDeploymentOperations DeploymentOperations { get; private set; } - /// /// Initializes a new instance of the ResourceManagementClient class. /// @@ -122,24 +100,22 @@ public partial class ResourceManagementClient : ServiceClient /// /// True: will dispose the provided httpClient on calling ResourceManagementClient.Dispose(). False: will not dispose provided httpClient - protected ResourceManagementClient(HttpClient httpClient, bool disposeHttpClient) : base(httpClient, disposeHttpClient) + protected ResourceManagementClient(System.Net.Http.HttpClient httpClient, bool disposeHttpClient) : base(httpClient, disposeHttpClient) { - Initialize(); + this.Initialize(); } - /// /// Initializes a new instance of the ResourceManagementClient class. /// /// /// Optional. The delegating handlers to add to the http client pipeline. /// - protected ResourceManagementClient(params DelegatingHandler[] handlers) : base(handlers) + protected ResourceManagementClient(params System.Net.Http.DelegatingHandler[] handlers) : base(handlers) { - Initialize(); + this.Initialize(); } - /// - /// Initializes a new instance of the ResourceManagementClient class. + /// Initializes a new instance of the ResourceManagementClient class. /// /// /// Optional. The http client handler used to handle http transport. @@ -147,11 +123,10 @@ protected ResourceManagementClient(params DelegatingHandler[] handlers) : base(h /// /// Optional. The delegating handlers to add to the http client pipeline. /// - protected ResourceManagementClient(HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : base(rootHandler, handlers) + protected ResourceManagementClient(System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : base(rootHandler, handlers) { - Initialize(); + this.Initialize(); } - /// /// Initializes a new instance of the ResourceManagementClient class. /// @@ -164,15 +139,14 @@ protected ResourceManagementClient(HttpClientHandler rootHandler, params Delegat /// /// Thrown when a required parameter is null /// - protected ResourceManagementClient(System.Uri baseUri, params DelegatingHandler[] handlers) : this(handlers) + protected ResourceManagementClient(System.Uri baseUri, params System.Net.Http.DelegatingHandler[] handlers) : this(handlers) { if (baseUri == null) { throw new System.ArgumentNullException("baseUri"); } - BaseUri = baseUri; + this.BaseUri = baseUri; } - /// /// Initializes a new instance of the ResourceManagementClient class. /// @@ -188,15 +162,15 @@ protected ResourceManagementClient(System.Uri baseUri, params DelegatingHandler[ /// /// Thrown when a required parameter is null /// - protected ResourceManagementClient(System.Uri baseUri, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + protected ResourceManagementClient(System.Uri baseUri, System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : this(rootHandler, handlers) { if (baseUri == null) { throw new System.ArgumentNullException("baseUri"); } - BaseUri = baseUri; + + this.BaseUri = baseUri; } - /// /// Initializes a new instance of the ResourceManagementClient class. /// @@ -209,23 +183,23 @@ protected ResourceManagementClient(System.Uri baseUri, HttpClientHandler rootHan /// /// Thrown when a required parameter is null /// - public ResourceManagementClient(ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers) + public ResourceManagementClient(Microsoft.Rest.ServiceClientCredentials credentials, params System.Net.Http.DelegatingHandler[] handlers) : this(handlers) { if (credentials == null) { throw new System.ArgumentNullException("credentials"); } - Credentials = credentials; - if (Credentials != null) + this.Credentials = credentials; + if (this.Credentials != null) { - Credentials.InitializeServiceClient(this); + this.Credentials.InitializeServiceClient(this); } + } - /// /// Initializes a new instance of the ResourceManagementClient class. /// - /// + /// /// Required. Credentials needed for the client to connect to Azure. /// /// @@ -236,23 +210,23 @@ public ResourceManagementClient(ServiceClientCredentials credentials, params Del /// /// Thrown when a required parameter is null /// - public ResourceManagementClient(ServiceClientCredentials credentials, HttpClient httpClient, bool disposeHttpClient) : this(httpClient, disposeHttpClient) + public ResourceManagementClient(Microsoft.Rest.ServiceClientCredentials credentials, System.Net.Http.HttpClient httpClient, bool disposeHttpClient) : this(httpClient, disposeHttpClient) { if (credentials == null) { throw new System.ArgumentNullException("credentials"); } - Credentials = credentials; - if (Credentials != null) + this.Credentials = credentials; + if (this.Credentials != null) { - Credentials.InitializeServiceClient(this); + this.Credentials.InitializeServiceClient(this); } + } - /// /// Initializes a new instance of the ResourceManagementClient class. /// - /// + /// /// Required. Credentials needed for the client to connect to Azure. /// /// @@ -264,26 +238,26 @@ public ResourceManagementClient(ServiceClientCredentials credentials, HttpClient /// /// Thrown when a required parameter is null /// - public ResourceManagementClient(ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + public ResourceManagementClient(Microsoft.Rest.ServiceClientCredentials credentials, System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : this(rootHandler, handlers) { if (credentials == null) { throw new System.ArgumentNullException("credentials"); } - Credentials = credentials; - if (Credentials != null) + this.Credentials = credentials; + if (this.Credentials != null) { - Credentials.InitializeServiceClient(this); + this.Credentials.InitializeServiceClient(this); } + } - /// /// Initializes a new instance of the ResourceManagementClient class. /// /// /// Optional. The base URI of the service. /// - /// + /// /// Required. Credentials needed for the client to connect to Azure. /// /// @@ -292,7 +266,7 @@ public ResourceManagementClient(ServiceClientCredentials credentials, HttpClient /// /// Thrown when a required parameter is null /// - public ResourceManagementClient(System.Uri baseUri, ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers) + public ResourceManagementClient(System.Uri baseUri, Microsoft.Rest.ServiceClientCredentials credentials, params System.Net.Http.DelegatingHandler[] handlers) : this(handlers) { if (baseUri == null) { @@ -302,33 +276,30 @@ public ResourceManagementClient(System.Uri baseUri, ServiceClientCredentials cre { throw new System.ArgumentNullException("credentials"); } - BaseUri = baseUri; - Credentials = credentials; - if (Credentials != null) + this.BaseUri = baseUri; + this.Credentials = credentials; + if (this.Credentials != null) { - Credentials.InitializeServiceClient(this); + this.Credentials.InitializeServiceClient(this); } + } - /// /// Initializes a new instance of the ResourceManagementClient class. /// /// /// Optional. The base URI of the service. /// - /// + /// /// Required. Credentials needed for the client to connect to Azure. /// /// /// Optional. The http client handler used to handle http transport. /// - /// - /// Optional. The delegating handlers to add to the http client pipeline. - /// /// /// Thrown when a required parameter is null /// - public ResourceManagementClient(System.Uri baseUri, ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + public ResourceManagementClient(System.Uri baseUri, Microsoft.Rest.ServiceClientCredentials credentials, System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : this(rootHandler, handlers) { if (baseUri == null) { @@ -338,65 +309,66 @@ public ResourceManagementClient(System.Uri baseUri, ServiceClientCredentials cre { throw new System.ArgumentNullException("credentials"); } - BaseUri = baseUri; - Credentials = credentials; - if (Credentials != null) + this.BaseUri = baseUri; + this.Credentials = credentials; + if (this.Credentials != null) { - Credentials.InitializeServiceClient(this); + this.Credentials.InitializeServiceClient(this); } + } - /// /// An optional partial-method to perform custom initialization. /// partial void CustomInitialize(); + /// /// Initializes client properties. /// private void Initialize() { - Operations = new Operations(this); - Deployments = new DeploymentsOperations(this); - Providers = new ProvidersOperations(this); - ProviderResourceTypes = new ProviderResourceTypesOperations(this); - Resources = new ResourcesOperations(this); - ResourceGroups = new ResourceGroupsOperations(this); - Tags = new TagsOperations(this); - DeploymentOperations = new DeploymentOperations(this); - BaseUri = new System.Uri("https://management.azure.com"); - ApiVersion = "2021-04-01"; - AcceptLanguage = "en-US"; - LongRunningOperationRetryTimeout = 30; - GenerateClientRequestId = true; - SerializationSettings = new JsonSerializerSettings + this.Operations = new Operations(this); + this.Deployments = new DeploymentsOperations(this); + this.Providers = new ProvidersOperations(this); + this.ProviderResourceTypes = new ProviderResourceTypesOperations(this); + this.Resources = new ResourcesOperations(this); + this.ResourceGroups = new ResourceGroupsOperations(this); + this.Tags = new TagsOperations(this); + this.DeploymentOperations = new DeploymentOperations(this); + this.BaseUri = new System.Uri("https://management.azure.com"); + this.ApiVersion = "2021-04-01"; + this.AcceptLanguage = "en-US"; + this.LongRunningOperationRetryTimeout = 30; + this.GenerateClientRequestId = true; + SerializationSettings = new Newtonsoft.Json.JsonSerializerSettings { Formatting = Newtonsoft.Json.Formatting.Indented, DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, - ContractResolver = new ReadOnlyJsonContractResolver(), - Converters = new List + ContractResolver = new Microsoft.Rest.Serialization.ReadOnlyJsonContractResolver(), + Converters = new System.Collections.Generic.List { - new Iso8601TimeSpanConverter() + new Microsoft.Rest.Serialization.Iso8601TimeSpanConverter() } }; - SerializationSettings.Converters.Add(new TransformationJsonConverter()); - DeserializationSettings = new JsonSerializerSettings + SerializationSettings.Converters.Add(new Microsoft.Rest.Serialization.TransformationJsonConverter()); + DeserializationSettings = new Newtonsoft.Json.JsonSerializerSettings { DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, - ContractResolver = new ReadOnlyJsonContractResolver(), - Converters = new List + ContractResolver = new Microsoft.Rest.Serialization.ReadOnlyJsonContractResolver(), + Converters = new System.Collections.Generic.List { - new Iso8601TimeSpanConverter() + new Microsoft.Rest.Serialization.Iso8601TimeSpanConverter() } }; CustomInitialize(); - DeserializationSettings.Converters.Add(new TransformationJsonConverter()); - DeserializationSettings.Converters.Add(new CloudErrorJsonConverter()); + DeserializationSettings.Converters.Add(new Microsoft.Rest.Serialization.TransformationJsonConverter()); + DeserializationSettings.Converters.Add(new Microsoft.Rest.Azure.CloudErrorJsonConverter()); } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/ResourceManagementPrivateLinkOperations.cs b/src/Resources/Resources.Management.Sdk/Generated/ResourceManagementPrivateLinkOperations.cs similarity index 56% rename from src/Resources/Resources.Sdk/Generated/ResourceManagementPrivateLinkOperations.cs rename to src/Resources/Resources.Management.Sdk/Generated/ResourceManagementPrivateLinkOperations.cs index b8416aed0852..a4f241e8b3a2 100644 --- a/src/Resources/Resources.Sdk/Generated/ResourceManagementPrivateLinkOperations.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/ResourceManagementPrivateLinkOperations.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; /// /// ResourceManagementPrivateLinkOperations operations. /// - internal partial class ResourceManagementPrivateLinkOperations : IServiceOperations, IResourceManagementPrivateLinkOperations + internal partial class ResourceManagementPrivateLinkOperations : Microsoft.Rest.IServiceOperations, IResourceManagementPrivateLinkOperations { /// /// Initializes a new instance of the ResourceManagementPrivateLinkOperations class. @@ -36,13 +24,13 @@ internal partial class ResourceManagementPrivateLinkOperations : IServiceOperati /// /// Thrown when a required parameter is null /// - internal ResourceManagementPrivateLinkOperations(ResourcePrivateLinkClient client) + internal ResourceManagementPrivateLinkOperations (ResourcePrivateLinkClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -68,13 +56,13 @@ internal ResourceManagementPrivateLinkOperations(ResourcePrivateLinkClient clien /// /// 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,98 @@ internal ResourceManagementPrivateLinkOperations(ResourcePrivateLinkClient clien /// /// A response object containing the response body and response headers. /// - public async Task> PutWithHttpMessagesAsync(string resourceGroupName, string rmplName, ResourceManagementPrivateLinkLocation parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> PutWithHttpMessagesAsync(string resourceGroupName, string rmplName, ResourceManagementPrivateLinkLocation parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (parameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); + } + + 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"); } + 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 (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 (rmplName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "rmplName"); - } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "rmplName"); } + // 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("rmplName", rmplName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Put", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Put", 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}/providers/Microsoft.Authorization/resourceManagementPrivateLinks/{rmplName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{rmplName}", System.Uri.EscapeDataString(rmplName)); - 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("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _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,61 +174,62 @@ internal ResourceManagementPrivateLinkOperations(ResourcePrivateLinkClient clien _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + 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 && (int)_statusCode != 201) { - 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) @@ -239,9 +239,10 @@ internal ResourceManagementPrivateLinkOperations(ResourcePrivateLinkClient clien 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(); @@ -252,16 +253,16 @@ internal ResourceManagementPrivateLinkOperations(ResourcePrivateLinkClient clien _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); } } // Deserialize Response @@ -270,25 +271,29 @@ internal ResourceManagementPrivateLinkOperations(ResourcePrivateLinkClient clien _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; - } + + + + + } /// /// Get a resource management private link(resource-level). /// @@ -304,13 +309,13 @@ internal ResourceManagementPrivateLinkOperations(ResourcePrivateLinkClient clien /// /// 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 /// /// @@ -319,82 +324,92 @@ internal ResourceManagementPrivateLinkOperations(ResourcePrivateLinkClient clien /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string rmplName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string rmplName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - 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"); } + 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 (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 (rmplName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "rmplName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "rmplName"); } + // 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("rmplName", rmplName); + + 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}/providers/Microsoft.Authorization/resourceManagementPrivateLinks/{rmplName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{rmplName}", System.Uri.EscapeDataString(rmplName)); - 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) @@ -406,55 +421,56 @@ internal ResourceManagementPrivateLinkOperations(ResourcePrivateLinkClient clien _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) @@ -464,9 +480,10 @@ internal ResourceManagementPrivateLinkOperations(ResourcePrivateLinkClient clien 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(); @@ -477,25 +494,29 @@ internal ResourceManagementPrivateLinkOperations(ResourcePrivateLinkClient clien _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; - } + + + + + } /// /// Delete a resource management private link. /// @@ -511,10 +532,10 @@ internal ResourceManagementPrivateLinkOperations(ResourcePrivateLinkClient clien /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -523,82 +544,92 @@ internal ResourceManagementPrivateLinkOperations(ResourcePrivateLinkClient clien /// /// A response object containing the response body and response headers. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string rmplName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string rmplName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - 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"); } + 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 (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 (rmplName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "rmplName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "rmplName"); } + // 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("rmplName", rmplName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Delete", 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}/providers/Microsoft.Authorization/resourceManagementPrivateLinks/{rmplName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{rmplName}", System.Uri.EscapeDataString(rmplName)); - 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("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _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) @@ -610,55 +641,56 @@ internal ResourceManagementPrivateLinkOperations(ResourcePrivateLinkClient clien _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 && (int)_statusCode != 204) { - 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) @@ -668,20 +700,25 @@ internal ResourceManagementPrivateLinkOperations(ResourcePrivateLinkClient clien 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(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Get all the resource management private links in a subscription. /// @@ -691,13 +728,13 @@ internal ResourceManagementPrivateLinkOperations(ResourcePrivateLinkClient clien /// /// 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 /// /// @@ -706,59 +743,68 @@ internal ResourceManagementPrivateLinkOperations(ResourcePrivateLinkClient clien /// /// A response object containing the response body and response headers. /// - public async Task> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - 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"); } - 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("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}/providers/Microsoft.Authorization/resourceManagementPrivateLinks").ToString(); - _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) @@ -770,55 +816,56 @@ internal ResourceManagementPrivateLinkOperations(ResourcePrivateLinkClient clien _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) @@ -828,9 +875,10 @@ internal ResourceManagementPrivateLinkOperations(ResourcePrivateLinkClient clien 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(); @@ -841,25 +889,29 @@ internal ResourceManagementPrivateLinkOperations(ResourcePrivateLinkClient clien _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; - } + + + + + } /// /// Get all the resource management private links in a resource group. /// @@ -872,13 +924,13 @@ internal ResourceManagementPrivateLinkOperations(ResourcePrivateLinkClient clien /// /// 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 /// /// @@ -887,76 +939,85 @@ internal ResourceManagementPrivateLinkOperations(ResourcePrivateLinkClient clien /// /// A response object containing the response body and response headers. /// - public async Task> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - 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"); } + 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 (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("resourceGroupName", resourceGroupName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", 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}/providers/Microsoft.Authorization/resourceManagementPrivateLinks").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - 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) @@ -968,55 +1029,56 @@ internal ResourceManagementPrivateLinkOperations(ResourcePrivateLinkClient clien _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) @@ -1026,9 +1088,10 @@ internal ResourceManagementPrivateLinkOperations(ResourcePrivateLinkClient clien 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(); @@ -1039,24 +1102,28 @@ internal ResourceManagementPrivateLinkOperations(ResourcePrivateLinkClient clien _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; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Management.Sdk/Generated/ResourceManagementPrivateLinkOperationsExtensions.cs b/src/Resources/Resources.Management.Sdk/Generated/ResourceManagementPrivateLinkOperationsExtensions.cs new file mode 100644 index 000000000000..d249e1586b5d --- /dev/null +++ b/src/Resources/Resources.Management.Sdk/Generated/ResourceManagementPrivateLinkOperationsExtensions.cs @@ -0,0 +1,190 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.Management.Resources +{ + using Microsoft.Rest.Azure; + using Models; + + /// + /// Extension methods for ResourceManagementPrivateLinkOperations + /// + public static partial class ResourceManagementPrivateLinkOperationsExtensions + { + /// + /// Create a resource management group private link. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the resource management private link. + /// + public static ResourceManagementPrivateLink Put(this IResourceManagementPrivateLinkOperations operations, string resourceGroupName, string rmplName, ResourceManagementPrivateLinkLocation parameters) + { + return ((IResourceManagementPrivateLinkOperations)operations).PutAsync(resourceGroupName, rmplName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Create a resource management group private link. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the resource management private link. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task PutAsync(this IResourceManagementPrivateLinkOperations operations, string resourceGroupName, string rmplName, ResourceManagementPrivateLinkLocation parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.PutWithHttpMessagesAsync(resourceGroupName, rmplName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Get a resource management private link(resource-level). + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the resource management private link. + /// + public static ResourceManagementPrivateLink Get(this IResourceManagementPrivateLinkOperations operations, string resourceGroupName, string rmplName) + { + return ((IResourceManagementPrivateLinkOperations)operations).GetAsync(resourceGroupName, rmplName).GetAwaiter().GetResult(); + } + + /// + /// Get a resource management private link(resource-level). + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the resource management private link. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IResourceManagementPrivateLinkOperations operations, string resourceGroupName, string rmplName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, rmplName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Delete a resource management private link. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the resource management private link. + /// + public static void Delete(this IResourceManagementPrivateLinkOperations operations, string resourceGroupName, string rmplName) + { + ((IResourceManagementPrivateLinkOperations)operations).DeleteAsync(resourceGroupName, rmplName).GetAwaiter().GetResult(); + } + + /// + /// Delete a resource management private link. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the resource management private link. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IResourceManagementPrivateLinkOperations operations, string resourceGroupName, string rmplName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, rmplName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Get all the resource management private links in a subscription. + /// + /// + /// The operations group for this extension method. + /// + public static ResourceManagementPrivateLinkListResult List(this IResourceManagementPrivateLinkOperations operations) + { + return ((IResourceManagementPrivateLinkOperations)operations).ListAsync().GetAwaiter().GetResult(); + } + + /// + /// Get all the resource management private links in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task ListAsync(this IResourceManagementPrivateLinkOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Get all the resource management private links in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + public static ResourceManagementPrivateLinkListResult ListByResourceGroup(this IResourceManagementPrivateLinkOperations operations, string resourceGroupName) + { + return ((IResourceManagementPrivateLinkOperations)operations).ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Get all the resource management private links in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task ListByResourceGroupAsync(this IResourceManagementPrivateLinkOperations operations, string resourceGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + } +} diff --git a/src/Resources/Resources.Sdk/Generated/ResourcePrivateLinkClient.cs b/src/Resources/Resources.Management.Sdk/Generated/ResourcePrivateLinkClient.cs similarity index 66% rename from src/Resources/Resources.Sdk/Generated/ResourcePrivateLinkClient.cs rename to src/Resources/Resources.Management.Sdk/Generated/ResourcePrivateLinkClient.cs index bb455edaf2c1..fffa2de0fc6e 100644 --- a/src/Resources/Resources.Sdk/Generated/ResourcePrivateLinkClient.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/ResourcePrivateLinkClient.cs @@ -1,50 +1,36 @@ -// // 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 Microsoft.Rest.Serialization; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; /// /// Provides operations for managing private link resources /// - public partial class ResourcePrivateLinkClient : ServiceClient, IResourcePrivateLinkClient, IAzureClient + public partial class ResourcePrivateLinkClient : Microsoft.Rest.ServiceClient, IResourcePrivateLinkClient, IAzureClient { /// /// The base URI of the service. /// public System.Uri BaseUri { get; set; } - /// /// Gets or sets json serialization settings. /// - public JsonSerializerSettings SerializationSettings { get; private set; } - + public Newtonsoft.Json.JsonSerializerSettings SerializationSettings { get; private set; } /// /// Gets or sets json deserialization settings. /// - public JsonSerializerSettings DeserializationSettings { get; private set; } - + public Newtonsoft.Json.JsonSerializerSettings DeserializationSettings { get; private set; } /// /// Credentials needed for the client to connect to Azure. /// - public ServiceClientCredentials Credentials { get; private set; } + public Microsoft.Rest.ServiceClientCredentials Credentials { get; private set; } /// /// The API version to use for this operation. @@ -54,36 +40,34 @@ public partial class ResourcePrivateLinkClient : ServiceClient /// The ID of the target subscription. /// - public string SubscriptionId { get; set; } + public string SubscriptionId { get; set;} /// /// The preferred language for the response. /// - public string AcceptLanguage { get; set; } + public string AcceptLanguage { get; set;} /// - /// The retry timeout in seconds for Long Running Operations. Default value is - /// 30. + /// The retry timeout in seconds for Long Running Operations. Default + /// /// value is 30. /// - public int? LongRunningOperationRetryTimeout { get; set; } + public int? LongRunningOperationRetryTimeout { get; set;} /// - /// Whether a unique x-ms-client-request-id should be generated. When set to - /// true a unique x-ms-client-request-id value is generated and included in - /// each request. Default is true. + /// Whether a unique x-ms-client-request-id should be generated. When + /// /// set to true a unique x-ms-client-request-id value is generated and + /// /// included in each request. Default is true. /// - public bool? GenerateClientRequestId { get; set; } + public bool? GenerateClientRequestId { get; set;} /// - /// Gets the IPrivateLinkAssociationOperations. + /// Gets the IPrivateLinkAssociationOperations /// public virtual IPrivateLinkAssociationOperations PrivateLinkAssociation { get; private set; } - /// - /// Gets the IResourceManagementPrivateLinkOperations. + /// Gets the IResourceManagementPrivateLinkOperations /// public virtual IResourceManagementPrivateLinkOperations ResourceManagementPrivateLink { get; private set; } - /// /// Initializes a new instance of the ResourcePrivateLinkClient class. /// @@ -92,24 +76,22 @@ public partial class ResourcePrivateLinkClient : ServiceClient /// /// True: will dispose the provided httpClient on calling ResourcePrivateLinkClient.Dispose(). False: will not dispose provided httpClient - protected ResourcePrivateLinkClient(HttpClient httpClient, bool disposeHttpClient) : base(httpClient, disposeHttpClient) + protected ResourcePrivateLinkClient(System.Net.Http.HttpClient httpClient, bool disposeHttpClient) : base(httpClient, disposeHttpClient) { - Initialize(); + this.Initialize(); } - /// /// Initializes a new instance of the ResourcePrivateLinkClient class. /// /// /// Optional. The delegating handlers to add to the http client pipeline. /// - protected ResourcePrivateLinkClient(params DelegatingHandler[] handlers) : base(handlers) + protected ResourcePrivateLinkClient(params System.Net.Http.DelegatingHandler[] handlers) : base(handlers) { - Initialize(); + this.Initialize(); } - /// - /// Initializes a new instance of the ResourcePrivateLinkClient class. + /// Initializes a new instance of the ResourcePrivateLinkClient class. /// /// /// Optional. The http client handler used to handle http transport. @@ -117,11 +99,10 @@ protected ResourcePrivateLinkClient(params DelegatingHandler[] handlers) : base( /// /// Optional. The delegating handlers to add to the http client pipeline. /// - protected ResourcePrivateLinkClient(HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : base(rootHandler, handlers) + protected ResourcePrivateLinkClient(System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : base(rootHandler, handlers) { - Initialize(); + this.Initialize(); } - /// /// Initializes a new instance of the ResourcePrivateLinkClient class. /// @@ -134,15 +115,14 @@ protected ResourcePrivateLinkClient(HttpClientHandler rootHandler, params Delega /// /// Thrown when a required parameter is null /// - protected ResourcePrivateLinkClient(System.Uri baseUri, params DelegatingHandler[] handlers) : this(handlers) + protected ResourcePrivateLinkClient(System.Uri baseUri, params System.Net.Http.DelegatingHandler[] handlers) : this(handlers) { if (baseUri == null) { throw new System.ArgumentNullException("baseUri"); } - BaseUri = baseUri; + this.BaseUri = baseUri; } - /// /// Initializes a new instance of the ResourcePrivateLinkClient class. /// @@ -158,15 +138,15 @@ protected ResourcePrivateLinkClient(System.Uri baseUri, params DelegatingHandler /// /// Thrown when a required parameter is null /// - protected ResourcePrivateLinkClient(System.Uri baseUri, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + protected ResourcePrivateLinkClient(System.Uri baseUri, System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : this(rootHandler, handlers) { if (baseUri == null) { throw new System.ArgumentNullException("baseUri"); } - BaseUri = baseUri; + + this.BaseUri = baseUri; } - /// /// Initializes a new instance of the ResourcePrivateLinkClient class. /// @@ -179,23 +159,23 @@ protected ResourcePrivateLinkClient(System.Uri baseUri, HttpClientHandler rootHa /// /// Thrown when a required parameter is null /// - public ResourcePrivateLinkClient(ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers) + public ResourcePrivateLinkClient(Microsoft.Rest.ServiceClientCredentials credentials, params System.Net.Http.DelegatingHandler[] handlers) : this(handlers) { if (credentials == null) { throw new System.ArgumentNullException("credentials"); } - Credentials = credentials; - if (Credentials != null) + this.Credentials = credentials; + if (this.Credentials != null) { - Credentials.InitializeServiceClient(this); + this.Credentials.InitializeServiceClient(this); } + } - /// /// Initializes a new instance of the ResourcePrivateLinkClient class. /// - /// + /// /// Required. Credentials needed for the client to connect to Azure. /// /// @@ -206,23 +186,23 @@ public ResourcePrivateLinkClient(ServiceClientCredentials credentials, params De /// /// Thrown when a required parameter is null /// - public ResourcePrivateLinkClient(ServiceClientCredentials credentials, HttpClient httpClient, bool disposeHttpClient) : this(httpClient, disposeHttpClient) + public ResourcePrivateLinkClient(Microsoft.Rest.ServiceClientCredentials credentials, System.Net.Http.HttpClient httpClient, bool disposeHttpClient) : this(httpClient, disposeHttpClient) { if (credentials == null) { throw new System.ArgumentNullException("credentials"); } - Credentials = credentials; - if (Credentials != null) + this.Credentials = credentials; + if (this.Credentials != null) { - Credentials.InitializeServiceClient(this); + this.Credentials.InitializeServiceClient(this); } + } - /// /// Initializes a new instance of the ResourcePrivateLinkClient class. /// - /// + /// /// Required. Credentials needed for the client to connect to Azure. /// /// @@ -234,26 +214,26 @@ public ResourcePrivateLinkClient(ServiceClientCredentials credentials, HttpClien /// /// Thrown when a required parameter is null /// - public ResourcePrivateLinkClient(ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + public ResourcePrivateLinkClient(Microsoft.Rest.ServiceClientCredentials credentials, System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : this(rootHandler, handlers) { if (credentials == null) { throw new System.ArgumentNullException("credentials"); } - Credentials = credentials; - if (Credentials != null) + this.Credentials = credentials; + if (this.Credentials != null) { - Credentials.InitializeServiceClient(this); + this.Credentials.InitializeServiceClient(this); } + } - /// /// Initializes a new instance of the ResourcePrivateLinkClient class. /// /// /// Optional. The base URI of the service. /// - /// + /// /// Required. Credentials needed for the client to connect to Azure. /// /// @@ -262,7 +242,7 @@ public ResourcePrivateLinkClient(ServiceClientCredentials credentials, HttpClien /// /// Thrown when a required parameter is null /// - public ResourcePrivateLinkClient(System.Uri baseUri, ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers) + public ResourcePrivateLinkClient(System.Uri baseUri, Microsoft.Rest.ServiceClientCredentials credentials, params System.Net.Http.DelegatingHandler[] handlers) : this(handlers) { if (baseUri == null) { @@ -272,33 +252,30 @@ public ResourcePrivateLinkClient(System.Uri baseUri, ServiceClientCredentials cr { throw new System.ArgumentNullException("credentials"); } - BaseUri = baseUri; - Credentials = credentials; - if (Credentials != null) + this.BaseUri = baseUri; + this.Credentials = credentials; + if (this.Credentials != null) { - Credentials.InitializeServiceClient(this); + this.Credentials.InitializeServiceClient(this); } + } - /// /// Initializes a new instance of the ResourcePrivateLinkClient class. /// /// /// Optional. The base URI of the service. /// - /// + /// /// Required. Credentials needed for the client to connect to Azure. /// /// /// Optional. The http client handler used to handle http transport. /// - /// - /// Optional. The delegating handlers to add to the http client pipeline. - /// /// /// Thrown when a required parameter is null /// - public ResourcePrivateLinkClient(System.Uri baseUri, ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + public ResourcePrivateLinkClient(System.Uri baseUri, Microsoft.Rest.ServiceClientCredentials credentials, System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : this(rootHandler, handlers) { if (baseUri == null) { @@ -308,57 +285,58 @@ public ResourcePrivateLinkClient(System.Uri baseUri, ServiceClientCredentials cr { throw new System.ArgumentNullException("credentials"); } - BaseUri = baseUri; - Credentials = credentials; - if (Credentials != null) + this.BaseUri = baseUri; + this.Credentials = credentials; + if (this.Credentials != null) { - Credentials.InitializeServiceClient(this); + this.Credentials.InitializeServiceClient(this); } + } - /// /// An optional partial-method to perform custom initialization. /// partial void CustomInitialize(); + /// /// Initializes client properties. /// private void Initialize() { - PrivateLinkAssociation = new PrivateLinkAssociationOperations(this); - ResourceManagementPrivateLink = new ResourceManagementPrivateLinkOperations(this); - BaseUri = new System.Uri("https://management.azure.com"); - ApiVersion = "2020-05-01"; - AcceptLanguage = "en-US"; - LongRunningOperationRetryTimeout = 30; - GenerateClientRequestId = true; - SerializationSettings = new JsonSerializerSettings + this.PrivateLinkAssociation = new PrivateLinkAssociationOperations(this); + this.ResourceManagementPrivateLink = new ResourceManagementPrivateLinkOperations(this); + this.BaseUri = new System.Uri("https://management.azure.com"); + this.ApiVersion = "2020-05-01"; + this.AcceptLanguage = "en-US"; + this.LongRunningOperationRetryTimeout = 30; + this.GenerateClientRequestId = true; + SerializationSettings = new Newtonsoft.Json.JsonSerializerSettings { Formatting = Newtonsoft.Json.Formatting.Indented, DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, - ContractResolver = new ReadOnlyJsonContractResolver(), - Converters = new List + ContractResolver = new Microsoft.Rest.Serialization.ReadOnlyJsonContractResolver(), + Converters = new System.Collections.Generic.List { - new Iso8601TimeSpanConverter() + new Microsoft.Rest.Serialization.Iso8601TimeSpanConverter() } }; - DeserializationSettings = new JsonSerializerSettings + DeserializationSettings = new Newtonsoft.Json.JsonSerializerSettings { DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, - ContractResolver = new ReadOnlyJsonContractResolver(), - Converters = new List + ContractResolver = new Microsoft.Rest.Serialization.ReadOnlyJsonContractResolver(), + Converters = new System.Collections.Generic.List { - new Iso8601TimeSpanConverter() + new Microsoft.Rest.Serialization.Iso8601TimeSpanConverter() } }; CustomInitialize(); - DeserializationSettings.Converters.Add(new CloudErrorJsonConverter()); + DeserializationSettings.Converters.Add(new Microsoft.Rest.Azure.CloudErrorJsonConverter()); } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/ResourcesOperations.cs b/src/Resources/Resources.Management.Sdk/Generated/ResourcesOperations.cs similarity index 57% rename from src/Resources/Resources.Sdk/Generated/ResourcesOperations.cs rename to src/Resources/Resources.Management.Sdk/Generated/ResourcesOperations.cs index fdf3877c70fa..607adc546905 100644 --- a/src/Resources/Resources.Sdk/Generated/ResourcesOperations.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/ResourcesOperations.cs @@ -1,32 +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 Microsoft.Rest.Azure.OData; 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; /// /// ResourcesOperations operations. /// - internal partial class ResourcesOperations : IServiceOperations, IResourcesOperations + internal partial class ResourcesOperations : Microsoft.Rest.IServiceOperations, IResourcesOperations { /// /// Initializes a new instance of the ResourcesOperations class. @@ -37,13 +24,13 @@ internal partial class ResourcesOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal ResourcesOperations(ResourceManagementClient client) + internal ResourcesOperations (ResourceManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -54,25 +41,25 @@ internal ResourcesOperations(ResourceManagementClient client) /// /// Get all the resources for a resource group. /// + /// + /// + /// /// /// The resource group with the resources to get. /// - /// - /// OData parameters to apply to the operation. - /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -81,89 +68,99 @@ internal ResourcesOperations(ResourceManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), 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 (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("odataQuery", odataQuery); tracingParameters.Add("resourceGroupName", resourceGroupName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", 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}/resources").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _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 (odataQuery != null) { - var _odataFilter = odataQuery.ToString(); - if (!string.IsNullOrEmpty(_odataFilter)) + var _genericResourceFilter = odataQuery.ToString(); + if (!string.IsNullOrEmpty(_genericResourceFilter)) { - _queryParameters.Add(_odataFilter); + _queryParameters.Add(_genericResourceFilter); } } - 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) @@ -175,55 +172,56 @@ internal ResourcesOperations(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 +231,10 @@ internal ResourcesOperations(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,35 +245,32 @@ internal ResourcesOperations(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; - } + + + + + } /// - /// Moves resources from one resource group to another resource group. + /// The resources to be moved must be in the same source resource group in the source subscription being used. The target resource group may be in a different subscription. When moving resources, both the source group and the target group are locked for the duration of the operation. Write and delete operations are blocked on the groups until the move completes. /// - /// - /// The resources to be moved must be in the same source resource group in the - /// source subscription being used. The target resource group may be in a - /// different subscription. When moving resources, both the source group and - /// the target group are locked for the duration of the operation. Write and - /// delete operations are blocked on the groups until the move completes. - /// /// /// The name of the resource group from the source subscription containing the /// resources to be moved. @@ -283,31 +279,21 @@ internal ResourcesOperations(ResourceManagementClient client) /// Parameters for moving resources. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task MoveResourcesWithHttpMessagesAsync(string sourceResourceGroupName, ResourcesMoveInfo parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task MoveResourcesWithHttpMessagesAsync(string sourceResourceGroupName, ResourcesMoveInfo parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginMoveResourcesWithHttpMessagesAsync(sourceResourceGroupName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginMoveResourcesWithHttpMessagesAsync(sourceResourceGroupName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Validates whether resources can be moved from one resource group to another - /// resource group. + /// This operation checks whether the specified resources can be moved to the target. The resources to be moved must be in the same source resource group in the source subscription being used. The target resource group may be in a different subscription. If validation succeeds, it returns HTTP response code 204 (no content). If validation fails, it returns HTTP response code 409 (Conflict) with an error message. Retrieve the URL in the Location header value to check the result of the long-running operation. /// - /// - /// This operation checks whether the specified resources can be moved to the - /// target. The resources to be moved must be in the same source resource group - /// in the source subscription being used. The target resource group may be in - /// a different subscription. If validation succeeds, it returns HTTP response - /// code 204 (no content). If validation fails, it returns HTTP response code - /// 409 (Conflict) with an error message. Retrieve the URL in the Location - /// header value to check the result of the long-running operation. - /// /// /// The name of the resource group from the source subscription containing the /// resources to be validated for move. @@ -316,23 +302,23 @@ internal ResourcesOperations(ResourceManagementClient client) /// Parameters for moving resources. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task ValidateMoveResourcesWithHttpMessagesAsync(string sourceResourceGroupName, ResourcesMoveInfo parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task ValidateMoveResourcesWithHttpMessagesAsync(string sourceResourceGroupName, ResourcesMoveInfo parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginValidateMoveResourcesWithHttpMessagesAsync(sourceResourceGroupName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginValidateMoveResourcesWithHttpMessagesAsync(sourceResourceGroupName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// /// Get all the resources in a subscription. /// /// - /// OData parameters to apply to the operation. + /// /// /// /// Headers that will be added to request. @@ -340,13 +326,13 @@ internal ResourcesOperations(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 /// /// @@ -355,68 +341,78 @@ internal ResourcesOperations(ResourceManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - 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("odataQuery", odataQuery); + + 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}/resources").ToString(); - _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 (odataQuery != null) { - var _odataFilter = odataQuery.ToString(); - if (!string.IsNullOrEmpty(_odataFilter)) + var _genericResourceFilter = odataQuery.ToString(); + if (!string.IsNullOrEmpty(_genericResourceFilter)) { - _queryParameters.Add(_odataFilter); + _queryParameters.Add(_genericResourceFilter); } } - 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) @@ -428,55 +424,56 @@ internal ResourcesOperations(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) @@ -486,9 +483,10 @@ internal ResourcesOperations(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(); @@ -499,25 +497,29 @@ internal ResourcesOperations(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; - } + + + + + } /// /// Checks whether a resource exists. /// @@ -546,10 +548,10 @@ internal ResourcesOperations(ResourceManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -558,77 +560,91 @@ internal ResourcesOperations(ResourceManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CheckExistenceWithHttpMessagesAsync(string resourceGroupName, string resourceProviderNamespace, string parentResourcePath, string resourceType, string resourceName, string apiVersion, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CheckExistenceWithHttpMessagesAsync(string resourceGroupName, string resourceProviderNamespace, string parentResourcePath, string resourceType, string resourceName, string apiVersion, 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 (resourceProviderNamespace == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceProviderNamespace"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceProviderNamespace"); } + if (parentResourcePath == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parentResourcePath"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parentResourcePath"); } + if (resourceType == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceType"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceType"); } + if (resourceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceName"); } + if (apiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "apiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "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("resourceProviderNamespace", resourceProviderNamespace); tracingParameters.Add("parentResourcePath", parentResourcePath); tracingParameters.Add("resourceType", resourceType); tracingParameters.Add("resourceName", resourceName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CheckExistence", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "CheckExistence", 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}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{resourceProviderNamespace}", System.Uri.EscapeDataString(resourceProviderNamespace)); _url = _url.Replace("{parentResourcePath}", parentResourcePath); _url = _url.Replace("{resourceType}", resourceType); _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); - _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 (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -638,25 +654,24 @@ internal ResourcesOperations(ResourceManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("HEAD"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("HEAD"); _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) @@ -668,55 +683,56 @@ internal ResourcesOperations(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, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, 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 != 204 && (int)_statusCode != 404) { - 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) @@ -726,21 +742,25 @@ internal ResourcesOperations(ResourceManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; - _result.Body = _statusCode == System.Net.HttpStatusCode.NoContent; + _result.Body = (_statusCode == System.Net.HttpStatusCode.NoContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes a resource. /// @@ -764,16 +784,16 @@ internal ResourcesOperations(ResourceManagementClient client) /// The API version to use for the operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string resourceProviderNamespace, string parentResourcePath, string resourceType, string resourceName, string apiVersion, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string resourceProviderNamespace, string parentResourcePath, string resourceType, string resourceName, string apiVersion, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -802,16 +822,16 @@ internal ResourcesOperations(ResourceManagementClient client) /// Parameters for creating or updating the resource. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string resourceProviderNamespace, string parentResourcePath, string resourceType, string resourceName, string apiVersion, GenericResource parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string resourceProviderNamespace, string parentResourcePath, string resourceType, string resourceName, string apiVersion, GenericResource parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -840,16 +860,16 @@ internal ResourcesOperations(ResourceManagementClient client) /// Parameters for updating the resource. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string resourceProviderNamespace, string parentResourcePath, string resourceType, string resourceName, string apiVersion, GenericResource parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string resourceProviderNamespace, string parentResourcePath, string resourceType, string resourceName, string apiVersion, GenericResource parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -880,13 +900,13 @@ internal ResourcesOperations(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 /// /// @@ -895,77 +915,91 @@ internal ResourcesOperations(ResourceManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string resourceProviderNamespace, string parentResourcePath, string resourceType, string resourceName, string apiVersion, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string resourceProviderNamespace, string parentResourcePath, string resourceType, string resourceName, string apiVersion, 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 (resourceProviderNamespace == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceProviderNamespace"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceProviderNamespace"); } + if (parentResourcePath == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parentResourcePath"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parentResourcePath"); } + if (resourceType == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceType"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceType"); } + if (resourceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceName"); } + if (apiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "apiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "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("resourceProviderNamespace", resourceProviderNamespace); tracingParameters.Add("parentResourcePath", parentResourcePath); tracingParameters.Add("resourceType", resourceType); tracingParameters.Add("resourceName", resourceName); tracingParameters.Add("apiVersion", apiVersion); + + 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}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{resourceProviderNamespace}", System.Uri.EscapeDataString(resourceProviderNamespace)); _url = _url.Replace("{parentResourcePath}", parentResourcePath); _url = _url.Replace("{resourceType}", resourceType); _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); - _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 (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -975,25 +1009,24 @@ internal ResourcesOperations(ResourceManagementClient client) _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) @@ -1005,55 +1038,56 @@ internal ResourcesOperations(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) @@ -1063,9 +1097,10 @@ internal ResourcesOperations(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(); @@ -1076,25 +1111,29 @@ internal ResourcesOperations(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; - } + + + + + } /// /// Checks by ID whether a resource exists. This API currently works only for a /// limited set of Resource providers. In the event that a Resource provider @@ -1115,10 +1154,10 @@ internal ResourcesOperations(ResourceManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1127,33 +1166,43 @@ internal ResourcesOperations(ResourceManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CheckExistenceByIdWithHttpMessagesAsync(string resourceId, string apiVersion, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CheckExistenceByIdWithHttpMessagesAsync(string resourceId, string apiVersion, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceId"); } + if (apiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "apiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "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("resourceId", resourceId); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CheckExistenceById", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "CheckExistenceById", 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("/") ? "" : "/")), "{resourceId}").ToString(); _url = _url.Replace("{resourceId}", resourceId); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1163,25 +1212,24 @@ internal ResourcesOperations(ResourceManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("HEAD"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("HEAD"); _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) @@ -1193,55 +1241,56 @@ internal ResourcesOperations(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, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, 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 != 204 && (int)_statusCode != 404) { - 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) @@ -1251,21 +1300,25 @@ internal ResourcesOperations(ResourceManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; - _result.Body = _statusCode == System.Net.HttpStatusCode.NoContent; + _result.Body = (_statusCode == System.Net.HttpStatusCode.NoContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes a resource by ID. /// @@ -1278,16 +1331,16 @@ internal ResourcesOperations(ResourceManagementClient client) /// The API version to use for the operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteByIdWithHttpMessagesAsync(string resourceId, string apiVersion, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteByIdWithHttpMessagesAsync(string resourceId, string apiVersion, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteByIdWithHttpMessagesAsync(resourceId, apiVersion, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteByIdWithHttpMessagesAsync(resourceId, apiVersion, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -1305,16 +1358,16 @@ internal ResourcesOperations(ResourceManagementClient client) /// Create or update resource parameters. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateByIdWithHttpMessagesAsync(string resourceId, string apiVersion, GenericResource parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateByIdWithHttpMessagesAsync(string resourceId, string apiVersion, GenericResource parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateByIdWithHttpMessagesAsync(resourceId, apiVersion, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateByIdWithHttpMessagesAsync(resourceId, apiVersion, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -1332,16 +1385,16 @@ internal ResourcesOperations(ResourceManagementClient client) /// Update resource parameters. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> UpdateByIdWithHttpMessagesAsync(string resourceId, string apiVersion, GenericResource parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> UpdateByIdWithHttpMessagesAsync(string resourceId, string apiVersion, GenericResource parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginUpdateByIdWithHttpMessagesAsync(resourceId, apiVersion, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginUpdateByIdWithHttpMessagesAsync(resourceId, apiVersion, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -1361,13 +1414,13 @@ internal ResourcesOperations(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 /// /// @@ -1376,33 +1429,43 @@ internal ResourcesOperations(ResourceManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetByIdWithHttpMessagesAsync(string resourceId, string apiVersion, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetByIdWithHttpMessagesAsync(string resourceId, string apiVersion, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceId"); } + if (apiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "apiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "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("resourceId", resourceId); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetById", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetById", 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("/") ? "" : "/")), "{resourceId}").ToString(); _url = _url.Replace("{resourceId}", resourceId); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1412,25 +1475,24 @@ internal ResourcesOperations(ResourceManagementClient client) _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) @@ -1442,55 +1504,56 @@ internal ResourcesOperations(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) @@ -1500,9 +1563,10 @@ internal ResourcesOperations(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(); @@ -1513,35 +1577,36 @@ internal ResourcesOperations(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; - } + + + + + } /// - /// Moves resources from one resource group to another resource group. - /// - /// /// The resources to be moved must be in the same source resource group in the /// source subscription being used. The target resource group may be in a /// different subscription. When moving resources, both the source group and /// the target group are locked for the duration of the operation. Write and /// delete operations are blocked on the groups until the move completes. - /// + /// /// /// The name of the resource group from the source subscription containing the /// resources to be moved. @@ -1555,10 +1620,10 @@ internal ResourcesOperations(ResourceManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1567,85 +1632,95 @@ internal ResourcesOperations(ResourceManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginMoveResourcesWithHttpMessagesAsync(string sourceResourceGroupName, ResourcesMoveInfo parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginMoveResourcesWithHttpMessagesAsync(string sourceResourceGroupName, ResourcesMoveInfo parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + + if (parameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); + } + if (sourceResourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "sourceResourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "sourceResourceGroupName"); } if (sourceResourceGroupName != null) { if (sourceResourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "sourceResourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "sourceResourceGroupName", 90); } if (sourceResourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "sourceResourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "sourceResourceGroupName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(sourceResourceGroupName, "^[-\\w\\._\\(\\)]+$")) { - throw new ValidationException(ValidationRules.Pattern, "sourceResourceGroupName", "^[-\\w\\._\\(\\)]+$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "sourceResourceGroupName", "^[-\\w\\._\\(\\)]+$"); } } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - 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("sourceResourceGroupName", sourceResourceGroupName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginMoveResources", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginMoveResources", 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/{sourceResourceGroupName}/moveResources").ToString(); _url = _url.Replace("{sourceResourceGroupName}", System.Uri.EscapeDataString(sourceResourceGroupName)); - _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("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _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) @@ -1657,61 +1732,62 @@ internal ResourcesOperations(ResourceManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + 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 != 202 && (int)_statusCode != 204) { - 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) @@ -1721,25 +1797,26 @@ internal ResourcesOperations(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(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Validates whether resources can be moved from one resource group to another - /// resource group. - /// - /// /// This operation checks whether the specified resources can be moved to the /// target. The resources to be moved must be in the same source resource group /// in the source subscription being used. The target resource group may be in @@ -1747,7 +1824,7 @@ internal ResourcesOperations(ResourceManagementClient client) /// code 204 (no content). If validation fails, it returns HTTP response code /// 409 (Conflict) with an error message. Retrieve the URL in the Location /// header value to check the result of the long-running operation. - /// + /// /// /// The name of the resource group from the source subscription containing the /// resources to be validated for move. @@ -1761,10 +1838,10 @@ internal ResourcesOperations(ResourceManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1773,85 +1850,95 @@ internal ResourcesOperations(ResourceManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginValidateMoveResourcesWithHttpMessagesAsync(string sourceResourceGroupName, ResourcesMoveInfo parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginValidateMoveResourcesWithHttpMessagesAsync(string sourceResourceGroupName, ResourcesMoveInfo parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + + if (parameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); + } + if (sourceResourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "sourceResourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "sourceResourceGroupName"); } if (sourceResourceGroupName != null) { if (sourceResourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "sourceResourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "sourceResourceGroupName", 90); } if (sourceResourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "sourceResourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "sourceResourceGroupName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(sourceResourceGroupName, "^[-\\w\\._\\(\\)]+$")) { - throw new ValidationException(ValidationRules.Pattern, "sourceResourceGroupName", "^[-\\w\\._\\(\\)]+$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "sourceResourceGroupName", "^[-\\w\\._\\(\\)]+$"); } } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - 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("sourceResourceGroupName", sourceResourceGroupName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginValidateMoveResources", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginValidateMoveResources", 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/{sourceResourceGroupName}/validateMoveResources").ToString(); _url = _url.Replace("{sourceResourceGroupName}", System.Uri.EscapeDataString(sourceResourceGroupName)); - _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("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _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) @@ -1863,61 +1950,62 @@ internal ResourcesOperations(ResourceManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + 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 != 202 && (int)_statusCode != 204) { - 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) @@ -1927,20 +2015,25 @@ internal ResourcesOperations(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(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes a resource. /// @@ -1969,10 +2062,10 @@ internal ResourcesOperations(ResourceManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1981,77 +2074,91 @@ internal ResourcesOperations(ResourceManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string resourceProviderNamespace, string parentResourcePath, string resourceType, string resourceName, string apiVersion, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string resourceProviderNamespace, string parentResourcePath, string resourceType, string resourceName, string apiVersion, 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 (resourceProviderNamespace == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceProviderNamespace"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceProviderNamespace"); } + if (parentResourcePath == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parentResourcePath"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parentResourcePath"); } + if (resourceType == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceType"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceType"); } + if (resourceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceName"); } + if (apiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "apiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "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("resourceProviderNamespace", resourceProviderNamespace); tracingParameters.Add("parentResourcePath", parentResourcePath); tracingParameters.Add("resourceType", resourceType); tracingParameters.Add("resourceName", resourceName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", 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}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{resourceProviderNamespace}", System.Uri.EscapeDataString(resourceProviderNamespace)); _url = _url.Replace("{parentResourcePath}", parentResourcePath); _url = _url.Replace("{resourceType}", resourceType); _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); - _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 (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -2061,25 +2168,24 @@ internal ResourcesOperations(ResourceManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _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) @@ -2091,55 +2197,56 @@ internal ResourcesOperations(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 && (int)_statusCode != 202 && (int)_statusCode != 204) { - 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) @@ -2149,20 +2256,25 @@ internal ResourcesOperations(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(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Creates a resource. /// @@ -2194,13 +2306,13 @@ internal ResourcesOperations(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 /// /// @@ -2209,86 +2321,100 @@ internal ResourcesOperations(ResourceManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string resourceProviderNamespace, string parentResourcePath, string resourceType, string resourceName, string apiVersion, GenericResource parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string resourceProviderNamespace, string parentResourcePath, string resourceType, string resourceName, string apiVersion, GenericResource parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + + if (parameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); + } + if (parameters != null) + { + parameters.Validate(); + } 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 (resourceProviderNamespace == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceProviderNamespace"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceProviderNamespace"); } + if (parentResourcePath == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parentResourcePath"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parentResourcePath"); } + if (resourceType == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceType"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceType"); } + if (resourceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceName"); } + if (apiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "apiVersion"); - } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "apiVersion"); } - if (parameters != null) - { - parameters.Validate(); - } - 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("resourceProviderNamespace", resourceProviderNamespace); tracingParameters.Add("parentResourcePath", parentResourcePath); tracingParameters.Add("resourceType", resourceType); tracingParameters.Add("resourceName", resourceName); tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", 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}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{resourceProviderNamespace}", System.Uri.EscapeDataString(resourceProviderNamespace)); _url = _url.Replace("{parentResourcePath}", parentResourcePath); _url = _url.Replace("{resourceType}", resourceType); _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); - _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 (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -2298,25 +2424,24 @@ internal ResourcesOperations(ResourceManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _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) @@ -2328,61 +2453,62 @@ internal ResourcesOperations(ResourceManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + 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 && (int)_statusCode != 201 && (int)_statusCode != 202) { - 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) @@ -2392,9 +2518,10 @@ internal ResourcesOperations(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(); @@ -2405,16 +2532,16 @@ internal ResourcesOperations(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); } } // Deserialize Response @@ -2423,25 +2550,29 @@ internal ResourcesOperations(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; - } + + + + + } /// /// Updates a resource. /// @@ -2473,13 +2604,13 @@ internal ResourcesOperations(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 /// /// @@ -2488,82 +2619,96 @@ internal ResourcesOperations(ResourceManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string resourceProviderNamespace, string parentResourcePath, string resourceType, string resourceName, string apiVersion, GenericResource parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string resourceProviderNamespace, string parentResourcePath, string resourceType, string resourceName, string apiVersion, GenericResource parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + + if (parameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); + } 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 (resourceProviderNamespace == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceProviderNamespace"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceProviderNamespace"); } + if (parentResourcePath == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parentResourcePath"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parentResourcePath"); } + if (resourceType == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceType"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceType"); } + if (resourceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceName"); } + if (apiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "apiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "apiVersion"); } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - 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("resourceProviderNamespace", resourceProviderNamespace); tracingParameters.Add("parentResourcePath", parentResourcePath); tracingParameters.Add("resourceType", resourceType); tracingParameters.Add("resourceName", resourceName); tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", 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}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{resourceProviderNamespace}", System.Uri.EscapeDataString(resourceProviderNamespace)); _url = _url.Replace("{parentResourcePath}", parentResourcePath); _url = _url.Replace("{resourceType}", resourceType); _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); - _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 (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -2573,25 +2718,24 @@ internal ResourcesOperations(ResourceManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); _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) @@ -2603,61 +2747,62 @@ internal ResourcesOperations(ResourceManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + 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 && (int)_statusCode != 202) { - 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) @@ -2667,9 +2812,10 @@ internal ResourcesOperations(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(); @@ -2680,25 +2826,29 @@ internal ResourcesOperations(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; - } + + + + + } /// /// Deletes a resource by ID. /// @@ -2716,10 +2866,10 @@ internal ResourcesOperations(ResourceManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -2728,33 +2878,43 @@ internal ResourcesOperations(ResourceManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteByIdWithHttpMessagesAsync(string resourceId, string apiVersion, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteByIdWithHttpMessagesAsync(string resourceId, string apiVersion, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceId"); } + if (apiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "apiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "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("resourceId", resourceId); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDeleteById", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDeleteById", 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("/") ? "" : "/")), "{resourceId}").ToString(); _url = _url.Replace("{resourceId}", resourceId); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -2764,25 +2924,24 @@ internal ResourcesOperations(ResourceManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _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) @@ -2794,55 +2953,56 @@ internal ResourcesOperations(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 && (int)_statusCode != 202 && (int)_statusCode != 204) { - 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) @@ -2852,20 +3012,25 @@ internal ResourcesOperations(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(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Create a resource by ID. /// @@ -2886,13 +3051,13 @@ internal ResourcesOperations(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 /// /// @@ -2901,42 +3066,52 @@ internal ResourcesOperations(ResourceManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateByIdWithHttpMessagesAsync(string resourceId, string apiVersion, GenericResource parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateByIdWithHttpMessagesAsync(string resourceId, string apiVersion, GenericResource parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (resourceId == null) + + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } - if (apiVersion == null) + if (parameters != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "apiVersion"); + parameters.Validate(); } - if (parameters == null) + if (resourceId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceId"); } - if (parameters != null) + + if (apiVersion == null) { - parameters.Validate(); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "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("resourceId", resourceId); tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdateById", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdateById", 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("/") ? "" : "/")), "{resourceId}").ToString(); _url = _url.Replace("{resourceId}", resourceId); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -2946,25 +3121,24 @@ internal ResourcesOperations(ResourceManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _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) @@ -2976,61 +3150,62 @@ internal ResourcesOperations(ResourceManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + 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 && (int)_statusCode != 201 && (int)_statusCode != 202) { - 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) @@ -3040,9 +3215,10 @@ internal ResourcesOperations(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(); @@ -3053,16 +3229,16 @@ internal ResourcesOperations(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); } } // Deserialize Response @@ -3071,25 +3247,29 @@ internal ResourcesOperations(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; - } + + + + + } /// /// Updates a resource by ID. /// @@ -3110,13 +3290,13 @@ internal ResourcesOperations(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 /// /// @@ -3125,38 +3305,48 @@ internal ResourcesOperations(ResourceManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginUpdateByIdWithHttpMessagesAsync(string resourceId, string apiVersion, GenericResource parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginUpdateByIdWithHttpMessagesAsync(string resourceId, string apiVersion, GenericResource parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (resourceId == null) + + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } - if (apiVersion == null) + if (resourceId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "apiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceId"); } - if (parameters == null) + + if (apiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "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("resourceId", resourceId); tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginUpdateById", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginUpdateById", 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("/") ? "" : "/")), "{resourceId}").ToString(); _url = _url.Replace("{resourceId}", resourceId); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -3166,25 +3356,24 @@ internal ResourcesOperations(ResourceManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); _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) @@ -3196,61 +3385,62 @@ internal ResourcesOperations(ResourceManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + 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 && (int)_statusCode != 202) { - 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) @@ -3260,9 +3450,10 @@ internal ResourcesOperations(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(); @@ -3273,25 +3464,29 @@ internal ResourcesOperations(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; - } + + + + + } /// /// Get all the resources for a resource group. /// @@ -3304,13 +3499,13 @@ internal ResourcesOperations(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 /// /// @@ -3319,51 +3514,54 @@ internal ResourcesOperations(ResourceManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByResourceGroupNextWithHttpMessagesAsync(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, "ListByResourceGroupNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", 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) @@ -3375,55 +3573,56 @@ internal ResourcesOperations(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) @@ -3433,9 +3632,10 @@ internal ResourcesOperations(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(); @@ -3446,25 +3646,29 @@ internal ResourcesOperations(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; - } + + + + + } /// /// Get all the resources in a subscription. /// @@ -3477,13 +3681,13 @@ internal ResourcesOperations(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 /// /// @@ -3492,51 +3696,54 @@ internal ResourcesOperations(ResourceManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(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, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", 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) @@ -3548,55 +3755,56 @@ internal ResourcesOperations(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) @@ -3606,9 +3814,10 @@ internal ResourcesOperations(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(); @@ -3619,24 +3828,28 @@ internal ResourcesOperations(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; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Management.Sdk/Generated/ResourcesOperationsExtensions.cs b/src/Resources/Resources.Management.Sdk/Generated/ResourcesOperationsExtensions.cs new file mode 100644 index 000000000000..d0683ca08d8f --- /dev/null +++ b/src/Resources/Resources.Management.Sdk/Generated/ResourcesOperationsExtensions.cs @@ -0,0 +1,1180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.Management.Resources +{ + using Microsoft.Rest.Azure; + using Models; + + /// + /// Extension methods for ResourcesOperations + /// + public static partial class ResourcesOperationsExtensions + { + /// + /// Get all the resources for a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// + /// + /// + /// The resource group with the resources to get. + /// + public static Microsoft.Rest.Azure.IPage ListByResourceGroup(this IResourcesOperations operations, string resourceGroupName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery)) + { + return ((IResourcesOperations)operations).ListByResourceGroupAsync(resourceGroupName, odataQuery).GetAwaiter().GetResult(); + } + + /// + /// Get all the resources for a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// + /// + /// + /// The resource group with the resources to get. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByResourceGroupAsync(this IResourcesOperations operations, string resourceGroupName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, odataQuery, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// The resources to be moved must be in the same source resource group in the + /// source subscription being used. The target resource group may be in a + /// different subscription. When moving resources, both the source group and + /// the target group are locked for the duration of the operation. Write and + /// delete operations are blocked on the groups until the move completes. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group from the source subscription containing the + /// resources to be moved. + /// + public static void MoveResources(this IResourcesOperations operations, string sourceResourceGroupName, ResourcesMoveInfo parameters) + { + ((IResourcesOperations)operations).MoveResourcesAsync(sourceResourceGroupName, parameters).GetAwaiter().GetResult(); + } + + /// + /// The resources to be moved must be in the same source resource group in the + /// source subscription being used. The target resource group may be in a + /// different subscription. When moving resources, both the source group and + /// the target group are locked for the duration of the operation. Write and + /// delete operations are blocked on the groups until the move completes. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group from the source subscription containing the + /// resources to be moved. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task MoveResourcesAsync(this IResourcesOperations operations, string sourceResourceGroupName, ResourcesMoveInfo parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.MoveResourcesWithHttpMessagesAsync(sourceResourceGroupName, parameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// This operation checks whether the specified resources can be moved to the + /// target. The resources to be moved must be in the same source resource group + /// in the source subscription being used. The target resource group may be in + /// a different subscription. If validation succeeds, it returns HTTP response + /// code 204 (no content). If validation fails, it returns HTTP response code + /// 409 (Conflict) with an error message. Retrieve the URL in the Location + /// header value to check the result of the long-running operation. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group from the source subscription containing the + /// resources to be validated for move. + /// + public static void ValidateMoveResources(this IResourcesOperations operations, string sourceResourceGroupName, ResourcesMoveInfo parameters) + { + ((IResourcesOperations)operations).ValidateMoveResourcesAsync(sourceResourceGroupName, parameters).GetAwaiter().GetResult(); + } + + /// + /// This operation checks whether the specified resources can be moved to the + /// target. The resources to be moved must be in the same source resource group + /// in the source subscription being used. The target resource group may be in + /// a different subscription. If validation succeeds, it returns HTTP response + /// code 204 (no content). If validation fails, it returns HTTP response code + /// 409 (Conflict) with an error message. Retrieve the URL in the Location + /// header value to check the result of the long-running operation. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group from the source subscription containing the + /// resources to be validated for move. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task ValidateMoveResourcesAsync(this IResourcesOperations operations, string sourceResourceGroupName, ResourcesMoveInfo parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.ValidateMoveResourcesWithHttpMessagesAsync(sourceResourceGroupName, parameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Get all the resources in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// + /// + public static Microsoft.Rest.Azure.IPage List(this IResourcesOperations operations, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery)) + { + return ((IResourcesOperations)operations).ListAsync(odataQuery).GetAwaiter().GetResult(); + } + + /// + /// Get all the resources in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IResourcesOperations operations, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(odataQuery, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Checks whether a resource exists. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group containing the resource to check. The name + /// is case insensitive. + /// + /// + /// The resource provider of the resource to check. + /// + /// + /// The parent resource identity. + /// + /// + /// The resource type. + /// + /// + /// The name of the resource to check whether it exists. + /// + /// + /// The API version to use for the operation. + /// + public static bool CheckExistence(this IResourcesOperations operations, string resourceGroupName, string resourceProviderNamespace, string parentResourcePath, string resourceType, string resourceName, string apiVersion) + { + return ((IResourcesOperations)operations).CheckExistenceAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion).GetAwaiter().GetResult(); + } + + /// + /// Checks whether a resource exists. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group containing the resource to check. The name + /// is case insensitive. + /// + /// + /// The resource provider of the resource to check. + /// + /// + /// The parent resource identity. + /// + /// + /// The resource type. + /// + /// + /// The name of the resource to check whether it exists. + /// + /// + /// The API version to use for the operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CheckExistenceAsync(this IResourcesOperations operations, string resourceGroupName, string resourceProviderNamespace, string parentResourcePath, string resourceType, string resourceName, string apiVersion, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CheckExistenceWithHttpMessagesAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Deletes a resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource to delete. The + /// name is case insensitive. + /// + /// + /// The namespace of the resource provider. + /// + /// + /// The parent resource identity. + /// + /// + /// The resource type. + /// + /// + /// The name of the resource to delete. + /// + /// + /// The API version to use for the operation. + /// + public static void Delete(this IResourcesOperations operations, string resourceGroupName, string resourceProviderNamespace, string parentResourcePath, string resourceType, string resourceName, string apiVersion) + { + ((IResourcesOperations)operations).DeleteAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion).GetAwaiter().GetResult(); + } + + /// + /// Deletes a resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource to delete. The + /// name is case insensitive. + /// + /// + /// The namespace of the resource provider. + /// + /// + /// The parent resource identity. + /// + /// + /// The resource type. + /// + /// + /// The name of the resource to delete. + /// + /// + /// The API version to use for the operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IResourcesOperations operations, string resourceGroupName, string resourceProviderNamespace, string parentResourcePath, string resourceType, string resourceName, string apiVersion, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Creates a resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group for the resource. The name is case + /// insensitive. + /// + /// + /// The namespace of the resource provider. + /// + /// + /// The parent resource identity. + /// + /// + /// The resource type of the resource to create. + /// + /// + /// The name of the resource to create. + /// + /// + /// The API version to use for the operation. + /// + public static GenericResource CreateOrUpdate(this IResourcesOperations operations, string resourceGroupName, string resourceProviderNamespace, string parentResourcePath, string resourceType, string resourceName, string apiVersion, GenericResource parameters) + { + return ((IResourcesOperations)operations).CreateOrUpdateAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion, parameters).GetAwaiter().GetResult(); + } + + /// + /// Creates a resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group for the resource. The name is case + /// insensitive. + /// + /// + /// The namespace of the resource provider. + /// + /// + /// The parent resource identity. + /// + /// + /// The resource type of the resource to create. + /// + /// + /// The name of the resource to create. + /// + /// + /// The API version to use for the operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IResourcesOperations operations, string resourceGroupName, string resourceProviderNamespace, string parentResourcePath, string resourceType, string resourceName, string apiVersion, GenericResource parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Updates a resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group for the resource. The name is case + /// insensitive. + /// + /// + /// The namespace of the resource provider. + /// + /// + /// The parent resource identity. + /// + /// + /// The resource type of the resource to update. + /// + /// + /// The name of the resource to update. + /// + /// + /// The API version to use for the operation. + /// + public static GenericResource Update(this IResourcesOperations operations, string resourceGroupName, string resourceProviderNamespace, string parentResourcePath, string resourceType, string resourceName, string apiVersion, GenericResource parameters) + { + return ((IResourcesOperations)operations).UpdateAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion, parameters).GetAwaiter().GetResult(); + } + + /// + /// Updates a resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group for the resource. The name is case + /// insensitive. + /// + /// + /// The namespace of the resource provider. + /// + /// + /// The parent resource identity. + /// + /// + /// The resource type of the resource to update. + /// + /// + /// The name of the resource to update. + /// + /// + /// The API version to use for the operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UpdateAsync(this IResourcesOperations operations, string resourceGroupName, string resourceProviderNamespace, string parentResourcePath, string resourceType, string resourceName, string apiVersion, GenericResource parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets a resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group containing the resource to get. The name is + /// case insensitive. + /// + /// + /// The namespace of the resource provider. + /// + /// + /// The parent resource identity. + /// + /// + /// The resource type of the resource. + /// + /// + /// The name of the resource to get. + /// + /// + /// The API version to use for the operation. + /// + public static GenericResource Get(this IResourcesOperations operations, string resourceGroupName, string resourceProviderNamespace, string parentResourcePath, string resourceType, string resourceName, string apiVersion) + { + return ((IResourcesOperations)operations).GetAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion).GetAwaiter().GetResult(); + } + + /// + /// Gets a resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group containing the resource to get. The name is + /// case insensitive. + /// + /// + /// The namespace of the resource provider. + /// + /// + /// The parent resource identity. + /// + /// + /// The resource type of the resource. + /// + /// + /// The name of the resource to get. + /// + /// + /// The API version to use for the operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IResourcesOperations operations, string resourceGroupName, string resourceProviderNamespace, string parentResourcePath, string resourceType, string resourceName, string apiVersion, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Checks by ID whether a resource exists. This API currently works only for a + /// limited set of Resource providers. In the event that a Resource provider + /// does not implement this API, ARM will respond with a 405. The alternative + /// then is to use the GET API to check for the existence of the resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The fully qualified ID of the resource, including the resource name and + /// resource type. Use the format, + /// /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} + /// + /// + /// The API version to use for the operation. + /// + public static bool CheckExistenceById(this IResourcesOperations operations, string resourceId, string apiVersion) + { + return ((IResourcesOperations)operations).CheckExistenceByIdAsync(resourceId, apiVersion).GetAwaiter().GetResult(); + } + + /// + /// Checks by ID whether a resource exists. This API currently works only for a + /// limited set of Resource providers. In the event that a Resource provider + /// does not implement this API, ARM will respond with a 405. The alternative + /// then is to use the GET API to check for the existence of the resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The fully qualified ID of the resource, including the resource name and + /// resource type. Use the format, + /// /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} + /// + /// + /// The API version to use for the operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CheckExistenceByIdAsync(this IResourcesOperations operations, string resourceId, string apiVersion, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CheckExistenceByIdWithHttpMessagesAsync(resourceId, apiVersion, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Deletes a resource by ID. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The fully qualified ID of the resource, including the resource name and + /// resource type. Use the format, + /// /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} + /// + /// + /// The API version to use for the operation. + /// + public static void DeleteById(this IResourcesOperations operations, string resourceId, string apiVersion) + { + ((IResourcesOperations)operations).DeleteByIdAsync(resourceId, apiVersion).GetAwaiter().GetResult(); + } + + /// + /// Deletes a resource by ID. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The fully qualified ID of the resource, including the resource name and + /// resource type. Use the format, + /// /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} + /// + /// + /// The API version to use for the operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteByIdAsync(this IResourcesOperations operations, string resourceId, string apiVersion, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteByIdWithHttpMessagesAsync(resourceId, apiVersion, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Create a resource by ID. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The fully qualified ID of the resource, including the resource name and + /// resource type. Use the format, + /// /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} + /// + /// + /// The API version to use for the operation. + /// + public static GenericResource CreateOrUpdateById(this IResourcesOperations operations, string resourceId, string apiVersion, GenericResource parameters) + { + return ((IResourcesOperations)operations).CreateOrUpdateByIdAsync(resourceId, apiVersion, parameters).GetAwaiter().GetResult(); + } + + /// + /// Create a resource by ID. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The fully qualified ID of the resource, including the resource name and + /// resource type. Use the format, + /// /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} + /// + /// + /// The API version to use for the operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateByIdAsync(this IResourcesOperations operations, string resourceId, string apiVersion, GenericResource parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateByIdWithHttpMessagesAsync(resourceId, apiVersion, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Updates a resource by ID. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The fully qualified ID of the resource, including the resource name and + /// resource type. Use the format, + /// /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} + /// + /// + /// The API version to use for the operation. + /// + public static GenericResource UpdateById(this IResourcesOperations operations, string resourceId, string apiVersion, GenericResource parameters) + { + return ((IResourcesOperations)operations).UpdateByIdAsync(resourceId, apiVersion, parameters).GetAwaiter().GetResult(); + } + + /// + /// Updates a resource by ID. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The fully qualified ID of the resource, including the resource name and + /// resource type. Use the format, + /// /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} + /// + /// + /// The API version to use for the operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UpdateByIdAsync(this IResourcesOperations operations, string resourceId, string apiVersion, GenericResource parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.UpdateByIdWithHttpMessagesAsync(resourceId, apiVersion, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets a resource by ID. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The fully qualified ID of the resource, including the resource name and + /// resource type. Use the format, + /// /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} + /// + /// + /// The API version to use for the operation. + /// + public static GenericResource GetById(this IResourcesOperations operations, string resourceId, string apiVersion) + { + return ((IResourcesOperations)operations).GetByIdAsync(resourceId, apiVersion).GetAwaiter().GetResult(); + } + + /// + /// Gets a resource by ID. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The fully qualified ID of the resource, including the resource name and + /// resource type. Use the format, + /// /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} + /// + /// + /// The API version to use for the operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetByIdAsync(this IResourcesOperations operations, string resourceId, string apiVersion, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetByIdWithHttpMessagesAsync(resourceId, apiVersion, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// The resources to be moved must be in the same source resource group in the + /// source subscription being used. The target resource group may be in a + /// different subscription. When moving resources, both the source group and + /// the target group are locked for the duration of the operation. Write and + /// delete operations are blocked on the groups until the move completes. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group from the source subscription containing the + /// resources to be moved. + /// + public static void BeginMoveResources(this IResourcesOperations operations, string sourceResourceGroupName, ResourcesMoveInfo parameters) + { + ((IResourcesOperations)operations).BeginMoveResourcesAsync(sourceResourceGroupName, parameters).GetAwaiter().GetResult(); + } + + /// + /// The resources to be moved must be in the same source resource group in the + /// source subscription being used. The target resource group may be in a + /// different subscription. When moving resources, both the source group and + /// the target group are locked for the duration of the operation. Write and + /// delete operations are blocked on the groups until the move completes. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group from the source subscription containing the + /// resources to be moved. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginMoveResourcesAsync(this IResourcesOperations operations, string sourceResourceGroupName, ResourcesMoveInfo parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginMoveResourcesWithHttpMessagesAsync(sourceResourceGroupName, parameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// This operation checks whether the specified resources can be moved to the + /// target. The resources to be moved must be in the same source resource group + /// in the source subscription being used. The target resource group may be in + /// a different subscription. If validation succeeds, it returns HTTP response + /// code 204 (no content). If validation fails, it returns HTTP response code + /// 409 (Conflict) with an error message. Retrieve the URL in the Location + /// header value to check the result of the long-running operation. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group from the source subscription containing the + /// resources to be validated for move. + /// + public static void BeginValidateMoveResources(this IResourcesOperations operations, string sourceResourceGroupName, ResourcesMoveInfo parameters) + { + ((IResourcesOperations)operations).BeginValidateMoveResourcesAsync(sourceResourceGroupName, parameters).GetAwaiter().GetResult(); + } + + /// + /// This operation checks whether the specified resources can be moved to the + /// target. The resources to be moved must be in the same source resource group + /// in the source subscription being used. The target resource group may be in + /// a different subscription. If validation succeeds, it returns HTTP response + /// code 204 (no content). If validation fails, it returns HTTP response code + /// 409 (Conflict) with an error message. Retrieve the URL in the Location + /// header value to check the result of the long-running operation. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group from the source subscription containing the + /// resources to be validated for move. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginValidateMoveResourcesAsync(this IResourcesOperations operations, string sourceResourceGroupName, ResourcesMoveInfo parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginValidateMoveResourcesWithHttpMessagesAsync(sourceResourceGroupName, parameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Deletes a resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource to delete. The + /// name is case insensitive. + /// + /// + /// The namespace of the resource provider. + /// + /// + /// The parent resource identity. + /// + /// + /// The resource type. + /// + /// + /// The name of the resource to delete. + /// + /// + /// The API version to use for the operation. + /// + public static void BeginDelete(this IResourcesOperations operations, string resourceGroupName, string resourceProviderNamespace, string parentResourcePath, string resourceType, string resourceName, string apiVersion) + { + ((IResourcesOperations)operations).BeginDeleteAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion).GetAwaiter().GetResult(); + } + + /// + /// Deletes a resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource to delete. The + /// name is case insensitive. + /// + /// + /// The namespace of the resource provider. + /// + /// + /// The parent resource identity. + /// + /// + /// The resource type. + /// + /// + /// The name of the resource to delete. + /// + /// + /// The API version to use for the operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IResourcesOperations operations, string resourceGroupName, string resourceProviderNamespace, string parentResourcePath, string resourceType, string resourceName, string apiVersion, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Creates a resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group for the resource. The name is case + /// insensitive. + /// + /// + /// The namespace of the resource provider. + /// + /// + /// The parent resource identity. + /// + /// + /// The resource type of the resource to create. + /// + /// + /// The name of the resource to create. + /// + /// + /// The API version to use for the operation. + /// + public static GenericResource BeginCreateOrUpdate(this IResourcesOperations operations, string resourceGroupName, string resourceProviderNamespace, string parentResourcePath, string resourceType, string resourceName, string apiVersion, GenericResource parameters) + { + return ((IResourcesOperations)operations).BeginCreateOrUpdateAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion, parameters).GetAwaiter().GetResult(); + } + + /// + /// Creates a resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group for the resource. The name is case + /// insensitive. + /// + /// + /// The namespace of the resource provider. + /// + /// + /// The parent resource identity. + /// + /// + /// The resource type of the resource to create. + /// + /// + /// The name of the resource to create. + /// + /// + /// The API version to use for the operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IResourcesOperations operations, string resourceGroupName, string resourceProviderNamespace, string parentResourcePath, string resourceType, string resourceName, string apiVersion, GenericResource parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Updates a resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group for the resource. The name is case + /// insensitive. + /// + /// + /// The namespace of the resource provider. + /// + /// + /// The parent resource identity. + /// + /// + /// The resource type of the resource to update. + /// + /// + /// The name of the resource to update. + /// + /// + /// The API version to use for the operation. + /// + public static GenericResource BeginUpdate(this IResourcesOperations operations, string resourceGroupName, string resourceProviderNamespace, string parentResourcePath, string resourceType, string resourceName, string apiVersion, GenericResource parameters) + { + return ((IResourcesOperations)operations).BeginUpdateAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion, parameters).GetAwaiter().GetResult(); + } + + /// + /// Updates a resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group for the resource. The name is case + /// insensitive. + /// + /// + /// The namespace of the resource provider. + /// + /// + /// The parent resource identity. + /// + /// + /// The resource type of the resource to update. + /// + /// + /// The name of the resource to update. + /// + /// + /// The API version to use for the operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginUpdateAsync(this IResourcesOperations operations, string resourceGroupName, string resourceProviderNamespace, string parentResourcePath, string resourceType, string resourceName, string apiVersion, GenericResource parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Deletes a resource by ID. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The fully qualified ID of the resource, including the resource name and + /// resource type. Use the format, + /// /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} + /// + /// + /// The API version to use for the operation. + /// + public static void BeginDeleteById(this IResourcesOperations operations, string resourceId, string apiVersion) + { + ((IResourcesOperations)operations).BeginDeleteByIdAsync(resourceId, apiVersion).GetAwaiter().GetResult(); + } + + /// + /// Deletes a resource by ID. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The fully qualified ID of the resource, including the resource name and + /// resource type. Use the format, + /// /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} + /// + /// + /// The API version to use for the operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteByIdAsync(this IResourcesOperations operations, string resourceId, string apiVersion, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteByIdWithHttpMessagesAsync(resourceId, apiVersion, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Create a resource by ID. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The fully qualified ID of the resource, including the resource name and + /// resource type. Use the format, + /// /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} + /// + /// + /// The API version to use for the operation. + /// + public static GenericResource BeginCreateOrUpdateById(this IResourcesOperations operations, string resourceId, string apiVersion, GenericResource parameters) + { + return ((IResourcesOperations)operations).BeginCreateOrUpdateByIdAsync(resourceId, apiVersion, parameters).GetAwaiter().GetResult(); + } + + /// + /// Create a resource by ID. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The fully qualified ID of the resource, including the resource name and + /// resource type. Use the format, + /// /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} + /// + /// + /// The API version to use for the operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateByIdAsync(this IResourcesOperations operations, string resourceId, string apiVersion, GenericResource parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateByIdWithHttpMessagesAsync(resourceId, apiVersion, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Updates a resource by ID. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The fully qualified ID of the resource, including the resource name and + /// resource type. Use the format, + /// /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} + /// + /// + /// The API version to use for the operation. + /// + public static GenericResource BeginUpdateById(this IResourcesOperations operations, string resourceId, string apiVersion, GenericResource parameters) + { + return ((IResourcesOperations)operations).BeginUpdateByIdAsync(resourceId, apiVersion, parameters).GetAwaiter().GetResult(); + } + + /// + /// Updates a resource by ID. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The fully qualified ID of the resource, including the resource name and + /// resource type. Use the format, + /// /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} + /// + /// + /// The API version to use for the operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginUpdateByIdAsync(this IResourcesOperations operations, string resourceId, string apiVersion, GenericResource parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginUpdateByIdWithHttpMessagesAsync(resourceId, apiVersion, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Get all the resources for a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListByResourceGroupNext(this IResourcesOperations operations, string nextPageLink) + { + return ((IResourcesOperations)operations).ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Get all the resources for a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByResourceGroupNextAsync(this IResourcesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Get all the resources in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IResourcesOperations operations, string nextPageLink) + { + return ((IResourcesOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Get all the resources in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IResourcesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + } +} diff --git a/src/Resources/Resources.Sdk/Generated/SubscriptionClient.cs b/src/Resources/Resources.Management.Sdk/Generated/SubscriptionClient.cs similarity index 62% rename from src/Resources/Resources.Sdk/Generated/SubscriptionClient.cs rename to src/Resources/Resources.Management.Sdk/Generated/SubscriptionClient.cs index bcb86eb12958..633674a903b4 100644 --- a/src/Resources/Resources.Sdk/Generated/SubscriptionClient.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/SubscriptionClient.cs @@ -1,89 +1,71 @@ -// // 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 Microsoft.Rest.Serialization; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// All resource groups and resources exist within subscriptions. These - /// operation enable you get information about your subscriptions and - /// tenants. A tenant is a dedicated instance of Azure Active Directory - /// (Azure AD) for your organization. + /// operation enable you get information about your subscriptions and tenants. + /// A tenant is a dedicated instance of Azure Active Directory (Azure AD) for + /// your organization. /// - public partial class SubscriptionClient : ServiceClient, ISubscriptionClient, IAzureClient + public partial class SubscriptionClient : Microsoft.Rest.ServiceClient, ISubscriptionClient, IAzureClient { /// /// The base URI of the service. /// public System.Uri BaseUri { get; set; } - /// /// Gets or sets json serialization settings. /// - public JsonSerializerSettings SerializationSettings { get; private set; } - + public Newtonsoft.Json.JsonSerializerSettings SerializationSettings { get; private set; } /// /// Gets or sets json deserialization settings. /// - public JsonSerializerSettings DeserializationSettings { get; private set; } - + public Newtonsoft.Json.JsonSerializerSettings DeserializationSettings { get; private set; } /// /// Credentials needed for the client to connect to Azure. /// - public ServiceClientCredentials Credentials { get; private set; } + public Microsoft.Rest.ServiceClientCredentials Credentials { get; private set; } /// - /// The API version to use for the operation. + /// The API version to use for this operation. /// public string ApiVersion { get; private set; } /// /// The preferred language for the response. /// - public string AcceptLanguage { get; set; } + public string AcceptLanguage { get; set;} /// - /// The retry timeout in seconds for Long Running Operations. Default value is - /// 30. + /// The retry timeout in seconds for Long Running Operations. Default + /// /// value is 30. /// - public int? LongRunningOperationRetryTimeout { get; set; } + public int? LongRunningOperationRetryTimeout { get; set;} /// - /// Whether a unique x-ms-client-request-id should be generated. When set to - /// true a unique x-ms-client-request-id value is generated and included in - /// each request. Default is true. + /// Whether a unique x-ms-client-request-id should be generated. When + /// /// set to true a unique x-ms-client-request-id value is generated and + /// /// included in each request. Default is true. /// - public bool? GenerateClientRequestId { get; set; } + public bool? GenerateClientRequestId { get; set;} /// - /// Gets the ISubscriptionsOperations. + /// Gets the ISubscriptionsOperations /// public virtual ISubscriptionsOperations Subscriptions { get; private set; } - /// - /// Gets the ITenantsOperations. + /// Gets the ITenantsOperations /// public virtual ITenantsOperations Tenants { get; private set; } - /// /// Initializes a new instance of the SubscriptionClient class. /// @@ -92,24 +74,22 @@ public partial class SubscriptionClient : ServiceClient, ISu /// /// /// True: will dispose the provided httpClient on calling SubscriptionClient.Dispose(). False: will not dispose provided httpClient - protected SubscriptionClient(HttpClient httpClient, bool disposeHttpClient) : base(httpClient, disposeHttpClient) + protected SubscriptionClient(System.Net.Http.HttpClient httpClient, bool disposeHttpClient) : base(httpClient, disposeHttpClient) { - Initialize(); + this.Initialize(); } - /// /// Initializes a new instance of the SubscriptionClient class. /// /// /// Optional. The delegating handlers to add to the http client pipeline. /// - protected SubscriptionClient(params DelegatingHandler[] handlers) : base(handlers) + protected SubscriptionClient(params System.Net.Http.DelegatingHandler[] handlers) : base(handlers) { - Initialize(); + this.Initialize(); } - /// - /// Initializes a new instance of the SubscriptionClient class. + /// Initializes a new instance of the SubscriptionClient class. /// /// /// Optional. The http client handler used to handle http transport. @@ -117,11 +97,10 @@ protected SubscriptionClient(params DelegatingHandler[] handlers) : base(handler /// /// Optional. The delegating handlers to add to the http client pipeline. /// - protected SubscriptionClient(HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : base(rootHandler, handlers) + protected SubscriptionClient(System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : base(rootHandler, handlers) { - Initialize(); + this.Initialize(); } - /// /// Initializes a new instance of the SubscriptionClient class. /// @@ -134,15 +113,14 @@ protected SubscriptionClient(HttpClientHandler rootHandler, params DelegatingHan /// /// Thrown when a required parameter is null /// - protected SubscriptionClient(System.Uri baseUri, params DelegatingHandler[] handlers) : this(handlers) + protected SubscriptionClient(System.Uri baseUri, params System.Net.Http.DelegatingHandler[] handlers) : this(handlers) { if (baseUri == null) { throw new System.ArgumentNullException("baseUri"); } - BaseUri = baseUri; + this.BaseUri = baseUri; } - /// /// Initializes a new instance of the SubscriptionClient class. /// @@ -158,15 +136,15 @@ protected SubscriptionClient(System.Uri baseUri, params DelegatingHandler[] hand /// /// Thrown when a required parameter is null /// - protected SubscriptionClient(System.Uri baseUri, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + protected SubscriptionClient(System.Uri baseUri, System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : this(rootHandler, handlers) { if (baseUri == null) { throw new System.ArgumentNullException("baseUri"); } - BaseUri = baseUri; + + this.BaseUri = baseUri; } - /// /// Initializes a new instance of the SubscriptionClient class. /// @@ -179,23 +157,23 @@ protected SubscriptionClient(System.Uri baseUri, HttpClientHandler rootHandler, /// /// Thrown when a required parameter is null /// - public SubscriptionClient(ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers) + public SubscriptionClient(Microsoft.Rest.ServiceClientCredentials credentials, params System.Net.Http.DelegatingHandler[] handlers) : this(handlers) { if (credentials == null) { throw new System.ArgumentNullException("credentials"); } - Credentials = credentials; - if (Credentials != null) + this.Credentials = credentials; + if (this.Credentials != null) { - Credentials.InitializeServiceClient(this); + this.Credentials.InitializeServiceClient(this); } + } - /// /// Initializes a new instance of the SubscriptionClient class. /// - /// + /// /// Required. Credentials needed for the client to connect to Azure. /// /// @@ -206,23 +184,23 @@ public SubscriptionClient(ServiceClientCredentials credentials, params Delegatin /// /// Thrown when a required parameter is null /// - public SubscriptionClient(ServiceClientCredentials credentials, HttpClient httpClient, bool disposeHttpClient) : this(httpClient, disposeHttpClient) + public SubscriptionClient(Microsoft.Rest.ServiceClientCredentials credentials, System.Net.Http.HttpClient httpClient, bool disposeHttpClient) : this(httpClient, disposeHttpClient) { if (credentials == null) { throw new System.ArgumentNullException("credentials"); } - Credentials = credentials; - if (Credentials != null) + this.Credentials = credentials; + if (this.Credentials != null) { - Credentials.InitializeServiceClient(this); + this.Credentials.InitializeServiceClient(this); } + } - /// /// Initializes a new instance of the SubscriptionClient class. /// - /// + /// /// Required. Credentials needed for the client to connect to Azure. /// /// @@ -234,26 +212,26 @@ public SubscriptionClient(ServiceClientCredentials credentials, HttpClient httpC /// /// Thrown when a required parameter is null /// - public SubscriptionClient(ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + public SubscriptionClient(Microsoft.Rest.ServiceClientCredentials credentials, System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : this(rootHandler, handlers) { if (credentials == null) { throw new System.ArgumentNullException("credentials"); } - Credentials = credentials; - if (Credentials != null) + this.Credentials = credentials; + if (this.Credentials != null) { - Credentials.InitializeServiceClient(this); + this.Credentials.InitializeServiceClient(this); } + } - /// /// Initializes a new instance of the SubscriptionClient class. /// /// /// Optional. The base URI of the service. /// - /// + /// /// Required. Credentials needed for the client to connect to Azure. /// /// @@ -262,7 +240,7 @@ public SubscriptionClient(ServiceClientCredentials credentials, HttpClientHandle /// /// Thrown when a required parameter is null /// - public SubscriptionClient(System.Uri baseUri, ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers) + public SubscriptionClient(System.Uri baseUri, Microsoft.Rest.ServiceClientCredentials credentials, params System.Net.Http.DelegatingHandler[] handlers) : this(handlers) { if (baseUri == null) { @@ -272,33 +250,30 @@ public SubscriptionClient(System.Uri baseUri, ServiceClientCredentials credentia { throw new System.ArgumentNullException("credentials"); } - BaseUri = baseUri; - Credentials = credentials; - if (Credentials != null) + this.BaseUri = baseUri; + this.Credentials = credentials; + if (this.Credentials != null) { - Credentials.InitializeServiceClient(this); + this.Credentials.InitializeServiceClient(this); } + } - /// /// Initializes a new instance of the SubscriptionClient class. /// /// /// Optional. The base URI of the service. /// - /// + /// /// Required. Credentials needed for the client to connect to Azure. /// /// /// Optional. The http client handler used to handle http transport. /// - /// - /// Optional. The delegating handlers to add to the http client pipeline. - /// /// /// Thrown when a required parameter is null /// - public SubscriptionClient(System.Uri baseUri, ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + public SubscriptionClient(System.Uri baseUri, Microsoft.Rest.ServiceClientCredentials credentials, System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : this(rootHandler, handlers) { if (baseUri == null) { @@ -308,65 +283,63 @@ public SubscriptionClient(System.Uri baseUri, ServiceClientCredentials credentia { throw new System.ArgumentNullException("credentials"); } - BaseUri = baseUri; - Credentials = credentials; - if (Credentials != null) + this.BaseUri = baseUri; + this.Credentials = credentials; + if (this.Credentials != null) { - Credentials.InitializeServiceClient(this); + this.Credentials.InitializeServiceClient(this); } + } - /// /// An optional partial-method to perform custom initialization. /// partial void CustomInitialize(); + /// /// Initializes client properties. /// private void Initialize() { - Subscriptions = new SubscriptionsOperations(this); - Tenants = new TenantsOperations(this); - BaseUri = new System.Uri("https://management.azure.com"); - ApiVersion = "2021-01-01"; - AcceptLanguage = "en-US"; - LongRunningOperationRetryTimeout = 30; - GenerateClientRequestId = true; - SerializationSettings = new JsonSerializerSettings + this.Subscriptions = new SubscriptionsOperations(this); + this.Tenants = new TenantsOperations(this); + this.BaseUri = new System.Uri("https://management.azure.com"); + this.ApiVersion = "2021-01-01"; + this.AcceptLanguage = "en-US"; + this.LongRunningOperationRetryTimeout = 30; + this.GenerateClientRequestId = true; + SerializationSettings = new Newtonsoft.Json.JsonSerializerSettings { Formatting = Newtonsoft.Json.Formatting.Indented, DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, - ContractResolver = new ReadOnlyJsonContractResolver(), - Converters = new List + ContractResolver = new Microsoft.Rest.Serialization.ReadOnlyJsonContractResolver(), + Converters = new System.Collections.Generic.List { - new Iso8601TimeSpanConverter() + new Microsoft.Rest.Serialization.Iso8601TimeSpanConverter() } }; - DeserializationSettings = new JsonSerializerSettings + DeserializationSettings = new Newtonsoft.Json.JsonSerializerSettings { DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, - ContractResolver = new ReadOnlyJsonContractResolver(), - Converters = new List + ContractResolver = new Microsoft.Rest.Serialization.ReadOnlyJsonContractResolver(), + Converters = new System.Collections.Generic.List { - new Iso8601TimeSpanConverter() + new Microsoft.Rest.Serialization.Iso8601TimeSpanConverter() } }; CustomInitialize(); - DeserializationSettings.Converters.Add(new CloudErrorJsonConverter()); + DeserializationSettings.Converters.Add(new Microsoft.Rest.Azure.CloudErrorJsonConverter()); } /// - /// Checks resource name validity - /// - /// /// A resource name is valid if it is not a reserved word, does not contains a /// reserved word and does not start with a reserved word - /// + /// /// /// Resource object with values for resource name and resource type /// @@ -376,13 +349,13 @@ private void Initialize() /// /// 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 /// /// @@ -391,59 +364,67 @@ private void Initialize() /// /// A response object containing the response body and response headers. /// - public async Task> CheckResourceNameWithHttpMessagesAsync(ResourceName resourceNameDefinition = default(ResourceName), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CheckResourceNameWithHttpMessagesAsync(ResourceName resourceNameDefinition = default(ResourceName), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceNameDefinition != null) { resourceNameDefinition.Validate(); } - if (ApiVersion == null) + if (this.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.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("resourceNameDefinition", resourceNameDefinition); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CheckResourceName", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "CheckResourceName", tracingParameters); } // Construct URL - var _baseUrl = BaseUri.AbsoluteUri; + + var _baseUrl = this.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Resources/checkResourceName").ToString(); - List _queryParameters = new List(); - if (ApiVersion != null) + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (GenerateClientRequestId != null && GenerateClientRequestId.Value) + if (this.GenerateClientRequestId != null && this.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (AcceptLanguage != null) + if (this.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -455,61 +436,62 @@ private void Initialize() _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(resourceNameDefinition != null) { - _requestContent = SafeJsonConvert.SerializeObject(resourceNameDefinition, SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(resourceNameDefinition, this.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Credentials != null) + if (this.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.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 = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.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) @@ -519,9 +501,10 @@ private void Initialize() 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(); @@ -532,24 +515,28 @@ private void Initialize() _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.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; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Management.Sdk/Generated/SubscriptionClientExtensions.cs b/src/Resources/Resources.Management.Sdk/Generated/SubscriptionClientExtensions.cs new file mode 100644 index 000000000000..158ef717cebc --- /dev/null +++ b/src/Resources/Resources.Management.Sdk/Generated/SubscriptionClientExtensions.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.Management.Resources +{ + using Microsoft.Rest.Azure; + using Models; + + /// + /// Extension methods for SubscriptionClient + /// + public static partial class SubscriptionClientExtensions + { + /// + /// A resource name is valid if it is not a reserved word, does not contains a + /// reserved word and does not start with a reserved word + /// + /// + /// The operations group for this extension method. + /// + public static CheckResourceNameResult CheckResourceName(this ISubscriptionClient operations, ResourceName resourceNameDefinition = default(ResourceName)) + { + return ((ISubscriptionClient)operations).CheckResourceNameAsync(resourceNameDefinition).GetAwaiter().GetResult(); + } + + /// + /// A resource name is valid if it is not a reserved word, does not contains a + /// reserved word and does not start with a reserved word + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CheckResourceNameAsync(this ISubscriptionClient operations, ResourceName resourceNameDefinition = default(ResourceName), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CheckResourceNameWithHttpMessagesAsync(resourceNameDefinition, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + } +} diff --git a/src/Resources/Resources.Sdk/Generated/SubscriptionFeatureRegistrationsOperations.cs b/src/Resources/Resources.Management.Sdk/Generated/SubscriptionFeatureRegistrationsOperations.cs similarity index 58% rename from src/Resources/Resources.Sdk/Generated/SubscriptionFeatureRegistrationsOperations.cs rename to src/Resources/Resources.Management.Sdk/Generated/SubscriptionFeatureRegistrationsOperations.cs index 9a22a2469049..a20844ae3166 100644 --- a/src/Resources/Resources.Sdk/Generated/SubscriptionFeatureRegistrationsOperations.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/SubscriptionFeatureRegistrationsOperations.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; /// /// SubscriptionFeatureRegistrationsOperations operations. /// - internal partial class SubscriptionFeatureRegistrationsOperations : IServiceOperations, ISubscriptionFeatureRegistrationsOperations + internal partial class SubscriptionFeatureRegistrationsOperations : Microsoft.Rest.IServiceOperations, ISubscriptionFeatureRegistrationsOperations { /// /// Initializes a new instance of the SubscriptionFeatureRegistrationsOperations class. @@ -36,13 +24,13 @@ internal partial class SubscriptionFeatureRegistrationsOperations : IServiceOper /// /// Thrown when a required parameter is null /// - internal SubscriptionFeatureRegistrationsOperations(FeatureClient client) + internal SubscriptionFeatureRegistrationsOperations (FeatureClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -65,13 +53,13 @@ internal SubscriptionFeatureRegistrationsOperations(FeatureClient 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 /// /// @@ -80,71 +68,82 @@ internal SubscriptionFeatureRegistrationsOperations(FeatureClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string providerNamespace, string featureName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string providerNamespace, string featureName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - 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"); } + if (providerNamespace == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "providerNamespace"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "providerNamespace"); } + if (featureName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "featureName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "featureName"); } + // 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("providerNamespace", providerNamespace); tracingParameters.Add("featureName", featureName); + + 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}/providers/Microsoft.Features/featureProviders/{providerNamespace}/subscriptionFeatureRegistrations/{featureName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{providerNamespace}", System.Uri.EscapeDataString(providerNamespace)); _url = _url.Replace("{featureName}", System.Uri.EscapeDataString(featureName)); - 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) @@ -156,50 +155,51 @@ internal SubscriptionFeatureRegistrationsOperations(FeatureClient 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 ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -209,9 +209,10 @@ internal SubscriptionFeatureRegistrationsOperations(FeatureClient 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(); @@ -222,25 +223,29 @@ internal SubscriptionFeatureRegistrationsOperations(FeatureClient 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; - } + + + + + } /// /// Create or update a feature registration. /// @@ -259,13 +264,13 @@ internal SubscriptionFeatureRegistrationsOperations(FeatureClient 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 /// /// @@ -274,76 +279,87 @@ internal SubscriptionFeatureRegistrationsOperations(FeatureClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string providerNamespace, string featureName, SubscriptionFeatureRegistration subscriptionFeatureRegistrationType = default(SubscriptionFeatureRegistration), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string providerNamespace, string featureName, SubscriptionFeatureRegistration subscriptionFeatureRegistrationType = default(SubscriptionFeatureRegistration), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.ApiVersion == null) + + + + + if (subscriptionFeatureRegistrationType != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + subscriptionFeatureRegistrationType.Validate(); } - if (Client.SubscriptionId == null) + if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (providerNamespace == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "providerNamespace"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (featureName == null) + + if (providerNamespace == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "featureName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "providerNamespace"); } - if (subscriptionFeatureRegistrationType != null) + + if (featureName == null) { - subscriptionFeatureRegistrationType.Validate(); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "featureName"); } + // 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("providerNamespace", providerNamespace); tracingParameters.Add("featureName", featureName); + tracingParameters.Add("subscriptionFeatureRegistrationType", subscriptionFeatureRegistrationType); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", 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.Features/featureProviders/{providerNamespace}/subscriptionFeatureRegistrations/{featureName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{providerNamespace}", System.Uri.EscapeDataString(providerNamespace)); _url = _url.Replace("{featureName}", System.Uri.EscapeDataString(featureName)); - 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("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _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) @@ -355,56 +371,57 @@ internal SubscriptionFeatureRegistrationsOperations(FeatureClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(subscriptionFeatureRegistrationType != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(subscriptionFeatureRegistrationType, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(subscriptionFeatureRegistrationType, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + 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 ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -414,9 +431,10 @@ internal SubscriptionFeatureRegistrationsOperations(FeatureClient 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(); @@ -427,25 +445,29 @@ internal SubscriptionFeatureRegistrationsOperations(FeatureClient 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; - } + + + + + } /// /// Deletes a feature registration /// @@ -461,10 +483,10 @@ internal SubscriptionFeatureRegistrationsOperations(FeatureClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -473,71 +495,82 @@ internal SubscriptionFeatureRegistrationsOperations(FeatureClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteWithHttpMessagesAsync(string providerNamespace, string featureName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string providerNamespace, string featureName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - 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"); } + if (providerNamespace == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "providerNamespace"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "providerNamespace"); } + if (featureName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "featureName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "featureName"); } + // 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("providerNamespace", providerNamespace); tracingParameters.Add("featureName", featureName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Delete", 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.Features/featureProviders/{providerNamespace}/subscriptionFeatureRegistrations/{featureName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{providerNamespace}", System.Uri.EscapeDataString(providerNamespace)); _url = _url.Replace("{featureName}", System.Uri.EscapeDataString(featureName)); - 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("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _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) @@ -549,50 +582,51 @@ internal SubscriptionFeatureRegistrationsOperations(FeatureClient 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 && (int)_statusCode != 204) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -602,20 +636,25 @@ internal SubscriptionFeatureRegistrationsOperations(FeatureClient 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(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Returns subscription feature registrations for given subscription and /// provider namespace. @@ -629,13 +668,13 @@ internal SubscriptionFeatureRegistrationsOperations(FeatureClient 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 /// /// @@ -644,65 +683,75 @@ internal SubscriptionFeatureRegistrationsOperations(FeatureClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListBySubscriptionWithHttpMessagesAsync(string providerNamespace, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListBySubscriptionWithHttpMessagesAsync(string providerNamespace, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - 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"); } + if (providerNamespace == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "providerNamespace"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "providerNamespace"); } + // 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("providerNamespace", providerNamespace); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListBySubscription", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListBySubscription", 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.Features/featureProviders/{providerNamespace}/subscriptionFeatureRegistrations").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{providerNamespace}", System.Uri.EscapeDataString(providerNamespace)); - 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) @@ -714,50 +763,51 @@ internal SubscriptionFeatureRegistrationsOperations(FeatureClient 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 ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -767,9 +817,10 @@ internal SubscriptionFeatureRegistrationsOperations(FeatureClient 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(); @@ -780,25 +831,29 @@ internal SubscriptionFeatureRegistrationsOperations(FeatureClient 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; - } + + + + + } /// /// Returns subscription feature registrations for given subscription. /// @@ -808,13 +863,13 @@ internal SubscriptionFeatureRegistrationsOperations(FeatureClient 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 /// /// @@ -823,59 +878,68 @@ internal SubscriptionFeatureRegistrationsOperations(FeatureClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListAllBySubscriptionWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListAllBySubscriptionWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - 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("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAllBySubscription", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAllBySubscription", 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.Features/subscriptionFeatureRegistrations").ToString(); - _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) @@ -887,50 +951,51 @@ internal SubscriptionFeatureRegistrationsOperations(FeatureClient 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 ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -940,9 +1005,10 @@ internal SubscriptionFeatureRegistrationsOperations(FeatureClient 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(); @@ -953,25 +1019,29 @@ internal SubscriptionFeatureRegistrationsOperations(FeatureClient 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; - } + + + + + } /// /// Returns subscription feature registrations for given subscription and /// provider namespace. @@ -985,13 +1055,13 @@ internal SubscriptionFeatureRegistrationsOperations(FeatureClient 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 /// /// @@ -1000,51 +1070,54 @@ internal SubscriptionFeatureRegistrationsOperations(FeatureClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListBySubscriptionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListBySubscriptionNextWithHttpMessagesAsync(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, "ListBySubscriptionNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListBySubscriptionNext", 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) @@ -1056,50 +1129,51 @@ internal SubscriptionFeatureRegistrationsOperations(FeatureClient 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 ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1109,9 +1183,10 @@ internal SubscriptionFeatureRegistrationsOperations(FeatureClient 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(); @@ -1122,25 +1197,29 @@ internal SubscriptionFeatureRegistrationsOperations(FeatureClient 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; - } + + + + + } /// /// Returns subscription feature registrations for given subscription. /// @@ -1153,13 +1232,13 @@ internal SubscriptionFeatureRegistrationsOperations(FeatureClient 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 /// /// @@ -1168,51 +1247,54 @@ internal SubscriptionFeatureRegistrationsOperations(FeatureClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListAllBySubscriptionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListAllBySubscriptionNextWithHttpMessagesAsync(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, "ListAllBySubscriptionNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAllBySubscriptionNext", 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) @@ -1224,50 +1306,51 @@ internal SubscriptionFeatureRegistrationsOperations(FeatureClient 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 ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1277,9 +1360,10 @@ internal SubscriptionFeatureRegistrationsOperations(FeatureClient 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(); @@ -1290,24 +1374,28 @@ internal SubscriptionFeatureRegistrationsOperations(FeatureClient 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; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Management.Sdk/Generated/SubscriptionFeatureRegistrationsOperationsExtensions.cs b/src/Resources/Resources.Management.Sdk/Generated/SubscriptionFeatureRegistrationsOperationsExtensions.cs new file mode 100644 index 000000000000..9ef82e924aa6 --- /dev/null +++ b/src/Resources/Resources.Management.Sdk/Generated/SubscriptionFeatureRegistrationsOperationsExtensions.cs @@ -0,0 +1,260 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.Management.Resources +{ + using Microsoft.Rest.Azure; + using Models; + + /// + /// Extension methods for SubscriptionFeatureRegistrationsOperations + /// + public static partial class SubscriptionFeatureRegistrationsOperationsExtensions + { + /// + /// Returns a feature registration + /// + /// + /// The operations group for this extension method. + /// + /// + /// The provider namespace. + /// + /// + /// The feature name. + /// + public static SubscriptionFeatureRegistration Get(this ISubscriptionFeatureRegistrationsOperations operations, string providerNamespace, string featureName) + { + return ((ISubscriptionFeatureRegistrationsOperations)operations).GetAsync(providerNamespace, featureName).GetAwaiter().GetResult(); + } + + /// + /// Returns a feature registration + /// + /// + /// The operations group for this extension method. + /// + /// + /// The provider namespace. + /// + /// + /// The feature name. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this ISubscriptionFeatureRegistrationsOperations operations, string providerNamespace, string featureName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(providerNamespace, featureName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Create or update a feature registration. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The provider namespace. + /// + /// + /// The feature name. + /// + public static SubscriptionFeatureRegistration CreateOrUpdate(this ISubscriptionFeatureRegistrationsOperations operations, string providerNamespace, string featureName, SubscriptionFeatureRegistration subscriptionFeatureRegistrationType = default(SubscriptionFeatureRegistration)) + { + return ((ISubscriptionFeatureRegistrationsOperations)operations).CreateOrUpdateAsync(providerNamespace, featureName, subscriptionFeatureRegistrationType).GetAwaiter().GetResult(); + } + + /// + /// Create or update a feature registration. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The provider namespace. + /// + /// + /// The feature name. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this ISubscriptionFeatureRegistrationsOperations operations, string providerNamespace, string featureName, SubscriptionFeatureRegistration subscriptionFeatureRegistrationType = default(SubscriptionFeatureRegistration), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(providerNamespace, featureName, subscriptionFeatureRegistrationType, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Deletes a feature registration + /// + /// + /// The operations group for this extension method. + /// + /// + /// The provider namespace. + /// + /// + /// The feature name. + /// + public static void Delete(this ISubscriptionFeatureRegistrationsOperations operations, string providerNamespace, string featureName) + { + ((ISubscriptionFeatureRegistrationsOperations)operations).DeleteAsync(providerNamespace, featureName).GetAwaiter().GetResult(); + } + + /// + /// Deletes a feature registration + /// + /// + /// The operations group for this extension method. + /// + /// + /// The provider namespace. + /// + /// + /// The feature name. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this ISubscriptionFeatureRegistrationsOperations operations, string providerNamespace, string featureName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(providerNamespace, featureName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Returns subscription feature registrations for given subscription and + /// provider namespace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The provider namespace. + /// + public static Microsoft.Rest.Azure.IPage ListBySubscription(this ISubscriptionFeatureRegistrationsOperations operations, string providerNamespace) + { + return ((ISubscriptionFeatureRegistrationsOperations)operations).ListBySubscriptionAsync(providerNamespace).GetAwaiter().GetResult(); + } + + /// + /// Returns subscription feature registrations for given subscription and + /// provider namespace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The provider namespace. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListBySubscriptionAsync(this ISubscriptionFeatureRegistrationsOperations operations, string providerNamespace, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListBySubscriptionWithHttpMessagesAsync(providerNamespace, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Returns subscription feature registrations for given subscription. + /// + /// + /// The operations group for this extension method. + /// + public static Microsoft.Rest.Azure.IPage ListAllBySubscription(this ISubscriptionFeatureRegistrationsOperations operations) + { + return ((ISubscriptionFeatureRegistrationsOperations)operations).ListAllBySubscriptionAsync().GetAwaiter().GetResult(); + } + + /// + /// Returns subscription feature registrations for given subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAllBySubscriptionAsync(this ISubscriptionFeatureRegistrationsOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListAllBySubscriptionWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Returns subscription feature registrations for given subscription and + /// provider namespace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListBySubscriptionNext(this ISubscriptionFeatureRegistrationsOperations operations, string nextPageLink) + { + return ((ISubscriptionFeatureRegistrationsOperations)operations).ListBySubscriptionNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Returns subscription feature registrations for given subscription and + /// provider namespace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListBySubscriptionNextAsync(this ISubscriptionFeatureRegistrationsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListBySubscriptionNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Returns subscription feature registrations for given subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListAllBySubscriptionNext(this ISubscriptionFeatureRegistrationsOperations operations, string nextPageLink) + { + return ((ISubscriptionFeatureRegistrationsOperations)operations).ListAllBySubscriptionNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Returns subscription feature registrations for given subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAllBySubscriptionNextAsync(this ISubscriptionFeatureRegistrationsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListAllBySubscriptionNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + } +} diff --git a/src/Resources/Resources.Sdk/Generated/SubscriptionsOperations.cs b/src/Resources/Resources.Management.Sdk/Generated/SubscriptionsOperations.cs similarity index 57% rename from src/Resources/Resources.Sdk/Generated/SubscriptionsOperations.cs rename to src/Resources/Resources.Management.Sdk/Generated/SubscriptionsOperations.cs index b556162902bd..d08a5db8dd77 100644 --- a/src/Resources/Resources.Sdk/Generated/SubscriptionsOperations.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/SubscriptionsOperations.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; /// /// SubscriptionsOperations operations. /// - internal partial class SubscriptionsOperations : IServiceOperations, ISubscriptionsOperations + internal partial class SubscriptionsOperations : Microsoft.Rest.IServiceOperations, ISubscriptionsOperations { /// /// Initializes a new instance of the SubscriptionsOperations class. @@ -36,13 +24,13 @@ internal partial class SubscriptionsOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal SubscriptionsOperations(SubscriptionClient client) + internal SubscriptionsOperations (SubscriptionClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -51,13 +39,10 @@ internal SubscriptionsOperations(SubscriptionClient client) public SubscriptionClient Client { get; private set; } /// - /// Gets all available geo-locations. - /// - /// /// This operation provides all the locations that are available for resource /// providers; however, each resource provider may support a subset of this /// list. - /// + /// /// /// The ID of the target subscription. /// @@ -70,13 +55,13 @@ internal SubscriptionsOperations(SubscriptionClient 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 /// /// @@ -85,65 +70,75 @@ internal SubscriptionsOperations(SubscriptionClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListLocationsWithHttpMessagesAsync(string subscriptionId, bool? includeExtendedLocations = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListLocationsWithHttpMessagesAsync(string subscriptionId, bool? includeExtendedLocations = default(bool?), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (subscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "subscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "subscriptionId"); } - 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("subscriptionId", subscriptionId); tracingParameters.Add("includeExtendedLocations", includeExtendedLocations); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListLocations", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListLocations", 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}/locations").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(subscriptionId)); - 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 (includeExtendedLocations != null) { - _queryParameters.Add(string.Format("includeExtendedLocations={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(includeExtendedLocations, Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("includeExtendedLocations={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(includeExtendedLocations, this.Client.SerializationSettings).Trim('"')))); } 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) @@ -155,55 +150,56 @@ internal SubscriptionsOperations(SubscriptionClient 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) @@ -213,9 +209,10 @@ internal SubscriptionsOperations(SubscriptionClient 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(); @@ -226,25 +223,29 @@ internal SubscriptionsOperations(SubscriptionClient 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 details about a specified subscription. /// @@ -257,13 +258,13 @@ internal SubscriptionsOperations(SubscriptionClient 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 /// /// @@ -272,60 +273,69 @@ internal SubscriptionsOperations(SubscriptionClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string subscriptionId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string subscriptionId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (subscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "subscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "subscriptionId"); } - 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("subscriptionId", subscriptionId); + + 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}").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(subscriptionId)); - 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) @@ -337,55 +347,56 @@ internal SubscriptionsOperations(SubscriptionClient 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) @@ -395,9 +406,10 @@ internal SubscriptionsOperations(SubscriptionClient 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(); @@ -408,25 +420,29 @@ internal SubscriptionsOperations(SubscriptionClient 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 subscriptions for a tenant. /// @@ -436,13 +452,13 @@ internal SubscriptionsOperations(SubscriptionClient 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 /// /// @@ -451,54 +467,62 @@ internal SubscriptionsOperations(SubscriptionClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - 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("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").ToString(); - 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) @@ -510,55 +534,56 @@ internal SubscriptionsOperations(SubscriptionClient 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) @@ -568,9 +593,10 @@ internal SubscriptionsOperations(SubscriptionClient 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(); @@ -581,25 +607,29 @@ internal SubscriptionsOperations(SubscriptionClient 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; - } + + + + + } /// /// Compares a subscriptions logical zone mapping /// @@ -615,13 +645,13 @@ internal SubscriptionsOperations(SubscriptionClient 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 /// /// @@ -630,65 +660,75 @@ internal SubscriptionsOperations(SubscriptionClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CheckZonePeersWithHttpMessagesAsync(string subscriptionId, CheckZonePeersRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CheckZonePeersWithHttpMessagesAsync(string subscriptionId, CheckZonePeersRequest parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (subscriptionId == null) + + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "subscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } - if (Client.ApiVersion == null) + + if (subscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "subscriptionId"); } - if (parameters == null) + + if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + 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("subscriptionId", subscriptionId); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CheckZonePeers", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "CheckZonePeers", 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/checkZonePeers/").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(subscriptionId)); - 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("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _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) @@ -700,56 +740,57 @@ internal SubscriptionsOperations(SubscriptionClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + 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 ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseAutoGeneratedException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponseAutoGenerated _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -759,9 +800,10 @@ internal SubscriptionsOperations(SubscriptionClient 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(); @@ -772,25 +814,29 @@ internal SubscriptionsOperations(SubscriptionClient 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 subscriptions for a tenant. /// @@ -803,13 +849,13 @@ internal SubscriptionsOperations(SubscriptionClient 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 /// /// @@ -818,51 +864,54 @@ internal SubscriptionsOperations(SubscriptionClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(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, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", 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) @@ -874,55 +923,56 @@ internal SubscriptionsOperations(SubscriptionClient 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) @@ -932,9 +982,10 @@ internal SubscriptionsOperations(SubscriptionClient 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(); @@ -945,24 +996,28 @@ internal SubscriptionsOperations(SubscriptionClient 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; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Management.Sdk/Generated/SubscriptionsOperationsExtensions.cs b/src/Resources/Resources.Management.Sdk/Generated/SubscriptionsOperationsExtensions.cs new file mode 100644 index 000000000000..412e44b7ac32 --- /dev/null +++ b/src/Resources/Resources.Management.Sdk/Generated/SubscriptionsOperationsExtensions.cs @@ -0,0 +1,185 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.Management.Resources +{ + using Microsoft.Rest.Azure; + using Models; + + /// + /// Extension methods for SubscriptionsOperations + /// + public static partial class SubscriptionsOperationsExtensions + { + /// + /// This operation provides all the locations that are available for resource + /// providers; however, each resource provider may support a subset of this + /// list. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The ID of the target subscription. + /// + /// + /// Whether to include extended locations. + /// + public static System.Collections.Generic.IEnumerable ListLocations(this ISubscriptionsOperations operations, string subscriptionId, bool? includeExtendedLocations = default(bool?)) + { + return ((ISubscriptionsOperations)operations).ListLocationsAsync(subscriptionId, includeExtendedLocations).GetAwaiter().GetResult(); + } + + /// + /// This operation provides all the locations that are available for resource + /// providers; however, each resource provider may support a subset of this + /// list. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The ID of the target subscription. + /// + /// + /// Whether to include extended locations. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListLocationsAsync(this ISubscriptionsOperations operations, string subscriptionId, bool? includeExtendedLocations = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListLocationsWithHttpMessagesAsync(subscriptionId, includeExtendedLocations, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets details about a specified subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The ID of the target subscription. + /// + public static Subscription Get(this ISubscriptionsOperations operations, string subscriptionId) + { + return ((ISubscriptionsOperations)operations).GetAsync(subscriptionId).GetAwaiter().GetResult(); + } + + /// + /// Gets details about a specified subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The ID of the target subscription. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this ISubscriptionsOperations operations, string subscriptionId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(subscriptionId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets all subscriptions for a tenant. + /// + /// + /// The operations group for this extension method. + /// + public static Microsoft.Rest.Azure.IPage List(this ISubscriptionsOperations operations) + { + return ((ISubscriptionsOperations)operations).ListAsync().GetAwaiter().GetResult(); + } + + /// + /// Gets all subscriptions for a tenant. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this ISubscriptionsOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Compares a subscriptions logical zone mapping + /// + /// + /// The operations group for this extension method. + /// + /// + /// The ID of the target subscription. + /// + public static CheckZonePeersResult CheckZonePeers(this ISubscriptionsOperations operations, string subscriptionId, CheckZonePeersRequest parameters) + { + return ((ISubscriptionsOperations)operations).CheckZonePeersAsync(subscriptionId, parameters).GetAwaiter().GetResult(); + } + + /// + /// Compares a subscriptions logical zone mapping + /// + /// + /// The operations group for this extension method. + /// + /// + /// The ID of the target subscription. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CheckZonePeersAsync(this ISubscriptionsOperations operations, string subscriptionId, CheckZonePeersRequest parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CheckZonePeersWithHttpMessagesAsync(subscriptionId, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets all subscriptions for a tenant. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this ISubscriptionsOperations operations, string nextPageLink) + { + return ((ISubscriptionsOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets all subscriptions for a tenant. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this ISubscriptionsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + } +} diff --git a/src/Resources/Resources.Sdk/Generated/TagsOperations.cs b/src/Resources/Resources.Management.Sdk/Generated/TagsOperations.cs similarity index 57% rename from src/Resources/Resources.Sdk/Generated/TagsOperations.cs rename to src/Resources/Resources.Management.Sdk/Generated/TagsOperations.cs index 75e9d503c31d..a0717a64bec1 100644 --- a/src/Resources/Resources.Sdk/Generated/TagsOperations.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/TagsOperations.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; /// /// TagsOperations operations. /// - internal partial class TagsOperations : IServiceOperations, ITagsOperations + internal partial class TagsOperations : Microsoft.Rest.IServiceOperations, ITagsOperations { /// /// Initializes a new instance of the TagsOperations class. @@ -36,13 +24,13 @@ internal partial class TagsOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal TagsOperations(ResourceManagementClient client) + internal TagsOperations (ResourceManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -51,13 +39,10 @@ internal TagsOperations(ResourceManagementClient client) public ResourceManagementClient Client { get; private set; } /// - /// Deletes a predefined tag value for a predefined tag name. - /// - /// /// This operation allows deleting a value from the list of predefined values /// for an existing predefined tag name. The value being deleted must not be in /// use as a tag value for the given tag name for any resource. - /// + /// /// /// The name of the tag. /// @@ -70,10 +55,10 @@ internal TagsOperations(ResourceManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -82,71 +67,82 @@ internal TagsOperations(ResourceManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteValueWithHttpMessagesAsync(string tagName, string tagValue, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteValueWithHttpMessagesAsync(string tagName, string tagValue, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (tagName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "tagName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "tagName"); } + if (tagValue == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "tagValue"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "tagValue"); } - 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("tagName", tagName); tracingParameters.Add("tagValue", tagValue); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteValue", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "DeleteValue", 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}/tagNames/{tagName}/tagValues/{tagValue}").ToString(); _url = _url.Replace("{tagName}", System.Uri.EscapeDataString(tagName)); _url = _url.Replace("{tagValue}", System.Uri.EscapeDataString(tagValue)); - _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("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _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) @@ -158,55 +154,56 @@ internal TagsOperations(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 && (int)_statusCode != 204) { - 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) @@ -216,28 +213,30 @@ internal TagsOperations(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(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Creates a predefined value for a predefined tag name. - /// - /// /// This operation allows adding a value to the list of predefined values for /// an existing predefined tag name. A tag value can have a maximum of 256 /// characters. - /// + /// /// /// The name of the tag. /// @@ -250,13 +249,13 @@ internal TagsOperations(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 /// /// @@ -265,71 +264,82 @@ internal TagsOperations(ResourceManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateValueWithHttpMessagesAsync(string tagName, string tagValue, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateValueWithHttpMessagesAsync(string tagName, string tagValue, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (tagName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "tagName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "tagName"); } + if (tagValue == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "tagValue"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "tagValue"); } - 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("tagName", tagName); tracingParameters.Add("tagValue", tagValue); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateValue", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateValue", 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}/tagNames/{tagName}/tagValues/{tagValue}").ToString(); _url = _url.Replace("{tagName}", System.Uri.EscapeDataString(tagName)); _url = _url.Replace("{tagValue}", System.Uri.EscapeDataString(tagValue)); - _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("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _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) @@ -341,55 +351,56 @@ internal TagsOperations(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 && (int)_statusCode != 201) { - 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) @@ -399,9 +410,10 @@ internal TagsOperations(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(); @@ -412,16 +424,16 @@ internal TagsOperations(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); } } // Deserialize Response @@ -430,34 +442,35 @@ internal TagsOperations(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; - } + + + + + } /// - /// Creates a predefined tag name. - /// - /// /// This operation allows adding a name to the list of predefined tag names for /// the given subscription. A tag name can have a maximum of 512 characters and /// is case-insensitive. Tag names cannot have the following prefixes which are - /// reserved for Azure use: 'microsoft', 'azure', 'windows'. - /// + /// reserved for Azure use: 'microsoft', 'azure', 'windows'. + /// /// /// The name of the tag to create. /// @@ -467,13 +480,13 @@ internal TagsOperations(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 /// /// @@ -482,65 +495,75 @@ internal TagsOperations(ResourceManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string tagName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string tagName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (tagName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "tagName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "tagName"); } - 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("tagName", tagName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", 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}/tagNames/{tagName}").ToString(); _url = _url.Replace("{tagName}", System.Uri.EscapeDataString(tagName)); - _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("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _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) @@ -552,55 +575,56 @@ internal TagsOperations(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 && (int)_statusCode != 201) { - 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) @@ -610,9 +634,10 @@ internal TagsOperations(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(); @@ -623,16 +648,16 @@ internal TagsOperations(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); } } // Deserialize Response @@ -641,34 +666,35 @@ internal TagsOperations(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; - } + + + + + } /// - /// Deletes a predefined tag name. - /// - /// /// This operation allows deleting a name from the list of predefined tag names /// for the given subscription. The name being deleted must not be in use as a /// tag name for any resource. All predefined values for the given name must /// have already been deleted. - /// + /// /// /// The name of the tag. /// @@ -678,10 +704,10 @@ internal TagsOperations(ResourceManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -690,65 +716,75 @@ internal TagsOperations(ResourceManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteWithHttpMessagesAsync(string tagName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string tagName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (tagName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "tagName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "tagName"); } - 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("tagName", tagName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Delete", 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}/tagNames/{tagName}").ToString(); _url = _url.Replace("{tagName}", System.Uri.EscapeDataString(tagName)); - _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("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _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) @@ -760,55 +796,56 @@ internal TagsOperations(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 && (int)_statusCode != 204) { - 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) @@ -818,42 +855,44 @@ internal TagsOperations(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(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Gets a summary of tag usage under the subscription. - /// - /// /// This operation performs a union of predefined tags, resource tags, resource /// group tags and subscription tags, and returns a summary of usage for each /// tag name and value under the given subscription. In case of a large number /// of tags, this operation may return a previously cached result. - /// + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -862,59 +901,68 @@ internal TagsOperations(ResourceManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - 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("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}/tagNames").ToString(); - _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) @@ -926,55 +974,56 @@ internal TagsOperations(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) @@ -984,9 +1033,10 @@ internal TagsOperations(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(); @@ -997,37 +1047,39 @@ internal TagsOperations(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; - } + + + + + } /// - /// Creates or updates the entire set of tags on a resource or subscription. - /// - /// /// This operation allows adding or replacing the entire set of tags on the /// specified resource or subscription. The specified entity can have a maximum /// of 50 tags. - /// + /// /// /// The resource scope. /// /// + /// /// /// /// Headers that will be added to request. @@ -1035,13 +1087,13 @@ internal TagsOperations(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 /// /// @@ -1050,69 +1102,78 @@ internal TagsOperations(ResourceManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateAtScopeWithHttpMessagesAsync(string scope, TagsResource parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateAtScopeWithHttpMessagesAsync(string scope, TagsResource parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (scope == null) + + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "scope"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } - if (Client.ApiVersion == null) + if (parameters != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + parameters.Validate(); } - if (parameters == null) + if (scope == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "scope"); } - if (parameters != null) + + if (this.Client.ApiVersion == null) { - parameters.Validate(); + 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("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateAtScope", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateAtScope", 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/tags/default").ToString(); _url = _url.Replace("{scope}", scope); - 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("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _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) @@ -1124,61 +1185,62 @@ internal TagsOperations(ResourceManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + 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) @@ -1188,9 +1250,10 @@ internal TagsOperations(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(); @@ -1201,41 +1264,43 @@ internal TagsOperations(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; - } + + + + + } /// - /// Selectively updates the set of tags on a resource or subscription. - /// - /// /// This operation allows replacing, merging or selectively deleting tags on /// the specified resource or subscription. The specified entity can have a - /// maximum of 50 tags at the end of the operation. The 'replace' option - /// replaces the entire set of existing tags with a new set. The 'merge' option + /// maximum of 50 tags at the end of the operation. The 'replace' option + /// replaces the entire set of existing tags with a new set. The 'merge' option /// allows adding tags with new names and updating the values of tags with - /// existing names. The 'delete' option allows selectively deleting tags based + /// existing names. The 'delete' option allows selectively deleting tags based /// on given names or name/value pairs. - /// + /// /// /// The resource scope. /// /// + /// /// /// /// Headers that will be added to request. @@ -1243,13 +1308,13 @@ internal TagsOperations(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 /// /// @@ -1258,65 +1323,74 @@ internal TagsOperations(ResourceManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateAtScopeWithHttpMessagesAsync(string scope, TagsPatchResource parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> UpdateAtScopeWithHttpMessagesAsync(string scope, TagsPatchResource parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (scope == null) + + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "scope"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } - if (Client.ApiVersion == null) + if (scope == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "scope"); } - if (parameters == null) + + if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + 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("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateAtScope", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "UpdateAtScope", 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/tags/default").ToString(); _url = _url.Replace("{scope}", scope); - 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("PATCH"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); _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) @@ -1328,61 +1402,62 @@ internal TagsOperations(ResourceManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + 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) @@ -1392,9 +1467,10 @@ internal TagsOperations(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(); @@ -1405,25 +1481,29 @@ internal TagsOperations(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 the entire set of tags on a resource or subscription. /// @@ -1436,13 +1516,13 @@ internal TagsOperations(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 /// /// @@ -1451,60 +1531,69 @@ internal TagsOperations(ResourceManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetAtScopeWithHttpMessagesAsync(string scope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetAtScopeWithHttpMessagesAsync(string scope, 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 (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("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/tags/default").ToString(); _url = _url.Replace("{scope}", scope); - 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) @@ -1516,55 +1605,56 @@ internal TagsOperations(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) @@ -1574,9 +1664,10 @@ internal TagsOperations(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(); @@ -1587,25 +1678,29 @@ internal TagsOperations(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; - } + + + + + } /// /// Deletes the entire set of tags on a resource or subscription. /// @@ -1618,10 +1713,10 @@ internal TagsOperations(ResourceManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1630,60 +1725,69 @@ internal TagsOperations(ResourceManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteAtScopeWithHttpMessagesAsync(string scope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteAtScopeWithHttpMessagesAsync(string scope, 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 (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("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteAtScope", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "DeleteAtScope", 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/tags/default").ToString(); _url = _url.Replace("{scope}", scope); - 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("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _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) @@ -1695,55 +1799,56 @@ internal TagsOperations(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) @@ -1753,29 +1858,31 @@ internal TagsOperations(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(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Gets a summary of tag usage under the subscription. - /// - /// /// This operation performs a union of predefined tags, resource tags, resource /// group tags and subscription tags, and returns a summary of usage for each /// tag name and value under the given subscription. In case of a large number /// of tags, this operation may return a previously cached result. - /// + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -1785,13 +1892,13 @@ internal TagsOperations(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 /// /// @@ -1800,51 +1907,54 @@ internal TagsOperations(ResourceManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(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, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", 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) @@ -1856,55 +1966,56 @@ internal TagsOperations(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) @@ -1914,9 +2025,10 @@ internal TagsOperations(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(); @@ -1927,24 +2039,28 @@ internal TagsOperations(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; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Management.Sdk/Generated/TagsOperationsExtensions.cs b/src/Resources/Resources.Management.Sdk/Generated/TagsOperationsExtensions.cs new file mode 100644 index 000000000000..b57136d3d16b --- /dev/null +++ b/src/Resources/Resources.Management.Sdk/Generated/TagsOperationsExtensions.cs @@ -0,0 +1,391 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.Management.Resources +{ + using Microsoft.Rest.Azure; + using Models; + + /// + /// Extension methods for TagsOperations + /// + public static partial class TagsOperationsExtensions + { + /// + /// This operation allows deleting a value from the list of predefined values + /// for an existing predefined tag name. The value being deleted must not be in + /// use as a tag value for the given tag name for any resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the tag. + /// + /// + /// The value of the tag to delete. + /// + public static void DeleteValue(this ITagsOperations operations, string tagName, string tagValue) + { + ((ITagsOperations)operations).DeleteValueAsync(tagName, tagValue).GetAwaiter().GetResult(); + } + + /// + /// This operation allows deleting a value from the list of predefined values + /// for an existing predefined tag name. The value being deleted must not be in + /// use as a tag value for the given tag name for any resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the tag. + /// + /// + /// The value of the tag to delete. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteValueAsync(this ITagsOperations operations, string tagName, string tagValue, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteValueWithHttpMessagesAsync(tagName, tagValue, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// This operation allows adding a value to the list of predefined values for + /// an existing predefined tag name. A tag value can have a maximum of 256 + /// characters. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the tag. + /// + /// + /// The value of the tag to create. + /// + public static TagValue CreateOrUpdateValue(this ITagsOperations operations, string tagName, string tagValue) + { + return ((ITagsOperations)operations).CreateOrUpdateValueAsync(tagName, tagValue).GetAwaiter().GetResult(); + } + + /// + /// This operation allows adding a value to the list of predefined values for + /// an existing predefined tag name. A tag value can have a maximum of 256 + /// characters. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the tag. + /// + /// + /// The value of the tag to create. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateValueAsync(this ITagsOperations operations, string tagName, string tagValue, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateValueWithHttpMessagesAsync(tagName, tagValue, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// This operation allows adding a name to the list of predefined tag names for + /// the given subscription. A tag name can have a maximum of 512 characters and + /// is case-insensitive. Tag names cannot have the following prefixes which are + /// reserved for Azure use: 'microsoft', 'azure', 'windows'. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the tag to create. + /// + public static TagDetails CreateOrUpdate(this ITagsOperations operations, string tagName) + { + return ((ITagsOperations)operations).CreateOrUpdateAsync(tagName).GetAwaiter().GetResult(); + } + + /// + /// This operation allows adding a name to the list of predefined tag names for + /// the given subscription. A tag name can have a maximum of 512 characters and + /// is case-insensitive. Tag names cannot have the following prefixes which are + /// reserved for Azure use: 'microsoft', 'azure', 'windows'. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the tag to create. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this ITagsOperations operations, string tagName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(tagName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// This operation allows deleting a name from the list of predefined tag names + /// for the given subscription. The name being deleted must not be in use as a + /// tag name for any resource. All predefined values for the given name must + /// have already been deleted. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the tag. + /// + public static void Delete(this ITagsOperations operations, string tagName) + { + ((ITagsOperations)operations).DeleteAsync(tagName).GetAwaiter().GetResult(); + } + + /// + /// This operation allows deleting a name from the list of predefined tag names + /// for the given subscription. The name being deleted must not be in use as a + /// tag name for any resource. All predefined values for the given name must + /// have already been deleted. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the tag. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this ITagsOperations operations, string tagName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(tagName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// This operation performs a union of predefined tags, resource tags, resource + /// group tags and subscription tags, and returns a summary of usage for each + /// tag name and value under the given subscription. In case of a large number + /// of tags, this operation may return a previously cached result. + /// + /// + /// The operations group for this extension method. + /// + public static Microsoft.Rest.Azure.IPage List(this ITagsOperations operations) + { + return ((ITagsOperations)operations).ListAsync().GetAwaiter().GetResult(); + } + + /// + /// This operation performs a union of predefined tags, resource tags, resource + /// group tags and subscription tags, and returns a summary of usage for each + /// tag name and value under the given subscription. In case of a large number + /// of tags, this operation may return a previously cached result. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this ITagsOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// This operation allows adding or replacing the entire set of tags on the + /// specified resource or subscription. The specified entity can have a maximum + /// of 50 tags. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource scope. + /// + public static TagsResource CreateOrUpdateAtScope(this ITagsOperations operations, string scope, TagsResource parameters) + { + return ((ITagsOperations)operations).CreateOrUpdateAtScopeAsync(scope, parameters).GetAwaiter().GetResult(); + } + + /// + /// This operation allows adding or replacing the entire set of tags on the + /// specified resource or subscription. The specified entity can have a maximum + /// of 50 tags. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource scope. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAtScopeAsync(this ITagsOperations operations, string scope, TagsResource parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateAtScopeWithHttpMessagesAsync(scope, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// This operation allows replacing, merging or selectively deleting tags on + /// the specified resource or subscription. The specified entity can have a + /// maximum of 50 tags at the end of the operation. The 'replace' option + /// replaces the entire set of existing tags with a new set. The 'merge' option + /// allows adding tags with new names and updating the values of tags with + /// existing names. The 'delete' option allows selectively deleting tags based + /// on given names or name/value pairs. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource scope. + /// + public static TagsResource UpdateAtScope(this ITagsOperations operations, string scope, TagsPatchResource parameters) + { + return ((ITagsOperations)operations).UpdateAtScopeAsync(scope, parameters).GetAwaiter().GetResult(); + } + + /// + /// This operation allows replacing, merging or selectively deleting tags on + /// the specified resource or subscription. The specified entity can have a + /// maximum of 50 tags at the end of the operation. The 'replace' option + /// replaces the entire set of existing tags with a new set. The 'merge' option + /// allows adding tags with new names and updating the values of tags with + /// existing names. The 'delete' option allows selectively deleting tags based + /// on given names or name/value pairs. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource scope. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UpdateAtScopeAsync(this ITagsOperations operations, string scope, TagsPatchResource parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.UpdateAtScopeWithHttpMessagesAsync(scope, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets the entire set of tags on a resource or subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource scope. + /// + public static TagsResource GetAtScope(this ITagsOperations operations, string scope) + { + return ((ITagsOperations)operations).GetAtScopeAsync(scope).GetAwaiter().GetResult(); + } + + /// + /// Gets the entire set of tags on a resource or subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource scope. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAtScopeAsync(this ITagsOperations operations, string scope, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetAtScopeWithHttpMessagesAsync(scope, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Deletes the entire set of tags on a resource or subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource scope. + /// + public static void DeleteAtScope(this ITagsOperations operations, string scope) + { + ((ITagsOperations)operations).DeleteAtScopeAsync(scope).GetAwaiter().GetResult(); + } + + /// + /// Deletes the entire set of tags on a resource or subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource scope. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAtScopeAsync(this ITagsOperations operations, string scope, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteAtScopeWithHttpMessagesAsync(scope, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// This operation performs a union of predefined tags, resource tags, resource + /// group tags and subscription tags, and returns a summary of usage for each + /// tag name and value under the given subscription. In case of a large number + /// of tags, this operation may return a previously cached result. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this ITagsOperations operations, string nextPageLink) + { + return ((ITagsOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// This operation performs a union of predefined tags, resource tags, resource + /// group tags and subscription tags, and returns a summary of usage for each + /// tag name and value under the given subscription. In case of a large number + /// of tags, this operation may return a previously cached result. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this ITagsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + } +} diff --git a/src/Resources/Resources.Sdk/Generated/TemplateSpecVersionsOperations.cs b/src/Resources/Resources.Management.Sdk/Generated/TemplateSpecVersionsOperations.cs similarity index 57% rename from src/Resources/Resources.Sdk/Generated/TemplateSpecVersionsOperations.cs rename to src/Resources/Resources.Management.Sdk/Generated/TemplateSpecVersionsOperations.cs index 6c6741c893c3..8029c1d12a71 100644 --- a/src/Resources/Resources.Sdk/Generated/TemplateSpecVersionsOperations.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/TemplateSpecVersionsOperations.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; /// /// TemplateSpecVersionsOperations operations. /// - internal partial class TemplateSpecVersionsOperations : IServiceOperations, ITemplateSpecVersionsOperations + internal partial class TemplateSpecVersionsOperations : Microsoft.Rest.IServiceOperations, ITemplateSpecVersionsOperations { /// /// Initializes a new instance of the TemplateSpecVersionsOperations class. @@ -36,13 +24,13 @@ internal partial class TemplateSpecVersionsOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal TemplateSpecVersionsOperations(TemplateSpecsClient client) + internal TemplateSpecVersionsOperations (TemplateSpecsClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -71,13 +59,13 @@ internal TemplateSpecVersionsOperations(TemplateSpecsClient 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 /// /// @@ -86,131 +74,140 @@ internal TemplateSpecVersionsOperations(TemplateSpecsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string templateSpecName, string templateSpecVersion, TemplateSpecVersion templateSpecVersionModel, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string templateSpecName, string templateSpecVersion, TemplateSpecVersion templateSpecVersionModel, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (templateSpecVersionModel == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "templateSpecVersionModel"); + } + if (templateSpecVersionModel != null) + { + templateSpecVersionModel.Validate(); + } + 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"); } + 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 (templateSpecName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "templateSpecName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "templateSpecName"); } if (templateSpecName != null) { if (templateSpecName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "templateSpecName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "templateSpecName", 90); } if (templateSpecName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "templateSpecName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "templateSpecName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(templateSpecName, "^[-\\w\\._\\(\\)]+$")) { - throw new ValidationException(ValidationRules.Pattern, "templateSpecName", "^[-\\w\\._\\(\\)]+$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "templateSpecName", "^[-\\w\\._\\(\\)]+$"); } } if (templateSpecVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "templateSpecVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "templateSpecVersion"); } if (templateSpecVersion != null) { if (templateSpecVersion.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "templateSpecVersion", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "templateSpecVersion", 90); } if (templateSpecVersion.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "templateSpecVersion", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "templateSpecVersion", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(templateSpecVersion, "^[-\\w\\._\\(\\)]+$")) { - throw new ValidationException(ValidationRules.Pattern, "templateSpecVersion", "^[-\\w\\._\\(\\)]+$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "templateSpecVersion", "^[-\\w\\._\\(\\)]+$"); } } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (templateSpecVersionModel == null) + if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "templateSpecVersionModel"); - } - if (templateSpecVersionModel != null) - { - templateSpecVersionModel.Validate(); + 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("resourceGroupName", resourceGroupName); tracingParameters.Add("templateSpecName", templateSpecName); tracingParameters.Add("templateSpecVersion", templateSpecVersion); + tracingParameters.Add("templateSpecVersionModel", templateSpecVersionModel); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", 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}/providers/Microsoft.Resources/templateSpecs/{templateSpecName}/versions/{templateSpecVersion}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{templateSpecName}", System.Uri.EscapeDataString(templateSpecName)); _url = _url.Replace("{templateSpecVersion}", System.Uri.EscapeDataString(templateSpecVersion)); - 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("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _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) @@ -222,56 +219,57 @@ internal TemplateSpecVersionsOperations(TemplateSpecsClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(templateSpecVersionModel != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(templateSpecVersionModel, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(templateSpecVersionModel, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + 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 && (int)_statusCode != 201) { var ex = new TemplateSpecsErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - TemplateSpecsError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + TemplateSpecsError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -281,9 +279,10 @@ internal TemplateSpecVersionsOperations(TemplateSpecsClient 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(); @@ -294,16 +293,16 @@ internal TemplateSpecVersionsOperations(TemplateSpecsClient 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); } } // Deserialize Response @@ -312,25 +311,29 @@ internal TemplateSpecVersionsOperations(TemplateSpecsClient 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; - } + + + + + } /// /// Updates Template Spec Version tags with specified values. /// @@ -352,13 +355,13 @@ internal TemplateSpecVersionsOperations(TemplateSpecsClient 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 /// /// @@ -367,123 +370,132 @@ internal TemplateSpecVersionsOperations(TemplateSpecsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string templateSpecName, string templateSpecVersion, TemplateSpecVersionUpdateModel templateSpecVersionUpdateModel = default(TemplateSpecVersionUpdateModel), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string templateSpecName, string templateSpecVersion, TemplateSpecVersionUpdateModel templateSpecVersionUpdateModel = default(TemplateSpecVersionUpdateModel), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - 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"); } + 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 (templateSpecName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "templateSpecName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "templateSpecName"); } if (templateSpecName != null) { if (templateSpecName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "templateSpecName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "templateSpecName", 90); } if (templateSpecName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "templateSpecName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "templateSpecName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(templateSpecName, "^[-\\w\\._\\(\\)]+$")) { - throw new ValidationException(ValidationRules.Pattern, "templateSpecName", "^[-\\w\\._\\(\\)]+$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "templateSpecName", "^[-\\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 (templateSpecVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "templateSpecVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "templateSpecVersion"); } if (templateSpecVersion != null) { if (templateSpecVersion.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "templateSpecVersion", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "templateSpecVersion", 90); } if (templateSpecVersion.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "templateSpecVersion", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "templateSpecVersion", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(templateSpecVersion, "^[-\\w\\._\\(\\)]+$")) { - throw new ValidationException(ValidationRules.Pattern, "templateSpecVersion", "^[-\\w\\._\\(\\)]+$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "templateSpecVersion", "^[-\\w\\._\\(\\)]+$"); } } // 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("templateSpecName", templateSpecName); tracingParameters.Add("templateSpecVersion", templateSpecVersion); + tracingParameters.Add("templateSpecVersionUpdateModel", templateSpecVersionUpdateModel); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Update", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Update", 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}/providers/Microsoft.Resources/templateSpecs/{templateSpecName}/versions/{templateSpecVersion}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{templateSpecName}", System.Uri.EscapeDataString(templateSpecName)); _url = _url.Replace("{templateSpecVersion}", System.Uri.EscapeDataString(templateSpecVersion)); - 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("PATCH"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); _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) @@ -495,56 +507,57 @@ internal TemplateSpecVersionsOperations(TemplateSpecsClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(templateSpecVersionUpdateModel != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(templateSpecVersionUpdateModel, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(templateSpecVersionUpdateModel, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + 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 TemplateSpecsErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - TemplateSpecsError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + TemplateSpecsError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -554,9 +567,10 @@ internal TemplateSpecVersionsOperations(TemplateSpecsClient 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(); @@ -567,25 +581,29 @@ internal TemplateSpecVersionsOperations(TemplateSpecsClient 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 Template Spec version from a specific Template Spec. /// @@ -604,13 +622,13 @@ internal TemplateSpecVersionsOperations(TemplateSpecsClient 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 /// /// @@ -619,122 +637,131 @@ internal TemplateSpecVersionsOperations(TemplateSpecsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string templateSpecName, string templateSpecVersion, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string templateSpecName, string templateSpecVersion, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - 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"); } + 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 (templateSpecName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "templateSpecName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "templateSpecName"); } if (templateSpecName != null) { if (templateSpecName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "templateSpecName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "templateSpecName", 90); } if (templateSpecName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "templateSpecName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "templateSpecName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(templateSpecName, "^[-\\w\\._\\(\\)]+$")) { - throw new ValidationException(ValidationRules.Pattern, "templateSpecName", "^[-\\w\\._\\(\\)]+$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "templateSpecName", "^[-\\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 (templateSpecVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "templateSpecVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "templateSpecVersion"); } if (templateSpecVersion != null) { if (templateSpecVersion.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "templateSpecVersion", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "templateSpecVersion", 90); } if (templateSpecVersion.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "templateSpecVersion", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "templateSpecVersion", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(templateSpecVersion, "^[-\\w\\._\\(\\)]+$")) { - throw new ValidationException(ValidationRules.Pattern, "templateSpecVersion", "^[-\\w\\._\\(\\)]+$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "templateSpecVersion", "^[-\\w\\._\\(\\)]+$"); } } // 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("templateSpecName", templateSpecName); tracingParameters.Add("templateSpecVersion", templateSpecVersion); + + 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}/providers/Microsoft.Resources/templateSpecs/{templateSpecName}/versions/{templateSpecVersion}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{templateSpecName}", System.Uri.EscapeDataString(templateSpecName)); _url = _url.Replace("{templateSpecVersion}", System.Uri.EscapeDataString(templateSpecVersion)); - 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) @@ -746,50 +773,51 @@ internal TemplateSpecVersionsOperations(TemplateSpecsClient 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 TemplateSpecsErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - TemplateSpecsError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + TemplateSpecsError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -799,9 +827,10 @@ internal TemplateSpecVersionsOperations(TemplateSpecsClient 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(); @@ -812,25 +841,29 @@ internal TemplateSpecVersionsOperations(TemplateSpecsClient 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; - } + + + + + } /// /// Deletes a specific version from a Template Spec. When operation completes, /// status code 200 returned without content. @@ -850,10 +883,10 @@ internal TemplateSpecVersionsOperations(TemplateSpecsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -862,122 +895,131 @@ internal TemplateSpecVersionsOperations(TemplateSpecsClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string templateSpecName, string templateSpecVersion, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string templateSpecName, string templateSpecVersion, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - 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"); } + 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 (templateSpecName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "templateSpecName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "templateSpecName"); } if (templateSpecName != null) { if (templateSpecName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "templateSpecName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "templateSpecName", 90); } if (templateSpecName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "templateSpecName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "templateSpecName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(templateSpecName, "^[-\\w\\._\\(\\)]+$")) { - throw new ValidationException(ValidationRules.Pattern, "templateSpecName", "^[-\\w\\._\\(\\)]+$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "templateSpecName", "^[-\\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 (templateSpecVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "templateSpecVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "templateSpecVersion"); } if (templateSpecVersion != null) { if (templateSpecVersion.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "templateSpecVersion", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "templateSpecVersion", 90); } if (templateSpecVersion.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "templateSpecVersion", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "templateSpecVersion", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(templateSpecVersion, "^[-\\w\\._\\(\\)]+$")) { - throw new ValidationException(ValidationRules.Pattern, "templateSpecVersion", "^[-\\w\\._\\(\\)]+$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "templateSpecVersion", "^[-\\w\\._\\(\\)]+$"); } } // 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("templateSpecName", templateSpecName); tracingParameters.Add("templateSpecVersion", templateSpecVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Delete", 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}/providers/Microsoft.Resources/templateSpecs/{templateSpecName}/versions/{templateSpecVersion}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{templateSpecName}", System.Uri.EscapeDataString(templateSpecName)); _url = _url.Replace("{templateSpecVersion}", System.Uri.EscapeDataString(templateSpecVersion)); - 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("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _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) @@ -989,50 +1031,51 @@ internal TemplateSpecVersionsOperations(TemplateSpecsClient 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 && (int)_statusCode != 204) { var ex = new TemplateSpecsErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - TemplateSpecsError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + TemplateSpecsError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1042,20 +1085,25 @@ internal TemplateSpecVersionsOperations(TemplateSpecsClient 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(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Lists all the Template Spec versions in the specified Template Spec. /// @@ -1071,13 +1119,13 @@ internal TemplateSpecVersionsOperations(TemplateSpecsClient 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 /// /// @@ -1086,101 +1134,110 @@ internal TemplateSpecVersionsOperations(TemplateSpecsClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string templateSpecName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string templateSpecName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - 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"); } + 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 (templateSpecName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "templateSpecName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "templateSpecName"); } if (templateSpecName != null) { if (templateSpecName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "templateSpecName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "templateSpecName", 90); } if (templateSpecName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "templateSpecName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "templateSpecName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(templateSpecName, "^[-\\w\\._\\(\\)]+$")) { - throw new ValidationException(ValidationRules.Pattern, "templateSpecName", "^[-\\w\\._\\(\\)]+$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "templateSpecName", "^[-\\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("resourceGroupName", resourceGroupName); tracingParameters.Add("templateSpecName", templateSpecName); + + 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}/providers/Microsoft.Resources/templateSpecs/{templateSpecName}/versions").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{templateSpecName}", System.Uri.EscapeDataString(templateSpecName)); - 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) @@ -1192,50 +1249,51 @@ internal TemplateSpecVersionsOperations(TemplateSpecsClient 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 TemplateSpecsErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - TemplateSpecsError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + TemplateSpecsError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1245,9 +1303,10 @@ internal TemplateSpecVersionsOperations(TemplateSpecsClient 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(); @@ -1258,25 +1317,29 @@ internal TemplateSpecVersionsOperations(TemplateSpecsClient 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; - } + + + + + } /// /// Lists all the Template Spec versions in the specified Template Spec. /// @@ -1289,13 +1352,13 @@ internal TemplateSpecVersionsOperations(TemplateSpecsClient 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 /// /// @@ -1304,51 +1367,54 @@ internal TemplateSpecVersionsOperations(TemplateSpecsClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(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, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", 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) @@ -1360,50 +1426,51 @@ internal TemplateSpecVersionsOperations(TemplateSpecsClient 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 TemplateSpecsErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - TemplateSpecsError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + TemplateSpecsError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1413,9 +1480,10 @@ internal TemplateSpecVersionsOperations(TemplateSpecsClient 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(); @@ -1426,24 +1494,28 @@ internal TemplateSpecVersionsOperations(TemplateSpecsClient 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; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Management.Sdk/Generated/TemplateSpecVersionsOperationsExtensions.cs b/src/Resources/Resources.Management.Sdk/Generated/TemplateSpecVersionsOperationsExtensions.cs new file mode 100644 index 000000000000..ea377bbe9e0a --- /dev/null +++ b/src/Resources/Resources.Management.Sdk/Generated/TemplateSpecVersionsOperationsExtensions.cs @@ -0,0 +1,267 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.Management.Resources +{ + using Microsoft.Rest.Azure; + using Models; + + /// + /// Extension methods for TemplateSpecVersionsOperations + /// + public static partial class TemplateSpecVersionsOperationsExtensions + { + /// + /// Creates or updates a Template Spec version. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the Template Spec. + /// + /// + /// The version of the Template Spec. + /// + public static TemplateSpecVersion CreateOrUpdate(this ITemplateSpecVersionsOperations operations, string resourceGroupName, string templateSpecName, string templateSpecVersion, TemplateSpecVersion templateSpecVersionModel) + { + return ((ITemplateSpecVersionsOperations)operations).CreateOrUpdateAsync(resourceGroupName, templateSpecName, templateSpecVersion, templateSpecVersionModel).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates a Template Spec version. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the Template Spec. + /// + /// + /// The version of the Template Spec. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this ITemplateSpecVersionsOperations operations, string resourceGroupName, string templateSpecName, string templateSpecVersion, TemplateSpecVersion templateSpecVersionModel, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, templateSpecName, templateSpecVersion, templateSpecVersionModel, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Updates Template Spec Version tags with specified values. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the Template Spec. + /// + /// + /// The version of the Template Spec. + /// + public static TemplateSpecVersion Update(this ITemplateSpecVersionsOperations operations, string resourceGroupName, string templateSpecName, string templateSpecVersion, TemplateSpecVersionUpdateModel templateSpecVersionUpdateModel = default(TemplateSpecVersionUpdateModel)) + { + return ((ITemplateSpecVersionsOperations)operations).UpdateAsync(resourceGroupName, templateSpecName, templateSpecVersion, templateSpecVersionUpdateModel).GetAwaiter().GetResult(); + } + + /// + /// Updates Template Spec Version tags with specified values. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the Template Spec. + /// + /// + /// The version of the Template Spec. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UpdateAsync(this ITemplateSpecVersionsOperations operations, string resourceGroupName, string templateSpecName, string templateSpecVersion, TemplateSpecVersionUpdateModel templateSpecVersionUpdateModel = default(TemplateSpecVersionUpdateModel), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, templateSpecName, templateSpecVersion, templateSpecVersionUpdateModel, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets a Template Spec version from a specific Template Spec. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the Template Spec. + /// + /// + /// The version of the Template Spec. + /// + public static TemplateSpecVersion Get(this ITemplateSpecVersionsOperations operations, string resourceGroupName, string templateSpecName, string templateSpecVersion) + { + return ((ITemplateSpecVersionsOperations)operations).GetAsync(resourceGroupName, templateSpecName, templateSpecVersion).GetAwaiter().GetResult(); + } + + /// + /// Gets a Template Spec version from a specific Template Spec. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the Template Spec. + /// + /// + /// The version of the Template Spec. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this ITemplateSpecVersionsOperations operations, string resourceGroupName, string templateSpecName, string templateSpecVersion, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, templateSpecName, templateSpecVersion, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Deletes a specific version from a Template Spec. When operation completes, + /// status code 200 returned without content. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the Template Spec. + /// + /// + /// The version of the Template Spec. + /// + public static void Delete(this ITemplateSpecVersionsOperations operations, string resourceGroupName, string templateSpecName, string templateSpecVersion) + { + ((ITemplateSpecVersionsOperations)operations).DeleteAsync(resourceGroupName, templateSpecName, templateSpecVersion).GetAwaiter().GetResult(); + } + + /// + /// Deletes a specific version from a Template Spec. When operation completes, + /// status code 200 returned without content. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the Template Spec. + /// + /// + /// The version of the Template Spec. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this ITemplateSpecVersionsOperations operations, string resourceGroupName, string templateSpecName, string templateSpecVersion, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, templateSpecName, templateSpecVersion, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Lists all the Template Spec versions in the specified Template Spec. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the Template Spec. + /// + public static Microsoft.Rest.Azure.IPage List(this ITemplateSpecVersionsOperations operations, string resourceGroupName, string templateSpecName) + { + return ((ITemplateSpecVersionsOperations)operations).ListAsync(resourceGroupName, templateSpecName).GetAwaiter().GetResult(); + } + + /// + /// Lists all the Template Spec versions in the specified Template Spec. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the Template Spec. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this ITemplateSpecVersionsOperations operations, string resourceGroupName, string templateSpecName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, templateSpecName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Lists all the Template Spec versions in the specified Template Spec. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this ITemplateSpecVersionsOperations operations, string nextPageLink) + { + return ((ITemplateSpecVersionsOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists all the Template Spec versions in the specified Template Spec. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this ITemplateSpecVersionsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + } +} diff --git a/src/Resources/Resources.Sdk/Generated/TemplateSpecsClient.cs b/src/Resources/Resources.Management.Sdk/Generated/TemplateSpecsClient.cs similarity index 64% rename from src/Resources/Resources.Sdk/Generated/TemplateSpecsClient.cs rename to src/Resources/Resources.Management.Sdk/Generated/TemplateSpecsClient.cs index 3bf5f1273fb6..0db8c9ad9fd7 100644 --- a/src/Resources/Resources.Sdk/Generated/TemplateSpecsClient.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/TemplateSpecsClient.cs @@ -1,90 +1,74 @@ -// // 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 Microsoft.Rest.Serialization; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; /// - /// The APIs listed in this specification can be used to manage Template - /// Spec resources through the Azure Resource Manager. + /// The APIs listed in this specification can be used to manage Template Spec + /// resources through the Azure Resource Manager. /// - public partial class TemplateSpecsClient : ServiceClient, ITemplateSpecsClient, IAzureClient + public partial class TemplateSpecsClient : Microsoft.Rest.ServiceClient, ITemplateSpecsClient, IAzureClient { /// /// The base URI of the service. /// public System.Uri BaseUri { get; set; } - /// /// Gets or sets json serialization settings. /// - public JsonSerializerSettings SerializationSettings { get; private set; } - + public Newtonsoft.Json.JsonSerializerSettings SerializationSettings { get; private set; } /// /// Gets or sets json deserialization settings. /// - public JsonSerializerSettings DeserializationSettings { get; private set; } - + public Newtonsoft.Json.JsonSerializerSettings DeserializationSettings { get; private set; } /// /// Credentials needed for the client to connect to Azure. /// - public ServiceClientCredentials Credentials { get; private set; } + public Microsoft.Rest.ServiceClientCredentials Credentials { get; private set; } /// - /// Subscription Id which forms part of the URI for every service call. + /// The API version to use for this operation. /// - public string SubscriptionId { get; set; } + public string ApiVersion { get; private set; } /// - /// Client Api version. + /// Subscription Id which forms part of the URI for every service call. /// - public string ApiVersion { get; private set; } + public string SubscriptionId { get; set;} /// /// The preferred language for the response. /// - public string AcceptLanguage { get; set; } + public string AcceptLanguage { get; set;} /// - /// The retry timeout in seconds for Long Running Operations. Default value is - /// 30. + /// The retry timeout in seconds for Long Running Operations. Default + /// /// value is 30. /// - public int? LongRunningOperationRetryTimeout { get; set; } + public int? LongRunningOperationRetryTimeout { get; set;} /// - /// Whether a unique x-ms-client-request-id should be generated. When set to - /// true a unique x-ms-client-request-id value is generated and included in - /// each request. Default is true. + /// Whether a unique x-ms-client-request-id should be generated. When + /// /// set to true a unique x-ms-client-request-id value is generated and + /// /// included in each request. Default is true. /// - public bool? GenerateClientRequestId { get; set; } + public bool? GenerateClientRequestId { get; set;} /// - /// Gets the ITemplateSpecsOperations. + /// Gets the ITemplateSpecsOperations /// public virtual ITemplateSpecsOperations TemplateSpecs { get; private set; } - /// - /// Gets the ITemplateSpecVersionsOperations. + /// Gets the ITemplateSpecVersionsOperations /// public virtual ITemplateSpecVersionsOperations TemplateSpecVersions { get; private set; } - /// /// Initializes a new instance of the TemplateSpecsClient class. /// @@ -93,24 +77,22 @@ public partial class TemplateSpecsClient : ServiceClient, I /// /// /// True: will dispose the provided httpClient on calling TemplateSpecsClient.Dispose(). False: will not dispose provided httpClient - protected TemplateSpecsClient(HttpClient httpClient, bool disposeHttpClient) : base(httpClient, disposeHttpClient) + protected TemplateSpecsClient(System.Net.Http.HttpClient httpClient, bool disposeHttpClient) : base(httpClient, disposeHttpClient) { - Initialize(); + this.Initialize(); } - /// /// Initializes a new instance of the TemplateSpecsClient class. /// /// /// Optional. The delegating handlers to add to the http client pipeline. /// - protected TemplateSpecsClient(params DelegatingHandler[] handlers) : base(handlers) + protected TemplateSpecsClient(params System.Net.Http.DelegatingHandler[] handlers) : base(handlers) { - Initialize(); + this.Initialize(); } - /// - /// Initializes a new instance of the TemplateSpecsClient class. + /// Initializes a new instance of the TemplateSpecsClient class. /// /// /// Optional. The http client handler used to handle http transport. @@ -118,11 +100,10 @@ protected TemplateSpecsClient(params DelegatingHandler[] handlers) : base(handle /// /// Optional. The delegating handlers to add to the http client pipeline. /// - protected TemplateSpecsClient(HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : base(rootHandler, handlers) + protected TemplateSpecsClient(System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : base(rootHandler, handlers) { - Initialize(); + this.Initialize(); } - /// /// Initializes a new instance of the TemplateSpecsClient class. /// @@ -135,15 +116,14 @@ protected TemplateSpecsClient(HttpClientHandler rootHandler, params DelegatingHa /// /// Thrown when a required parameter is null /// - protected TemplateSpecsClient(System.Uri baseUri, params DelegatingHandler[] handlers) : this(handlers) + protected TemplateSpecsClient(System.Uri baseUri, params System.Net.Http.DelegatingHandler[] handlers) : this(handlers) { if (baseUri == null) { throw new System.ArgumentNullException("baseUri"); } - BaseUri = baseUri; + this.BaseUri = baseUri; } - /// /// Initializes a new instance of the TemplateSpecsClient class. /// @@ -159,15 +139,15 @@ protected TemplateSpecsClient(System.Uri baseUri, params DelegatingHandler[] han /// /// Thrown when a required parameter is null /// - protected TemplateSpecsClient(System.Uri baseUri, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + protected TemplateSpecsClient(System.Uri baseUri, System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : this(rootHandler, handlers) { if (baseUri == null) { throw new System.ArgumentNullException("baseUri"); } - BaseUri = baseUri; + + this.BaseUri = baseUri; } - /// /// Initializes a new instance of the TemplateSpecsClient class. /// @@ -180,23 +160,23 @@ protected TemplateSpecsClient(System.Uri baseUri, HttpClientHandler rootHandler, /// /// Thrown when a required parameter is null /// - public TemplateSpecsClient(ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers) + public TemplateSpecsClient(Microsoft.Rest.ServiceClientCredentials credentials, params System.Net.Http.DelegatingHandler[] handlers) : this(handlers) { if (credentials == null) { throw new System.ArgumentNullException("credentials"); } - Credentials = credentials; - if (Credentials != null) + this.Credentials = credentials; + if (this.Credentials != null) { - Credentials.InitializeServiceClient(this); + this.Credentials.InitializeServiceClient(this); } + } - /// /// Initializes a new instance of the TemplateSpecsClient class. /// - /// + /// /// Required. Credentials needed for the client to connect to Azure. /// /// @@ -207,23 +187,23 @@ public TemplateSpecsClient(ServiceClientCredentials credentials, params Delegati /// /// Thrown when a required parameter is null /// - public TemplateSpecsClient(ServiceClientCredentials credentials, HttpClient httpClient, bool disposeHttpClient) : this(httpClient, disposeHttpClient) + public TemplateSpecsClient(Microsoft.Rest.ServiceClientCredentials credentials, System.Net.Http.HttpClient httpClient, bool disposeHttpClient) : this(httpClient, disposeHttpClient) { if (credentials == null) { throw new System.ArgumentNullException("credentials"); } - Credentials = credentials; - if (Credentials != null) + this.Credentials = credentials; + if (this.Credentials != null) { - Credentials.InitializeServiceClient(this); + this.Credentials.InitializeServiceClient(this); } + } - /// /// Initializes a new instance of the TemplateSpecsClient class. /// - /// + /// /// Required. Credentials needed for the client to connect to Azure. /// /// @@ -235,26 +215,26 @@ public TemplateSpecsClient(ServiceClientCredentials credentials, HttpClient http /// /// Thrown when a required parameter is null /// - public TemplateSpecsClient(ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + public TemplateSpecsClient(Microsoft.Rest.ServiceClientCredentials credentials, System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : this(rootHandler, handlers) { if (credentials == null) { throw new System.ArgumentNullException("credentials"); } - Credentials = credentials; - if (Credentials != null) + this.Credentials = credentials; + if (this.Credentials != null) { - Credentials.InitializeServiceClient(this); + this.Credentials.InitializeServiceClient(this); } + } - /// /// Initializes a new instance of the TemplateSpecsClient class. /// /// /// Optional. The base URI of the service. /// - /// + /// /// Required. Credentials needed for the client to connect to Azure. /// /// @@ -263,7 +243,7 @@ public TemplateSpecsClient(ServiceClientCredentials credentials, HttpClientHandl /// /// Thrown when a required parameter is null /// - public TemplateSpecsClient(System.Uri baseUri, ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers) + public TemplateSpecsClient(System.Uri baseUri, Microsoft.Rest.ServiceClientCredentials credentials, params System.Net.Http.DelegatingHandler[] handlers) : this(handlers) { if (baseUri == null) { @@ -273,33 +253,30 @@ public TemplateSpecsClient(System.Uri baseUri, ServiceClientCredentials credenti { throw new System.ArgumentNullException("credentials"); } - BaseUri = baseUri; - Credentials = credentials; - if (Credentials != null) + this.BaseUri = baseUri; + this.Credentials = credentials; + if (this.Credentials != null) { - Credentials.InitializeServiceClient(this); + this.Credentials.InitializeServiceClient(this); } + } - /// /// Initializes a new instance of the TemplateSpecsClient class. /// /// /// Optional. The base URI of the service. /// - /// + /// /// Required. Credentials needed for the client to connect to Azure. /// /// /// Optional. The http client handler used to handle http transport. /// - /// - /// Optional. The delegating handlers to add to the http client pipeline. - /// /// /// Thrown when a required parameter is null /// - public TemplateSpecsClient(System.Uri baseUri, ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + public TemplateSpecsClient(System.Uri baseUri, Microsoft.Rest.ServiceClientCredentials credentials, System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : this(rootHandler, handlers) { if (baseUri == null) { @@ -309,59 +286,60 @@ public TemplateSpecsClient(System.Uri baseUri, ServiceClientCredentials credenti { throw new System.ArgumentNullException("credentials"); } - BaseUri = baseUri; - Credentials = credentials; - if (Credentials != null) + this.BaseUri = baseUri; + this.Credentials = credentials; + if (this.Credentials != null) { - Credentials.InitializeServiceClient(this); + this.Credentials.InitializeServiceClient(this); } + } - /// /// An optional partial-method to perform custom initialization. /// partial void CustomInitialize(); + /// /// Initializes client properties. /// private void Initialize() { - TemplateSpecs = new TemplateSpecsOperations(this); - TemplateSpecVersions = new TemplateSpecVersionsOperations(this); - BaseUri = new System.Uri("https://management.azure.com"); - ApiVersion = "2021-05-01"; - AcceptLanguage = "en-US"; - LongRunningOperationRetryTimeout = 30; - GenerateClientRequestId = true; - SerializationSettings = new JsonSerializerSettings + this.TemplateSpecs = new TemplateSpecsOperations(this); + this.TemplateSpecVersions = new TemplateSpecVersionsOperations(this); + this.BaseUri = new System.Uri("https://management.azure.com"); + this.ApiVersion = "2021-05-01"; + this.AcceptLanguage = "en-US"; + this.LongRunningOperationRetryTimeout = 30; + this.GenerateClientRequestId = true; + SerializationSettings = new Newtonsoft.Json.JsonSerializerSettings { Formatting = Newtonsoft.Json.Formatting.Indented, DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, - ContractResolver = new ReadOnlyJsonContractResolver(), - Converters = new List + ContractResolver = new Microsoft.Rest.Serialization.ReadOnlyJsonContractResolver(), + Converters = new System.Collections.Generic.List { - new Iso8601TimeSpanConverter() + new Microsoft.Rest.Serialization.Iso8601TimeSpanConverter() } }; - SerializationSettings.Converters.Add(new TransformationJsonConverter()); - DeserializationSettings = new JsonSerializerSettings + SerializationSettings.Converters.Add(new Microsoft.Rest.Serialization.TransformationJsonConverter()); + DeserializationSettings = new Newtonsoft.Json.JsonSerializerSettings { DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, - ContractResolver = new ReadOnlyJsonContractResolver(), - Converters = new List + ContractResolver = new Microsoft.Rest.Serialization.ReadOnlyJsonContractResolver(), + Converters = new System.Collections.Generic.List { - new Iso8601TimeSpanConverter() + new Microsoft.Rest.Serialization.Iso8601TimeSpanConverter() } }; CustomInitialize(); - DeserializationSettings.Converters.Add(new TransformationJsonConverter()); - DeserializationSettings.Converters.Add(new CloudErrorJsonConverter()); + DeserializationSettings.Converters.Add(new Microsoft.Rest.Serialization.TransformationJsonConverter()); + DeserializationSettings.Converters.Add(new Microsoft.Rest.Azure.CloudErrorJsonConverter()); } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Sdk/Generated/TemplateSpecsOperations.cs b/src/Resources/Resources.Management.Sdk/Generated/TemplateSpecsOperations.cs similarity index 57% rename from src/Resources/Resources.Sdk/Generated/TemplateSpecsOperations.cs rename to src/Resources/Resources.Management.Sdk/Generated/TemplateSpecsOperations.cs index 93f6fc72cbd5..253beeb17d92 100644 --- a/src/Resources/Resources.Sdk/Generated/TemplateSpecsOperations.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/TemplateSpecsOperations.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; /// /// TemplateSpecsOperations operations. /// - internal partial class TemplateSpecsOperations : IServiceOperations, ITemplateSpecsOperations + internal partial class TemplateSpecsOperations : Microsoft.Rest.IServiceOperations, ITemplateSpecsOperations { /// /// Initializes a new instance of the TemplateSpecsOperations class. @@ -36,13 +24,13 @@ internal partial class TemplateSpecsOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal TemplateSpecsOperations(TemplateSpecsClient client) + internal TemplateSpecsOperations (TemplateSpecsClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -68,13 +56,13 @@ internal TemplateSpecsOperations(TemplateSpecsClient 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,110 +71,119 @@ internal TemplateSpecsOperations(TemplateSpecsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string templateSpecName, TemplateSpec templateSpec, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string templateSpecName, TemplateSpec templateSpec, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (templateSpec == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "templateSpec"); + } + if (templateSpec != null) + { + templateSpec.Validate(); + } + 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"); } + 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 (templateSpecName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "templateSpecName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "templateSpecName"); } if (templateSpecName != null) { if (templateSpecName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "templateSpecName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "templateSpecName", 90); } if (templateSpecName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "templateSpecName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "templateSpecName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(templateSpecName, "^[-\\w\\._\\(\\)]+$")) { - throw new ValidationException(ValidationRules.Pattern, "templateSpecName", "^[-\\w\\._\\(\\)]+$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "templateSpecName", "^[-\\w\\._\\(\\)]+$"); } } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (templateSpec == null) + if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "templateSpec"); - } - if (templateSpec != null) - { - templateSpec.Validate(); + 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("resourceGroupName", resourceGroupName); tracingParameters.Add("templateSpecName", templateSpecName); + tracingParameters.Add("templateSpec", templateSpec); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", 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}/providers/Microsoft.Resources/templateSpecs/{templateSpecName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{templateSpecName}", System.Uri.EscapeDataString(templateSpecName)); - 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("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _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) @@ -198,56 +195,57 @@ internal TemplateSpecsOperations(TemplateSpecsClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(templateSpec != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(templateSpec, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(templateSpec, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + 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 && (int)_statusCode != 201) { var ex = new TemplateSpecsErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - TemplateSpecsError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + TemplateSpecsError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -257,9 +255,10 @@ internal TemplateSpecsOperations(TemplateSpecsClient 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(); @@ -270,16 +269,16 @@ internal TemplateSpecsOperations(TemplateSpecsClient 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); } } // Deserialize Response @@ -288,25 +287,29 @@ internal TemplateSpecsOperations(TemplateSpecsClient 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; - } + + + + + } /// /// Updates Template Spec tags with specified values. /// @@ -325,13 +328,13 @@ internal TemplateSpecsOperations(TemplateSpecsClient 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 /// /// @@ -340,102 +343,111 @@ internal TemplateSpecsOperations(TemplateSpecsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string templateSpecName, TemplateSpecUpdateModel templateSpec = default(TemplateSpecUpdateModel), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string templateSpecName, TemplateSpecUpdateModel templateSpec = default(TemplateSpecUpdateModel), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - 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"); } + 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 (templateSpecName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "templateSpecName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "templateSpecName"); } if (templateSpecName != null) { if (templateSpecName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "templateSpecName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "templateSpecName", 90); } if (templateSpecName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "templateSpecName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "templateSpecName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(templateSpecName, "^[-\\w\\._\\(\\)]+$")) { - throw new ValidationException(ValidationRules.Pattern, "templateSpecName", "^[-\\w\\._\\(\\)]+$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "templateSpecName", "^[-\\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("resourceGroupName", resourceGroupName); tracingParameters.Add("templateSpecName", templateSpecName); + tracingParameters.Add("templateSpec", templateSpec); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Update", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Update", 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}/providers/Microsoft.Resources/templateSpecs/{templateSpecName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{templateSpecName}", System.Uri.EscapeDataString(templateSpecName)); - 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("PATCH"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); _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) @@ -447,56 +459,57 @@ internal TemplateSpecsOperations(TemplateSpecsClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(templateSpec != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(templateSpec, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(templateSpec, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + 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 TemplateSpecsErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - TemplateSpecsError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + TemplateSpecsError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -506,9 +519,10 @@ internal TemplateSpecsOperations(TemplateSpecsClient 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(); @@ -519,25 +533,29 @@ internal TemplateSpecsOperations(TemplateSpecsClient 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 Template Spec with a given name. /// @@ -549,7 +567,7 @@ internal TemplateSpecsOperations(TemplateSpecsClient client) /// /// /// Allows for expansion of additional Template Spec details in the response. - /// Optional. Possible values include: 'versions' + /// Optional. /// /// /// Headers that will be added to request. @@ -557,13 +575,13 @@ internal TemplateSpecsOperations(TemplateSpecsClient 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 /// /// @@ -572,106 +590,116 @@ internal TemplateSpecsOperations(TemplateSpecsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string templateSpecName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string templateSpecName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - 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"); } + 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 (templateSpecName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "templateSpecName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "templateSpecName"); } if (templateSpecName != null) { if (templateSpecName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "templateSpecName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "templateSpecName", 90); } if (templateSpecName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "templateSpecName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "templateSpecName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(templateSpecName, "^[-\\w\\._\\(\\)]+$")) { - throw new ValidationException(ValidationRules.Pattern, "templateSpecName", "^[-\\w\\._\\(\\)]+$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "templateSpecName", "^[-\\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("resourceGroupName", resourceGroupName); tracingParameters.Add("templateSpecName", templateSpecName); tracingParameters.Add("expand", expand); + + 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}/providers/Microsoft.Resources/templateSpecs/{templateSpecName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{templateSpecName}", System.Uri.EscapeDataString(templateSpecName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (expand != null) { _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand))); } - 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) @@ -683,50 +711,51 @@ internal TemplateSpecsOperations(TemplateSpecsClient 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 TemplateSpecsErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - TemplateSpecsError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + TemplateSpecsError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -736,9 +765,10 @@ internal TemplateSpecsOperations(TemplateSpecsClient 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(); @@ -749,25 +779,29 @@ internal TemplateSpecsOperations(TemplateSpecsClient 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; - } + + + + + } /// /// Deletes a Template Spec by name. When operation completes, status code 200 /// returned without content. @@ -784,10 +818,10 @@ internal TemplateSpecsOperations(TemplateSpecsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -796,101 +830,110 @@ internal TemplateSpecsOperations(TemplateSpecsClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string templateSpecName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string templateSpecName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - 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"); } + 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 (templateSpecName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "templateSpecName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "templateSpecName"); } if (templateSpecName != null) { if (templateSpecName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "templateSpecName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "templateSpecName", 90); } if (templateSpecName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "templateSpecName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "templateSpecName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(templateSpecName, "^[-\\w\\._\\(\\)]+$")) { - throw new ValidationException(ValidationRules.Pattern, "templateSpecName", "^[-\\w\\._\\(\\)]+$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "templateSpecName", "^[-\\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("resourceGroupName", resourceGroupName); tracingParameters.Add("templateSpecName", templateSpecName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Delete", 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}/providers/Microsoft.Resources/templateSpecs/{templateSpecName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{templateSpecName}", System.Uri.EscapeDataString(templateSpecName)); - 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("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _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) @@ -902,50 +945,51 @@ internal TemplateSpecsOperations(TemplateSpecsClient 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 && (int)_statusCode != 204) { var ex = new TemplateSpecsErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - TemplateSpecsError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + TemplateSpecsError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -955,26 +999,31 @@ internal TemplateSpecsOperations(TemplateSpecsClient 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(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Lists all the Template Specs within the specified subscriptions. /// /// /// Allows for expansion of additional Template Spec details in the response. - /// Optional. Possible values include: 'versions' + /// Optional. /// /// /// Headers that will be added to request. @@ -982,13 +1031,13 @@ internal TemplateSpecsOperations(TemplateSpecsClient 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 /// /// @@ -997,64 +1046,74 @@ internal TemplateSpecsOperations(TemplateSpecsClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListBySubscriptionWithHttpMessagesAsync(string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListBySubscriptionWithHttpMessagesAsync(string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - 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"); } - 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("expand", expand); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListBySubscription", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListBySubscription", 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/templateSpecs/").ToString(); - _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 (expand != null) { _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand))); } - 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) @@ -1066,50 +1125,51 @@ internal TemplateSpecsOperations(TemplateSpecsClient 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 TemplateSpecsErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - TemplateSpecsError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + TemplateSpecsError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1119,9 +1179,10 @@ internal TemplateSpecsOperations(TemplateSpecsClient 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(); @@ -1132,25 +1193,29 @@ internal TemplateSpecsOperations(TemplateSpecsClient 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; - } + + + + + } /// /// Lists all the Template Specs within the specified resource group. /// @@ -1159,7 +1224,7 @@ internal TemplateSpecsOperations(TemplateSpecsClient client) /// /// /// Allows for expansion of additional Template Spec details in the response. - /// Optional. Possible values include: 'versions' + /// Optional. /// /// /// Headers that will be added to request. @@ -1167,13 +1232,13 @@ internal TemplateSpecsOperations(TemplateSpecsClient 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 /// /// @@ -1182,85 +1247,95 @@ internal TemplateSpecsOperations(TemplateSpecsClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - 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"); } + 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 (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("resourceGroupName", resourceGroupName); tracingParameters.Add("expand", expand); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", 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}/providers/Microsoft.Resources/templateSpecs/").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (expand != null) { _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand))); } - 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) @@ -1272,50 +1347,51 @@ internal TemplateSpecsOperations(TemplateSpecsClient 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 TemplateSpecsErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - TemplateSpecsError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + TemplateSpecsError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1325,9 +1401,10 @@ internal TemplateSpecsOperations(TemplateSpecsClient 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(); @@ -1338,25 +1415,29 @@ internal TemplateSpecsOperations(TemplateSpecsClient 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; - } + + + + + } /// /// Lists all the Template Specs within the specified subscriptions. /// @@ -1369,13 +1450,13 @@ internal TemplateSpecsOperations(TemplateSpecsClient 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 /// /// @@ -1384,51 +1465,54 @@ internal TemplateSpecsOperations(TemplateSpecsClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListBySubscriptionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListBySubscriptionNextWithHttpMessagesAsync(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, "ListBySubscriptionNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListBySubscriptionNext", 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) @@ -1440,50 +1524,51 @@ internal TemplateSpecsOperations(TemplateSpecsClient 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 TemplateSpecsErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - TemplateSpecsError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + TemplateSpecsError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1493,9 +1578,10 @@ internal TemplateSpecsOperations(TemplateSpecsClient 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(); @@ -1506,25 +1592,29 @@ internal TemplateSpecsOperations(TemplateSpecsClient 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; - } + + + + + } /// /// Lists all the Template Specs within the specified resource group. /// @@ -1537,13 +1627,13 @@ internal TemplateSpecsOperations(TemplateSpecsClient 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 /// /// @@ -1552,51 +1642,54 @@ internal TemplateSpecsOperations(TemplateSpecsClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByResourceGroupNextWithHttpMessagesAsync(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, "ListByResourceGroupNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", 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) @@ -1608,50 +1701,51 @@ internal TemplateSpecsOperations(TemplateSpecsClient 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 TemplateSpecsErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - TemplateSpecsError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + TemplateSpecsError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { 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 (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1661,9 +1755,10 @@ internal TemplateSpecsOperations(TemplateSpecsClient 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(); @@ -1674,24 +1769,28 @@ internal TemplateSpecsOperations(TemplateSpecsClient 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; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Management.Sdk/Generated/TemplateSpecsOperationsExtensions.cs b/src/Resources/Resources.Management.Sdk/Generated/TemplateSpecsOperationsExtensions.cs new file mode 100644 index 000000000000..f1a0e169e0cc --- /dev/null +++ b/src/Resources/Resources.Management.Sdk/Generated/TemplateSpecsOperationsExtensions.cs @@ -0,0 +1,321 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.Management.Resources +{ + using Microsoft.Rest.Azure; + using Models; + + /// + /// Extension methods for TemplateSpecsOperations + /// + public static partial class TemplateSpecsOperationsExtensions + { + /// + /// Creates or updates a Template Spec. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the Template Spec. + /// + public static TemplateSpec CreateOrUpdate(this ITemplateSpecsOperations operations, string resourceGroupName, string templateSpecName, TemplateSpec templateSpec) + { + return ((ITemplateSpecsOperations)operations).CreateOrUpdateAsync(resourceGroupName, templateSpecName, templateSpec).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates a Template Spec. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the Template Spec. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this ITemplateSpecsOperations operations, string resourceGroupName, string templateSpecName, TemplateSpec templateSpec, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, templateSpecName, templateSpec, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Updates Template Spec tags with specified values. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the Template Spec. + /// + public static TemplateSpec Update(this ITemplateSpecsOperations operations, string resourceGroupName, string templateSpecName, TemplateSpecUpdateModel templateSpec = default(TemplateSpecUpdateModel)) + { + return ((ITemplateSpecsOperations)operations).UpdateAsync(resourceGroupName, templateSpecName, templateSpec).GetAwaiter().GetResult(); + } + + /// + /// Updates Template Spec tags with specified values. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the Template Spec. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UpdateAsync(this ITemplateSpecsOperations operations, string resourceGroupName, string templateSpecName, TemplateSpecUpdateModel templateSpec = default(TemplateSpecUpdateModel), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, templateSpecName, templateSpec, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets a Template Spec with a given name. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the Template Spec. + /// + /// + /// Allows for expansion of additional Template Spec details in the response. + /// Optional. + /// + public static TemplateSpec Get(this ITemplateSpecsOperations operations, string resourceGroupName, string templateSpecName, string expand = default(string)) + { + return ((ITemplateSpecsOperations)operations).GetAsync(resourceGroupName, templateSpecName, expand).GetAwaiter().GetResult(); + } + + /// + /// Gets a Template Spec with a given name. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the Template Spec. + /// + /// + /// Allows for expansion of additional Template Spec details in the response. + /// Optional. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this ITemplateSpecsOperations operations, string resourceGroupName, string templateSpecName, string expand = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, templateSpecName, expand, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Deletes a Template Spec by name. When operation completes, status code 200 + /// returned without content. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the Template Spec. + /// + public static void Delete(this ITemplateSpecsOperations operations, string resourceGroupName, string templateSpecName) + { + ((ITemplateSpecsOperations)operations).DeleteAsync(resourceGroupName, templateSpecName).GetAwaiter().GetResult(); + } + + /// + /// Deletes a Template Spec by name. When operation completes, status code 200 + /// returned without content. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the Template Spec. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this ITemplateSpecsOperations operations, string resourceGroupName, string templateSpecName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, templateSpecName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Lists all the Template Specs within the specified subscriptions. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Allows for expansion of additional Template Spec details in the response. + /// Optional. + /// + public static Microsoft.Rest.Azure.IPage ListBySubscription(this ITemplateSpecsOperations operations, string expand = default(string)) + { + return ((ITemplateSpecsOperations)operations).ListBySubscriptionAsync(expand).GetAwaiter().GetResult(); + } + + /// + /// Lists all the Template Specs within the specified subscriptions. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Allows for expansion of additional Template Spec details in the response. + /// Optional. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListBySubscriptionAsync(this ITemplateSpecsOperations operations, string expand = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListBySubscriptionWithHttpMessagesAsync(expand, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Lists all the Template Specs within the specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Allows for expansion of additional Template Spec details in the response. + /// Optional. + /// + public static Microsoft.Rest.Azure.IPage ListByResourceGroup(this ITemplateSpecsOperations operations, string resourceGroupName, string expand = default(string)) + { + return ((ITemplateSpecsOperations)operations).ListByResourceGroupAsync(resourceGroupName, expand).GetAwaiter().GetResult(); + } + + /// + /// Lists all the Template Specs within the specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Allows for expansion of additional Template Spec details in the response. + /// Optional. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByResourceGroupAsync(this ITemplateSpecsOperations operations, string resourceGroupName, string expand = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, expand, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Lists all the Template Specs within the specified subscriptions. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListBySubscriptionNext(this ITemplateSpecsOperations operations, string nextPageLink) + { + return ((ITemplateSpecsOperations)operations).ListBySubscriptionNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists all the Template Specs within the specified subscriptions. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListBySubscriptionNextAsync(this ITemplateSpecsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListBySubscriptionNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Lists all the Template Specs within the specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListByResourceGroupNext(this ITemplateSpecsOperations operations, string nextPageLink) + { + return ((ITemplateSpecsOperations)operations).ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists all the Template Specs within the specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByResourceGroupNextAsync(this ITemplateSpecsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + } +} diff --git a/src/Resources/Resources.Sdk/Generated/TenantsOperations.cs b/src/Resources/Resources.Management.Sdk/Generated/TenantsOperations.cs similarity index 58% rename from src/Resources/Resources.Sdk/Generated/TenantsOperations.cs rename to src/Resources/Resources.Management.Sdk/Generated/TenantsOperations.cs index ca317edb0fe9..15b3851a8bed 100644 --- a/src/Resources/Resources.Sdk/Generated/TenantsOperations.cs +++ b/src/Resources/Resources.Management.Sdk/Generated/TenantsOperations.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; /// /// TenantsOperations operations. /// - internal partial class TenantsOperations : IServiceOperations, ITenantsOperations + internal partial class TenantsOperations : Microsoft.Rest.IServiceOperations, ITenantsOperations { /// /// Initializes a new instance of the TenantsOperations class. @@ -36,13 +24,13 @@ internal partial class TenantsOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal TenantsOperations(SubscriptionClient client) + internal TenantsOperations (SubscriptionClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -59,13 +47,13 @@ internal TenantsOperations(SubscriptionClient 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 /// /// @@ -74,54 +62,62 @@ internal TenantsOperations(SubscriptionClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - 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("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("/") ? "" : "/")), "tenants").ToString(); - 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) @@ -133,55 +129,56 @@ internal TenantsOperations(SubscriptionClient 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) @@ -191,9 +188,10 @@ internal TenantsOperations(SubscriptionClient 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(); @@ -204,25 +202,29 @@ internal TenantsOperations(SubscriptionClient 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 the tenants for your account. /// @@ -235,13 +237,13 @@ internal TenantsOperations(SubscriptionClient 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 /// /// @@ -250,51 +252,54 @@ internal TenantsOperations(SubscriptionClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(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, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", 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) @@ -306,55 +311,56 @@ internal TenantsOperations(SubscriptionClient 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) @@ -364,9 +370,10 @@ internal TenantsOperations(SubscriptionClient 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(); @@ -377,24 +384,28 @@ internal TenantsOperations(SubscriptionClient 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; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Resources/Resources.Management.Sdk/Generated/TenantsOperationsExtensions.cs b/src/Resources/Resources.Management.Sdk/Generated/TenantsOperationsExtensions.cs new file mode 100644 index 000000000000..6630a827cda4 --- /dev/null +++ b/src/Resources/Resources.Management.Sdk/Generated/TenantsOperationsExtensions.cs @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.Management.Resources +{ + using Microsoft.Rest.Azure; + using Models; + + /// + /// Extension methods for TenantsOperations + /// + public static partial class TenantsOperationsExtensions + { + /// + /// Gets the tenants for your account. + /// + /// + /// The operations group for this extension method. + /// + public static Microsoft.Rest.Azure.IPage List(this ITenantsOperations operations) + { + return ((ITenantsOperations)operations).ListAsync().GetAwaiter().GetResult(); + } + + /// + /// Gets the tenants for your account. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this ITenantsOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets the tenants for your account. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this ITenantsOperations operations, string nextPageLink) + { + return ((ITenantsOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets the tenants for your account. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this ITenantsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + } +} diff --git a/src/Resources/Resources.Sdk/Properties/AssemblyInfo.cs b/src/Resources/Resources.Management.Sdk/Properties/AssemblyInfo.cs similarity index 100% rename from src/Resources/Resources.Sdk/Properties/AssemblyInfo.cs rename to src/Resources/Resources.Management.Sdk/Properties/AssemblyInfo.cs diff --git a/src/Resources/Resources.Sdk/Readme.md b/src/Resources/Resources.Management.Sdk/Readme.md similarity index 85% rename from src/Resources/Resources.Sdk/Readme.md rename to src/Resources/Resources.Management.Sdk/Readme.md index 06f173fb559c..a82081fdcd83 100644 --- a/src/Resources/Resources.Sdk/Readme.md +++ b/src/Resources/Resources.Management.Sdk/Readme.md @@ -6,13 +6,13 @@ In this directory, run AutoRest: ``` rm -r Generated/* autorest --reset -autorest.cmd README.md --tag=package-privatelinks-2020-05 --version=v2 -autorest.cmd README.md --tag=package-subscriptions-2021-01 --version=v2 -autorest.cmd README.md --tag=package-features-2021-07 --version=v2 -autorest.cmd README.md --tag=package-deploymentscripts-2020-10 --version=v2 -autorest.cmd README.md --tag=package-resources-2021-04 --version=v2 -autorest.cmd README.md --tag=package-deploymentstacks-2022-08-preview --version=v2 -autorest.cmd README.md --tag=package-templatespecs-2021-05 --version=v2 +autorest --use:@autorest/powershell@4.x --tag=package-privatelinks-2020-05 +autorest --use:@autorest/powershell@4.x --tag=package-subscriptions-2021-01 +autorest --use:@autorest/powershell@4.x --tag=package-features-2021-07 +autorest --use:@autorest/powershell@4.x --tag=package-deploymentscripts-2020-10 +autorest --use:@autorest/powershell@4.x --tag=package-resources-2021-04 +autorest --use:@autorest/powershell@4.x --tag=package-deploymentstacks-2022-08-preview +autorest --use:@autorest/powershell@4.x --tag=package-templatespecs-2021-05 ``` ### AutoRest Configuration @@ -20,7 +20,8 @@ autorest.cmd README.md --tag=package-templatespecs-2021-05 --version=v2 ``` yaml output-folder: Generated namespace: Microsoft.Azure.Management.Resources -csharp: true +isSdkGenerator: true +powershell: true clear-output-folder: false reflect-api-versions: true azure-arm: true diff --git a/src/Resources/Resources.Sdk/Resources.Sdk.csproj b/src/Resources/Resources.Management.Sdk/Resources.Management.Sdk.csproj similarity index 100% rename from src/Resources/Resources.Sdk/Resources.Sdk.csproj rename to src/Resources/Resources.Management.Sdk/Resources.Management.Sdk.csproj diff --git a/src/Resources/Resources.Sdk/Utility/SafeJsonConvertWrapper.cs b/src/Resources/Resources.Management.Sdk/Utility/SafeJsonConvertWrapper.cs similarity index 100% rename from src/Resources/Resources.Sdk/Utility/SafeJsonConvertWrapper.cs rename to src/Resources/Resources.Management.Sdk/Utility/SafeJsonConvertWrapper.cs diff --git a/src/Resources/Resources.Sdk/generate.ps1 b/src/Resources/Resources.Management.Sdk/generate.ps1 similarity index 100% rename from src/Resources/Resources.Sdk/generate.ps1 rename to src/Resources/Resources.Management.Sdk/generate.ps1 diff --git a/src/Resources/Resources.Sdk/Generated/DeploymentOperationsExtensions.cs b/src/Resources/Resources.Sdk/Generated/DeploymentOperationsExtensions.cs deleted file mode 100644 index bddbc0e873c0..000000000000 --- a/src/Resources/Resources.Sdk/Generated/DeploymentOperationsExtensions.cs +++ /dev/null @@ -1,631 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Resources -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Threading; - using System.Threading.Tasks; - - /// - /// Extension methods for DeploymentOperations. - /// - public static partial class DeploymentOperationsExtensions - { - /// - /// Gets a deployments operation. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource scope. - /// - /// - /// The name of the deployment. - /// - /// - /// The ID of the operation to get. - /// - public static DeploymentOperation GetAtScope(this IDeploymentOperations operations, string scope, string deploymentName, string operationId) - { - return operations.GetAtScopeAsync(scope, deploymentName, operationId).GetAwaiter().GetResult(); - } - - /// - /// Gets a deployments operation. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource scope. - /// - /// - /// The name of the deployment. - /// - /// - /// The ID of the operation to get. - /// - /// - /// The cancellation token. - /// - public static async Task GetAtScopeAsync(this IDeploymentOperations operations, string scope, string deploymentName, string operationId, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetAtScopeWithHttpMessagesAsync(scope, deploymentName, operationId, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets all deployments operations for a deployment. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource scope. - /// - /// - /// The name of the deployment. - /// - /// - /// The number of results to return. - /// - public static IPage ListAtScope(this IDeploymentOperations operations, string scope, string deploymentName, int? top = default(int?)) - { - return operations.ListAtScopeAsync(scope, deploymentName, top).GetAwaiter().GetResult(); - } - - /// - /// Gets all deployments operations for a deployment. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource scope. - /// - /// - /// The name of the deployment. - /// - /// - /// The number of results to return. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAtScopeAsync(this IDeploymentOperations operations, string scope, string deploymentName, int? top = default(int?), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListAtScopeWithHttpMessagesAsync(scope, deploymentName, top, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets a deployments operation. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the deployment. - /// - /// - /// The ID of the operation to get. - /// - public static DeploymentOperation GetAtTenantScope(this IDeploymentOperations operations, string deploymentName, string operationId) - { - return operations.GetAtTenantScopeAsync(deploymentName, operationId).GetAwaiter().GetResult(); - } - - /// - /// Gets a deployments operation. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the deployment. - /// - /// - /// The ID of the operation to get. - /// - /// - /// The cancellation token. - /// - public static async Task GetAtTenantScopeAsync(this IDeploymentOperations operations, string deploymentName, string operationId, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetAtTenantScopeWithHttpMessagesAsync(deploymentName, operationId, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets all deployments operations for a deployment. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the deployment. - /// - /// - /// The number of results to return. - /// - public static IPage ListAtTenantScope(this IDeploymentOperations operations, string deploymentName, int? top = default(int?)) - { - return operations.ListAtTenantScopeAsync(deploymentName, top).GetAwaiter().GetResult(); - } - - /// - /// Gets all deployments operations for a deployment. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the deployment. - /// - /// - /// The number of results to return. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAtTenantScopeAsync(this IDeploymentOperations operations, string deploymentName, int? top = default(int?), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListAtTenantScopeWithHttpMessagesAsync(deploymentName, top, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets a deployments operation. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The management group ID. - /// - /// - /// The name of the deployment. - /// - /// - /// The ID of the operation to get. - /// - public static DeploymentOperation GetAtManagementGroupScope(this IDeploymentOperations operations, string groupId, string deploymentName, string operationId) - { - return operations.GetAtManagementGroupScopeAsync(groupId, deploymentName, operationId).GetAwaiter().GetResult(); - } - - /// - /// Gets a deployments operation. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The management group ID. - /// - /// - /// The name of the deployment. - /// - /// - /// The ID of the operation to get. - /// - /// - /// The cancellation token. - /// - public static async Task GetAtManagementGroupScopeAsync(this IDeploymentOperations operations, string groupId, string deploymentName, string operationId, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetAtManagementGroupScopeWithHttpMessagesAsync(groupId, deploymentName, operationId, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets all deployments operations for a deployment. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The management group ID. - /// - /// - /// The name of the deployment. - /// - /// - /// The number of results to return. - /// - public static IPage ListAtManagementGroupScope(this IDeploymentOperations operations, string groupId, string deploymentName, int? top = default(int?)) - { - return operations.ListAtManagementGroupScopeAsync(groupId, deploymentName, top).GetAwaiter().GetResult(); - } - - /// - /// Gets all deployments operations for a deployment. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The management group ID. - /// - /// - /// The name of the deployment. - /// - /// - /// The number of results to return. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAtManagementGroupScopeAsync(this IDeploymentOperations operations, string groupId, string deploymentName, int? top = default(int?), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListAtManagementGroupScopeWithHttpMessagesAsync(groupId, deploymentName, top, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets a deployments operation. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the deployment. - /// - /// - /// The ID of the operation to get. - /// - public static DeploymentOperation GetAtSubscriptionScope(this IDeploymentOperations operations, string deploymentName, string operationId) - { - return operations.GetAtSubscriptionScopeAsync(deploymentName, operationId).GetAwaiter().GetResult(); - } - - /// - /// Gets a deployments operation. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the deployment. - /// - /// - /// The ID of the operation to get. - /// - /// - /// The cancellation token. - /// - public static async Task GetAtSubscriptionScopeAsync(this IDeploymentOperations operations, string deploymentName, string operationId, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetAtSubscriptionScopeWithHttpMessagesAsync(deploymentName, operationId, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets all deployments operations for a deployment. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the deployment. - /// - /// - /// The number of results to return. - /// - public static IPage ListAtSubscriptionScope(this IDeploymentOperations operations, string deploymentName, int? top = default(int?)) - { - return operations.ListAtSubscriptionScopeAsync(deploymentName, top).GetAwaiter().GetResult(); - } - - /// - /// Gets all deployments operations for a deployment. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the deployment. - /// - /// - /// The number of results to return. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAtSubscriptionScopeAsync(this IDeploymentOperations operations, string deploymentName, int? top = default(int?), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListAtSubscriptionScopeWithHttpMessagesAsync(deploymentName, top, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets a deployments operation. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the deployment. - /// - /// - /// The ID of the operation to get. - /// - public static DeploymentOperation Get(this IDeploymentOperations operations, string resourceGroupName, string deploymentName, string operationId) - { - return operations.GetAsync(resourceGroupName, deploymentName, operationId).GetAwaiter().GetResult(); - } - - /// - /// Gets a deployments operation. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the deployment. - /// - /// - /// The ID of the operation to get. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IDeploymentOperations operations, string resourceGroupName, string deploymentName, string operationId, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, deploymentName, operationId, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets all deployments operations for a deployment. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the deployment. - /// - /// - /// The number of results to return. - /// - public static IPage List(this IDeploymentOperations operations, string resourceGroupName, string deploymentName, int? top = default(int?)) - { - return operations.ListAsync(resourceGroupName, deploymentName, top).GetAwaiter().GetResult(); - } - - /// - /// Gets all deployments operations for a deployment. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the deployment. - /// - /// - /// The number of results to return. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IDeploymentOperations operations, string resourceGroupName, string deploymentName, int? top = default(int?), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, deploymentName, top, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets all deployments operations for a deployment. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListAtScopeNext(this IDeploymentOperations operations, string nextPageLink) - { - return operations.ListAtScopeNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets all deployments operations for a deployment. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAtScopeNextAsync(this IDeploymentOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListAtScopeNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets all deployments operations for a deployment. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListAtTenantScopeNext(this IDeploymentOperations operations, string nextPageLink) - { - return operations.ListAtTenantScopeNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets all deployments operations for a deployment. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAtTenantScopeNextAsync(this IDeploymentOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListAtTenantScopeNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets all deployments operations for a deployment. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListAtManagementGroupScopeNext(this IDeploymentOperations operations, string nextPageLink) - { - return operations.ListAtManagementGroupScopeNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets all deployments operations for a deployment. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAtManagementGroupScopeNextAsync(this IDeploymentOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListAtManagementGroupScopeNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets all deployments operations for a deployment. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListAtSubscriptionScopeNext(this IDeploymentOperations operations, string nextPageLink) - { - return operations.ListAtSubscriptionScopeNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets all deployments operations for a deployment. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAtSubscriptionScopeNextAsync(this IDeploymentOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListAtSubscriptionScopeNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets all deployments operations for a deployment. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IDeploymentOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets all deployments operations for a deployment. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this IDeploymentOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - } -} diff --git a/src/Resources/Resources.Sdk/Generated/DeploymentScriptsOperationsExtensions.cs b/src/Resources/Resources.Sdk/Generated/DeploymentScriptsOperationsExtensions.cs deleted file mode 100644 index cfe9637c9a39..000000000000 --- a/src/Resources/Resources.Sdk/Generated/DeploymentScriptsOperationsExtensions.cs +++ /dev/null @@ -1,462 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Resources -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Threading; - using System.Threading.Tasks; - - /// - /// Extension methods for DeploymentScriptsOperations. - /// - public static partial class DeploymentScriptsOperationsExtensions - { - /// - /// Creates a deployment script. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Name of the deployment script. - /// - /// - /// Deployment script supplied to the operation. - /// - public static DeploymentScript Create(this IDeploymentScriptsOperations operations, string resourceGroupName, string scriptName, DeploymentScript deploymentScript) - { - return operations.CreateAsync(resourceGroupName, scriptName, deploymentScript).GetAwaiter().GetResult(); - } - - /// - /// Creates a deployment script. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Name of the deployment script. - /// - /// - /// Deployment script supplied to the operation. - /// - /// - /// The cancellation token. - /// - public static async Task CreateAsync(this IDeploymentScriptsOperations operations, string resourceGroupName, string scriptName, DeploymentScript deploymentScript, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateWithHttpMessagesAsync(resourceGroupName, scriptName, deploymentScript, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Updates deployment script tags with specified values. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Name of the deployment script. - /// - /// - /// Deployment script resource with the tags to be updated. - /// - public static DeploymentScript Update(this IDeploymentScriptsOperations operations, string resourceGroupName, string scriptName, DeploymentScriptUpdateParameter deploymentScript = default(DeploymentScriptUpdateParameter)) - { - return operations.UpdateAsync(resourceGroupName, scriptName, deploymentScript).GetAwaiter().GetResult(); - } - - /// - /// Updates deployment script tags with specified values. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Name of the deployment script. - /// - /// - /// Deployment script resource with the tags to be updated. - /// - /// - /// The cancellation token. - /// - public static async Task UpdateAsync(this IDeploymentScriptsOperations operations, string resourceGroupName, string scriptName, DeploymentScriptUpdateParameter deploymentScript = default(DeploymentScriptUpdateParameter), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, scriptName, deploymentScript, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets a deployment script with a given name. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Name of the deployment script. - /// - public static DeploymentScript Get(this IDeploymentScriptsOperations operations, string resourceGroupName, string scriptName) - { - return operations.GetAsync(resourceGroupName, scriptName).GetAwaiter().GetResult(); - } - - /// - /// Gets a deployment script with a given name. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Name of the deployment script. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IDeploymentScriptsOperations operations, string resourceGroupName, string scriptName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, scriptName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes a deployment script. When operation completes, status code 200 - /// returned without content. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Name of the deployment script. - /// - public static void Delete(this IDeploymentScriptsOperations operations, string resourceGroupName, string scriptName) - { - operations.DeleteAsync(resourceGroupName, scriptName).GetAwaiter().GetResult(); - } - - /// - /// Deletes a deployment script. When operation completes, status code 200 - /// returned without content. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Name of the deployment script. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IDeploymentScriptsOperations operations, string resourceGroupName, string scriptName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, scriptName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Lists all deployment scripts for a given subscription. - /// - /// - /// The operations group for this extension method. - /// - public static IPage ListBySubscription(this IDeploymentScriptsOperations operations) - { - return operations.ListBySubscriptionAsync().GetAwaiter().GetResult(); - } - - /// - /// Lists all deployment scripts for a given subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The cancellation token. - /// - public static async Task> ListBySubscriptionAsync(this IDeploymentScriptsOperations operations, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListBySubscriptionWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets deployment script logs for a given deployment script name. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Name of the deployment script. - /// - public static ScriptLogsList GetLogs(this IDeploymentScriptsOperations operations, string resourceGroupName, string scriptName) - { - return operations.GetLogsAsync(resourceGroupName, scriptName).GetAwaiter().GetResult(); - } - - /// - /// Gets deployment script logs for a given deployment script name. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Name of the deployment script. - /// - /// - /// The cancellation token. - /// - public static async Task GetLogsAsync(this IDeploymentScriptsOperations operations, string resourceGroupName, string scriptName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetLogsWithHttpMessagesAsync(resourceGroupName, scriptName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets deployment script logs for a given deployment script name. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Name of the deployment script. - /// - /// - /// The number of lines to show from the tail of the deployment script log. - /// Valid value is a positive number up to 1000. If 'tail' is not provided, all - /// available logs are shown up to container instance log capacity of 4mb. - /// - public static ScriptLog GetLogsDefault(this IDeploymentScriptsOperations operations, string resourceGroupName, string scriptName, int? tail = default(int?)) - { - return operations.GetLogsDefaultAsync(resourceGroupName, scriptName, tail).GetAwaiter().GetResult(); - } - - /// - /// Gets deployment script logs for a given deployment script name. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Name of the deployment script. - /// - /// - /// The number of lines to show from the tail of the deployment script log. - /// Valid value is a positive number up to 1000. If 'tail' is not provided, all - /// available logs are shown up to container instance log capacity of 4mb. - /// - /// - /// The cancellation token. - /// - public static async Task GetLogsDefaultAsync(this IDeploymentScriptsOperations operations, string resourceGroupName, string scriptName, int? tail = default(int?), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetLogsDefaultWithHttpMessagesAsync(resourceGroupName, scriptName, tail, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Lists deployments scripts. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - public static IPage ListByResourceGroup(this IDeploymentScriptsOperations operations, string resourceGroupName) - { - return operations.ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); - } - - /// - /// Lists deployments scripts. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByResourceGroupAsync(this IDeploymentScriptsOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Creates a deployment script. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Name of the deployment script. - /// - /// - /// Deployment script supplied to the operation. - /// - public static DeploymentScript BeginCreate(this IDeploymentScriptsOperations operations, string resourceGroupName, string scriptName, DeploymentScript deploymentScript) - { - return operations.BeginCreateAsync(resourceGroupName, scriptName, deploymentScript).GetAwaiter().GetResult(); - } - - /// - /// Creates a deployment script. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Name of the deployment script. - /// - /// - /// Deployment script supplied to the operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateAsync(this IDeploymentScriptsOperations operations, string resourceGroupName, string scriptName, DeploymentScript deploymentScript, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginCreateWithHttpMessagesAsync(resourceGroupName, scriptName, deploymentScript, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Lists all deployment scripts for a given subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListBySubscriptionNext(this IDeploymentScriptsOperations operations, string nextPageLink) - { - return operations.ListBySubscriptionNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Lists all deployment scripts for a given subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListBySubscriptionNextAsync(this IDeploymentScriptsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListBySubscriptionNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Lists deployments scripts. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListByResourceGroupNext(this IDeploymentScriptsOperations operations, string nextPageLink) - { - return operations.ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Lists deployments scripts. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByResourceGroupNextAsync(this IDeploymentScriptsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - } -} diff --git a/src/Resources/Resources.Sdk/Generated/DeploymentStacksOperationsExtensions.cs b/src/Resources/Resources.Sdk/Generated/DeploymentStacksOperationsExtensions.cs deleted file mode 100644 index 39dc0af41be3..000000000000 --- a/src/Resources/Resources.Sdk/Generated/DeploymentStacksOperationsExtensions.cs +++ /dev/null @@ -1,1067 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Resources -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Threading; - using System.Threading.Tasks; - - /// - /// Extension methods for DeploymentStacksOperations. - /// - public static partial class DeploymentStacksOperationsExtensions - { - /// - /// Lists all the Deployment Stacks within the specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - public static IPage ListAtResourceGroup(this IDeploymentStacksOperations operations, string resourceGroupName) - { - return operations.ListAtResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); - } - - /// - /// Lists all the Deployment Stacks within the specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAtResourceGroupAsync(this IDeploymentStacksOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListAtResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Lists all the Deployment Stacks within the specified subscription. - /// - /// - /// The operations group for this extension method. - /// - public static IPage ListAtSubscription(this IDeploymentStacksOperations operations) - { - return operations.ListAtSubscriptionAsync().GetAwaiter().GetResult(); - } - - /// - /// Lists all the Deployment Stacks within the specified subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAtSubscriptionAsync(this IDeploymentStacksOperations operations, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListAtSubscriptionWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Lists all the Deployment Stacks within the specified management group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Management Group. - /// - public static IPage ListAtManagementGroup(this IDeploymentStacksOperations operations, string managementGroupId) - { - return operations.ListAtManagementGroupAsync(managementGroupId).GetAwaiter().GetResult(); - } - - /// - /// Lists all the Deployment Stacks within the specified management group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Management Group. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAtManagementGroupAsync(this IDeploymentStacksOperations operations, string managementGroupId, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListAtManagementGroupWithHttpMessagesAsync(managementGroupId, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Creates or updates a Deployment Stack. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Name of the deployment stack. - /// - /// - /// Deployment Stack supplied to the operation. - /// - public static DeploymentStack CreateOrUpdateAtResourceGroup(this IDeploymentStacksOperations operations, string resourceGroupName, string deploymentStackName, DeploymentStack deploymentStack) - { - return operations.CreateOrUpdateAtResourceGroupAsync(resourceGroupName, deploymentStackName, deploymentStack).GetAwaiter().GetResult(); - } - - /// - /// Creates or updates a Deployment Stack. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Name of the deployment stack. - /// - /// - /// Deployment Stack supplied to the operation. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAtResourceGroupAsync(this IDeploymentStacksOperations operations, string resourceGroupName, string deploymentStackName, DeploymentStack deploymentStack, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateAtResourceGroupWithHttpMessagesAsync(resourceGroupName, deploymentStackName, deploymentStack, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets a Deployment Stack with a given name. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Name of the deployment stack. - /// - public static DeploymentStack GetAtResourceGroup(this IDeploymentStacksOperations operations, string resourceGroupName, string deploymentStackName) - { - return operations.GetAtResourceGroupAsync(resourceGroupName, deploymentStackName).GetAwaiter().GetResult(); - } - - /// - /// Gets a Deployment Stack with a given name. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Name of the deployment stack. - /// - /// - /// The cancellation token. - /// - public static async Task GetAtResourceGroupAsync(this IDeploymentStacksOperations operations, string resourceGroupName, string deploymentStackName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetAtResourceGroupWithHttpMessagesAsync(resourceGroupName, deploymentStackName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes a Deployment Stack by name. When operation completes, status code - /// 200 returned without content. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Name of the deployment stack. - /// - /// - /// Flag to indicate delete rather than detach for the resources. Possible - /// values include: 'delete', 'detach' - /// - /// - /// Flag to indicate delete rather than detach for the resource groups. - /// Possible values include: 'delete', 'detach' - /// - public static DeploymentStacksDeleteAtResourceGroupHeaders DeleteAtResourceGroup(this IDeploymentStacksOperations operations, string resourceGroupName, string deploymentStackName, string unmanageActionResources = default(string), string unmanageActionResourceGroups = default(string)) - { - return operations.DeleteAtResourceGroupAsync(resourceGroupName, deploymentStackName, unmanageActionResources, unmanageActionResourceGroups).GetAwaiter().GetResult(); - } - - /// - /// Deletes a Deployment Stack by name. When operation completes, status code - /// 200 returned without content. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Name of the deployment stack. - /// - /// - /// Flag to indicate delete rather than detach for the resources. Possible - /// values include: 'delete', 'detach' - /// - /// - /// Flag to indicate delete rather than detach for the resource groups. - /// Possible values include: 'delete', 'detach' - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAtResourceGroupAsync(this IDeploymentStacksOperations operations, string resourceGroupName, string deploymentStackName, string unmanageActionResources = default(string), string unmanageActionResourceGroups = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.DeleteAtResourceGroupWithHttpMessagesAsync(resourceGroupName, deploymentStackName, unmanageActionResources, unmanageActionResourceGroups, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Headers; - } - } - - /// - /// Creates or updates a Deployment Stack. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the deployment stack. - /// - /// - /// Deployment Stack supplied to the operation. - /// - public static DeploymentStack CreateOrUpdateAtSubscription(this IDeploymentStacksOperations operations, string deploymentStackName, DeploymentStack deploymentStack) - { - return operations.CreateOrUpdateAtSubscriptionAsync(deploymentStackName, deploymentStack).GetAwaiter().GetResult(); - } - - /// - /// Creates or updates a Deployment Stack. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the deployment stack. - /// - /// - /// Deployment Stack supplied to the operation. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAtSubscriptionAsync(this IDeploymentStacksOperations operations, string deploymentStackName, DeploymentStack deploymentStack, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateAtSubscriptionWithHttpMessagesAsync(deploymentStackName, deploymentStack, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets a Deployment Stack with a given name. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the deployment stack. - /// - public static DeploymentStack GetAtSubscription(this IDeploymentStacksOperations operations, string deploymentStackName) - { - return operations.GetAtSubscriptionAsync(deploymentStackName).GetAwaiter().GetResult(); - } - - /// - /// Gets a Deployment Stack with a given name. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the deployment stack. - /// - /// - /// The cancellation token. - /// - public static async Task GetAtSubscriptionAsync(this IDeploymentStacksOperations operations, string deploymentStackName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetAtSubscriptionWithHttpMessagesAsync(deploymentStackName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes a Deployment Stack by name. When operation completes, status code - /// 200 returned without content. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the deployment stack. - /// - /// - /// Flag to indicate delete rather than detach for the resources. Possible - /// values include: 'delete', 'detach' - /// - /// - /// Flag to indicate delete rather than detach for the resource groups. - /// Possible values include: 'delete', 'detach' - /// - public static DeploymentStacksDeleteAtSubscriptionHeaders DeleteAtSubscription(this IDeploymentStacksOperations operations, string deploymentStackName, string unmanageActionResources = default(string), string unmanageActionResourceGroups = default(string)) - { - return operations.DeleteAtSubscriptionAsync(deploymentStackName, unmanageActionResources, unmanageActionResourceGroups).GetAwaiter().GetResult(); - } - - /// - /// Deletes a Deployment Stack by name. When operation completes, status code - /// 200 returned without content. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the deployment stack. - /// - /// - /// Flag to indicate delete rather than detach for the resources. Possible - /// values include: 'delete', 'detach' - /// - /// - /// Flag to indicate delete rather than detach for the resource groups. - /// Possible values include: 'delete', 'detach' - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAtSubscriptionAsync(this IDeploymentStacksOperations operations, string deploymentStackName, string unmanageActionResources = default(string), string unmanageActionResourceGroups = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.DeleteAtSubscriptionWithHttpMessagesAsync(deploymentStackName, unmanageActionResources, unmanageActionResourceGroups, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Headers; - } - } - - /// - /// Creates or updates a Deployment Stack. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Management Group. - /// - /// - /// Name of the deployment stack. - /// - /// - /// Deployment Stack supplied to the operation. - /// - public static DeploymentStack CreateOrUpdateAtManagementGroup(this IDeploymentStacksOperations operations, string managementGroupId, string deploymentStackName, DeploymentStack deploymentStack) - { - return operations.CreateOrUpdateAtManagementGroupAsync(managementGroupId, deploymentStackName, deploymentStack).GetAwaiter().GetResult(); - } - - /// - /// Creates or updates a Deployment Stack. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Management Group. - /// - /// - /// Name of the deployment stack. - /// - /// - /// Deployment Stack supplied to the operation. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAtManagementGroupAsync(this IDeploymentStacksOperations operations, string managementGroupId, string deploymentStackName, DeploymentStack deploymentStack, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateAtManagementGroupWithHttpMessagesAsync(managementGroupId, deploymentStackName, deploymentStack, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets a Deployment Stack with a given name. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Management Group. - /// - /// - /// Name of the deployment stack. - /// - public static DeploymentStack GetAtManagementGroup(this IDeploymentStacksOperations operations, string managementGroupId, string deploymentStackName) - { - return operations.GetAtManagementGroupAsync(managementGroupId, deploymentStackName).GetAwaiter().GetResult(); - } - - /// - /// Gets a Deployment Stack with a given name. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Management Group. - /// - /// - /// Name of the deployment stack. - /// - /// - /// The cancellation token. - /// - public static async Task GetAtManagementGroupAsync(this IDeploymentStacksOperations operations, string managementGroupId, string deploymentStackName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetAtManagementGroupWithHttpMessagesAsync(managementGroupId, deploymentStackName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes a Deployment Stack by name. When operation completes, status code - /// 200 returned without content. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Management Group. - /// - /// - /// Name of the deployment stack. - /// - /// - /// Flag to indicate delete rather than detach for the resources. Possible - /// values include: 'delete', 'detach' - /// - /// - /// Flag to indicate delete rather than detach for the resource groups. - /// Possible values include: 'delete', 'detach' - /// - /// - /// Flag to indicate delete rather than detach for the management groups. - /// Possible values include: 'delete', 'detach' - /// - public static DeploymentStacksDeleteAtManagementGroupHeaders DeleteAtManagementGroup(this IDeploymentStacksOperations operations, string managementGroupId, string deploymentStackName, string unmanageActionResources = default(string), string unmanageActionResourceGroups = default(string), string unmanageActionManagementGroups = default(string)) - { - return operations.DeleteAtManagementGroupAsync(managementGroupId, deploymentStackName, unmanageActionResources, unmanageActionResourceGroups, unmanageActionManagementGroups).GetAwaiter().GetResult(); - } - - /// - /// Deletes a Deployment Stack by name. When operation completes, status code - /// 200 returned without content. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Management Group. - /// - /// - /// Name of the deployment stack. - /// - /// - /// Flag to indicate delete rather than detach for the resources. Possible - /// values include: 'delete', 'detach' - /// - /// - /// Flag to indicate delete rather than detach for the resource groups. - /// Possible values include: 'delete', 'detach' - /// - /// - /// Flag to indicate delete rather than detach for the management groups. - /// Possible values include: 'delete', 'detach' - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAtManagementGroupAsync(this IDeploymentStacksOperations operations, string managementGroupId, string deploymentStackName, string unmanageActionResources = default(string), string unmanageActionResourceGroups = default(string), string unmanageActionManagementGroups = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.DeleteAtManagementGroupWithHttpMessagesAsync(managementGroupId, deploymentStackName, unmanageActionResources, unmanageActionResourceGroups, unmanageActionManagementGroups, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Headers; - } - } - - /// - /// Exports the template used to create the deployment stack. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Name of the deployment stack. - /// - public static DeploymentStackTemplateDefinition ExportTemplateAtResourceGroup(this IDeploymentStacksOperations operations, string resourceGroupName, string deploymentStackName) - { - return operations.ExportTemplateAtResourceGroupAsync(resourceGroupName, deploymentStackName).GetAwaiter().GetResult(); - } - - /// - /// Exports the template used to create the deployment stack. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Name of the deployment stack. - /// - /// - /// The cancellation token. - /// - public static async Task ExportTemplateAtResourceGroupAsync(this IDeploymentStacksOperations operations, string resourceGroupName, string deploymentStackName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ExportTemplateAtResourceGroupWithHttpMessagesAsync(resourceGroupName, deploymentStackName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Exports the template used to create the deployment stack. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the deployment stack. - /// - public static DeploymentStackTemplateDefinition ExportTemplateAtSubscription(this IDeploymentStacksOperations operations, string deploymentStackName) - { - return operations.ExportTemplateAtSubscriptionAsync(deploymentStackName).GetAwaiter().GetResult(); - } - - /// - /// Exports the template used to create the deployment stack. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the deployment stack. - /// - /// - /// The cancellation token. - /// - public static async Task ExportTemplateAtSubscriptionAsync(this IDeploymentStacksOperations operations, string deploymentStackName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ExportTemplateAtSubscriptionWithHttpMessagesAsync(deploymentStackName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Exports the template used to create the deployment stack. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Management Group. - /// - /// - /// Name of the deployment stack. - /// - public static DeploymentStackTemplateDefinition ExportTemplateAtManagementGroup(this IDeploymentStacksOperations operations, string managementGroupId, string deploymentStackName) - { - return operations.ExportTemplateAtManagementGroupAsync(managementGroupId, deploymentStackName).GetAwaiter().GetResult(); - } - - /// - /// Exports the template used to create the deployment stack. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Management Group. - /// - /// - /// Name of the deployment stack. - /// - /// - /// The cancellation token. - /// - public static async Task ExportTemplateAtManagementGroupAsync(this IDeploymentStacksOperations operations, string managementGroupId, string deploymentStackName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ExportTemplateAtManagementGroupWithHttpMessagesAsync(managementGroupId, deploymentStackName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Creates or updates a Deployment Stack. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Name of the deployment stack. - /// - /// - /// Deployment Stack supplied to the operation. - /// - public static DeploymentStack BeginCreateOrUpdateAtResourceGroup(this IDeploymentStacksOperations operations, string resourceGroupName, string deploymentStackName, DeploymentStack deploymentStack) - { - return operations.BeginCreateOrUpdateAtResourceGroupAsync(resourceGroupName, deploymentStackName, deploymentStack).GetAwaiter().GetResult(); - } - - /// - /// Creates or updates a Deployment Stack. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Name of the deployment stack. - /// - /// - /// Deployment Stack supplied to the operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAtResourceGroupAsync(this IDeploymentStacksOperations operations, string resourceGroupName, string deploymentStackName, DeploymentStack deploymentStack, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginCreateOrUpdateAtResourceGroupWithHttpMessagesAsync(resourceGroupName, deploymentStackName, deploymentStack, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes a Deployment Stack by name. When operation completes, status code - /// 200 returned without content. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Name of the deployment stack. - /// - /// - /// Flag to indicate delete rather than detach for the resources. Possible - /// values include: 'delete', 'detach' - /// - /// - /// Flag to indicate delete rather than detach for the resource groups. - /// Possible values include: 'delete', 'detach' - /// - public static DeploymentStacksDeleteAtResourceGroupHeaders BeginDeleteAtResourceGroup(this IDeploymentStacksOperations operations, string resourceGroupName, string deploymentStackName, string unmanageActionResources = default(string), string unmanageActionResourceGroups = default(string)) - { - return operations.BeginDeleteAtResourceGroupAsync(resourceGroupName, deploymentStackName, unmanageActionResources, unmanageActionResourceGroups).GetAwaiter().GetResult(); - } - - /// - /// Deletes a Deployment Stack by name. When operation completes, status code - /// 200 returned without content. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Name of the deployment stack. - /// - /// - /// Flag to indicate delete rather than detach for the resources. Possible - /// values include: 'delete', 'detach' - /// - /// - /// Flag to indicate delete rather than detach for the resource groups. - /// Possible values include: 'delete', 'detach' - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAtResourceGroupAsync(this IDeploymentStacksOperations operations, string resourceGroupName, string deploymentStackName, string unmanageActionResources = default(string), string unmanageActionResourceGroups = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginDeleteAtResourceGroupWithHttpMessagesAsync(resourceGroupName, deploymentStackName, unmanageActionResources, unmanageActionResourceGroups, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Headers; - } - } - - /// - /// Creates or updates a Deployment Stack. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the deployment stack. - /// - /// - /// Deployment Stack supplied to the operation. - /// - public static DeploymentStack BeginCreateOrUpdateAtSubscription(this IDeploymentStacksOperations operations, string deploymentStackName, DeploymentStack deploymentStack) - { - return operations.BeginCreateOrUpdateAtSubscriptionAsync(deploymentStackName, deploymentStack).GetAwaiter().GetResult(); - } - - /// - /// Creates or updates a Deployment Stack. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the deployment stack. - /// - /// - /// Deployment Stack supplied to the operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAtSubscriptionAsync(this IDeploymentStacksOperations operations, string deploymentStackName, DeploymentStack deploymentStack, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginCreateOrUpdateAtSubscriptionWithHttpMessagesAsync(deploymentStackName, deploymentStack, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes a Deployment Stack by name. When operation completes, status code - /// 200 returned without content. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the deployment stack. - /// - /// - /// Flag to indicate delete rather than detach for the resources. Possible - /// values include: 'delete', 'detach' - /// - /// - /// Flag to indicate delete rather than detach for the resource groups. - /// Possible values include: 'delete', 'detach' - /// - public static DeploymentStacksDeleteAtSubscriptionHeaders BeginDeleteAtSubscription(this IDeploymentStacksOperations operations, string deploymentStackName, string unmanageActionResources = default(string), string unmanageActionResourceGroups = default(string)) - { - return operations.BeginDeleteAtSubscriptionAsync(deploymentStackName, unmanageActionResources, unmanageActionResourceGroups).GetAwaiter().GetResult(); - } - - /// - /// Deletes a Deployment Stack by name. When operation completes, status code - /// 200 returned without content. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the deployment stack. - /// - /// - /// Flag to indicate delete rather than detach for the resources. Possible - /// values include: 'delete', 'detach' - /// - /// - /// Flag to indicate delete rather than detach for the resource groups. - /// Possible values include: 'delete', 'detach' - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAtSubscriptionAsync(this IDeploymentStacksOperations operations, string deploymentStackName, string unmanageActionResources = default(string), string unmanageActionResourceGroups = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginDeleteAtSubscriptionWithHttpMessagesAsync(deploymentStackName, unmanageActionResources, unmanageActionResourceGroups, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Headers; - } - } - - /// - /// Creates or updates a Deployment Stack. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Management Group. - /// - /// - /// Name of the deployment stack. - /// - /// - /// Deployment Stack supplied to the operation. - /// - public static DeploymentStack BeginCreateOrUpdateAtManagementGroup(this IDeploymentStacksOperations operations, string managementGroupId, string deploymentStackName, DeploymentStack deploymentStack) - { - return operations.BeginCreateOrUpdateAtManagementGroupAsync(managementGroupId, deploymentStackName, deploymentStack).GetAwaiter().GetResult(); - } - - /// - /// Creates or updates a Deployment Stack. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Management Group. - /// - /// - /// Name of the deployment stack. - /// - /// - /// Deployment Stack supplied to the operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAtManagementGroupAsync(this IDeploymentStacksOperations operations, string managementGroupId, string deploymentStackName, DeploymentStack deploymentStack, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginCreateOrUpdateAtManagementGroupWithHttpMessagesAsync(managementGroupId, deploymentStackName, deploymentStack, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes a Deployment Stack by name. When operation completes, status code - /// 200 returned without content. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Management Group. - /// - /// - /// Name of the deployment stack. - /// - /// - /// Flag to indicate delete rather than detach for the resources. Possible - /// values include: 'delete', 'detach' - /// - /// - /// Flag to indicate delete rather than detach for the resource groups. - /// Possible values include: 'delete', 'detach' - /// - /// - /// Flag to indicate delete rather than detach for the management groups. - /// Possible values include: 'delete', 'detach' - /// - public static DeploymentStacksDeleteAtManagementGroupHeaders BeginDeleteAtManagementGroup(this IDeploymentStacksOperations operations, string managementGroupId, string deploymentStackName, string unmanageActionResources = default(string), string unmanageActionResourceGroups = default(string), string unmanageActionManagementGroups = default(string)) - { - return operations.BeginDeleteAtManagementGroupAsync(managementGroupId, deploymentStackName, unmanageActionResources, unmanageActionResourceGroups, unmanageActionManagementGroups).GetAwaiter().GetResult(); - } - - /// - /// Deletes a Deployment Stack by name. When operation completes, status code - /// 200 returned without content. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Management Group. - /// - /// - /// Name of the deployment stack. - /// - /// - /// Flag to indicate delete rather than detach for the resources. Possible - /// values include: 'delete', 'detach' - /// - /// - /// Flag to indicate delete rather than detach for the resource groups. - /// Possible values include: 'delete', 'detach' - /// - /// - /// Flag to indicate delete rather than detach for the management groups. - /// Possible values include: 'delete', 'detach' - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAtManagementGroupAsync(this IDeploymentStacksOperations operations, string managementGroupId, string deploymentStackName, string unmanageActionResources = default(string), string unmanageActionResourceGroups = default(string), string unmanageActionManagementGroups = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginDeleteAtManagementGroupWithHttpMessagesAsync(managementGroupId, deploymentStackName, unmanageActionResources, unmanageActionResourceGroups, unmanageActionManagementGroups, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Headers; - } - } - - /// - /// Lists all the Deployment Stacks within the specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListAtResourceGroupNext(this IDeploymentStacksOperations operations, string nextPageLink) - { - return operations.ListAtResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Lists all the Deployment Stacks within the specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAtResourceGroupNextAsync(this IDeploymentStacksOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListAtResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Lists all the Deployment Stacks within the specified subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListAtSubscriptionNext(this IDeploymentStacksOperations operations, string nextPageLink) - { - return operations.ListAtSubscriptionNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Lists all the Deployment Stacks within the specified subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAtSubscriptionNextAsync(this IDeploymentStacksOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListAtSubscriptionNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Lists all the Deployment Stacks within the specified management group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListAtManagementGroupNext(this IDeploymentStacksOperations operations, string nextPageLink) - { - return operations.ListAtManagementGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Lists all the Deployment Stacks within the specified management group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAtManagementGroupNextAsync(this IDeploymentStacksOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListAtManagementGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - } -} diff --git a/src/Resources/Resources.Sdk/Generated/DeploymentsOperationsExtensions.cs b/src/Resources/Resources.Sdk/Generated/DeploymentsOperationsExtensions.cs deleted file mode 100644 index 0148d39496da..000000000000 --- a/src/Resources/Resources.Sdk/Generated/DeploymentsOperationsExtensions.cs +++ /dev/null @@ -1,3137 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Resources -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Microsoft.Rest.Azure.OData; - using Models; - using System.Threading; - using System.Threading.Tasks; - - /// - /// Extension methods for DeploymentsOperations. - /// - public static partial class DeploymentsOperationsExtensions - { - /// - /// Deletes a deployment from the deployment history. - /// - /// - /// A template deployment that is currently running cannot be deleted. Deleting - /// a template deployment removes the associated deployment operations. This is - /// an asynchronous operation that returns a status of 202 until the template - /// deployment is successfully deleted. The Location response header contains - /// the URI that is used to obtain the status of the process. While the process - /// is running, a call to the URI in the Location header returns a status of - /// 202. When the process finishes, the URI in the Location header returns a - /// status of 204 on success. If the asynchronous request failed, the URI in - /// the Location header returns an error-level status code. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource scope. - /// - /// - /// The name of the deployment. - /// - public static void DeleteAtScope(this IDeploymentsOperations operations, string scope, string deploymentName) - { - operations.DeleteAtScopeAsync(scope, deploymentName).GetAwaiter().GetResult(); - } - - /// - /// Deletes a deployment from the deployment history. - /// - /// - /// A template deployment that is currently running cannot be deleted. Deleting - /// a template deployment removes the associated deployment operations. This is - /// an asynchronous operation that returns a status of 202 until the template - /// deployment is successfully deleted. The Location response header contains - /// the URI that is used to obtain the status of the process. While the process - /// is running, a call to the URI in the Location header returns a status of - /// 202. When the process finishes, the URI in the Location header returns a - /// status of 204 on success. If the asynchronous request failed, the URI in - /// the Location header returns an error-level status code. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource scope. - /// - /// - /// The name of the deployment. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAtScopeAsync(this IDeploymentsOperations operations, string scope, string deploymentName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteAtScopeWithHttpMessagesAsync(scope, deploymentName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Checks whether the deployment exists. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource scope. - /// - /// - /// The name of the deployment. - /// - public static bool CheckExistenceAtScope(this IDeploymentsOperations operations, string scope, string deploymentName) - { - return operations.CheckExistenceAtScopeAsync(scope, deploymentName).GetAwaiter().GetResult(); - } - - /// - /// Checks whether the deployment exists. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource scope. - /// - /// - /// The name of the deployment. - /// - /// - /// The cancellation token. - /// - public static async Task CheckExistenceAtScopeAsync(this IDeploymentsOperations operations, string scope, string deploymentName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CheckExistenceAtScopeWithHttpMessagesAsync(scope, deploymentName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deploys resources at a given scope. - /// - /// - /// You can provide the template and parameters directly in the request or link - /// to JSON files. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource scope. - /// - /// - /// The name of the deployment. - /// - /// - /// Additional parameters supplied to the operation. - /// - public static DeploymentExtended CreateOrUpdateAtScope(this IDeploymentsOperations operations, string scope, string deploymentName, Deployment parameters) - { - return operations.CreateOrUpdateAtScopeAsync(scope, deploymentName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Deploys resources at a given scope. - /// - /// - /// You can provide the template and parameters directly in the request or link - /// to JSON files. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource scope. - /// - /// - /// The name of the deployment. - /// - /// - /// Additional parameters supplied to the operation. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAtScopeAsync(this IDeploymentsOperations operations, string scope, string deploymentName, Deployment parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateAtScopeWithHttpMessagesAsync(scope, deploymentName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets a deployment. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource scope. - /// - /// - /// The name of the deployment. - /// - public static DeploymentExtended GetAtScope(this IDeploymentsOperations operations, string scope, string deploymentName) - { - return operations.GetAtScopeAsync(scope, deploymentName).GetAwaiter().GetResult(); - } - - /// - /// Gets a deployment. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource scope. - /// - /// - /// The name of the deployment. - /// - /// - /// The cancellation token. - /// - public static async Task GetAtScopeAsync(this IDeploymentsOperations operations, string scope, string deploymentName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetAtScopeWithHttpMessagesAsync(scope, deploymentName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Cancels a currently running template deployment. - /// - /// - /// You can cancel a deployment only if the provisioningState is Accepted or - /// Running. After the deployment is canceled, the provisioningState is set to - /// Canceled. Canceling a template deployment stops the currently running - /// template deployment and leaves the resources partially deployed. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource scope. - /// - /// - /// The name of the deployment. - /// - public static void CancelAtScope(this IDeploymentsOperations operations, string scope, string deploymentName) - { - operations.CancelAtScopeAsync(scope, deploymentName).GetAwaiter().GetResult(); - } - - /// - /// Cancels a currently running template deployment. - /// - /// - /// You can cancel a deployment only if the provisioningState is Accepted or - /// Running. After the deployment is canceled, the provisioningState is set to - /// Canceled. Canceling a template deployment stops the currently running - /// template deployment and leaves the resources partially deployed. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource scope. - /// - /// - /// The name of the deployment. - /// - /// - /// The cancellation token. - /// - public static async Task CancelAtScopeAsync(this IDeploymentsOperations operations, string scope, string deploymentName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.CancelAtScopeWithHttpMessagesAsync(scope, deploymentName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Validates whether the specified template is syntactically correct and will - /// be accepted by Azure Resource Manager.. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource scope. - /// - /// - /// The name of the deployment. - /// - /// - /// Parameters to validate. - /// - public static DeploymentValidateResult ValidateAtScope(this IDeploymentsOperations operations, string scope, string deploymentName, Deployment parameters) - { - return operations.ValidateAtScopeAsync(scope, deploymentName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Validates whether the specified template is syntactically correct and will - /// be accepted by Azure Resource Manager.. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource scope. - /// - /// - /// The name of the deployment. - /// - /// - /// Parameters to validate. - /// - /// - /// The cancellation token. - /// - public static async Task ValidateAtScopeAsync(this IDeploymentsOperations operations, string scope, string deploymentName, Deployment parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ValidateAtScopeWithHttpMessagesAsync(scope, deploymentName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Exports the template used for specified deployment. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource scope. - /// - /// - /// The name of the deployment. - /// - public static DeploymentExportResult ExportTemplateAtScope(this IDeploymentsOperations operations, string scope, string deploymentName) - { - return operations.ExportTemplateAtScopeAsync(scope, deploymentName).GetAwaiter().GetResult(); - } - - /// - /// Exports the template used for specified deployment. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource scope. - /// - /// - /// The name of the deployment. - /// - /// - /// The cancellation token. - /// - public static async Task ExportTemplateAtScopeAsync(this IDeploymentsOperations operations, string scope, string deploymentName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ExportTemplateAtScopeWithHttpMessagesAsync(scope, deploymentName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Get all the deployments at the given scope. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource scope. - /// - /// - /// OData parameters to apply to the operation. - /// - public static IPage ListAtScope(this IDeploymentsOperations operations, string scope, ODataQuery odataQuery = default(ODataQuery)) - { - return operations.ListAtScopeAsync(scope, odataQuery).GetAwaiter().GetResult(); - } - - /// - /// Get all the deployments at the given scope. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource scope. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAtScopeAsync(this IDeploymentsOperations operations, string scope, ODataQuery odataQuery = default(ODataQuery), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListAtScopeWithHttpMessagesAsync(scope, odataQuery, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes a deployment from the deployment history. - /// - /// - /// A template deployment that is currently running cannot be deleted. Deleting - /// a template deployment removes the associated deployment operations. This is - /// an asynchronous operation that returns a status of 202 until the template - /// deployment is successfully deleted. The Location response header contains - /// the URI that is used to obtain the status of the process. While the process - /// is running, a call to the URI in the Location header returns a status of - /// 202. When the process finishes, the URI in the Location header returns a - /// status of 204 on success. If the asynchronous request failed, the URI in - /// the Location header returns an error-level status code. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the deployment. - /// - public static void DeleteAtTenantScope(this IDeploymentsOperations operations, string deploymentName) - { - operations.DeleteAtTenantScopeAsync(deploymentName).GetAwaiter().GetResult(); - } - - /// - /// Deletes a deployment from the deployment history. - /// - /// - /// A template deployment that is currently running cannot be deleted. Deleting - /// a template deployment removes the associated deployment operations. This is - /// an asynchronous operation that returns a status of 202 until the template - /// deployment is successfully deleted. The Location response header contains - /// the URI that is used to obtain the status of the process. While the process - /// is running, a call to the URI in the Location header returns a status of - /// 202. When the process finishes, the URI in the Location header returns a - /// status of 204 on success. If the asynchronous request failed, the URI in - /// the Location header returns an error-level status code. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the deployment. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAtTenantScopeAsync(this IDeploymentsOperations operations, string deploymentName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteAtTenantScopeWithHttpMessagesAsync(deploymentName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Checks whether the deployment exists. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the deployment. - /// - public static bool CheckExistenceAtTenantScope(this IDeploymentsOperations operations, string deploymentName) - { - return operations.CheckExistenceAtTenantScopeAsync(deploymentName).GetAwaiter().GetResult(); - } - - /// - /// Checks whether the deployment exists. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the deployment. - /// - /// - /// The cancellation token. - /// - public static async Task CheckExistenceAtTenantScopeAsync(this IDeploymentsOperations operations, string deploymentName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CheckExistenceAtTenantScopeWithHttpMessagesAsync(deploymentName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deploys resources at tenant scope. - /// - /// - /// You can provide the template and parameters directly in the request or link - /// to JSON files. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the deployment. - /// - /// - /// Additional parameters supplied to the operation. - /// - public static DeploymentExtended CreateOrUpdateAtTenantScope(this IDeploymentsOperations operations, string deploymentName, ScopedDeployment parameters) - { - return operations.CreateOrUpdateAtTenantScopeAsync(deploymentName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Deploys resources at tenant scope. - /// - /// - /// You can provide the template and parameters directly in the request or link - /// to JSON files. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the deployment. - /// - /// - /// Additional parameters supplied to the operation. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAtTenantScopeAsync(this IDeploymentsOperations operations, string deploymentName, ScopedDeployment parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateAtTenantScopeWithHttpMessagesAsync(deploymentName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets a deployment. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the deployment. - /// - public static DeploymentExtended GetAtTenantScope(this IDeploymentsOperations operations, string deploymentName) - { - return operations.GetAtTenantScopeAsync(deploymentName).GetAwaiter().GetResult(); - } - - /// - /// Gets a deployment. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the deployment. - /// - /// - /// The cancellation token. - /// - public static async Task GetAtTenantScopeAsync(this IDeploymentsOperations operations, string deploymentName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetAtTenantScopeWithHttpMessagesAsync(deploymentName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Cancels a currently running template deployment. - /// - /// - /// You can cancel a deployment only if the provisioningState is Accepted or - /// Running. After the deployment is canceled, the provisioningState is set to - /// Canceled. Canceling a template deployment stops the currently running - /// template deployment and leaves the resources partially deployed. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the deployment. - /// - public static void CancelAtTenantScope(this IDeploymentsOperations operations, string deploymentName) - { - operations.CancelAtTenantScopeAsync(deploymentName).GetAwaiter().GetResult(); - } - - /// - /// Cancels a currently running template deployment. - /// - /// - /// You can cancel a deployment only if the provisioningState is Accepted or - /// Running. After the deployment is canceled, the provisioningState is set to - /// Canceled. Canceling a template deployment stops the currently running - /// template deployment and leaves the resources partially deployed. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the deployment. - /// - /// - /// The cancellation token. - /// - public static async Task CancelAtTenantScopeAsync(this IDeploymentsOperations operations, string deploymentName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.CancelAtTenantScopeWithHttpMessagesAsync(deploymentName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Validates whether the specified template is syntactically correct and will - /// be accepted by Azure Resource Manager.. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the deployment. - /// - /// - /// Parameters to validate. - /// - public static DeploymentValidateResult ValidateAtTenantScope(this IDeploymentsOperations operations, string deploymentName, ScopedDeployment parameters) - { - return operations.ValidateAtTenantScopeAsync(deploymentName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Validates whether the specified template is syntactically correct and will - /// be accepted by Azure Resource Manager.. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the deployment. - /// - /// - /// Parameters to validate. - /// - /// - /// The cancellation token. - /// - public static async Task ValidateAtTenantScopeAsync(this IDeploymentsOperations operations, string deploymentName, ScopedDeployment parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ValidateAtTenantScopeWithHttpMessagesAsync(deploymentName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Returns changes that will be made by the deployment if executed at the - /// scope of the tenant group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the deployment. - /// - /// - /// Parameters to validate. - /// - public static WhatIfOperationResult WhatIfAtTenantScope(this IDeploymentsOperations operations, string deploymentName, ScopedDeploymentWhatIf parameters) - { - return operations.WhatIfAtTenantScopeAsync(deploymentName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Returns changes that will be made by the deployment if executed at the - /// scope of the tenant group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the deployment. - /// - /// - /// Parameters to validate. - /// - /// - /// The cancellation token. - /// - public static async Task WhatIfAtTenantScopeAsync(this IDeploymentsOperations operations, string deploymentName, ScopedDeploymentWhatIf parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.WhatIfAtTenantScopeWithHttpMessagesAsync(deploymentName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Exports the template used for specified deployment. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the deployment. - /// - public static DeploymentExportResult ExportTemplateAtTenantScope(this IDeploymentsOperations operations, string deploymentName) - { - return operations.ExportTemplateAtTenantScopeAsync(deploymentName).GetAwaiter().GetResult(); - } - - /// - /// Exports the template used for specified deployment. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the deployment. - /// - /// - /// The cancellation token. - /// - public static async Task ExportTemplateAtTenantScopeAsync(this IDeploymentsOperations operations, string deploymentName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ExportTemplateAtTenantScopeWithHttpMessagesAsync(deploymentName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Get all the deployments at the tenant scope. - /// - /// - /// The operations group for this extension method. - /// - /// - /// OData parameters to apply to the operation. - /// - public static IPage ListAtTenantScope(this IDeploymentsOperations operations, ODataQuery odataQuery = default(ODataQuery)) - { - return operations.ListAtTenantScopeAsync(odataQuery).GetAwaiter().GetResult(); - } - - /// - /// Get all the deployments at the tenant scope. - /// - /// - /// The operations group for this extension method. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAtTenantScopeAsync(this IDeploymentsOperations operations, ODataQuery odataQuery = default(ODataQuery), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListAtTenantScopeWithHttpMessagesAsync(odataQuery, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes a deployment from the deployment history. - /// - /// - /// A template deployment that is currently running cannot be deleted. Deleting - /// a template deployment removes the associated deployment operations. This is - /// an asynchronous operation that returns a status of 202 until the template - /// deployment is successfully deleted. The Location response header contains - /// the URI that is used to obtain the status of the process. While the process - /// is running, a call to the URI in the Location header returns a status of - /// 202. When the process finishes, the URI in the Location header returns a - /// status of 204 on success. If the asynchronous request failed, the URI in - /// the Location header returns an error-level status code. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The management group ID. - /// - /// - /// The name of the deployment. - /// - public static void DeleteAtManagementGroupScope(this IDeploymentsOperations operations, string groupId, string deploymentName) - { - operations.DeleteAtManagementGroupScopeAsync(groupId, deploymentName).GetAwaiter().GetResult(); - } - - /// - /// Deletes a deployment from the deployment history. - /// - /// - /// A template deployment that is currently running cannot be deleted. Deleting - /// a template deployment removes the associated deployment operations. This is - /// an asynchronous operation that returns a status of 202 until the template - /// deployment is successfully deleted. The Location response header contains - /// the URI that is used to obtain the status of the process. While the process - /// is running, a call to the URI in the Location header returns a status of - /// 202. When the process finishes, the URI in the Location header returns a - /// status of 204 on success. If the asynchronous request failed, the URI in - /// the Location header returns an error-level status code. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The management group ID. - /// - /// - /// The name of the deployment. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAtManagementGroupScopeAsync(this IDeploymentsOperations operations, string groupId, string deploymentName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteAtManagementGroupScopeWithHttpMessagesAsync(groupId, deploymentName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Checks whether the deployment exists. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The management group ID. - /// - /// - /// The name of the deployment. - /// - public static bool CheckExistenceAtManagementGroupScope(this IDeploymentsOperations operations, string groupId, string deploymentName) - { - return operations.CheckExistenceAtManagementGroupScopeAsync(groupId, deploymentName).GetAwaiter().GetResult(); - } - - /// - /// Checks whether the deployment exists. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The management group ID. - /// - /// - /// The name of the deployment. - /// - /// - /// The cancellation token. - /// - public static async Task CheckExistenceAtManagementGroupScopeAsync(this IDeploymentsOperations operations, string groupId, string deploymentName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CheckExistenceAtManagementGroupScopeWithHttpMessagesAsync(groupId, deploymentName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deploys resources at management group scope. - /// - /// - /// You can provide the template and parameters directly in the request or link - /// to JSON files. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The management group ID. - /// - /// - /// The name of the deployment. - /// - /// - /// Additional parameters supplied to the operation. - /// - public static DeploymentExtended CreateOrUpdateAtManagementGroupScope(this IDeploymentsOperations operations, string groupId, string deploymentName, ScopedDeployment parameters) - { - return operations.CreateOrUpdateAtManagementGroupScopeAsync(groupId, deploymentName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Deploys resources at management group scope. - /// - /// - /// You can provide the template and parameters directly in the request or link - /// to JSON files. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The management group ID. - /// - /// - /// The name of the deployment. - /// - /// - /// Additional parameters supplied to the operation. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAtManagementGroupScopeAsync(this IDeploymentsOperations operations, string groupId, string deploymentName, ScopedDeployment parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateAtManagementGroupScopeWithHttpMessagesAsync(groupId, deploymentName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets a deployment. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The management group ID. - /// - /// - /// The name of the deployment. - /// - public static DeploymentExtended GetAtManagementGroupScope(this IDeploymentsOperations operations, string groupId, string deploymentName) - { - return operations.GetAtManagementGroupScopeAsync(groupId, deploymentName).GetAwaiter().GetResult(); - } - - /// - /// Gets a deployment. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The management group ID. - /// - /// - /// The name of the deployment. - /// - /// - /// The cancellation token. - /// - public static async Task GetAtManagementGroupScopeAsync(this IDeploymentsOperations operations, string groupId, string deploymentName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetAtManagementGroupScopeWithHttpMessagesAsync(groupId, deploymentName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Cancels a currently running template deployment. - /// - /// - /// You can cancel a deployment only if the provisioningState is Accepted or - /// Running. After the deployment is canceled, the provisioningState is set to - /// Canceled. Canceling a template deployment stops the currently running - /// template deployment and leaves the resources partially deployed. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The management group ID. - /// - /// - /// The name of the deployment. - /// - public static void CancelAtManagementGroupScope(this IDeploymentsOperations operations, string groupId, string deploymentName) - { - operations.CancelAtManagementGroupScopeAsync(groupId, deploymentName).GetAwaiter().GetResult(); - } - - /// - /// Cancels a currently running template deployment. - /// - /// - /// You can cancel a deployment only if the provisioningState is Accepted or - /// Running. After the deployment is canceled, the provisioningState is set to - /// Canceled. Canceling a template deployment stops the currently running - /// template deployment and leaves the resources partially deployed. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The management group ID. - /// - /// - /// The name of the deployment. - /// - /// - /// The cancellation token. - /// - public static async Task CancelAtManagementGroupScopeAsync(this IDeploymentsOperations operations, string groupId, string deploymentName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.CancelAtManagementGroupScopeWithHttpMessagesAsync(groupId, deploymentName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Validates whether the specified template is syntactically correct and will - /// be accepted by Azure Resource Manager.. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The management group ID. - /// - /// - /// The name of the deployment. - /// - /// - /// Parameters to validate. - /// - public static DeploymentValidateResult ValidateAtManagementGroupScope(this IDeploymentsOperations operations, string groupId, string deploymentName, ScopedDeployment parameters) - { - return operations.ValidateAtManagementGroupScopeAsync(groupId, deploymentName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Validates whether the specified template is syntactically correct and will - /// be accepted by Azure Resource Manager.. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The management group ID. - /// - /// - /// The name of the deployment. - /// - /// - /// Parameters to validate. - /// - /// - /// The cancellation token. - /// - public static async Task ValidateAtManagementGroupScopeAsync(this IDeploymentsOperations operations, string groupId, string deploymentName, ScopedDeployment parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ValidateAtManagementGroupScopeWithHttpMessagesAsync(groupId, deploymentName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Returns changes that will be made by the deployment if executed at the - /// scope of the management group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The management group ID. - /// - /// - /// The name of the deployment. - /// - /// - /// Parameters to validate. - /// - public static WhatIfOperationResult WhatIfAtManagementGroupScope(this IDeploymentsOperations operations, string groupId, string deploymentName, ScopedDeploymentWhatIf parameters) - { - return operations.WhatIfAtManagementGroupScopeAsync(groupId, deploymentName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Returns changes that will be made by the deployment if executed at the - /// scope of the management group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The management group ID. - /// - /// - /// The name of the deployment. - /// - /// - /// Parameters to validate. - /// - /// - /// The cancellation token. - /// - public static async Task WhatIfAtManagementGroupScopeAsync(this IDeploymentsOperations operations, string groupId, string deploymentName, ScopedDeploymentWhatIf parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.WhatIfAtManagementGroupScopeWithHttpMessagesAsync(groupId, deploymentName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Exports the template used for specified deployment. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The management group ID. - /// - /// - /// The name of the deployment. - /// - public static DeploymentExportResult ExportTemplateAtManagementGroupScope(this IDeploymentsOperations operations, string groupId, string deploymentName) - { - return operations.ExportTemplateAtManagementGroupScopeAsync(groupId, deploymentName).GetAwaiter().GetResult(); - } - - /// - /// Exports the template used for specified deployment. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The management group ID. - /// - /// - /// The name of the deployment. - /// - /// - /// The cancellation token. - /// - public static async Task ExportTemplateAtManagementGroupScopeAsync(this IDeploymentsOperations operations, string groupId, string deploymentName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ExportTemplateAtManagementGroupScopeWithHttpMessagesAsync(groupId, deploymentName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Get all the deployments for a management group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The management group ID. - /// - /// - /// OData parameters to apply to the operation. - /// - public static IPage ListAtManagementGroupScope(this IDeploymentsOperations operations, string groupId, ODataQuery odataQuery = default(ODataQuery)) - { - return operations.ListAtManagementGroupScopeAsync(groupId, odataQuery).GetAwaiter().GetResult(); - } - - /// - /// Get all the deployments for a management group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The management group ID. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAtManagementGroupScopeAsync(this IDeploymentsOperations operations, string groupId, ODataQuery odataQuery = default(ODataQuery), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListAtManagementGroupScopeWithHttpMessagesAsync(groupId, odataQuery, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes a deployment from the deployment history. - /// - /// - /// A template deployment that is currently running cannot be deleted. Deleting - /// a template deployment removes the associated deployment operations. This is - /// an asynchronous operation that returns a status of 202 until the template - /// deployment is successfully deleted. The Location response header contains - /// the URI that is used to obtain the status of the process. While the process - /// is running, a call to the URI in the Location header returns a status of - /// 202. When the process finishes, the URI in the Location header returns a - /// status of 204 on success. If the asynchronous request failed, the URI in - /// the Location header returns an error-level status code. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the deployment. - /// - public static void DeleteAtSubscriptionScope(this IDeploymentsOperations operations, string deploymentName) - { - operations.DeleteAtSubscriptionScopeAsync(deploymentName).GetAwaiter().GetResult(); - } - - /// - /// Deletes a deployment from the deployment history. - /// - /// - /// A template deployment that is currently running cannot be deleted. Deleting - /// a template deployment removes the associated deployment operations. This is - /// an asynchronous operation that returns a status of 202 until the template - /// deployment is successfully deleted. The Location response header contains - /// the URI that is used to obtain the status of the process. While the process - /// is running, a call to the URI in the Location header returns a status of - /// 202. When the process finishes, the URI in the Location header returns a - /// status of 204 on success. If the asynchronous request failed, the URI in - /// the Location header returns an error-level status code. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the deployment. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAtSubscriptionScopeAsync(this IDeploymentsOperations operations, string deploymentName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteAtSubscriptionScopeWithHttpMessagesAsync(deploymentName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Checks whether the deployment exists. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the deployment. - /// - public static bool CheckExistenceAtSubscriptionScope(this IDeploymentsOperations operations, string deploymentName) - { - return operations.CheckExistenceAtSubscriptionScopeAsync(deploymentName).GetAwaiter().GetResult(); - } - - /// - /// Checks whether the deployment exists. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the deployment. - /// - /// - /// The cancellation token. - /// - public static async Task CheckExistenceAtSubscriptionScopeAsync(this IDeploymentsOperations operations, string deploymentName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CheckExistenceAtSubscriptionScopeWithHttpMessagesAsync(deploymentName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deploys resources at subscription scope. - /// - /// - /// You can provide the template and parameters directly in the request or link - /// to JSON files. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the deployment. - /// - /// - /// Additional parameters supplied to the operation. - /// - public static DeploymentExtended CreateOrUpdateAtSubscriptionScope(this IDeploymentsOperations operations, string deploymentName, Deployment parameters) - { - return operations.CreateOrUpdateAtSubscriptionScopeAsync(deploymentName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Deploys resources at subscription scope. - /// - /// - /// You can provide the template and parameters directly in the request or link - /// to JSON files. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the deployment. - /// - /// - /// Additional parameters supplied to the operation. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAtSubscriptionScopeAsync(this IDeploymentsOperations operations, string deploymentName, Deployment parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateAtSubscriptionScopeWithHttpMessagesAsync(deploymentName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets a deployment. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the deployment. - /// - public static DeploymentExtended GetAtSubscriptionScope(this IDeploymentsOperations operations, string deploymentName) - { - return operations.GetAtSubscriptionScopeAsync(deploymentName).GetAwaiter().GetResult(); - } - - /// - /// Gets a deployment. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the deployment. - /// - /// - /// The cancellation token. - /// - public static async Task GetAtSubscriptionScopeAsync(this IDeploymentsOperations operations, string deploymentName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetAtSubscriptionScopeWithHttpMessagesAsync(deploymentName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Cancels a currently running template deployment. - /// - /// - /// You can cancel a deployment only if the provisioningState is Accepted or - /// Running. After the deployment is canceled, the provisioningState is set to - /// Canceled. Canceling a template deployment stops the currently running - /// template deployment and leaves the resources partially deployed. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the deployment. - /// - public static void CancelAtSubscriptionScope(this IDeploymentsOperations operations, string deploymentName) - { - operations.CancelAtSubscriptionScopeAsync(deploymentName).GetAwaiter().GetResult(); - } - - /// - /// Cancels a currently running template deployment. - /// - /// - /// You can cancel a deployment only if the provisioningState is Accepted or - /// Running. After the deployment is canceled, the provisioningState is set to - /// Canceled. Canceling a template deployment stops the currently running - /// template deployment and leaves the resources partially deployed. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the deployment. - /// - /// - /// The cancellation token. - /// - public static async Task CancelAtSubscriptionScopeAsync(this IDeploymentsOperations operations, string deploymentName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.CancelAtSubscriptionScopeWithHttpMessagesAsync(deploymentName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Validates whether the specified template is syntactically correct and will - /// be accepted by Azure Resource Manager.. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the deployment. - /// - /// - /// Parameters to validate. - /// - public static DeploymentValidateResult ValidateAtSubscriptionScope(this IDeploymentsOperations operations, string deploymentName, Deployment parameters) - { - return operations.ValidateAtSubscriptionScopeAsync(deploymentName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Validates whether the specified template is syntactically correct and will - /// be accepted by Azure Resource Manager.. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the deployment. - /// - /// - /// Parameters to validate. - /// - /// - /// The cancellation token. - /// - public static async Task ValidateAtSubscriptionScopeAsync(this IDeploymentsOperations operations, string deploymentName, Deployment parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ValidateAtSubscriptionScopeWithHttpMessagesAsync(deploymentName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Returns changes that will be made by the deployment if executed at the - /// scope of the subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the deployment. - /// - /// - /// Parameters to What If. - /// - public static WhatIfOperationResult WhatIfAtSubscriptionScope(this IDeploymentsOperations operations, string deploymentName, DeploymentWhatIf parameters) - { - return operations.WhatIfAtSubscriptionScopeAsync(deploymentName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Returns changes that will be made by the deployment if executed at the - /// scope of the subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the deployment. - /// - /// - /// Parameters to What If. - /// - /// - /// The cancellation token. - /// - public static async Task WhatIfAtSubscriptionScopeAsync(this IDeploymentsOperations operations, string deploymentName, DeploymentWhatIf parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.WhatIfAtSubscriptionScopeWithHttpMessagesAsync(deploymentName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Exports the template used for specified deployment. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the deployment. - /// - public static DeploymentExportResult ExportTemplateAtSubscriptionScope(this IDeploymentsOperations operations, string deploymentName) - { - return operations.ExportTemplateAtSubscriptionScopeAsync(deploymentName).GetAwaiter().GetResult(); - } - - /// - /// Exports the template used for specified deployment. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the deployment. - /// - /// - /// The cancellation token. - /// - public static async Task ExportTemplateAtSubscriptionScopeAsync(this IDeploymentsOperations operations, string deploymentName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ExportTemplateAtSubscriptionScopeWithHttpMessagesAsync(deploymentName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Get all the deployments for a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// OData parameters to apply to the operation. - /// - public static IPage ListAtSubscriptionScope(this IDeploymentsOperations operations, ODataQuery odataQuery = default(ODataQuery)) - { - return operations.ListAtSubscriptionScopeAsync(odataQuery).GetAwaiter().GetResult(); - } - - /// - /// Get all the deployments for a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAtSubscriptionScopeAsync(this IDeploymentsOperations operations, ODataQuery odataQuery = default(ODataQuery), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListAtSubscriptionScopeWithHttpMessagesAsync(odataQuery, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes a deployment from the deployment history. - /// - /// - /// A template deployment that is currently running cannot be deleted. Deleting - /// a template deployment removes the associated deployment operations. - /// Deleting a template deployment does not affect the state of the resource - /// group. This is an asynchronous operation that returns a status of 202 until - /// the template deployment is successfully deleted. The Location response - /// header contains the URI that is used to obtain the status of the process. - /// While the process is running, a call to the URI in the Location header - /// returns a status of 202. When the process finishes, the URI in the Location - /// header returns a status of 204 on success. If the asynchronous request - /// failed, the URI in the Location header returns an error-level status code. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group with the deployment to delete. The name is - /// case insensitive. - /// - /// - /// The name of the deployment. - /// - public static void Delete(this IDeploymentsOperations operations, string resourceGroupName, string deploymentName) - { - operations.DeleteAsync(resourceGroupName, deploymentName).GetAwaiter().GetResult(); - } - - /// - /// Deletes a deployment from the deployment history. - /// - /// - /// A template deployment that is currently running cannot be deleted. Deleting - /// a template deployment removes the associated deployment operations. - /// Deleting a template deployment does not affect the state of the resource - /// group. This is an asynchronous operation that returns a status of 202 until - /// the template deployment is successfully deleted. The Location response - /// header contains the URI that is used to obtain the status of the process. - /// While the process is running, a call to the URI in the Location header - /// returns a status of 202. When the process finishes, the URI in the Location - /// header returns a status of 204 on success. If the asynchronous request - /// failed, the URI in the Location header returns an error-level status code. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group with the deployment to delete. The name is - /// case insensitive. - /// - /// - /// The name of the deployment. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IDeploymentsOperations operations, string resourceGroupName, string deploymentName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, deploymentName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Checks whether the deployment exists. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group with the deployment to check. The name is - /// case insensitive. - /// - /// - /// The name of the deployment. - /// - public static bool CheckExistence(this IDeploymentsOperations operations, string resourceGroupName, string deploymentName) - { - return operations.CheckExistenceAsync(resourceGroupName, deploymentName).GetAwaiter().GetResult(); - } - - /// - /// Checks whether the deployment exists. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group with the deployment to check. The name is - /// case insensitive. - /// - /// - /// The name of the deployment. - /// - /// - /// The cancellation token. - /// - public static async Task CheckExistenceAsync(this IDeploymentsOperations operations, string resourceGroupName, string deploymentName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CheckExistenceWithHttpMessagesAsync(resourceGroupName, deploymentName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deploys resources to a resource group. - /// - /// - /// You can provide the template and parameters directly in the request or link - /// to JSON files. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group to deploy the resources to. The name is case - /// insensitive. The resource group must already exist. - /// - /// - /// The name of the deployment. - /// - /// - /// Additional parameters supplied to the operation. - /// - public static DeploymentExtended CreateOrUpdate(this IDeploymentsOperations operations, string resourceGroupName, string deploymentName, Deployment parameters) - { - return operations.CreateOrUpdateAsync(resourceGroupName, deploymentName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Deploys resources to a resource group. - /// - /// - /// You can provide the template and parameters directly in the request or link - /// to JSON files. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group to deploy the resources to. The name is case - /// insensitive. The resource group must already exist. - /// - /// - /// The name of the deployment. - /// - /// - /// Additional parameters supplied to the operation. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IDeploymentsOperations operations, string resourceGroupName, string deploymentName, Deployment parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, deploymentName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets a deployment. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the deployment. - /// - public static DeploymentExtended Get(this IDeploymentsOperations operations, string resourceGroupName, string deploymentName) - { - return operations.GetAsync(resourceGroupName, deploymentName).GetAwaiter().GetResult(); - } - - /// - /// Gets a deployment. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the deployment. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IDeploymentsOperations operations, string resourceGroupName, string deploymentName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, deploymentName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Cancels a currently running template deployment. - /// - /// - /// You can cancel a deployment only if the provisioningState is Accepted or - /// Running. After the deployment is canceled, the provisioningState is set to - /// Canceled. Canceling a template deployment stops the currently running - /// template deployment and leaves the resource group partially deployed. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the deployment. - /// - public static void Cancel(this IDeploymentsOperations operations, string resourceGroupName, string deploymentName) - { - operations.CancelAsync(resourceGroupName, deploymentName).GetAwaiter().GetResult(); - } - - /// - /// Cancels a currently running template deployment. - /// - /// - /// You can cancel a deployment only if the provisioningState is Accepted or - /// Running. After the deployment is canceled, the provisioningState is set to - /// Canceled. Canceling a template deployment stops the currently running - /// template deployment and leaves the resource group partially deployed. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the deployment. - /// - /// - /// The cancellation token. - /// - public static async Task CancelAsync(this IDeploymentsOperations operations, string resourceGroupName, string deploymentName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.CancelWithHttpMessagesAsync(resourceGroupName, deploymentName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Validates whether the specified template is syntactically correct and will - /// be accepted by Azure Resource Manager.. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group the template will be deployed to. The name - /// is case insensitive. - /// - /// - /// The name of the deployment. - /// - /// - /// Parameters to validate. - /// - public static DeploymentValidateResult Validate(this IDeploymentsOperations operations, string resourceGroupName, string deploymentName, Deployment parameters) - { - return operations.ValidateAsync(resourceGroupName, deploymentName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Validates whether the specified template is syntactically correct and will - /// be accepted by Azure Resource Manager.. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group the template will be deployed to. The name - /// is case insensitive. - /// - /// - /// The name of the deployment. - /// - /// - /// Parameters to validate. - /// - /// - /// The cancellation token. - /// - public static async Task ValidateAsync(this IDeploymentsOperations operations, string resourceGroupName, string deploymentName, Deployment parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ValidateWithHttpMessagesAsync(resourceGroupName, deploymentName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Returns changes that will be made by the deployment if executed at the - /// scope of the resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group the template will be deployed to. The name - /// is case insensitive. - /// - /// - /// The name of the deployment. - /// - /// - /// Parameters to validate. - /// - public static WhatIfOperationResult WhatIf(this IDeploymentsOperations operations, string resourceGroupName, string deploymentName, DeploymentWhatIf parameters) - { - return operations.WhatIfAsync(resourceGroupName, deploymentName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Returns changes that will be made by the deployment if executed at the - /// scope of the resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group the template will be deployed to. The name - /// is case insensitive. - /// - /// - /// The name of the deployment. - /// - /// - /// Parameters to validate. - /// - /// - /// The cancellation token. - /// - public static async Task WhatIfAsync(this IDeploymentsOperations operations, string resourceGroupName, string deploymentName, DeploymentWhatIf parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.WhatIfWithHttpMessagesAsync(resourceGroupName, deploymentName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Exports the template used for specified deployment. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the deployment. - /// - public static DeploymentExportResult ExportTemplate(this IDeploymentsOperations operations, string resourceGroupName, string deploymentName) - { - return operations.ExportTemplateAsync(resourceGroupName, deploymentName).GetAwaiter().GetResult(); - } - - /// - /// Exports the template used for specified deployment. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the deployment. - /// - /// - /// The cancellation token. - /// - public static async Task ExportTemplateAsync(this IDeploymentsOperations operations, string resourceGroupName, string deploymentName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ExportTemplateWithHttpMessagesAsync(resourceGroupName, deploymentName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Get all the deployments for a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group with the deployments to get. The name is - /// case insensitive. - /// - /// - /// OData parameters to apply to the operation. - /// - public static IPage ListByResourceGroup(this IDeploymentsOperations operations, string resourceGroupName, ODataQuery odataQuery = default(ODataQuery)) - { - return operations.ListByResourceGroupAsync(resourceGroupName, odataQuery).GetAwaiter().GetResult(); - } - - /// - /// Get all the deployments for a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group with the deployments to get. The name is - /// case insensitive. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByResourceGroupAsync(this IDeploymentsOperations operations, string resourceGroupName, ODataQuery odataQuery = default(ODataQuery), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, odataQuery, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Calculate the hash of the given template. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The template provided to calculate hash. - /// - public static TemplateHashResult CalculateTemplateHash(this IDeploymentsOperations operations, object template) - { - return operations.CalculateTemplateHashAsync(template).GetAwaiter().GetResult(); - } - - /// - /// Calculate the hash of the given template. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The template provided to calculate hash. - /// - /// - /// The cancellation token. - /// - public static async Task CalculateTemplateHashAsync(this IDeploymentsOperations operations, object template, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CalculateTemplateHashWithHttpMessagesAsync(template, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes a deployment from the deployment history. - /// - /// - /// A template deployment that is currently running cannot be deleted. Deleting - /// a template deployment removes the associated deployment operations. This is - /// an asynchronous operation that returns a status of 202 until the template - /// deployment is successfully deleted. The Location response header contains - /// the URI that is used to obtain the status of the process. While the process - /// is running, a call to the URI in the Location header returns a status of - /// 202. When the process finishes, the URI in the Location header returns a - /// status of 204 on success. If the asynchronous request failed, the URI in - /// the Location header returns an error-level status code. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource scope. - /// - /// - /// The name of the deployment. - /// - public static void BeginDeleteAtScope(this IDeploymentsOperations operations, string scope, string deploymentName) - { - operations.BeginDeleteAtScopeAsync(scope, deploymentName).GetAwaiter().GetResult(); - } - - /// - /// Deletes a deployment from the deployment history. - /// - /// - /// A template deployment that is currently running cannot be deleted. Deleting - /// a template deployment removes the associated deployment operations. This is - /// an asynchronous operation that returns a status of 202 until the template - /// deployment is successfully deleted. The Location response header contains - /// the URI that is used to obtain the status of the process. While the process - /// is running, a call to the URI in the Location header returns a status of - /// 202. When the process finishes, the URI in the Location header returns a - /// status of 204 on success. If the asynchronous request failed, the URI in - /// the Location header returns an error-level status code. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource scope. - /// - /// - /// The name of the deployment. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAtScopeAsync(this IDeploymentsOperations operations, string scope, string deploymentName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDeleteAtScopeWithHttpMessagesAsync(scope, deploymentName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Deploys resources at a given scope. - /// - /// - /// You can provide the template and parameters directly in the request or link - /// to JSON files. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource scope. - /// - /// - /// The name of the deployment. - /// - /// - /// Additional parameters supplied to the operation. - /// - public static DeploymentExtended BeginCreateOrUpdateAtScope(this IDeploymentsOperations operations, string scope, string deploymentName, Deployment parameters) - { - return operations.BeginCreateOrUpdateAtScopeAsync(scope, deploymentName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Deploys resources at a given scope. - /// - /// - /// You can provide the template and parameters directly in the request or link - /// to JSON files. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource scope. - /// - /// - /// The name of the deployment. - /// - /// - /// Additional parameters supplied to the operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAtScopeAsync(this IDeploymentsOperations operations, string scope, string deploymentName, Deployment parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginCreateOrUpdateAtScopeWithHttpMessagesAsync(scope, deploymentName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Validates whether the specified template is syntactically correct and will - /// be accepted by Azure Resource Manager.. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource scope. - /// - /// - /// The name of the deployment. - /// - /// - /// Parameters to validate. - /// - public static DeploymentValidateResult BeginValidateAtScope(this IDeploymentsOperations operations, string scope, string deploymentName, Deployment parameters) - { - return operations.BeginValidateAtScopeAsync(scope, deploymentName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Validates whether the specified template is syntactically correct and will - /// be accepted by Azure Resource Manager.. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource scope. - /// - /// - /// The name of the deployment. - /// - /// - /// Parameters to validate. - /// - /// - /// The cancellation token. - /// - public static async Task BeginValidateAtScopeAsync(this IDeploymentsOperations operations, string scope, string deploymentName, Deployment parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginValidateAtScopeWithHttpMessagesAsync(scope, deploymentName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes a deployment from the deployment history. - /// - /// - /// A template deployment that is currently running cannot be deleted. Deleting - /// a template deployment removes the associated deployment operations. This is - /// an asynchronous operation that returns a status of 202 until the template - /// deployment is successfully deleted. The Location response header contains - /// the URI that is used to obtain the status of the process. While the process - /// is running, a call to the URI in the Location header returns a status of - /// 202. When the process finishes, the URI in the Location header returns a - /// status of 204 on success. If the asynchronous request failed, the URI in - /// the Location header returns an error-level status code. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the deployment. - /// - public static void BeginDeleteAtTenantScope(this IDeploymentsOperations operations, string deploymentName) - { - operations.BeginDeleteAtTenantScopeAsync(deploymentName).GetAwaiter().GetResult(); - } - - /// - /// Deletes a deployment from the deployment history. - /// - /// - /// A template deployment that is currently running cannot be deleted. Deleting - /// a template deployment removes the associated deployment operations. This is - /// an asynchronous operation that returns a status of 202 until the template - /// deployment is successfully deleted. The Location response header contains - /// the URI that is used to obtain the status of the process. While the process - /// is running, a call to the URI in the Location header returns a status of - /// 202. When the process finishes, the URI in the Location header returns a - /// status of 204 on success. If the asynchronous request failed, the URI in - /// the Location header returns an error-level status code. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the deployment. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAtTenantScopeAsync(this IDeploymentsOperations operations, string deploymentName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDeleteAtTenantScopeWithHttpMessagesAsync(deploymentName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Deploys resources at tenant scope. - /// - /// - /// You can provide the template and parameters directly in the request or link - /// to JSON files. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the deployment. - /// - /// - /// Additional parameters supplied to the operation. - /// - public static DeploymentExtended BeginCreateOrUpdateAtTenantScope(this IDeploymentsOperations operations, string deploymentName, ScopedDeployment parameters) - { - return operations.BeginCreateOrUpdateAtTenantScopeAsync(deploymentName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Deploys resources at tenant scope. - /// - /// - /// You can provide the template and parameters directly in the request or link - /// to JSON files. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the deployment. - /// - /// - /// Additional parameters supplied to the operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAtTenantScopeAsync(this IDeploymentsOperations operations, string deploymentName, ScopedDeployment parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginCreateOrUpdateAtTenantScopeWithHttpMessagesAsync(deploymentName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Validates whether the specified template is syntactically correct and will - /// be accepted by Azure Resource Manager.. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the deployment. - /// - /// - /// Parameters to validate. - /// - public static DeploymentValidateResult BeginValidateAtTenantScope(this IDeploymentsOperations operations, string deploymentName, ScopedDeployment parameters) - { - return operations.BeginValidateAtTenantScopeAsync(deploymentName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Validates whether the specified template is syntactically correct and will - /// be accepted by Azure Resource Manager.. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the deployment. - /// - /// - /// Parameters to validate. - /// - /// - /// The cancellation token. - /// - public static async Task BeginValidateAtTenantScopeAsync(this IDeploymentsOperations operations, string deploymentName, ScopedDeployment parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginValidateAtTenantScopeWithHttpMessagesAsync(deploymentName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Returns changes that will be made by the deployment if executed at the - /// scope of the tenant group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the deployment. - /// - /// - /// Parameters to validate. - /// - public static WhatIfOperationResult BeginWhatIfAtTenantScope(this IDeploymentsOperations operations, string deploymentName, ScopedDeploymentWhatIf parameters) - { - return operations.BeginWhatIfAtTenantScopeAsync(deploymentName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Returns changes that will be made by the deployment if executed at the - /// scope of the tenant group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the deployment. - /// - /// - /// Parameters to validate. - /// - /// - /// The cancellation token. - /// - public static async Task BeginWhatIfAtTenantScopeAsync(this IDeploymentsOperations operations, string deploymentName, ScopedDeploymentWhatIf parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginWhatIfAtTenantScopeWithHttpMessagesAsync(deploymentName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes a deployment from the deployment history. - /// - /// - /// A template deployment that is currently running cannot be deleted. Deleting - /// a template deployment removes the associated deployment operations. This is - /// an asynchronous operation that returns a status of 202 until the template - /// deployment is successfully deleted. The Location response header contains - /// the URI that is used to obtain the status of the process. While the process - /// is running, a call to the URI in the Location header returns a status of - /// 202. When the process finishes, the URI in the Location header returns a - /// status of 204 on success. If the asynchronous request failed, the URI in - /// the Location header returns an error-level status code. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The management group ID. - /// - /// - /// The name of the deployment. - /// - public static void BeginDeleteAtManagementGroupScope(this IDeploymentsOperations operations, string groupId, string deploymentName) - { - operations.BeginDeleteAtManagementGroupScopeAsync(groupId, deploymentName).GetAwaiter().GetResult(); - } - - /// - /// Deletes a deployment from the deployment history. - /// - /// - /// A template deployment that is currently running cannot be deleted. Deleting - /// a template deployment removes the associated deployment operations. This is - /// an asynchronous operation that returns a status of 202 until the template - /// deployment is successfully deleted. The Location response header contains - /// the URI that is used to obtain the status of the process. While the process - /// is running, a call to the URI in the Location header returns a status of - /// 202. When the process finishes, the URI in the Location header returns a - /// status of 204 on success. If the asynchronous request failed, the URI in - /// the Location header returns an error-level status code. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The management group ID. - /// - /// - /// The name of the deployment. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAtManagementGroupScopeAsync(this IDeploymentsOperations operations, string groupId, string deploymentName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDeleteAtManagementGroupScopeWithHttpMessagesAsync(groupId, deploymentName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Deploys resources at management group scope. - /// - /// - /// You can provide the template and parameters directly in the request or link - /// to JSON files. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The management group ID. - /// - /// - /// The name of the deployment. - /// - /// - /// Additional parameters supplied to the operation. - /// - public static DeploymentExtended BeginCreateOrUpdateAtManagementGroupScope(this IDeploymentsOperations operations, string groupId, string deploymentName, ScopedDeployment parameters) - { - return operations.BeginCreateOrUpdateAtManagementGroupScopeAsync(groupId, deploymentName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Deploys resources at management group scope. - /// - /// - /// You can provide the template and parameters directly in the request or link - /// to JSON files. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The management group ID. - /// - /// - /// The name of the deployment. - /// - /// - /// Additional parameters supplied to the operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAtManagementGroupScopeAsync(this IDeploymentsOperations operations, string groupId, string deploymentName, ScopedDeployment parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginCreateOrUpdateAtManagementGroupScopeWithHttpMessagesAsync(groupId, deploymentName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Validates whether the specified template is syntactically correct and will - /// be accepted by Azure Resource Manager.. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The management group ID. - /// - /// - /// The name of the deployment. - /// - /// - /// Parameters to validate. - /// - public static DeploymentValidateResult BeginValidateAtManagementGroupScope(this IDeploymentsOperations operations, string groupId, string deploymentName, ScopedDeployment parameters) - { - return operations.BeginValidateAtManagementGroupScopeAsync(groupId, deploymentName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Validates whether the specified template is syntactically correct and will - /// be accepted by Azure Resource Manager.. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The management group ID. - /// - /// - /// The name of the deployment. - /// - /// - /// Parameters to validate. - /// - /// - /// The cancellation token. - /// - public static async Task BeginValidateAtManagementGroupScopeAsync(this IDeploymentsOperations operations, string groupId, string deploymentName, ScopedDeployment parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginValidateAtManagementGroupScopeWithHttpMessagesAsync(groupId, deploymentName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Returns changes that will be made by the deployment if executed at the - /// scope of the management group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The management group ID. - /// - /// - /// The name of the deployment. - /// - /// - /// Parameters to validate. - /// - public static WhatIfOperationResult BeginWhatIfAtManagementGroupScope(this IDeploymentsOperations operations, string groupId, string deploymentName, ScopedDeploymentWhatIf parameters) - { - return operations.BeginWhatIfAtManagementGroupScopeAsync(groupId, deploymentName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Returns changes that will be made by the deployment if executed at the - /// scope of the management group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The management group ID. - /// - /// - /// The name of the deployment. - /// - /// - /// Parameters to validate. - /// - /// - /// The cancellation token. - /// - public static async Task BeginWhatIfAtManagementGroupScopeAsync(this IDeploymentsOperations operations, string groupId, string deploymentName, ScopedDeploymentWhatIf parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginWhatIfAtManagementGroupScopeWithHttpMessagesAsync(groupId, deploymentName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes a deployment from the deployment history. - /// - /// - /// A template deployment that is currently running cannot be deleted. Deleting - /// a template deployment removes the associated deployment operations. This is - /// an asynchronous operation that returns a status of 202 until the template - /// deployment is successfully deleted. The Location response header contains - /// the URI that is used to obtain the status of the process. While the process - /// is running, a call to the URI in the Location header returns a status of - /// 202. When the process finishes, the URI in the Location header returns a - /// status of 204 on success. If the asynchronous request failed, the URI in - /// the Location header returns an error-level status code. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the deployment. - /// - public static void BeginDeleteAtSubscriptionScope(this IDeploymentsOperations operations, string deploymentName) - { - operations.BeginDeleteAtSubscriptionScopeAsync(deploymentName).GetAwaiter().GetResult(); - } - - /// - /// Deletes a deployment from the deployment history. - /// - /// - /// A template deployment that is currently running cannot be deleted. Deleting - /// a template deployment removes the associated deployment operations. This is - /// an asynchronous operation that returns a status of 202 until the template - /// deployment is successfully deleted. The Location response header contains - /// the URI that is used to obtain the status of the process. While the process - /// is running, a call to the URI in the Location header returns a status of - /// 202. When the process finishes, the URI in the Location header returns a - /// status of 204 on success. If the asynchronous request failed, the URI in - /// the Location header returns an error-level status code. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the deployment. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAtSubscriptionScopeAsync(this IDeploymentsOperations operations, string deploymentName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDeleteAtSubscriptionScopeWithHttpMessagesAsync(deploymentName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Deploys resources at subscription scope. - /// - /// - /// You can provide the template and parameters directly in the request or link - /// to JSON files. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the deployment. - /// - /// - /// Additional parameters supplied to the operation. - /// - public static DeploymentExtended BeginCreateOrUpdateAtSubscriptionScope(this IDeploymentsOperations operations, string deploymentName, Deployment parameters) - { - return operations.BeginCreateOrUpdateAtSubscriptionScopeAsync(deploymentName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Deploys resources at subscription scope. - /// - /// - /// You can provide the template and parameters directly in the request or link - /// to JSON files. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the deployment. - /// - /// - /// Additional parameters supplied to the operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAtSubscriptionScopeAsync(this IDeploymentsOperations operations, string deploymentName, Deployment parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginCreateOrUpdateAtSubscriptionScopeWithHttpMessagesAsync(deploymentName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Validates whether the specified template is syntactically correct and will - /// be accepted by Azure Resource Manager.. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the deployment. - /// - /// - /// Parameters to validate. - /// - public static DeploymentValidateResult BeginValidateAtSubscriptionScope(this IDeploymentsOperations operations, string deploymentName, Deployment parameters) - { - return operations.BeginValidateAtSubscriptionScopeAsync(deploymentName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Validates whether the specified template is syntactically correct and will - /// be accepted by Azure Resource Manager.. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the deployment. - /// - /// - /// Parameters to validate. - /// - /// - /// The cancellation token. - /// - public static async Task BeginValidateAtSubscriptionScopeAsync(this IDeploymentsOperations operations, string deploymentName, Deployment parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginValidateAtSubscriptionScopeWithHttpMessagesAsync(deploymentName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Returns changes that will be made by the deployment if executed at the - /// scope of the subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the deployment. - /// - /// - /// Parameters to What If. - /// - public static WhatIfOperationResult BeginWhatIfAtSubscriptionScope(this IDeploymentsOperations operations, string deploymentName, DeploymentWhatIf parameters) - { - return operations.BeginWhatIfAtSubscriptionScopeAsync(deploymentName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Returns changes that will be made by the deployment if executed at the - /// scope of the subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the deployment. - /// - /// - /// Parameters to What If. - /// - /// - /// The cancellation token. - /// - public static async Task BeginWhatIfAtSubscriptionScopeAsync(this IDeploymentsOperations operations, string deploymentName, DeploymentWhatIf parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginWhatIfAtSubscriptionScopeWithHttpMessagesAsync(deploymentName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes a deployment from the deployment history. - /// - /// - /// A template deployment that is currently running cannot be deleted. Deleting - /// a template deployment removes the associated deployment operations. - /// Deleting a template deployment does not affect the state of the resource - /// group. This is an asynchronous operation that returns a status of 202 until - /// the template deployment is successfully deleted. The Location response - /// header contains the URI that is used to obtain the status of the process. - /// While the process is running, a call to the URI in the Location header - /// returns a status of 202. When the process finishes, the URI in the Location - /// header returns a status of 204 on success. If the asynchronous request - /// failed, the URI in the Location header returns an error-level status code. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group with the deployment to delete. The name is - /// case insensitive. - /// - /// - /// The name of the deployment. - /// - public static void BeginDelete(this IDeploymentsOperations operations, string resourceGroupName, string deploymentName) - { - operations.BeginDeleteAsync(resourceGroupName, deploymentName).GetAwaiter().GetResult(); - } - - /// - /// Deletes a deployment from the deployment history. - /// - /// - /// A template deployment that is currently running cannot be deleted. Deleting - /// a template deployment removes the associated deployment operations. - /// Deleting a template deployment does not affect the state of the resource - /// group. This is an asynchronous operation that returns a status of 202 until - /// the template deployment is successfully deleted. The Location response - /// header contains the URI that is used to obtain the status of the process. - /// While the process is running, a call to the URI in the Location header - /// returns a status of 202. When the process finishes, the URI in the Location - /// header returns a status of 204 on success. If the asynchronous request - /// failed, the URI in the Location header returns an error-level status code. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group with the deployment to delete. The name is - /// case insensitive. - /// - /// - /// The name of the deployment. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IDeploymentsOperations operations, string resourceGroupName, string deploymentName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, deploymentName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Deploys resources to a resource group. - /// - /// - /// You can provide the template and parameters directly in the request or link - /// to JSON files. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group to deploy the resources to. The name is case - /// insensitive. The resource group must already exist. - /// - /// - /// The name of the deployment. - /// - /// - /// Additional parameters supplied to the operation. - /// - public static DeploymentExtended BeginCreateOrUpdate(this IDeploymentsOperations operations, string resourceGroupName, string deploymentName, Deployment parameters) - { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, deploymentName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Deploys resources to a resource group. - /// - /// - /// You can provide the template and parameters directly in the request or link - /// to JSON files. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group to deploy the resources to. The name is case - /// insensitive. The resource group must already exist. - /// - /// - /// The name of the deployment. - /// - /// - /// Additional parameters supplied to the operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this IDeploymentsOperations operations, string resourceGroupName, string deploymentName, Deployment parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, deploymentName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Validates whether the specified template is syntactically correct and will - /// be accepted by Azure Resource Manager.. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group the template will be deployed to. The name - /// is case insensitive. - /// - /// - /// The name of the deployment. - /// - /// - /// Parameters to validate. - /// - public static DeploymentValidateResult BeginValidate(this IDeploymentsOperations operations, string resourceGroupName, string deploymentName, Deployment parameters) - { - return operations.BeginValidateAsync(resourceGroupName, deploymentName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Validates whether the specified template is syntactically correct and will - /// be accepted by Azure Resource Manager.. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group the template will be deployed to. The name - /// is case insensitive. - /// - /// - /// The name of the deployment. - /// - /// - /// Parameters to validate. - /// - /// - /// The cancellation token. - /// - public static async Task BeginValidateAsync(this IDeploymentsOperations operations, string resourceGroupName, string deploymentName, Deployment parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginValidateWithHttpMessagesAsync(resourceGroupName, deploymentName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Returns changes that will be made by the deployment if executed at the - /// scope of the resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group the template will be deployed to. The name - /// is case insensitive. - /// - /// - /// The name of the deployment. - /// - /// - /// Parameters to validate. - /// - public static WhatIfOperationResult BeginWhatIf(this IDeploymentsOperations operations, string resourceGroupName, string deploymentName, DeploymentWhatIf parameters) - { - return operations.BeginWhatIfAsync(resourceGroupName, deploymentName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Returns changes that will be made by the deployment if executed at the - /// scope of the resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group the template will be deployed to. The name - /// is case insensitive. - /// - /// - /// The name of the deployment. - /// - /// - /// Parameters to validate. - /// - /// - /// The cancellation token. - /// - public static async Task BeginWhatIfAsync(this IDeploymentsOperations operations, string resourceGroupName, string deploymentName, DeploymentWhatIf parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginWhatIfWithHttpMessagesAsync(resourceGroupName, deploymentName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Get all the deployments at the given scope. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListAtScopeNext(this IDeploymentsOperations operations, string nextPageLink) - { - return operations.ListAtScopeNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Get all the deployments at the given scope. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAtScopeNextAsync(this IDeploymentsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListAtScopeNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Get all the deployments at the tenant scope. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListAtTenantScopeNext(this IDeploymentsOperations operations, string nextPageLink) - { - return operations.ListAtTenantScopeNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Get all the deployments at the tenant scope. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAtTenantScopeNextAsync(this IDeploymentsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListAtTenantScopeNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Get all the deployments for a management group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListAtManagementGroupScopeNext(this IDeploymentsOperations operations, string nextPageLink) - { - return operations.ListAtManagementGroupScopeNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Get all the deployments for a management group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAtManagementGroupScopeNextAsync(this IDeploymentsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListAtManagementGroupScopeNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Get all the deployments for a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListAtSubscriptionScopeNext(this IDeploymentsOperations operations, string nextPageLink) - { - return operations.ListAtSubscriptionScopeNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Get all the deployments for a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAtSubscriptionScopeNextAsync(this IDeploymentsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListAtSubscriptionScopeNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Get all the deployments for a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListByResourceGroupNext(this IDeploymentsOperations operations, string nextPageLink) - { - return operations.ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Get all the deployments for a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByResourceGroupNextAsync(this IDeploymentsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - } -} diff --git a/src/Resources/Resources.Sdk/Generated/FeatureClientExtensions.cs b/src/Resources/Resources.Sdk/Generated/FeatureClientExtensions.cs deleted file mode 100644 index 540df4d86502..000000000000 --- a/src/Resources/Resources.Sdk/Generated/FeatureClientExtensions.cs +++ /dev/null @@ -1,87 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Resources -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Threading; - using System.Threading.Tasks; - - /// - /// Extension methods for FeatureClient. - /// - public static partial class FeatureClientExtensions - { - /// - /// Lists all of the available Microsoft.Features REST API operations. - /// - /// - /// The operations group for this extension method. - /// - public static IPage ListOperations(this IFeatureClient operations) - { - return operations.ListOperationsAsync().GetAwaiter().GetResult(); - } - - /// - /// Lists all of the available Microsoft.Features REST API operations. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The cancellation token. - /// - public static async Task> ListOperationsAsync(this IFeatureClient operations, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListOperationsWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Lists all of the available Microsoft.Features REST API operations. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListOperationsNext(this IFeatureClient operations, string nextPageLink) - { - return operations.ListOperationsNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Lists all of the available Microsoft.Features REST API operations. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListOperationsNextAsync(this IFeatureClient operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListOperationsNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - } -} diff --git a/src/Resources/Resources.Sdk/Generated/FeaturesOperationsExtensions.cs b/src/Resources/Resources.Sdk/Generated/FeaturesOperationsExtensions.cs deleted file mode 100644 index 65f6f564dadf..000000000000 --- a/src/Resources/Resources.Sdk/Generated/FeaturesOperationsExtensions.cs +++ /dev/null @@ -1,283 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Resources -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Threading; - using System.Threading.Tasks; - - /// - /// Extension methods for FeaturesOperations. - /// - public static partial class FeaturesOperationsExtensions - { - /// - /// Gets all the preview features that are available through AFEC for the - /// subscription. - /// - /// - /// The operations group for this extension method. - /// - public static IPage ListAll(this IFeaturesOperations operations) - { - return operations.ListAllAsync().GetAwaiter().GetResult(); - } - - /// - /// Gets all the preview features that are available through AFEC for the - /// subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAllAsync(this IFeaturesOperations operations, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListAllWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets all the preview features in a provider namespace that are available - /// through AFEC for the subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The namespace of the resource provider for getting features. - /// - public static IPage List(this IFeaturesOperations operations, string resourceProviderNamespace) - { - return operations.ListAsync(resourceProviderNamespace).GetAwaiter().GetResult(); - } - - /// - /// Gets all the preview features in a provider namespace that are available - /// through AFEC for the subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The namespace of the resource provider for getting features. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IFeaturesOperations operations, string resourceProviderNamespace, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceProviderNamespace, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets the preview feature with the specified name. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource provider namespace for the feature. - /// - /// - /// The name of the feature to get. - /// - public static FeatureResult Get(this IFeaturesOperations operations, string resourceProviderNamespace, string featureName) - { - return operations.GetAsync(resourceProviderNamespace, featureName).GetAwaiter().GetResult(); - } - - /// - /// Gets the preview feature with the specified name. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource provider namespace for the feature. - /// - /// - /// The name of the feature to get. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IFeaturesOperations operations, string resourceProviderNamespace, string featureName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceProviderNamespace, featureName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Registers the preview feature for the subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The namespace of the resource provider. - /// - /// - /// The name of the feature to register. - /// - public static FeatureResult Register(this IFeaturesOperations operations, string resourceProviderNamespace, string featureName) - { - return operations.RegisterAsync(resourceProviderNamespace, featureName).GetAwaiter().GetResult(); - } - - /// - /// Registers the preview feature for the subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The namespace of the resource provider. - /// - /// - /// The name of the feature to register. - /// - /// - /// The cancellation token. - /// - public static async Task RegisterAsync(this IFeaturesOperations operations, string resourceProviderNamespace, string featureName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.RegisterWithHttpMessagesAsync(resourceProviderNamespace, featureName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Unregisters the preview feature for the subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The namespace of the resource provider. - /// - /// - /// The name of the feature to unregister. - /// - public static FeatureResult Unregister(this IFeaturesOperations operations, string resourceProviderNamespace, string featureName) - { - return operations.UnregisterAsync(resourceProviderNamespace, featureName).GetAwaiter().GetResult(); - } - - /// - /// Unregisters the preview feature for the subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The namespace of the resource provider. - /// - /// - /// The name of the feature to unregister. - /// - /// - /// The cancellation token. - /// - public static async Task UnregisterAsync(this IFeaturesOperations operations, string resourceProviderNamespace, string featureName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.UnregisterWithHttpMessagesAsync(resourceProviderNamespace, featureName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets all the preview features that are available through AFEC for the - /// subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListAllNext(this IFeaturesOperations operations, string nextPageLink) - { - return operations.ListAllNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets all the preview features that are available through AFEC for the - /// subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAllNextAsync(this IFeaturesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListAllNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets all the preview features in a provider namespace that are available - /// through AFEC for the subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IFeaturesOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets all the preview features in a provider namespace that are available - /// through AFEC for the subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this IFeaturesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - } -} diff --git a/src/Resources/Resources.Sdk/Generated/IFeatureClient.cs b/src/Resources/Resources.Sdk/Generated/IFeatureClient.cs deleted file mode 100644 index 1faa100a26e9..000000000000 --- a/src/Resources/Resources.Sdk/Generated/IFeatureClient.cs +++ /dev/null @@ -1,111 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Resources -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; - - /// - /// - public partial interface IFeatureClient : System.IDisposable - { - /// - /// The base URI of the service. - /// - System.Uri BaseUri { get; set; } - - /// - /// Gets or sets json serialization settings. - /// - JsonSerializerSettings SerializationSettings { get; } - - /// - /// Gets or sets json deserialization settings. - /// - JsonSerializerSettings DeserializationSettings { get; } - - /// - /// Credentials needed for the client to connect to Azure. - /// - ServiceClientCredentials Credentials { get; } - - /// - /// The Azure subscription ID. - /// - string SubscriptionId { get; set; } - - /// - /// The API version to use for this operation. - /// - string ApiVersion { get; } - - /// - /// The preferred language for the response. - /// - string AcceptLanguage { get; set; } - - /// - /// The retry timeout in seconds for Long Running Operations. Default - /// value is 30. - /// - int? LongRunningOperationRetryTimeout { get; set; } - - /// - /// Whether a unique x-ms-client-request-id should be generated. When - /// set to true a unique x-ms-client-request-id value is generated and - /// included in each request. Default is true. - /// - bool? GenerateClientRequestId { get; set; } - - - /// - /// Gets the IFeaturesOperations. - /// - IFeaturesOperations Features { get; } - - /// - /// Gets the ISubscriptionFeatureRegistrationsOperations. - /// - ISubscriptionFeatureRegistrationsOperations SubscriptionFeatureRegistrations { get; } - - /// - /// Lists all of the available Microsoft.Features REST API operations. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - Task>> ListOperationsWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - - /// - /// Lists all of the available Microsoft.Features REST API operations. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - Task>> ListOperationsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - - } -} diff --git a/src/Resources/Resources.Sdk/Generated/ITagsOperations.cs b/src/Resources/Resources.Sdk/Generated/ITagsOperations.cs deleted file mode 100644 index 5557b50a7878..000000000000 --- a/src/Resources/Resources.Sdk/Generated/ITagsOperations.cs +++ /dev/null @@ -1,299 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Resources -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; - - /// - /// TagsOperations operations. - /// - public partial interface ITagsOperations - { - /// - /// Deletes a predefined tag value for a predefined tag name. - /// - /// - /// This operation allows deleting a value from the list of predefined - /// values for an existing predefined tag name. The value being deleted - /// must not be in use as a tag value for the given tag name for any - /// resource. - /// - /// - /// The name of the tag. - /// - /// - /// The value of the tag to delete. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteValueWithHttpMessagesAsync(string tagName, string tagValue, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Creates a predefined value for a predefined tag name. - /// - /// - /// This operation allows adding a value to the list of predefined - /// values for an existing predefined tag name. A tag value can have a - /// maximum of 256 characters. - /// - /// - /// The name of the tag. - /// - /// - /// The value of the tag to create. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateValueWithHttpMessagesAsync(string tagName, string tagValue, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Creates a predefined tag name. - /// - /// - /// This operation allows adding a name to the list of predefined tag - /// names for the given subscription. A tag name can have a maximum of - /// 512 characters and is case-insensitive. Tag names cannot have the - /// following prefixes which are reserved for Azure use: 'microsoft', - /// 'azure', 'windows'. - /// - /// - /// The name of the tag to create. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string tagName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Deletes a predefined tag name. - /// - /// - /// This operation allows deleting a name from the list of predefined - /// tag names for the given subscription. The name being deleted must - /// not be in use as a tag name for any resource. All predefined values - /// for the given name must have already been deleted. - /// - /// - /// The name of the tag. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string tagName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets a summary of tag usage under the subscription. - /// - /// - /// This operation performs a union of predefined tags, resource tags, - /// resource group tags and subscription tags, and returns a summary of - /// usage for each tag name and value under the given subscription. In - /// case of a large number of tags, this operation may return a - /// previously cached result. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Creates or updates the entire set of tags on a resource or - /// subscription. - /// - /// - /// This operation allows adding or replacing the entire set of tags on - /// the specified resource or subscription. The specified entity can - /// have a maximum of 50 tags. - /// - /// - /// The resource scope. - /// - /// - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateAtScopeWithHttpMessagesAsync(string scope, TagsResource parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Selectively updates the set of tags on a resource or subscription. - /// - /// - /// This operation allows replacing, merging or selectively deleting - /// tags on the specified resource or subscription. The specified - /// entity can have a maximum of 50 tags at the end of the operation. - /// The 'replace' option replaces the entire set of existing tags with - /// a new set. The 'merge' option allows adding tags with new names and - /// updating the values of tags with existing names. The 'delete' - /// option allows selectively deleting tags based on given names or - /// name/value pairs. - /// - /// - /// The resource scope. - /// - /// - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateAtScopeWithHttpMessagesAsync(string scope, TagsPatchResource parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets the entire set of tags on a resource or subscription. - /// - /// - /// The resource scope. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task> GetAtScopeWithHttpMessagesAsync(string scope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Deletes the entire set of tags on a resource or subscription. - /// - /// - /// The resource scope. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteAtScopeWithHttpMessagesAsync(string scope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets a summary of tag usage under the subscription. - /// - /// - /// This operation performs a union of predefined tags, resource tags, - /// resource group tags and subscription tags, and returns a summary of - /// usage for each tag name and value under the given subscription. In - /// case of a large number of tags, this operation may return a - /// previously cached result. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - } -} diff --git a/src/Resources/Resources.Sdk/Generated/Models/Alias.cs b/src/Resources/Resources.Sdk/Generated/Models/Alias.cs deleted file mode 100644 index 7ab83c96e4f1..000000000000 --- a/src/Resources/Resources.Sdk/Generated/Models/Alias.cs +++ /dev/null @@ -1,99 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Resources.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// The alias type. - /// - public partial class Alias - { - /// - /// Initializes a new instance of the Alias class. - /// - public Alias() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the Alias class. - /// - /// The alias name. - /// The paths for an alias. - /// The type of the alias. Possible values include: - /// 'NotSpecified', 'PlainText', 'Mask' - /// The default path for an alias. - /// The default pattern for an - /// alias. - /// The default alias path metadata. - /// Applies to the default path and to any alias path that doesn't have - /// metadata - public Alias(string name = default(string), IList paths = default(IList), AliasType? type = default(AliasType?), string defaultPath = default(string), AliasPattern defaultPattern = default(AliasPattern), AliasPathMetadata defaultMetadata = default(AliasPathMetadata)) - { - Name = name; - Paths = paths; - Type = type; - DefaultPath = defaultPath; - DefaultPattern = defaultPattern; - DefaultMetadata = defaultMetadata; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the alias name. - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - /// - /// Gets or sets the paths for an alias. - /// - [JsonProperty(PropertyName = "paths")] - public IList Paths { get; set; } - - /// - /// Gets or sets the type of the alias. Possible values include: - /// 'NotSpecified', 'PlainText', 'Mask' - /// - [JsonProperty(PropertyName = "type")] - public AliasType? Type { get; set; } - - /// - /// Gets or sets the default path for an alias. - /// - [JsonProperty(PropertyName = "defaultPath")] - public string DefaultPath { get; set; } - - /// - /// Gets or sets the default pattern for an alias. - /// - [JsonProperty(PropertyName = "defaultPattern")] - public AliasPattern DefaultPattern { get; set; } - - /// - /// Gets the default alias path metadata. Applies to the default path - /// and to any alias path that doesn't have metadata - /// - [JsonProperty(PropertyName = "defaultMetadata")] - public AliasPathMetadata DefaultMetadata { get; private set; } - - } -} diff --git a/src/Resources/Resources.Sdk/Generated/Models/AzureCliScript.cs b/src/Resources/Resources.Sdk/Generated/Models/AzureCliScript.cs deleted file mode 100644 index 0ab8db603065..000000000000 --- a/src/Resources/Resources.Sdk/Generated/Models/AzureCliScript.cs +++ /dev/null @@ -1,244 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Resources.Models -{ - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Object model for the Azure CLI script. - /// - [Newtonsoft.Json.JsonObject("AzureCLI")] - [Rest.Serialization.JsonTransformation] - public partial class AzureCliScript : DeploymentScript - { - /// - /// Initializes a new instance of the AzureCliScript class. - /// - public AzureCliScript() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the AzureCliScript class. - /// - /// The location of the ACI and the storage - /// account for the deployment script. - /// Interval for which the service - /// retains the script resource after it reaches a terminal state. - /// Resource will be deleted when this duration expires. Duration is - /// based on ISO 8601 pattern (for example P1D means one day). - /// Azure CLI module version to be - /// used. - /// String Id used to locate any resource on - /// Azure. - /// Name of this resource. - /// Type of this resource. - /// Optional property. Managed identity to be - /// used for this deployment script. Currently, only user-assigned MSI - /// is supported. - /// Resource tags. - /// The system metadata related to this - /// resource. - /// Container settings. - /// Storage Account - /// settings. - /// The clean up preference when the - /// script execution gets in a terminal state. Default setting is - /// 'Always'. Possible values include: 'Always', 'OnSuccess', - /// 'OnExpiration' - /// State of the script execution. This - /// only appears in the response. Possible values include: 'Creating', - /// 'ProvisioningResources', 'Running', 'Succeeded', 'Failed', - /// 'Canceled' - /// Contains the results of script - /// execution. - /// List of script outputs. - /// Uri for the script. This is the - /// entry point for the external script. - /// Supporting files for the - /// external script. - /// Script body. - /// Command line arguments to pass to the - /// script. Arguments are separated by spaces. ex: -Name blue* - /// -Location 'West US 2' - /// The environment variables to - /// pass over to the script. - /// Gets or sets how the deployment script - /// should be forced to execute even if the script resource has not - /// changed. Can be current time stamp or a GUID. - /// Maximum allowed script execution time - /// specified in ISO 8601 format. Default value is P1D - public AzureCliScript(string location, System.TimeSpan retentionInterval, string azCliVersion, string id = default(string), string name = default(string), string type = default(string), ManagedServiceIdentity identity = default(ManagedServiceIdentity), IDictionary tags = default(IDictionary), SystemData systemData = default(SystemData), ContainerConfiguration containerSettings = default(ContainerConfiguration), StorageAccountConfiguration storageAccountSettings = default(StorageAccountConfiguration), string cleanupPreference = default(string), string provisioningState = default(string), ScriptStatus status = default(ScriptStatus), IDictionary outputs = default(IDictionary), string primaryScriptUri = default(string), IList supportingScriptUris = default(IList), string scriptContent = default(string), string arguments = default(string), IList environmentVariables = default(IList), string forceUpdateTag = default(string), System.TimeSpan? timeout = default(System.TimeSpan?)) - : base(location, id, name, type, identity, tags, systemData) - { - ContainerSettings = containerSettings; - StorageAccountSettings = storageAccountSettings; - CleanupPreference = cleanupPreference; - ProvisioningState = provisioningState; - Status = status; - Outputs = outputs; - PrimaryScriptUri = primaryScriptUri; - SupportingScriptUris = supportingScriptUris; - ScriptContent = scriptContent; - Arguments = arguments; - EnvironmentVariables = environmentVariables; - ForceUpdateTag = forceUpdateTag; - RetentionInterval = retentionInterval; - Timeout = timeout; - AzCliVersion = azCliVersion; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets container settings. - /// - [JsonProperty(PropertyName = "properties.containerSettings")] - public ContainerConfiguration ContainerSettings { get; set; } - - /// - /// Gets or sets storage Account settings. - /// - [JsonProperty(PropertyName = "properties.storageAccountSettings")] - public StorageAccountConfiguration StorageAccountSettings { get; set; } - - /// - /// Gets or sets the clean up preference when the script execution gets - /// in a terminal state. Default setting is 'Always'. Possible values - /// include: 'Always', 'OnSuccess', 'OnExpiration' - /// - [JsonProperty(PropertyName = "properties.cleanupPreference")] - public string CleanupPreference { get; set; } - - /// - /// Gets state of the script execution. This only appears in the - /// response. Possible values include: 'Creating', - /// 'ProvisioningResources', 'Running', 'Succeeded', 'Failed', - /// 'Canceled' - /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } - - /// - /// Gets contains the results of script execution. - /// - [JsonProperty(PropertyName = "properties.status")] - public ScriptStatus Status { get; private set; } - - /// - /// Gets list of script outputs. - /// - [JsonProperty(PropertyName = "properties.outputs")] - public IDictionary Outputs { get; private set; } - - /// - /// Gets or sets uri for the script. This is the entry point for the - /// external script. - /// - [JsonProperty(PropertyName = "properties.primaryScriptUri")] - public string PrimaryScriptUri { get; set; } - - /// - /// Gets or sets supporting files for the external script. - /// - [JsonProperty(PropertyName = "properties.supportingScriptUris")] - public IList SupportingScriptUris { get; set; } - - /// - /// Gets or sets script body. - /// - [JsonProperty(PropertyName = "properties.scriptContent")] - public string ScriptContent { get; set; } - - /// - /// Gets or sets command line arguments to pass to the script. - /// Arguments are separated by spaces. ex: -Name blue* -Location 'West - /// US 2' - /// - [JsonProperty(PropertyName = "properties.arguments")] - public string Arguments { get; set; } - - /// - /// Gets or sets the environment variables to pass over to the script. - /// - [JsonProperty(PropertyName = "properties.environmentVariables")] - public IList EnvironmentVariables { get; set; } - - /// - /// Gets or sets how the deployment script should be forced to execute - /// even if the script resource has not changed. Can be current time - /// stamp or a GUID. - /// - [JsonProperty(PropertyName = "properties.forceUpdateTag")] - public string ForceUpdateTag { get; set; } - - /// - /// Gets or sets interval for which the service retains the script - /// resource after it reaches a terminal state. Resource will be - /// deleted when this duration expires. Duration is based on ISO 8601 - /// pattern (for example P1D means one day). - /// - [JsonProperty(PropertyName = "properties.retentionInterval")] - public System.TimeSpan RetentionInterval { get; set; } - - /// - /// Gets or sets maximum allowed script execution time specified in ISO - /// 8601 format. Default value is P1D - /// - [JsonProperty(PropertyName = "properties.timeout")] - public System.TimeSpan? Timeout { get; set; } - - /// - /// Gets or sets azure CLI module version to be used. - /// - [JsonProperty(PropertyName = "properties.azCliVersion")] - public string AzCliVersion { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public override void Validate() - { - base.Validate(); - if (AzCliVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "AzCliVersion"); - } - if (ContainerSettings != null) - { - ContainerSettings.Validate(); - } - if (EnvironmentVariables != null) - { - foreach (var element in EnvironmentVariables) - { - if (element != null) - { - element.Validate(); - } - } - } - } - } -} diff --git a/src/Resources/Resources.Sdk/Generated/Models/AzurePowerShellScript.cs b/src/Resources/Resources.Sdk/Generated/Models/AzurePowerShellScript.cs deleted file mode 100644 index 678104696514..000000000000 --- a/src/Resources/Resources.Sdk/Generated/Models/AzurePowerShellScript.cs +++ /dev/null @@ -1,244 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Resources.Models -{ - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Object model for the Azure PowerShell script. - /// - [Newtonsoft.Json.JsonObject("AzurePowerShell")] - [Rest.Serialization.JsonTransformation] - public partial class AzurePowerShellScript : DeploymentScript - { - /// - /// Initializes a new instance of the AzurePowerShellScript class. - /// - public AzurePowerShellScript() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the AzurePowerShellScript class. - /// - /// The location of the ACI and the storage - /// account for the deployment script. - /// Interval for which the service - /// retains the script resource after it reaches a terminal state. - /// Resource will be deleted when this duration expires. Duration is - /// based on ISO 8601 pattern (for example P1D means one day). - /// Azure PowerShell module version - /// to be used. - /// String Id used to locate any resource on - /// Azure. - /// Name of this resource. - /// Type of this resource. - /// Optional property. Managed identity to be - /// used for this deployment script. Currently, only user-assigned MSI - /// is supported. - /// Resource tags. - /// The system metadata related to this - /// resource. - /// Container settings. - /// Storage Account - /// settings. - /// The clean up preference when the - /// script execution gets in a terminal state. Default setting is - /// 'Always'. Possible values include: 'Always', 'OnSuccess', - /// 'OnExpiration' - /// State of the script execution. This - /// only appears in the response. Possible values include: 'Creating', - /// 'ProvisioningResources', 'Running', 'Succeeded', 'Failed', - /// 'Canceled' - /// Contains the results of script - /// execution. - /// List of script outputs. - /// Uri for the script. This is the - /// entry point for the external script. - /// Supporting files for the - /// external script. - /// Script body. - /// Command line arguments to pass to the - /// script. Arguments are separated by spaces. ex: -Name blue* - /// -Location 'West US 2' - /// The environment variables to - /// pass over to the script. - /// Gets or sets how the deployment script - /// should be forced to execute even if the script resource has not - /// changed. Can be current time stamp or a GUID. - /// Maximum allowed script execution time - /// specified in ISO 8601 format. Default value is P1D - public AzurePowerShellScript(string location, System.TimeSpan retentionInterval, string azPowerShellVersion, string id = default(string), string name = default(string), string type = default(string), ManagedServiceIdentity identity = default(ManagedServiceIdentity), IDictionary tags = default(IDictionary), SystemData systemData = default(SystemData), ContainerConfiguration containerSettings = default(ContainerConfiguration), StorageAccountConfiguration storageAccountSettings = default(StorageAccountConfiguration), string cleanupPreference = default(string), string provisioningState = default(string), ScriptStatus status = default(ScriptStatus), IDictionary outputs = default(IDictionary), string primaryScriptUri = default(string), IList supportingScriptUris = default(IList), string scriptContent = default(string), string arguments = default(string), IList environmentVariables = default(IList), string forceUpdateTag = default(string), System.TimeSpan? timeout = default(System.TimeSpan?)) - : base(location, id, name, type, identity, tags, systemData) - { - ContainerSettings = containerSettings; - StorageAccountSettings = storageAccountSettings; - CleanupPreference = cleanupPreference; - ProvisioningState = provisioningState; - Status = status; - Outputs = outputs; - PrimaryScriptUri = primaryScriptUri; - SupportingScriptUris = supportingScriptUris; - ScriptContent = scriptContent; - Arguments = arguments; - EnvironmentVariables = environmentVariables; - ForceUpdateTag = forceUpdateTag; - RetentionInterval = retentionInterval; - Timeout = timeout; - AzPowerShellVersion = azPowerShellVersion; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets container settings. - /// - [JsonProperty(PropertyName = "properties.containerSettings")] - public ContainerConfiguration ContainerSettings { get; set; } - - /// - /// Gets or sets storage Account settings. - /// - [JsonProperty(PropertyName = "properties.storageAccountSettings")] - public StorageAccountConfiguration StorageAccountSettings { get; set; } - - /// - /// Gets or sets the clean up preference when the script execution gets - /// in a terminal state. Default setting is 'Always'. Possible values - /// include: 'Always', 'OnSuccess', 'OnExpiration' - /// - [JsonProperty(PropertyName = "properties.cleanupPreference")] - public string CleanupPreference { get; set; } - - /// - /// Gets state of the script execution. This only appears in the - /// response. Possible values include: 'Creating', - /// 'ProvisioningResources', 'Running', 'Succeeded', 'Failed', - /// 'Canceled' - /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } - - /// - /// Gets contains the results of script execution. - /// - [JsonProperty(PropertyName = "properties.status")] - public ScriptStatus Status { get; private set; } - - /// - /// Gets list of script outputs. - /// - [JsonProperty(PropertyName = "properties.outputs")] - public IDictionary Outputs { get; private set; } - - /// - /// Gets or sets uri for the script. This is the entry point for the - /// external script. - /// - [JsonProperty(PropertyName = "properties.primaryScriptUri")] - public string PrimaryScriptUri { get; set; } - - /// - /// Gets or sets supporting files for the external script. - /// - [JsonProperty(PropertyName = "properties.supportingScriptUris")] - public IList SupportingScriptUris { get; set; } - - /// - /// Gets or sets script body. - /// - [JsonProperty(PropertyName = "properties.scriptContent")] - public string ScriptContent { get; set; } - - /// - /// Gets or sets command line arguments to pass to the script. - /// Arguments are separated by spaces. ex: -Name blue* -Location 'West - /// US 2' - /// - [JsonProperty(PropertyName = "properties.arguments")] - public string Arguments { get; set; } - - /// - /// Gets or sets the environment variables to pass over to the script. - /// - [JsonProperty(PropertyName = "properties.environmentVariables")] - public IList EnvironmentVariables { get; set; } - - /// - /// Gets or sets how the deployment script should be forced to execute - /// even if the script resource has not changed. Can be current time - /// stamp or a GUID. - /// - [JsonProperty(PropertyName = "properties.forceUpdateTag")] - public string ForceUpdateTag { get; set; } - - /// - /// Gets or sets interval for which the service retains the script - /// resource after it reaches a terminal state. Resource will be - /// deleted when this duration expires. Duration is based on ISO 8601 - /// pattern (for example P1D means one day). - /// - [JsonProperty(PropertyName = "properties.retentionInterval")] - public System.TimeSpan RetentionInterval { get; set; } - - /// - /// Gets or sets maximum allowed script execution time specified in ISO - /// 8601 format. Default value is P1D - /// - [JsonProperty(PropertyName = "properties.timeout")] - public System.TimeSpan? Timeout { get; set; } - - /// - /// Gets or sets azure PowerShell module version to be used. - /// - [JsonProperty(PropertyName = "properties.azPowerShellVersion")] - public string AzPowerShellVersion { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public override void Validate() - { - base.Validate(); - if (AzPowerShellVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "AzPowerShellVersion"); - } - if (ContainerSettings != null) - { - ContainerSettings.Validate(); - } - if (EnvironmentVariables != null) - { - foreach (var element in EnvironmentVariables) - { - if (element != null) - { - element.Validate(); - } - } - } - } - } -} diff --git a/src/Resources/Resources.Sdk/Generated/Models/ContainerConfiguration.cs b/src/Resources/Resources.Sdk/Generated/Models/ContainerConfiguration.cs deleted file mode 100644 index b03dce13604b..000000000000 --- a/src/Resources/Resources.Sdk/Generated/Models/ContainerConfiguration.cs +++ /dev/null @@ -1,98 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Resources.Models -{ - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Linq; - - /// - /// Settings to customize ACI container instance. - /// - public partial class ContainerConfiguration - { - /// - /// Initializes a new instance of the ContainerConfiguration class. - /// - public ContainerConfiguration() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ContainerConfiguration class. - /// - /// Container group name, if not - /// specified then the name will get auto-generated. Not specifying a - /// 'containerGroupName' indicates the system to generate a unique name - /// which might end up flagging an Azure Policy as non-compliant. Use - /// 'containerGroupName' when you have an Azure Policy that expects a - /// specific naming convention or when you want to fully control the - /// name. 'containerGroupName' property must be between 1 and 63 - /// characters long, must contain only lowercase letters, numbers, and - /// dashes and it cannot start or end with a dash and consecutive - /// dashes are not allowed. To specify a 'containerGroupName', add the - /// following object to properties: { "containerSettings": { - /// "containerGroupName": "contoso-container" } }. If you do not want - /// to specify a 'containerGroupName' then do not add - /// 'containerSettings' property. - public ContainerConfiguration(string containerGroupName = default(string)) - { - ContainerGroupName = containerGroupName; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets container group name, if not specified then the name - /// will get auto-generated. Not specifying a 'containerGroupName' - /// indicates the system to generate a unique name which might end up - /// flagging an Azure Policy as non-compliant. Use 'containerGroupName' - /// when you have an Azure Policy that expects a specific naming - /// convention or when you want to fully control the name. - /// 'containerGroupName' property must be between 1 and 63 characters - /// long, must contain only lowercase letters, numbers, and dashes and - /// it cannot start or end with a dash and consecutive dashes are not - /// allowed. To specify a 'containerGroupName', add the following - /// object to properties: { "containerSettings": { - /// "containerGroupName": "contoso-container" } }. If you do not want - /// to specify a 'containerGroupName' then do not add - /// 'containerSettings' property. - /// - [JsonProperty(PropertyName = "containerGroupName")] - public string ContainerGroupName { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (ContainerGroupName != null) - { - if (ContainerGroupName.Length > 63) - { - throw new ValidationException(ValidationRules.MaxLength, "ContainerGroupName", 63); - } - if (ContainerGroupName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "ContainerGroupName", 1); - } - } - } - } -} diff --git a/src/Resources/Resources.Sdk/Generated/Models/DenySettings.cs b/src/Resources/Resources.Sdk/Generated/Models/DenySettings.cs deleted file mode 100644 index e70b6cfa42d5..000000000000 --- a/src/Resources/Resources.Sdk/Generated/Models/DenySettings.cs +++ /dev/null @@ -1,113 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Resources.Models -{ - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Defines how resources deployed by the deployment stack are locked. - /// - public partial class DenySettings - { - /// - /// Initializes a new instance of the DenySettings class. - /// - public DenySettings() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the DenySettings class. - /// - /// denySettings Mode. Possible values include: - /// 'denyDelete', 'denyWriteAndDelete', 'none' - /// List of AAD principal IDs excluded - /// from the lock. Up to 5 principals are permitted. - /// List of role-based management - /// operations that are excluded from the denySettings. Up to 200 - /// actions are permitted. If the denySetting mode is set to - /// 'denyWriteAndDelete', then the following actions are automatically - /// appended to 'excludedActions': '*/read' and - /// 'Microsoft.Authorization/locks/delete'. If the denySetting mode is - /// set to 'denyDelete', then the following actions are automatically - /// appended to 'excludedActions': - /// 'Microsoft.Authorization/locks/delete'. Duplicate actions will be - /// removed. - /// DenySettings will be applied to - /// child scopes. - public DenySettings(string mode, IList excludedPrincipals = default(IList), IList excludedActions = default(IList), bool? applyToChildScopes = default(bool?)) - { - Mode = mode; - ExcludedPrincipals = excludedPrincipals; - ExcludedActions = excludedActions; - ApplyToChildScopes = applyToChildScopes; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets denySettings Mode. Possible values include: - /// 'denyDelete', 'denyWriteAndDelete', 'none' - /// - [JsonProperty(PropertyName = "mode")] - public string Mode { get; set; } - - /// - /// Gets or sets list of AAD principal IDs excluded from the lock. Up - /// to 5 principals are permitted. - /// - [JsonProperty(PropertyName = "excludedPrincipals")] - public IList ExcludedPrincipals { get; set; } - - /// - /// Gets or sets list of role-based management operations that are - /// excluded from the denySettings. Up to 200 actions are permitted. If - /// the denySetting mode is set to 'denyWriteAndDelete', then the - /// following actions are automatically appended to 'excludedActions': - /// '*/read' and 'Microsoft.Authorization/locks/delete'. If the - /// denySetting mode is set to 'denyDelete', then the following actions - /// are automatically appended to 'excludedActions': - /// 'Microsoft.Authorization/locks/delete'. Duplicate actions will be - /// removed. - /// - [JsonProperty(PropertyName = "excludedActions")] - public IList ExcludedActions { get; set; } - - /// - /// Gets or sets denySettings will be applied to child scopes. - /// - [JsonProperty(PropertyName = "applyToChildScopes")] - public bool? ApplyToChildScopes { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Mode == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Mode"); - } - } - } -} diff --git a/src/Resources/Resources.Sdk/Generated/Models/DeploymentOperationProperties.cs b/src/Resources/Resources.Sdk/Generated/Models/DeploymentOperationProperties.cs deleted file mode 100644 index b82045b46f81..000000000000 --- a/src/Resources/Resources.Sdk/Generated/Models/DeploymentOperationProperties.cs +++ /dev/null @@ -1,142 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Resources.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Deployment operation properties. - /// - public partial class DeploymentOperationProperties - { - /// - /// Initializes a new instance of the DeploymentOperationProperties - /// class. - /// - public DeploymentOperationProperties() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the DeploymentOperationProperties - /// class. - /// - /// The name of the current - /// provisioning operation. Possible values include: 'NotSpecified', - /// 'Create', 'Delete', 'Waiting', 'AzureAsyncOperationWaiting', - /// 'ResourceCacheWaiting', 'Action', 'Read', - /// 'EvaluateDeploymentOutput', 'DeploymentCleanup' - /// The state of the - /// provisioning. - /// The date and time of the operation. - /// The duration of the operation. - /// Deployment operation service request - /// id. - /// Operation status code from the resource - /// provider. This property may not be set if a response has not yet - /// been received. - /// Operation status message from the - /// resource provider. This property is optional. It will only be - /// provided if an error was received from the resource - /// provider. - /// The target resource. - /// The HTTP request message. - /// The HTTP response message. - public DeploymentOperationProperties(ProvisioningOperation? provisioningOperation = default(ProvisioningOperation?), string provisioningState = default(string), System.DateTime? timestamp = default(System.DateTime?), string duration = default(string), string serviceRequestId = default(string), string statusCode = default(string), StatusMessage statusMessage = default(StatusMessage), TargetResource targetResource = default(TargetResource), HttpMessage request = default(HttpMessage), HttpMessage response = default(HttpMessage)) - { - ProvisioningOperation = provisioningOperation; - ProvisioningState = provisioningState; - Timestamp = timestamp; - Duration = duration; - ServiceRequestId = serviceRequestId; - StatusCode = statusCode; - StatusMessage = statusMessage; - TargetResource = targetResource; - Request = request; - Response = response; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets the name of the current provisioning operation. Possible - /// values include: 'NotSpecified', 'Create', 'Delete', 'Waiting', - /// 'AzureAsyncOperationWaiting', 'ResourceCacheWaiting', 'Action', - /// 'Read', 'EvaluateDeploymentOutput', 'DeploymentCleanup' - /// - [JsonProperty(PropertyName = "provisioningOperation")] - public ProvisioningOperation? ProvisioningOperation { get; private set; } - - /// - /// Gets the state of the provisioning. - /// - [JsonProperty(PropertyName = "provisioningState")] - public string ProvisioningState { get; private set; } - - /// - /// Gets the date and time of the operation. - /// - [JsonProperty(PropertyName = "timestamp")] - public System.DateTime? Timestamp { get; private set; } - - /// - /// Gets the duration of the operation. - /// - [JsonProperty(PropertyName = "duration")] - public string Duration { get; private set; } - - /// - /// Gets deployment operation service request id. - /// - [JsonProperty(PropertyName = "serviceRequestId")] - public string ServiceRequestId { get; private set; } - - /// - /// Gets operation status code from the resource provider. This - /// property may not be set if a response has not yet been received. - /// - [JsonProperty(PropertyName = "statusCode")] - public string StatusCode { get; private set; } - - /// - /// Gets operation status message from the resource provider. This - /// property is optional. It will only be provided if an error was - /// received from the resource provider. - /// - [JsonProperty(PropertyName = "statusMessage")] - public StatusMessage StatusMessage { get; private set; } - - /// - /// Gets the target resource. - /// - [JsonProperty(PropertyName = "targetResource")] - public TargetResource TargetResource { get; private set; } - - /// - /// Gets the HTTP request message. - /// - [JsonProperty(PropertyName = "request")] - public HttpMessage Request { get; private set; } - - /// - /// Gets the HTTP response message. - /// - [JsonProperty(PropertyName = "response")] - public HttpMessage Response { get; private set; } - - } -} diff --git a/src/Resources/Resources.Sdk/Generated/Models/DeploymentProperties.cs b/src/Resources/Resources.Sdk/Generated/Models/DeploymentProperties.cs deleted file mode 100644 index 23ec8ed0cc1e..000000000000 --- a/src/Resources/Resources.Sdk/Generated/Models/DeploymentProperties.cs +++ /dev/null @@ -1,168 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Resources.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Deployment properties. - /// - public partial class DeploymentProperties - { - /// - /// Initializes a new instance of the DeploymentProperties class. - /// - public DeploymentProperties() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the DeploymentProperties class. - /// - /// The mode that is used to deploy resources. This - /// value can be either Incremental or Complete. In Incremental mode, - /// resources are deployed without deleting existing resources that are - /// not included in the template. In Complete mode, resources are - /// deployed and existing resources in the resource group that are not - /// included in the template are deleted. Be careful when using - /// Complete mode as you may unintentionally delete resources. Possible - /// values include: 'Incremental', 'Complete' - /// The template content. You use this element - /// when you want to pass the template syntax directly in the request - /// rather than link to an existing template. It can be a JObject or - /// well-formed JSON string. Use either the templateLink property or - /// the template property, but not both. - /// The URI of the template. Use either the - /// templateLink property or the template property, but not - /// both. - /// Name and value pairs that define the - /// deployment parameters for the template. You use this element when - /// you want to provide the parameter values directly in the request - /// rather than link to an existing parameter file. Use either the - /// parametersLink property or the parameters property, but not both. - /// It can be a JObject or a well formed JSON string. - /// The URI of parameters file. You use - /// this element to link to an existing parameters file. Use either the - /// parametersLink property or the parameters property, but not - /// both. - /// The debug setting of the - /// deployment. - /// The deployment on error - /// behavior. - /// Specifies whether - /// template expressions are evaluated within the scope of the parent - /// template or nested template. Only applicable to nested templates. - /// If not specified, default value is outer. - public DeploymentProperties(DeploymentMode mode, object template = default(object), TemplateLink templateLink = default(TemplateLink), object parameters = default(object), ParametersLink parametersLink = default(ParametersLink), DebugSetting debugSetting = default(DebugSetting), OnErrorDeployment onErrorDeployment = default(OnErrorDeployment), ExpressionEvaluationOptions expressionEvaluationOptions = default(ExpressionEvaluationOptions)) - { - Template = template; - TemplateLink = templateLink; - Parameters = parameters; - ParametersLink = parametersLink; - Mode = mode; - DebugSetting = debugSetting; - OnErrorDeployment = onErrorDeployment; - ExpressionEvaluationOptions = expressionEvaluationOptions; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the template content. You use this element when you - /// want to pass the template syntax directly in the request rather - /// than link to an existing template. It can be a JObject or - /// well-formed JSON string. Use either the templateLink property or - /// the template property, but not both. - /// - [JsonProperty(PropertyName = "template")] - public object Template { get; set; } - - /// - /// Gets or sets the URI of the template. Use either the templateLink - /// property or the template property, but not both. - /// - [JsonProperty(PropertyName = "templateLink")] - public TemplateLink TemplateLink { get; set; } - - /// - /// Gets or sets name and value pairs that define the deployment - /// parameters for the template. You use this element when you want to - /// provide the parameter values directly in the request rather than - /// link to an existing parameter file. Use either the parametersLink - /// property or the parameters property, but not both. It can be a - /// JObject or a well formed JSON string. - /// - [JsonProperty(PropertyName = "parameters")] - public object Parameters { get; set; } - - /// - /// Gets or sets the URI of parameters file. You use this element to - /// link to an existing parameters file. Use either the parametersLink - /// property or the parameters property, but not both. - /// - [JsonProperty(PropertyName = "parametersLink")] - public ParametersLink ParametersLink { get; set; } - - /// - /// Gets or sets the mode that is used to deploy resources. This value - /// can be either Incremental or Complete. In Incremental mode, - /// resources are deployed without deleting existing resources that are - /// not included in the template. In Complete mode, resources are - /// deployed and existing resources in the resource group that are not - /// included in the template are deleted. Be careful when using - /// Complete mode as you may unintentionally delete resources. Possible - /// values include: 'Incremental', 'Complete' - /// - [JsonProperty(PropertyName = "mode")] - public DeploymentMode Mode { get; set; } - - /// - /// Gets or sets the debug setting of the deployment. - /// - [JsonProperty(PropertyName = "debugSetting")] - public DebugSetting DebugSetting { get; set; } - - /// - /// Gets or sets the deployment on error behavior. - /// - [JsonProperty(PropertyName = "onErrorDeployment")] - public OnErrorDeployment OnErrorDeployment { get; set; } - - /// - /// Gets or sets specifies whether template expressions are evaluated - /// within the scope of the parent template or nested template. Only - /// applicable to nested templates. If not specified, default value is - /// outer. - /// - [JsonProperty(PropertyName = "expressionEvaluationOptions")] - public ExpressionEvaluationOptions ExpressionEvaluationOptions { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (ParametersLink != null) - { - ParametersLink.Validate(); - } - } - } -} diff --git a/src/Resources/Resources.Sdk/Generated/Models/DeploymentPropertiesExtended.cs b/src/Resources/Resources.Sdk/Generated/Models/DeploymentPropertiesExtended.cs deleted file mode 100644 index 5f5d6ee34265..000000000000 --- a/src/Resources/Resources.Sdk/Generated/Models/DeploymentPropertiesExtended.cs +++ /dev/null @@ -1,218 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Resources.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Deployment properties with additional details. - /// - public partial class DeploymentPropertiesExtended - { - /// - /// Initializes a new instance of the DeploymentPropertiesExtended - /// class. - /// - public DeploymentPropertiesExtended() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the DeploymentPropertiesExtended - /// class. - /// - /// Denotes the state of provisioning. - /// Possible values include: 'NotSpecified', 'Accepted', 'Running', - /// 'Ready', 'Creating', 'Created', 'Deleting', 'Deleted', 'Canceled', - /// 'Failed', 'Succeeded', 'Updating' - /// The correlation ID of the - /// deployment. - /// The timestamp of the template - /// deployment. - /// The duration of the template - /// deployment. - /// Key/value pairs that represent deployment - /// output. - /// The list of resource providers needed for - /// the deployment. - /// The list of deployment - /// dependencies. - /// The URI referencing the - /// template. - /// Deployment parameters. - /// The URI referencing the parameters. - /// - /// The deployment mode. Possible values are - /// Incremental and Complete. Possible values include: 'Incremental', - /// 'Complete' - /// The debug setting of the - /// deployment. - /// The deployment on error - /// behavior. - /// The hash produced for the - /// template. - /// Array of provisioned - /// resources. - /// Array of validated - /// resources. - /// The deployment error. - public DeploymentPropertiesExtended(string provisioningState = default(string), string correlationId = default(string), System.DateTime? timestamp = default(System.DateTime?), string duration = default(string), object outputs = default(object), IList providers = default(IList), IList dependencies = default(IList), TemplateLink templateLink = default(TemplateLink), object parameters = default(object), ParametersLink parametersLink = default(ParametersLink), DeploymentMode? mode = default(DeploymentMode?), DebugSetting debugSetting = default(DebugSetting), OnErrorDeploymentExtended onErrorDeployment = default(OnErrorDeploymentExtended), string templateHash = default(string), IList outputResources = default(IList), IList validatedResources = default(IList), ErrorResponse error = default(ErrorResponse)) - { - ProvisioningState = provisioningState; - CorrelationId = correlationId; - Timestamp = timestamp; - Duration = duration; - Outputs = outputs; - Providers = providers; - Dependencies = dependencies; - TemplateLink = templateLink; - Parameters = parameters; - ParametersLink = parametersLink; - Mode = mode; - DebugSetting = debugSetting; - OnErrorDeployment = onErrorDeployment; - TemplateHash = templateHash; - OutputResources = outputResources; - ValidatedResources = validatedResources; - Error = error; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets denotes the state of provisioning. Possible values include: - /// 'NotSpecified', 'Accepted', 'Running', 'Ready', 'Creating', - /// 'Created', 'Deleting', 'Deleted', 'Canceled', 'Failed', - /// 'Succeeded', 'Updating' - /// - [JsonProperty(PropertyName = "provisioningState")] - public string ProvisioningState { get; private set; } - - /// - /// Gets the correlation ID of the deployment. - /// - [JsonProperty(PropertyName = "correlationId")] - public string CorrelationId { get; private set; } - - /// - /// Gets the timestamp of the template deployment. - /// - [JsonProperty(PropertyName = "timestamp")] - public System.DateTime? Timestamp { get; private set; } - - /// - /// Gets the duration of the template deployment. - /// - [JsonProperty(PropertyName = "duration")] - public string Duration { get; private set; } - - /// - /// Gets key/value pairs that represent deployment output. - /// - [JsonProperty(PropertyName = "outputs")] - public object Outputs { get; private set; } - - /// - /// Gets the list of resource providers needed for the deployment. - /// - [JsonProperty(PropertyName = "providers")] - public IList Providers { get; private set; } - - /// - /// Gets the list of deployment dependencies. - /// - [JsonProperty(PropertyName = "dependencies")] - public IList Dependencies { get; private set; } - - /// - /// Gets the URI referencing the template. - /// - [JsonProperty(PropertyName = "templateLink")] - public TemplateLink TemplateLink { get; private set; } - - /// - /// Gets deployment parameters. - /// - [JsonProperty(PropertyName = "parameters")] - public object Parameters { get; private set; } - - /// - /// Gets the URI referencing the parameters. - /// - [JsonProperty(PropertyName = "parametersLink")] - public ParametersLink ParametersLink { get; private set; } - - /// - /// Gets the deployment mode. Possible values are Incremental and - /// Complete. Possible values include: 'Incremental', 'Complete' - /// - [JsonProperty(PropertyName = "mode")] - public DeploymentMode? Mode { get; private set; } - - /// - /// Gets the debug setting of the deployment. - /// - [JsonProperty(PropertyName = "debugSetting")] - public DebugSetting DebugSetting { get; private set; } - - /// - /// Gets the deployment on error behavior. - /// - [JsonProperty(PropertyName = "onErrorDeployment")] - public OnErrorDeploymentExtended OnErrorDeployment { get; private set; } - - /// - /// Gets the hash produced for the template. - /// - [JsonProperty(PropertyName = "templateHash")] - public string TemplateHash { get; private set; } - - /// - /// Gets array of provisioned resources. - /// - [JsonProperty(PropertyName = "outputResources")] - public IList OutputResources { get; private set; } - - /// - /// Gets array of validated resources. - /// - [JsonProperty(PropertyName = "validatedResources")] - public IList ValidatedResources { get; private set; } - - /// - /// Gets the deployment error. - /// - [JsonProperty(PropertyName = "error")] - public ErrorResponse Error { get; private set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (ParametersLink != null) - { - ParametersLink.Validate(); - } - } - } -} diff --git a/src/Resources/Resources.Sdk/Generated/Models/DeploymentStack.cs b/src/Resources/Resources.Sdk/Generated/Models/DeploymentStack.cs deleted file mode 100644 index 053711c12622..000000000000 --- a/src/Resources/Resources.Sdk/Generated/Models/DeploymentStack.cs +++ /dev/null @@ -1,317 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Resources.Models -{ - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Deployment stack object. - /// - [Rest.Serialization.JsonTransformation] - public partial class DeploymentStack : AzureResourceBase - { - /// - /// Initializes a new instance of the DeploymentStack class. - /// - public DeploymentStack() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the DeploymentStack class. - /// - /// Defines the behavior of resources - /// that are not managed immediately after the stack is - /// updated. - /// Defines how resources deployed by the - /// stack are locked. - /// String Id used to locate any resource on - /// Azure. - /// Name of this resource. - /// Type of this resource. - /// Azure Resource Manager metadata containing - /// createdBy and modifiedBy information. - /// The location of the deployment stack. It - /// cannot be changed after creation. It must be one of the supported - /// Azure locations. - /// Deployment stack resource tags. - /// The template content. You use this element - /// when you want to pass the template syntax directly in the request - /// rather than link to an existing template. It can be a JObject or - /// well-formed JSON string. Use either the templateLink property or - /// the template property, but not both. - /// The URI of the template. Use either the - /// templateLink property or the template property, but not - /// both. - /// Name and value pairs that define the - /// deployment parameters for the template. Use this element when - /// providing the parameter values directly in the request, rather than - /// linking to an existing parameter file. Use either the - /// parametersLink property or the parameters property, but not both. - /// It can be a JObject or a well formed JSON string. - /// The URI of parameters file. Use this - /// element to link to an existing parameters file. Use either the - /// parametersLink property or the parameters property, but not - /// both. - /// The debug setting of the - /// deployment. - /// The scope at which the initial - /// deployment should be created. If a scope is not specified, it will - /// default to the scope of the deployment stack. Valid scopes are: - /// management group (format: - /// '/providers/Microsoft.Management/managementGroups/{managementGroupId}'), - /// subscription (format: '/subscriptions/{subscriptionId}'), resource - /// group (format: - /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}'). - /// Deployment stack description. - /// State of the deployment stack. - /// Possible values include: 'Creating', 'Validating', 'Waiting', - /// 'Deploying', 'Canceling', 'Locking', 'DeletingResources', - /// 'Succeeded', 'Failed', 'Canceled', 'Deleting' - /// An array of resources that were - /// detached during the most recent update. - /// An array of resources that were - /// deleted during the most recent update. - /// An array of resources that failed to - /// reach goal state during the most recent update. - /// An array of resources currently - /// managed by the deployment stack. - /// The resourceId of the deployment - /// resource created by the deployment stack. - /// The outputs of the underlying - /// deployment. - /// The duration of the deployment stack - /// update. - public DeploymentStack(DeploymentStackPropertiesActionOnUnmanage actionOnUnmanage, DenySettings denySettings, string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string location = default(string), IDictionary tags = default(IDictionary), ErrorResponse error = default(ErrorResponse), object template = default(object), DeploymentStacksTemplateLink templateLink = default(DeploymentStacksTemplateLink), object parameters = default(object), DeploymentStacksParametersLink parametersLink = default(DeploymentStacksParametersLink), DeploymentStacksDebugSetting debugSetting = default(DeploymentStacksDebugSetting), string deploymentScope = default(string), string description = default(string), string provisioningState = default(string), IList detachedResources = default(IList), IList deletedResources = default(IList), IList failedResources = default(IList), IList resourcesProperty = default(IList), string deploymentId = default(string), object outputs = default(object), string duration = default(string)) - : base(id, name, type, systemData) - { - Location = location; - Tags = tags; - Error = error; - Template = template; - TemplateLink = templateLink; - Parameters = parameters; - ParametersLink = parametersLink; - ActionOnUnmanage = actionOnUnmanage; - DebugSetting = debugSetting; - DeploymentScope = deploymentScope; - Description = description; - DenySettings = denySettings; - ProvisioningState = provisioningState; - DetachedResources = detachedResources; - DeletedResources = deletedResources; - FailedResources = failedResources; - ResourcesProperty = resourcesProperty; - DeploymentId = deploymentId; - Outputs = outputs; - Duration = duration; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the location of the deployment stack. It cannot be - /// changed after creation. It must be one of the supported Azure - /// locations. - /// - [JsonProperty(PropertyName = "location")] - public string Location { get; set; } - - /// - /// Gets or sets deployment stack resource tags. - /// - [JsonProperty(PropertyName = "tags")] - public IDictionary Tags { get; set; } - - /// - /// - [JsonProperty(PropertyName = "properties.error")] - public ErrorResponse Error { get; set; } - - /// - /// Gets or sets the template content. You use this element when you - /// want to pass the template syntax directly in the request rather - /// than link to an existing template. It can be a JObject or - /// well-formed JSON string. Use either the templateLink property or - /// the template property, but not both. - /// - [JsonProperty(PropertyName = "properties.template")] - public object Template { get; set; } - - /// - /// Gets or sets the URI of the template. Use either the templateLink - /// property or the template property, but not both. - /// - [JsonProperty(PropertyName = "properties.templateLink")] - public DeploymentStacksTemplateLink TemplateLink { get; set; } - - /// - /// Gets or sets name and value pairs that define the deployment - /// parameters for the template. Use this element when providing the - /// parameter values directly in the request, rather than linking to an - /// existing parameter file. Use either the parametersLink property or - /// the parameters property, but not both. It can be a JObject or a - /// well formed JSON string. - /// - [JsonProperty(PropertyName = "properties.parameters")] - public object Parameters { get; set; } - - /// - /// Gets or sets the URI of parameters file. Use this element to link - /// to an existing parameters file. Use either the parametersLink - /// property or the parameters property, but not both. - /// - [JsonProperty(PropertyName = "properties.parametersLink")] - public DeploymentStacksParametersLink ParametersLink { get; set; } - - /// - /// Gets or sets defines the behavior of resources that are not managed - /// immediately after the stack is updated. - /// - [JsonProperty(PropertyName = "properties.actionOnUnmanage")] - public DeploymentStackPropertiesActionOnUnmanage ActionOnUnmanage { get; set; } - - /// - /// Gets or sets the debug setting of the deployment. - /// - [JsonProperty(PropertyName = "properties.debugSetting")] - public DeploymentStacksDebugSetting DebugSetting { get; set; } - - /// - /// Gets or sets the scope at which the initial deployment should be - /// created. If a scope is not specified, it will default to the scope - /// of the deployment stack. Valid scopes are: management group - /// (format: - /// '/providers/Microsoft.Management/managementGroups/{managementGroupId}'), - /// subscription (format: '/subscriptions/{subscriptionId}'), resource - /// group (format: - /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}'). - /// - [JsonProperty(PropertyName = "properties.deploymentScope")] - public string DeploymentScope { get; set; } - - /// - /// Gets or sets deployment stack description. - /// - [JsonProperty(PropertyName = "properties.description")] - public string Description { get; set; } - - /// - /// Gets or sets defines how resources deployed by the stack are - /// locked. - /// - [JsonProperty(PropertyName = "properties.denySettings")] - public DenySettings DenySettings { get; set; } - - /// - /// Gets state of the deployment stack. Possible values include: - /// 'Creating', 'Validating', 'Waiting', 'Deploying', 'Canceling', - /// 'Locking', 'DeletingResources', 'Succeeded', 'Failed', 'Canceled', - /// 'Deleting' - /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } - - /// - /// Gets an array of resources that were detached during the most - /// recent update. - /// - [JsonProperty(PropertyName = "properties.detachedResources")] - public IList DetachedResources { get; private set; } - - /// - /// Gets an array of resources that were deleted during the most recent - /// update. - /// - [JsonProperty(PropertyName = "properties.deletedResources")] - public IList DeletedResources { get; private set; } - - /// - /// Gets an array of resources that failed to reach goal state during - /// the most recent update. - /// - [JsonProperty(PropertyName = "properties.failedResources")] - public IList FailedResources { get; private set; } - - /// - /// Gets an array of resources currently managed by the deployment - /// stack. - /// - [JsonProperty(PropertyName = "properties.resources")] - public IList ResourcesProperty { get; private set; } - - /// - /// Gets the resourceId of the deployment resource created by the - /// deployment stack. - /// - [JsonProperty(PropertyName = "properties.deploymentId")] - public string DeploymentId { get; private set; } - - /// - /// Gets the outputs of the underlying deployment. - /// - [JsonProperty(PropertyName = "properties.outputs")] - public object Outputs { get; private set; } - - /// - /// Gets the duration of the deployment stack update. - /// - [JsonProperty(PropertyName = "properties.duration")] - public string Duration { get; private set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (ActionOnUnmanage == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "ActionOnUnmanage"); - } - if (DenySettings == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "DenySettings"); - } - if (ParametersLink != null) - { - ParametersLink.Validate(); - } - if (ActionOnUnmanage != null) - { - ActionOnUnmanage.Validate(); - } - if (Description != null) - { - if (Description.Length > 4096) - { - throw new ValidationException(ValidationRules.MaxLength, "Description", 4096); - } - } - if (DenySettings != null) - { - DenySettings.Validate(); - } - } - } -} diff --git a/src/Resources/Resources.Sdk/Generated/Models/DeploymentStackProperties.cs b/src/Resources/Resources.Sdk/Generated/Models/DeploymentStackProperties.cs deleted file mode 100644 index 929376ef6d6b..000000000000 --- a/src/Resources/Resources.Sdk/Generated/Models/DeploymentStackProperties.cs +++ /dev/null @@ -1,283 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Resources.Models -{ - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Deployment stack properties. - /// - public partial class DeploymentStackProperties : DeploymentStacksError - { - /// - /// Initializes a new instance of the DeploymentStackProperties class. - /// - public DeploymentStackProperties() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the DeploymentStackProperties class. - /// - /// Defines the behavior of resources - /// that are not managed immediately after the stack is - /// updated. - /// Defines how resources deployed by the - /// stack are locked. - /// The template content. You use this element - /// when you want to pass the template syntax directly in the request - /// rather than link to an existing template. It can be a JObject or - /// well-formed JSON string. Use either the templateLink property or - /// the template property, but not both. - /// The URI of the template. Use either the - /// templateLink property or the template property, but not - /// both. - /// Name and value pairs that define the - /// deployment parameters for the template. Use this element when - /// providing the parameter values directly in the request, rather than - /// linking to an existing parameter file. Use either the - /// parametersLink property or the parameters property, but not both. - /// It can be a JObject or a well formed JSON string. - /// The URI of parameters file. Use this - /// element to link to an existing parameters file. Use either the - /// parametersLink property or the parameters property, but not - /// both. - /// The debug setting of the - /// deployment. - /// The scope at which the initial - /// deployment should be created. If a scope is not specified, it will - /// default to the scope of the deployment stack. Valid scopes are: - /// management group (format: - /// '/providers/Microsoft.Management/managementGroups/{managementGroupId}'), - /// subscription (format: '/subscriptions/{subscriptionId}'), resource - /// group (format: - /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}'). - /// Deployment stack description. - /// State of the deployment stack. - /// Possible values include: 'Creating', 'Validating', 'Waiting', - /// 'Deploying', 'Canceling', 'Locking', 'DeletingResources', - /// 'Succeeded', 'Failed', 'Canceled', 'Deleting' - /// An array of resources that were - /// detached during the most recent update. - /// An array of resources that were - /// deleted during the most recent update. - /// An array of resources that failed to - /// reach goal state during the most recent update. - /// An array of resources currently managed by - /// the deployment stack. - /// The resourceId of the deployment - /// resource created by the deployment stack. - /// The outputs of the underlying - /// deployment. - /// The duration of the deployment stack - /// update. - public DeploymentStackProperties(DeploymentStackPropertiesActionOnUnmanage actionOnUnmanage, DenySettings denySettings, ErrorResponse error = default(ErrorResponse), object template = default(object), DeploymentStacksTemplateLink templateLink = default(DeploymentStacksTemplateLink), object parameters = default(object), DeploymentStacksParametersLink parametersLink = default(DeploymentStacksParametersLink), DeploymentStacksDebugSetting debugSetting = default(DeploymentStacksDebugSetting), string deploymentScope = default(string), string description = default(string), string provisioningState = default(string), IList detachedResources = default(IList), IList deletedResources = default(IList), IList failedResources = default(IList), IList resources = default(IList), string deploymentId = default(string), object outputs = default(object), string duration = default(string)) - : base(error) - { - Template = template; - TemplateLink = templateLink; - Parameters = parameters; - ParametersLink = parametersLink; - ActionOnUnmanage = actionOnUnmanage; - DebugSetting = debugSetting; - DeploymentScope = deploymentScope; - Description = description; - DenySettings = denySettings; - ProvisioningState = provisioningState; - DetachedResources = detachedResources; - DeletedResources = deletedResources; - FailedResources = failedResources; - Resources = resources; - DeploymentId = deploymentId; - Outputs = outputs; - Duration = duration; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the template content. You use this element when you - /// want to pass the template syntax directly in the request rather - /// than link to an existing template. It can be a JObject or - /// well-formed JSON string. Use either the templateLink property or - /// the template property, but not both. - /// - [JsonProperty(PropertyName = "template")] - public object Template { get; set; } - - /// - /// Gets or sets the URI of the template. Use either the templateLink - /// property or the template property, but not both. - /// - [JsonProperty(PropertyName = "templateLink")] - public DeploymentStacksTemplateLink TemplateLink { get; set; } - - /// - /// Gets or sets name and value pairs that define the deployment - /// parameters for the template. Use this element when providing the - /// parameter values directly in the request, rather than linking to an - /// existing parameter file. Use either the parametersLink property or - /// the parameters property, but not both. It can be a JObject or a - /// well formed JSON string. - /// - [JsonProperty(PropertyName = "parameters")] - public object Parameters { get; set; } - - /// - /// Gets or sets the URI of parameters file. Use this element to link - /// to an existing parameters file. Use either the parametersLink - /// property or the parameters property, but not both. - /// - [JsonProperty(PropertyName = "parametersLink")] - public DeploymentStacksParametersLink ParametersLink { get; set; } - - /// - /// Gets or sets defines the behavior of resources that are not managed - /// immediately after the stack is updated. - /// - [JsonProperty(PropertyName = "actionOnUnmanage")] - public DeploymentStackPropertiesActionOnUnmanage ActionOnUnmanage { get; set; } - - /// - /// Gets or sets the debug setting of the deployment. - /// - [JsonProperty(PropertyName = "debugSetting")] - public DeploymentStacksDebugSetting DebugSetting { get; set; } - - /// - /// Gets or sets the scope at which the initial deployment should be - /// created. If a scope is not specified, it will default to the scope - /// of the deployment stack. Valid scopes are: management group - /// (format: - /// '/providers/Microsoft.Management/managementGroups/{managementGroupId}'), - /// subscription (format: '/subscriptions/{subscriptionId}'), resource - /// group (format: - /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}'). - /// - [JsonProperty(PropertyName = "deploymentScope")] - public string DeploymentScope { get; set; } - - /// - /// Gets or sets deployment stack description. - /// - [JsonProperty(PropertyName = "description")] - public string Description { get; set; } - - /// - /// Gets or sets defines how resources deployed by the stack are - /// locked. - /// - [JsonProperty(PropertyName = "denySettings")] - public DenySettings DenySettings { get; set; } - - /// - /// Gets state of the deployment stack. Possible values include: - /// 'Creating', 'Validating', 'Waiting', 'Deploying', 'Canceling', - /// 'Locking', 'DeletingResources', 'Succeeded', 'Failed', 'Canceled', - /// 'Deleting' - /// - [JsonProperty(PropertyName = "provisioningState")] - public string ProvisioningState { get; private set; } - - /// - /// Gets an array of resources that were detached during the most - /// recent update. - /// - [JsonProperty(PropertyName = "detachedResources")] - public IList DetachedResources { get; private set; } - - /// - /// Gets an array of resources that were deleted during the most recent - /// update. - /// - [JsonProperty(PropertyName = "deletedResources")] - public IList DeletedResources { get; private set; } - - /// - /// Gets an array of resources that failed to reach goal state during - /// the most recent update. - /// - [JsonProperty(PropertyName = "failedResources")] - public IList FailedResources { get; private set; } - - /// - /// Gets an array of resources currently managed by the deployment - /// stack. - /// - [JsonProperty(PropertyName = "resources")] - public IList Resources { get; private set; } - - /// - /// Gets the resourceId of the deployment resource created by the - /// deployment stack. - /// - [JsonProperty(PropertyName = "deploymentId")] - public string DeploymentId { get; private set; } - - /// - /// Gets the outputs of the underlying deployment. - /// - [JsonProperty(PropertyName = "outputs")] - public object Outputs { get; private set; } - - /// - /// Gets the duration of the deployment stack update. - /// - [JsonProperty(PropertyName = "duration")] - public string Duration { get; private set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (ActionOnUnmanage == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "ActionOnUnmanage"); - } - if (DenySettings == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "DenySettings"); - } - if (ParametersLink != null) - { - ParametersLink.Validate(); - } - if (ActionOnUnmanage != null) - { - ActionOnUnmanage.Validate(); - } - if (Description != null) - { - if (Description.Length > 4096) - { - throw new ValidationException(ValidationRules.MaxLength, "Description", 4096); - } - } - if (DenySettings != null) - { - DenySettings.Validate(); - } - } - } -} diff --git a/src/Resources/Resources.Sdk/Generated/Models/DeploymentStackPropertiesActionOnUnmanage.cs b/src/Resources/Resources.Sdk/Generated/Models/DeploymentStackPropertiesActionOnUnmanage.cs deleted file mode 100644 index fce37c8fdcea..000000000000 --- a/src/Resources/Resources.Sdk/Generated/Models/DeploymentStackPropertiesActionOnUnmanage.cs +++ /dev/null @@ -1,87 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Resources.Models -{ - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Linq; - - /// - /// Defines the behavior of resources that are not managed immediately - /// after the stack is updated. - /// - public partial class DeploymentStackPropertiesActionOnUnmanage - { - /// - /// Initializes a new instance of the - /// DeploymentStackPropertiesActionOnUnmanage class. - /// - public DeploymentStackPropertiesActionOnUnmanage() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// DeploymentStackPropertiesActionOnUnmanage class. - /// - /// Possible values include: 'delete', - /// 'detach' - /// Possible values include: 'delete', - /// 'detach' - /// Possible values include: 'delete', - /// 'detach' - public DeploymentStackPropertiesActionOnUnmanage(string resources, string resourceGroups = default(string), string managementGroups = default(string)) - { - Resources = resources; - ResourceGroups = resourceGroups; - ManagementGroups = managementGroups; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets possible values include: 'delete', 'detach' - /// - [JsonProperty(PropertyName = "resources")] - public string Resources { get; set; } - - /// - /// Gets or sets possible values include: 'delete', 'detach' - /// - [JsonProperty(PropertyName = "resourceGroups")] - public string ResourceGroups { get; set; } - - /// - /// Gets or sets possible values include: 'delete', 'detach' - /// - [JsonProperty(PropertyName = "managementGroups")] - public string ManagementGroups { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Resources == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Resources"); - } - } - } -} diff --git a/src/Resources/Resources.Sdk/Generated/Models/DeploymentStacksDebugSetting.cs b/src/Resources/Resources.Sdk/Generated/Models/DeploymentStacksDebugSetting.cs deleted file mode 100644 index 36cd6c69a054..000000000000 --- a/src/Resources/Resources.Sdk/Generated/Models/DeploymentStacksDebugSetting.cs +++ /dev/null @@ -1,67 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Resources.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// The debug setting. - /// - public partial class DeploymentStacksDebugSetting - { - /// - /// Initializes a new instance of the DeploymentStacksDebugSetting - /// class. - /// - public DeploymentStacksDebugSetting() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the DeploymentStacksDebugSetting - /// class. - /// - /// Specifies the type of information to log - /// for debugging. The permitted values are none, requestContent, - /// responseContent, or both requestContent and responseContent - /// separated by a comma. The default is none. When setting this value, - /// carefully consider the type of information that is being passed in - /// during deployment. By logging information about the request or - /// response, sensitive data that is retrieved through the deployment - /// operations could potentially be exposed. - public DeploymentStacksDebugSetting(string detailLevel = default(string)) - { - DetailLevel = detailLevel; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets specifies the type of information to log for - /// debugging. The permitted values are none, requestContent, - /// responseContent, or both requestContent and responseContent - /// separated by a comma. The default is none. When setting this value, - /// carefully consider the type of information that is being passed in - /// during deployment. By logging information about the request or - /// response, sensitive data that is retrieved through the deployment - /// operations could potentially be exposed. - /// - [JsonProperty(PropertyName = "detailLevel")] - public string DetailLevel { get; set; } - - } -} diff --git a/src/Resources/Resources.Sdk/Generated/Models/DeploymentsWhatIfAtManagementGroupScopeHeaders.cs b/src/Resources/Resources.Sdk/Generated/Models/DeploymentsWhatIfAtManagementGroupScopeHeaders.cs deleted file mode 100644 index ab3f107eda79..000000000000 --- a/src/Resources/Resources.Sdk/Generated/Models/DeploymentsWhatIfAtManagementGroupScopeHeaders.cs +++ /dev/null @@ -1,63 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Resources.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Defines headers for WhatIfAtManagementGroupScope operation. - /// - public partial class DeploymentsWhatIfAtManagementGroupScopeHeaders - { - /// - /// Initializes a new instance of the - /// DeploymentsWhatIfAtManagementGroupScopeHeaders class. - /// - public DeploymentsWhatIfAtManagementGroupScopeHeaders() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// DeploymentsWhatIfAtManagementGroupScopeHeaders class. - /// - /// URL to get status of this long-running - /// operation. - /// Number of seconds to wait before polling - /// for status. - public DeploymentsWhatIfAtManagementGroupScopeHeaders(string location = default(string), string retryAfter = default(string)) - { - Location = location; - RetryAfter = retryAfter; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets URL to get status of this long-running operation. - /// - [JsonProperty(PropertyName = "Location")] - public string Location { get; set; } - - /// - /// Gets or sets number of seconds to wait before polling for status. - /// - [JsonProperty(PropertyName = "Retry-After")] - public string RetryAfter { get; set; } - - } -} diff --git a/src/Resources/Resources.Sdk/Generated/Models/DeploymentsWhatIfAtSubscriptionScopeHeaders.cs b/src/Resources/Resources.Sdk/Generated/Models/DeploymentsWhatIfAtSubscriptionScopeHeaders.cs deleted file mode 100644 index be99d8eae7a5..000000000000 --- a/src/Resources/Resources.Sdk/Generated/Models/DeploymentsWhatIfAtSubscriptionScopeHeaders.cs +++ /dev/null @@ -1,63 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Resources.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Defines headers for WhatIfAtSubscriptionScope operation. - /// - public partial class DeploymentsWhatIfAtSubscriptionScopeHeaders - { - /// - /// Initializes a new instance of the - /// DeploymentsWhatIfAtSubscriptionScopeHeaders class. - /// - public DeploymentsWhatIfAtSubscriptionScopeHeaders() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// DeploymentsWhatIfAtSubscriptionScopeHeaders class. - /// - /// URL to get status of this long-running - /// operation. - /// Number of seconds to wait before polling - /// for status. - public DeploymentsWhatIfAtSubscriptionScopeHeaders(string location = default(string), string retryAfter = default(string)) - { - Location = location; - RetryAfter = retryAfter; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets URL to get status of this long-running operation. - /// - [JsonProperty(PropertyName = "Location")] - public string Location { get; set; } - - /// - /// Gets or sets number of seconds to wait before polling for status. - /// - [JsonProperty(PropertyName = "Retry-After")] - public string RetryAfter { get; set; } - - } -} diff --git a/src/Resources/Resources.Sdk/Generated/Models/DeploymentsWhatIfAtTenantScopeHeaders.cs b/src/Resources/Resources.Sdk/Generated/Models/DeploymentsWhatIfAtTenantScopeHeaders.cs deleted file mode 100644 index 8e0239fc145d..000000000000 --- a/src/Resources/Resources.Sdk/Generated/Models/DeploymentsWhatIfAtTenantScopeHeaders.cs +++ /dev/null @@ -1,63 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Resources.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Defines headers for WhatIfAtTenantScope operation. - /// - public partial class DeploymentsWhatIfAtTenantScopeHeaders - { - /// - /// Initializes a new instance of the - /// DeploymentsWhatIfAtTenantScopeHeaders class. - /// - public DeploymentsWhatIfAtTenantScopeHeaders() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// DeploymentsWhatIfAtTenantScopeHeaders class. - /// - /// URL to get status of this long-running - /// operation. - /// Number of seconds to wait before polling - /// for status. - public DeploymentsWhatIfAtTenantScopeHeaders(string location = default(string), string retryAfter = default(string)) - { - Location = location; - RetryAfter = retryAfter; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets URL to get status of this long-running operation. - /// - [JsonProperty(PropertyName = "Location")] - public string Location { get; set; } - - /// - /// Gets or sets number of seconds to wait before polling for status. - /// - [JsonProperty(PropertyName = "Retry-After")] - public string RetryAfter { get; set; } - - } -} diff --git a/src/Resources/Resources.Sdk/Generated/Models/ErrorDetail.cs b/src/Resources/Resources.Sdk/Generated/Models/ErrorDetail.cs deleted file mode 100644 index c76868c39635..000000000000 --- a/src/Resources/Resources.Sdk/Generated/Models/ErrorDetail.cs +++ /dev/null @@ -1,85 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Resources.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// The error detail. - /// - public partial class ErrorDetail - { - /// - /// Initializes a new instance of the ErrorDetail class. - /// - public ErrorDetail() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ErrorDetail class. - /// - /// The error code. - /// The error message. - /// The error target. - /// The error details. - /// The error additional info. - public ErrorDetail(string code = default(string), string message = default(string), string target = default(string), IList details = default(IList), IList additionalInfo = default(IList)) - { - Code = code; - Message = message; - Target = target; - Details = details; - AdditionalInfo = additionalInfo; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets the error code. - /// - [JsonProperty(PropertyName = "code")] - public string Code { get; private set; } - - /// - /// Gets the error message. - /// - [JsonProperty(PropertyName = "message")] - public string Message { get; private set; } - - /// - /// Gets the error target. - /// - [JsonProperty(PropertyName = "target")] - public string Target { get; private set; } - - /// - /// Gets the error details. - /// - [JsonProperty(PropertyName = "details")] - public IList Details { get; private set; } - - /// - /// Gets the error additional info. - /// - [JsonProperty(PropertyName = "additionalInfo")] - public IList AdditionalInfo { get; private set; } - - } -} diff --git a/src/Resources/Resources.Sdk/Generated/Models/ErrorResponse.cs b/src/Resources/Resources.Sdk/Generated/Models/ErrorResponse.cs deleted file mode 100644 index d842b51d1c7a..000000000000 --- a/src/Resources/Resources.Sdk/Generated/Models/ErrorResponse.cs +++ /dev/null @@ -1,90 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Resources.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Error Response - /// - /// - /// Common error response for all Azure Resource Manager APIs to return - /// error details for failed operations. (This also follows the OData error - /// response format.) - /// - public partial class ErrorResponse - { - /// - /// Initializes a new instance of the ErrorResponse class. - /// - public ErrorResponse() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ErrorResponse class. - /// - /// The error code. - /// The error message. - /// The error target. - /// The error details. - /// The error additional info. - public ErrorResponse(string code = default(string), string message = default(string), string target = default(string), IList details = default(IList), IList additionalInfo = default(IList)) - { - Code = code; - Message = message; - Target = target; - Details = details; - AdditionalInfo = additionalInfo; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets the error code. - /// - [JsonProperty(PropertyName = "code")] - public string Code { get; private set; } - - /// - /// Gets the error message. - /// - [JsonProperty(PropertyName = "message")] - public string Message { get; private set; } - - /// - /// Gets the error target. - /// - [JsonProperty(PropertyName = "target")] - public string Target { get; private set; } - - /// - /// Gets the error details. - /// - [JsonProperty(PropertyName = "details")] - public IList Details { get; private set; } - - /// - /// Gets the error additional info. - /// - [JsonProperty(PropertyName = "additionalInfo")] - public IList AdditionalInfo { get; private set; } - - } -} diff --git a/src/Resources/Resources.Sdk/Generated/Models/GenericResource.cs b/src/Resources/Resources.Sdk/Generated/Models/GenericResource.cs deleted file mode 100644 index 2ab6f4e1cc56..000000000000 --- a/src/Resources/Resources.Sdk/Generated/Models/GenericResource.cs +++ /dev/null @@ -1,118 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Resources.Models -{ - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Resource information. - /// - public partial class GenericResource : Resource - { - /// - /// Initializes a new instance of the GenericResource class. - /// - public GenericResource() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the GenericResource class. - /// - /// Resource ID - /// Resource name - /// Resource type - /// Resource location - /// Resource extended location. - /// Resource tags - /// The plan of the resource. - /// The resource properties. - /// The kind of the resource. - /// ID of the resource that manages this - /// resource. - /// The SKU of the resource. - /// The identity of the resource. - public GenericResource(string id = default(string), string name = default(string), string type = default(string), string location = default(string), ExtendedLocation extendedLocation = default(ExtendedLocation), IDictionary tags = default(IDictionary), Plan plan = default(Plan), object properties = default(object), string kind = default(string), string managedBy = default(string), Sku sku = default(Sku), Identity identity = default(Identity)) - : base(id, name, type, location, extendedLocation, tags) - { - Plan = plan; - Properties = properties; - Kind = kind; - ManagedBy = managedBy; - Sku = sku; - Identity = identity; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the plan of the resource. - /// - [JsonProperty(PropertyName = "plan")] - public Plan Plan { get; set; } - - /// - /// Gets or sets the resource properties. - /// - [JsonProperty(PropertyName = "properties")] - public object Properties { get; set; } - - /// - /// Gets or sets the kind of the resource. - /// - [JsonProperty(PropertyName = "kind")] - public string Kind { get; set; } - - /// - /// Gets or sets ID of the resource that manages this resource. - /// - [JsonProperty(PropertyName = "managedBy")] - public string ManagedBy { get; set; } - - /// - /// Gets or sets the SKU of the resource. - /// - [JsonProperty(PropertyName = "sku")] - public Sku Sku { get; set; } - - /// - /// Gets or sets the identity of the resource. - /// - [JsonProperty(PropertyName = "identity")] - public Identity Identity { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Kind != null) - { - if (!System.Text.RegularExpressions.Regex.IsMatch(Kind, "^[-\\w\\._,\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "Kind", "^[-\\w\\._,\\(\\)]+$"); - } - } - } - } -} diff --git a/src/Resources/Resources.Sdk/Generated/Models/GenericResourceExpanded.cs b/src/Resources/Resources.Sdk/Generated/Models/GenericResourceExpanded.cs deleted file mode 100644 index 637e3ac492e0..000000000000 --- a/src/Resources/Resources.Sdk/Generated/Models/GenericResourceExpanded.cs +++ /dev/null @@ -1,100 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Resources.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Resource information. - /// - public partial class GenericResourceExpanded : GenericResource - { - /// - /// Initializes a new instance of the GenericResourceExpanded class. - /// - public GenericResourceExpanded() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the GenericResourceExpanded class. - /// - /// Resource ID - /// Resource name - /// Resource type - /// Resource location - /// Resource extended location. - /// Resource tags - /// The plan of the resource. - /// The resource properties. - /// The kind of the resource. - /// ID of the resource that manages this - /// resource. - /// The SKU of the resource. - /// The identity of the resource. - /// The created time of the resource. This is - /// only present if requested via the $expand query parameter. - /// The changed time of the resource. This is - /// only present if requested via the $expand query parameter. - /// The provisioning state of the - /// resource. This is only present if requested via the $expand query - /// parameter. - public GenericResourceExpanded(string id = default(string), string name = default(string), string type = default(string), string location = default(string), ExtendedLocation extendedLocation = default(ExtendedLocation), IDictionary tags = default(IDictionary), Plan plan = default(Plan), object properties = default(object), string kind = default(string), string managedBy = default(string), Sku sku = default(Sku), Identity identity = default(Identity), System.DateTime? createdTime = default(System.DateTime?), System.DateTime? changedTime = default(System.DateTime?), string provisioningState = default(string)) - : base(id, name, type, location, extendedLocation, tags, plan, properties, kind, managedBy, sku, identity) - { - CreatedTime = createdTime; - ChangedTime = changedTime; - ProvisioningState = provisioningState; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets the created time of the resource. This is only present if - /// requested via the $expand query parameter. - /// - [JsonProperty(PropertyName = "createdTime")] - public System.DateTime? CreatedTime { get; private set; } - - /// - /// Gets the changed time of the resource. This is only present if - /// requested via the $expand query parameter. - /// - [JsonProperty(PropertyName = "changedTime")] - public System.DateTime? ChangedTime { get; private set; } - - /// - /// Gets the provisioning state of the resource. This is only present - /// if requested via the $expand query parameter. - /// - [JsonProperty(PropertyName = "provisioningState")] - public string ProvisioningState { get; private set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public override void Validate() - { - base.Validate(); - } - } -} diff --git a/src/Resources/Resources.Sdk/Generated/Models/Identity.cs b/src/Resources/Resources.Sdk/Generated/Models/Identity.cs deleted file mode 100644 index 984fdd9852ad..000000000000 --- a/src/Resources/Resources.Sdk/Generated/Models/Identity.cs +++ /dev/null @@ -1,88 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Resources.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Identity for the resource. - /// - public partial class Identity - { - /// - /// Initializes a new instance of the Identity class. - /// - public Identity() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the Identity class. - /// - /// The principal ID of resource - /// identity. - /// The tenant ID of resource. - /// The identity type. Possible values include: - /// 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', - /// 'None' - /// The list of user identities - /// associated with the resource. The user identity dictionary key - /// references will be ARM resource ids in the form: - /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. - public Identity(string principalId = default(string), string tenantId = default(string), ResourceIdentityType? type = default(ResourceIdentityType?), IDictionary userAssignedIdentities = default(IDictionary)) - { - PrincipalId = principalId; - TenantId = tenantId; - Type = type; - UserAssignedIdentities = userAssignedIdentities; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets the principal ID of resource identity. - /// - [JsonProperty(PropertyName = "principalId")] - public string PrincipalId { get; private set; } - - /// - /// Gets the tenant ID of resource. - /// - [JsonProperty(PropertyName = "tenantId")] - public string TenantId { get; private set; } - - /// - /// Gets or sets the identity type. Possible values include: - /// 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', - /// 'None' - /// - [JsonProperty(PropertyName = "type")] - public ResourceIdentityType? Type { get; set; } - - /// - /// Gets or sets the list of user identities associated with the - /// resource. The user identity dictionary key references will be ARM - /// resource ids in the form: - /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. - /// - [JsonProperty(PropertyName = "userAssignedIdentities")] - public IDictionary UserAssignedIdentities { get; set; } - - } -} diff --git a/src/Resources/Resources.Sdk/Generated/Models/Page.cs b/src/Resources/Resources.Sdk/Generated/Models/Page.cs deleted file mode 100644 index 6978b2600aa6..000000000000 --- a/src/Resources/Resources.Sdk/Generated/Models/Page.cs +++ /dev/null @@ -1,53 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Resources.Models -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - - /// - /// Defines a page in Azure responses. - /// - /// Type of the page content items - [JsonObject] - public class Page : IPage - { - /// - /// Gets the link to the next page. - /// - [JsonProperty("nextLink")] - public string NextPageLink { get; private set; } - - [JsonProperty("value")] - private IList Items{ get; set; } - - /// - /// Returns an enumerator that iterates through the collection. - /// - /// A an enumerator that can be used to iterate through the collection. - public IEnumerator GetEnumerator() - { - return Items == null ? System.Linq.Enumerable.Empty().GetEnumerator() : Items.GetEnumerator(); - } - - /// - /// Returns an enumerator that iterates through the collection. - /// - /// A an enumerator that can be used to iterate through the collection. - IEnumerator IEnumerable.GetEnumerator() - { - return GetEnumerator(); - } - } -} diff --git a/src/Resources/Resources.Sdk/Generated/Models/Page1.cs b/src/Resources/Resources.Sdk/Generated/Models/Page1.cs deleted file mode 100644 index 879d3363a9fa..000000000000 --- a/src/Resources/Resources.Sdk/Generated/Models/Page1.cs +++ /dev/null @@ -1,53 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Resources.Models -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - - /// - /// Defines a page in Azure responses. - /// - /// Type of the page content items - [JsonObject] - public class Page1 : IPage - { - /// - /// Gets the link to the next page. - /// - [JsonProperty("nextLink")] - public string NextPageLink { get; private set; } - - [JsonProperty("value")] - private IList Items{ get; set; } - - /// - /// Returns an enumerator that iterates through the collection. - /// - /// A an enumerator that can be used to iterate through the collection. - public IEnumerator GetEnumerator() - { - return Items == null ? System.Linq.Enumerable.Empty().GetEnumerator() : Items.GetEnumerator(); - } - - /// - /// Returns an enumerator that iterates through the collection. - /// - /// A an enumerator that can be used to iterate through the collection. - IEnumerator IEnumerable.GetEnumerator() - { - return GetEnumerator(); - } - } -} diff --git a/src/Resources/Resources.Sdk/Generated/Models/Permission.cs b/src/Resources/Resources.Sdk/Generated/Models/Permission.cs deleted file mode 100644 index 0eb4c7f2f57c..000000000000 --- a/src/Resources/Resources.Sdk/Generated/Models/Permission.cs +++ /dev/null @@ -1,77 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Resources.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Role definition permissions. - /// - public partial class Permission - { - /// - /// Initializes a new instance of the Permission class. - /// - public Permission() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the Permission class. - /// - /// Allowed actions. - /// Denied actions. - /// Allowed Data actions. - /// Denied Data actions. - public Permission(IList actions = default(IList), IList notActions = default(IList), IList dataActions = default(IList), IList notDataActions = default(IList)) - { - Actions = actions; - NotActions = notActions; - DataActions = dataActions; - NotDataActions = notDataActions; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets allowed actions. - /// - [JsonProperty(PropertyName = "actions")] - public IList Actions { get; set; } - - /// - /// Gets or sets denied actions. - /// - [JsonProperty(PropertyName = "notActions")] - public IList NotActions { get; set; } - - /// - /// Gets or sets allowed Data actions. - /// - [JsonProperty(PropertyName = "dataActions")] - public IList DataActions { get; set; } - - /// - /// Gets or sets denied Data actions. - /// - [JsonProperty(PropertyName = "notDataActions")] - public IList NotDataActions { get; set; } - - } -} diff --git a/src/Resources/Resources.Sdk/Generated/Models/PrivateLinkAssociationPropertiesExpanded.cs b/src/Resources/Resources.Sdk/Generated/Models/PrivateLinkAssociationPropertiesExpanded.cs deleted file mode 100644 index 484b55dd37f9..000000000000 --- a/src/Resources/Resources.Sdk/Generated/Models/PrivateLinkAssociationPropertiesExpanded.cs +++ /dev/null @@ -1,79 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Resources.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Private Link Association Properties. - /// - public partial class PrivateLinkAssociationPropertiesExpanded - { - /// - /// Initializes a new instance of the - /// PrivateLinkAssociationPropertiesExpanded class. - /// - public PrivateLinkAssociationPropertiesExpanded() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// PrivateLinkAssociationPropertiesExpanded class. - /// - /// The rmpl Resource ID. - /// Possible values include: - /// 'Enabled', 'Disabled' - /// The TenantID. - /// The scope of the private link - /// association. - public PrivateLinkAssociationPropertiesExpanded(string privateLink = default(string), string publicNetworkAccess = default(string), string tenantID = default(string), string scope = default(string)) - { - PrivateLink = privateLink; - PublicNetworkAccess = publicNetworkAccess; - TenantID = tenantID; - Scope = scope; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the rmpl Resource ID. - /// - [JsonProperty(PropertyName = "privateLink")] - public string PrivateLink { get; set; } - - /// - /// Gets or sets possible values include: 'Enabled', 'Disabled' - /// - [JsonProperty(PropertyName = "publicNetworkAccess")] - public string PublicNetworkAccess { get; set; } - - /// - /// Gets or sets the TenantID. - /// - [JsonProperty(PropertyName = "tenantID")] - public string TenantID { get; set; } - - /// - /// Gets or sets the scope of the private link association. - /// - [JsonProperty(PropertyName = "scope")] - public string Scope { get; set; } - - } -} diff --git a/src/Resources/Resources.Sdk/Generated/Models/ProviderResourceType.cs b/src/Resources/Resources.Sdk/Generated/Models/ProviderResourceType.cs deleted file mode 100644 index 0309c1d45f5c..000000000000 --- a/src/Resources/Resources.Sdk/Generated/Models/ProviderResourceType.cs +++ /dev/null @@ -1,131 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Resources.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Resource type managed by the resource provider. - /// - public partial class ProviderResourceType - { - /// - /// Initializes a new instance of the ProviderResourceType class. - /// - public ProviderResourceType() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ProviderResourceType class. - /// - /// The resource type. - /// The collection of locations where this - /// resource type can be created. - /// The location mappings that are - /// supported by this resource type. - /// The aliases that are supported by this - /// resource type. - /// The API version. - /// The default API version. - /// The API profiles for the resource - /// provider. - /// The additional capabilities offered by - /// this resource type. - /// The properties. - public ProviderResourceType(string resourceType = default(string), IList locations = default(IList), IList locationMappings = default(IList), IList aliases = default(IList), IList apiVersions = default(IList), string defaultApiVersion = default(string), IList zoneMappings = default(IList), IList apiProfiles = default(IList), string capabilities = default(string), IDictionary properties = default(IDictionary)) - { - ResourceType = resourceType; - Locations = locations; - LocationMappings = locationMappings; - Aliases = aliases; - ApiVersions = apiVersions; - DefaultApiVersion = defaultApiVersion; - ZoneMappings = zoneMappings; - ApiProfiles = apiProfiles; - Capabilities = capabilities; - Properties = properties; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the resource type. - /// - [JsonProperty(PropertyName = "resourceType")] - public string ResourceType { get; set; } - - /// - /// Gets or sets the collection of locations where this resource type - /// can be created. - /// - [JsonProperty(PropertyName = "locations")] - public IList Locations { get; set; } - - /// - /// Gets or sets the location mappings that are supported by this - /// resource type. - /// - [JsonProperty(PropertyName = "locationMappings")] - public IList LocationMappings { get; set; } - - /// - /// Gets or sets the aliases that are supported by this resource type. - /// - [JsonProperty(PropertyName = "aliases")] - public IList Aliases { get; set; } - - /// - /// Gets or sets the API version. - /// - [JsonProperty(PropertyName = "apiVersions")] - public IList ApiVersions { get; set; } - - /// - /// Gets the default API version. - /// - [JsonProperty(PropertyName = "defaultApiVersion")] - public string DefaultApiVersion { get; private set; } - - /// - /// - [JsonProperty(PropertyName = "zoneMappings")] - public IList ZoneMappings { get; set; } - - /// - /// Gets the API profiles for the resource provider. - /// - [JsonProperty(PropertyName = "apiProfiles")] - public IList ApiProfiles { get; private set; } - - /// - /// Gets or sets the additional capabilities offered by this resource - /// type. - /// - [JsonProperty(PropertyName = "capabilities")] - public string Capabilities { get; set; } - - /// - /// Gets or sets the properties. - /// - [JsonProperty(PropertyName = "properties")] - public IDictionary Properties { get; set; } - - } -} diff --git a/src/Resources/Resources.Sdk/Generated/Models/Subscription.cs b/src/Resources/Resources.Sdk/Generated/Models/Subscription.cs deleted file mode 100644 index bdebc9565886..000000000000 --- a/src/Resources/Resources.Sdk/Generated/Models/Subscription.cs +++ /dev/null @@ -1,133 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Resources.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Subscription information. - /// - public partial class Subscription - { - /// - /// Initializes a new instance of the Subscription class. - /// - public Subscription() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the Subscription class. - /// - /// The fully qualified ID for the subscription. For - /// example, - /// /subscriptions/00000000-0000-0000-0000-000000000000. - /// The subscription ID. - /// The subscription display name. - /// The subscription tenant ID. - /// The subscription state. Possible values are - /// Enabled, Warned, PastDue, Disabled, and Deleted. Possible values - /// include: 'Enabled', 'Warned', 'PastDue', 'Disabled', - /// 'Deleted' - /// The subscription - /// policies. - /// The authorization source of the - /// request. Valid values are one or more combinations of Legacy, - /// RoleBased, Bypassed, Direct and Management. For example, 'Legacy, - /// RoleBased'. - /// An array containing the tenants - /// managing the subscription. - /// The tags attached to the subscription. - public Subscription(string id = default(string), string subscriptionId = default(string), string displayName = default(string), string tenantId = default(string), SubscriptionState? state = default(SubscriptionState?), SubscriptionPolicies subscriptionPolicies = default(SubscriptionPolicies), string authorizationSource = default(string), IList managedByTenants = default(IList), IDictionary tags = default(IDictionary)) - { - Id = id; - SubscriptionId = subscriptionId; - DisplayName = displayName; - TenantId = tenantId; - State = state; - SubscriptionPolicies = subscriptionPolicies; - AuthorizationSource = authorizationSource; - ManagedByTenants = managedByTenants; - Tags = tags; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets the fully qualified ID for the subscription. For example, - /// /subscriptions/00000000-0000-0000-0000-000000000000. - /// - [JsonProperty(PropertyName = "id")] - public string Id { get; private set; } - - /// - /// Gets the subscription ID. - /// - [JsonProperty(PropertyName = "subscriptionId")] - public string SubscriptionId { get; private set; } - - /// - /// Gets the subscription display name. - /// - [JsonProperty(PropertyName = "displayName")] - public string DisplayName { get; private set; } - - /// - /// Gets the subscription tenant ID. - /// - [JsonProperty(PropertyName = "tenantId")] - public string TenantId { get; private set; } - - /// - /// Gets the subscription state. Possible values are Enabled, Warned, - /// PastDue, Disabled, and Deleted. Possible values include: 'Enabled', - /// 'Warned', 'PastDue', 'Disabled', 'Deleted' - /// - [JsonProperty(PropertyName = "state")] - public SubscriptionState? State { get; private set; } - - /// - /// Gets or sets the subscription policies. - /// - [JsonProperty(PropertyName = "subscriptionPolicies")] - public SubscriptionPolicies SubscriptionPolicies { get; set; } - - /// - /// Gets or sets the authorization source of the request. Valid values - /// are one or more combinations of Legacy, RoleBased, Bypassed, Direct - /// and Management. For example, 'Legacy, RoleBased'. - /// - [JsonProperty(PropertyName = "authorizationSource")] - public string AuthorizationSource { get; set; } - - /// - /// Gets or sets an array containing the tenants managing the - /// subscription. - /// - [JsonProperty(PropertyName = "managedByTenants")] - public IList ManagedByTenants { get; set; } - - /// - /// Gets or sets the tags attached to the subscription. - /// - [JsonProperty(PropertyName = "tags")] - public IDictionary Tags { get; set; } - - } -} diff --git a/src/Resources/Resources.Sdk/Generated/Models/SubscriptionFeatureRegistrationProperties.cs b/src/Resources/Resources.Sdk/Generated/Models/SubscriptionFeatureRegistrationProperties.cs deleted file mode 100644 index 254bcfe4e6bb..000000000000 --- a/src/Resources/Resources.Sdk/Generated/Models/SubscriptionFeatureRegistrationProperties.cs +++ /dev/null @@ -1,189 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Resources.Models -{ - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - public partial class SubscriptionFeatureRegistrationProperties - { - /// - /// Initializes a new instance of the - /// SubscriptionFeatureRegistrationProperties class. - /// - public SubscriptionFeatureRegistrationProperties() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// SubscriptionFeatureRegistrationProperties class. - /// - /// The tenantId. - /// The subscriptionId. - /// The featureName. - /// The featureDisplayName. - /// The providerNamespace. - /// The state. Possible values include: - /// 'NotSpecified', 'NotRegistered', 'Pending', 'Registering', - /// 'Registered', 'Unregistering', 'Unregistered' - /// Key-value pairs for meta data. - /// The feature release date. - /// The feature registration - /// date. - /// The feature documentation - /// link. - /// The feature approval type. Possible - /// values include: 'NotSpecified', 'ApprovalRequired', - /// 'AutoApproval' - /// Indicates whether - /// feature should be displayed in Portal. - /// The feature description. - public SubscriptionFeatureRegistrationProperties(string tenantId = default(string), string subscriptionId = default(string), string featureName = default(string), string displayName = default(string), string providerNamespace = default(string), string state = default(string), AuthorizationProfile authorizationProfile = default(AuthorizationProfile), IDictionary metadata = default(IDictionary), System.DateTime? releaseDate = default(System.DateTime?), System.DateTime? registrationDate = default(System.DateTime?), string documentationLink = default(string), string approvalType = default(string), bool? shouldFeatureDisplayInPortal = default(bool?), string description = default(string)) - { - TenantId = tenantId; - SubscriptionId = subscriptionId; - FeatureName = featureName; - DisplayName = displayName; - ProviderNamespace = providerNamespace; - State = state; - AuthorizationProfile = authorizationProfile; - Metadata = metadata; - ReleaseDate = releaseDate; - RegistrationDate = registrationDate; - DocumentationLink = documentationLink; - ApprovalType = approvalType; - ShouldFeatureDisplayInPortal = shouldFeatureDisplayInPortal; - Description = description; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets the tenantId. - /// - [JsonProperty(PropertyName = "tenantId")] - public string TenantId { get; private set; } - - /// - /// Gets the subscriptionId. - /// - [JsonProperty(PropertyName = "subscriptionId")] - public string SubscriptionId { get; private set; } - - /// - /// Gets the featureName. - /// - [JsonProperty(PropertyName = "featureName")] - public string FeatureName { get; private set; } - - /// - /// Gets the featureDisplayName. - /// - [JsonProperty(PropertyName = "displayName")] - public string DisplayName { get; private set; } - - /// - /// Gets the providerNamespace. - /// - [JsonProperty(PropertyName = "providerNamespace")] - public string ProviderNamespace { get; private set; } - - /// - /// Gets or sets the state. Possible values include: 'NotSpecified', - /// 'NotRegistered', 'Pending', 'Registering', 'Registered', - /// 'Unregistering', 'Unregistered' - /// - [JsonProperty(PropertyName = "state")] - public string State { get; set; } - - /// - /// - [JsonProperty(PropertyName = "authorizationProfile")] - public AuthorizationProfile AuthorizationProfile { get; set; } - - /// - /// Gets or sets key-value pairs for meta data. - /// - [JsonProperty(PropertyName = "metadata")] - public IDictionary Metadata { get; set; } - - /// - /// Gets the feature release date. - /// - [JsonProperty(PropertyName = "releaseDate")] - public System.DateTime? ReleaseDate { get; private set; } - - /// - /// Gets the feature registration date. - /// - [JsonProperty(PropertyName = "registrationDate")] - public System.DateTime? RegistrationDate { get; private set; } - - /// - /// Gets the feature documentation link. - /// - [JsonProperty(PropertyName = "documentationLink")] - public string DocumentationLink { get; private set; } - - /// - /// Gets the feature approval type. Possible values include: - /// 'NotSpecified', 'ApprovalRequired', 'AutoApproval' - /// - [JsonProperty(PropertyName = "approvalType")] - public string ApprovalType { get; private set; } - - /// - /// Gets or sets indicates whether feature should be displayed in - /// Portal. - /// - [JsonProperty(PropertyName = "shouldFeatureDisplayInPortal")] - public bool? ShouldFeatureDisplayInPortal { get; set; } - - /// - /// Gets or sets the feature description. - /// - [JsonProperty(PropertyName = "description")] - public string Description { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (DocumentationLink != null) - { - if (DocumentationLink.Length > 1000) - { - throw new ValidationException(ValidationRules.MaxLength, "DocumentationLink", 1000); - } - } - if (Description != null) - { - if (Description.Length > 1000) - { - throw new ValidationException(ValidationRules.MaxLength, "Description", 1000); - } - } - } - } -} diff --git a/src/Resources/Resources.Sdk/Generated/Models/TemplateSpec.cs b/src/Resources/Resources.Sdk/Generated/Models/TemplateSpec.cs deleted file mode 100644 index f074c91f5705..000000000000 --- a/src/Resources/Resources.Sdk/Generated/Models/TemplateSpec.cs +++ /dev/null @@ -1,142 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Resources.Models -{ - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Template Spec object. - /// - [Rest.Serialization.JsonTransformation] - public partial class TemplateSpec : AzureResourceBase - { - /// - /// Initializes a new instance of the TemplateSpec class. - /// - public TemplateSpec() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the TemplateSpec class. - /// - /// The location of the Template Spec. It cannot - /// be changed after Template Spec creation. It must be one of the - /// supported Azure locations. - /// String Id used to locate any resource on - /// Azure. - /// Name of this resource. - /// Type of this resource. - /// Azure Resource Manager metadata containing - /// createdBy and modifiedBy information. - /// Template Spec description. - /// Template Spec display name. - /// The Template Spec metadata. Metadata is an - /// open-ended object and is typically a collection of key-value - /// pairs. - /// High-level information about the versions - /// within this Template Spec. The keys are the version names. Only - /// populated if the $expand query parameter is set to - /// 'versions'. - /// Resource tags. - public TemplateSpec(string location, string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string description = default(string), string displayName = default(string), object metadata = default(object), IDictionary versions = default(IDictionary), IDictionary tags = default(IDictionary)) - : base(id, name, type, systemData) - { - Location = location; - Description = description; - DisplayName = displayName; - Metadata = metadata; - Versions = versions; - Tags = tags; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the location of the Template Spec. It cannot be - /// changed after Template Spec creation. It must be one of the - /// supported Azure locations. - /// - [JsonProperty(PropertyName = "location")] - public string Location { get; set; } - - /// - /// Gets or sets template Spec description. - /// - [JsonProperty(PropertyName = "properties.description")] - public string Description { get; set; } - - /// - /// Gets or sets template Spec display name. - /// - [JsonProperty(PropertyName = "properties.displayName")] - public string DisplayName { get; set; } - - /// - /// Gets or sets the Template Spec metadata. Metadata is an open-ended - /// object and is typically a collection of key-value pairs. - /// - [JsonProperty(PropertyName = "properties.metadata")] - public object Metadata { get; set; } - - /// - /// Gets high-level information about the versions within this Template - /// Spec. The keys are the version names. Only populated if the $expand - /// query parameter is set to 'versions'. - /// - [JsonProperty(PropertyName = "properties.versions")] - public IDictionary Versions { get; private set; } - - /// - /// Gets or sets resource tags. - /// - [JsonProperty(PropertyName = "tags")] - public IDictionary Tags { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Location == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Location"); - } - if (Description != null) - { - if (Description.Length > 4096) - { - throw new ValidationException(ValidationRules.MaxLength, "Description", 4096); - } - } - if (DisplayName != null) - { - if (DisplayName.Length > 64) - { - throw new ValidationException(ValidationRules.MaxLength, "DisplayName", 64); - } - } - } - } -} diff --git a/src/Resources/Resources.Sdk/Generated/Models/TemplateSpecVersion.cs b/src/Resources/Resources.Sdk/Generated/Models/TemplateSpecVersion.cs deleted file mode 100644 index 1aed1386e529..000000000000 --- a/src/Resources/Resources.Sdk/Generated/Models/TemplateSpecVersion.cs +++ /dev/null @@ -1,151 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Resources.Models -{ - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Template Spec Version object. - /// - [Rest.Serialization.JsonTransformation] - public partial class TemplateSpecVersion : AzureResourceBase - { - /// - /// Initializes a new instance of the TemplateSpecVersion class. - /// - public TemplateSpecVersion() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the TemplateSpecVersion class. - /// - /// The location of the Template Spec Version. - /// It must match the location of the parent Template Spec. - /// String Id used to locate any resource on - /// Azure. - /// Name of this resource. - /// Type of this resource. - /// Azure Resource Manager metadata containing - /// createdBy and modifiedBy information. - /// Template Spec version - /// description. - /// An array of linked template - /// artifacts. - /// The version metadata. Metadata is an - /// open-ended object and is typically a collection of key-value - /// pairs. - /// The main Azure Resource Manager template - /// content. - /// The Azure Resource Manager template - /// UI definition content. - /// Resource tags. - public TemplateSpecVersion(string location, string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string description = default(string), IList linkedTemplates = default(IList), object metadata = default(object), object mainTemplate = default(object), object uiFormDefinition = default(object), IDictionary tags = default(IDictionary)) - : base(id, name, type, systemData) - { - Location = location; - Description = description; - LinkedTemplates = linkedTemplates; - Metadata = metadata; - MainTemplate = mainTemplate; - UiFormDefinition = uiFormDefinition; - Tags = tags; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the location of the Template Spec Version. It must - /// match the location of the parent Template Spec. - /// - [JsonProperty(PropertyName = "location")] - public string Location { get; set; } - - /// - /// Gets or sets template Spec version description. - /// - [JsonProperty(PropertyName = "properties.description")] - public string Description { get; set; } - - /// - /// Gets or sets an array of linked template artifacts. - /// - [JsonProperty(PropertyName = "properties.linkedTemplates")] - public IList LinkedTemplates { get; set; } - - /// - /// Gets or sets the version metadata. Metadata is an open-ended object - /// and is typically a collection of key-value pairs. - /// - [JsonProperty(PropertyName = "properties.metadata")] - public object Metadata { get; set; } - - /// - /// Gets or sets the main Azure Resource Manager template content. - /// - [JsonProperty(PropertyName = "properties.mainTemplate")] - public object MainTemplate { get; set; } - - /// - /// Gets or sets the Azure Resource Manager template UI definition - /// content. - /// - [JsonProperty(PropertyName = "properties.uiFormDefinition")] - public object UiFormDefinition { get; set; } - - /// - /// Gets or sets resource tags. - /// - [JsonProperty(PropertyName = "tags")] - public IDictionary Tags { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Location == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Location"); - } - if (Description != null) - { - if (Description.Length > 4096) - { - throw new ValidationException(ValidationRules.MaxLength, "Description", 4096); - } - } - if (LinkedTemplates != null) - { - foreach (var element in LinkedTemplates) - { - if (element != null) - { - element.Validate(); - } - } - } - } - } -} diff --git a/src/Resources/Resources.Sdk/Generated/Models/TenantIdDescription.cs b/src/Resources/Resources.Sdk/Generated/Models/TenantIdDescription.cs deleted file mode 100644 index 1d45e4f626e5..000000000000 --- a/src/Resources/Resources.Sdk/Generated/Models/TenantIdDescription.cs +++ /dev/null @@ -1,137 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Resources.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Tenant Id information. - /// - public partial class TenantIdDescription - { - /// - /// Initializes a new instance of the TenantIdDescription class. - /// - public TenantIdDescription() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the TenantIdDescription class. - /// - /// The fully qualified ID of the tenant. For example, - /// /tenants/00000000-0000-0000-0000-000000000000. - /// The tenant ID. For example, - /// 00000000-0000-0000-0000-000000000000. - /// Category of the tenant. Possible - /// values include: 'Home', 'ProjectedBy', 'ManagedBy' - /// Country/region name of the address for the - /// tenant. - /// Country/region abbreviation for the - /// tenant. - /// The display name of the tenant. - /// The list of domains for the tenant. - /// The default domain for the - /// tenant. - /// The tenant type. Only available for 'Home' - /// tenant category. - /// The tenant's branding logo URL. - /// Only available for 'Home' tenant category. - public TenantIdDescription(string id = default(string), string tenantId = default(string), TenantCategory? tenantCategory = default(TenantCategory?), string country = default(string), string countryCode = default(string), string displayName = default(string), IList domains = default(IList), string defaultDomain = default(string), string tenantType = default(string), string tenantBrandingLogoUrl = default(string)) - { - Id = id; - TenantId = tenantId; - TenantCategory = tenantCategory; - Country = country; - CountryCode = countryCode; - DisplayName = displayName; - Domains = domains; - DefaultDomain = defaultDomain; - TenantType = tenantType; - TenantBrandingLogoUrl = tenantBrandingLogoUrl; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets the fully qualified ID of the tenant. For example, - /// /tenants/00000000-0000-0000-0000-000000000000. - /// - [JsonProperty(PropertyName = "id")] - public string Id { get; private set; } - - /// - /// Gets the tenant ID. For example, - /// 00000000-0000-0000-0000-000000000000. - /// - [JsonProperty(PropertyName = "tenantId")] - public string TenantId { get; private set; } - - /// - /// Gets category of the tenant. Possible values include: 'Home', - /// 'ProjectedBy', 'ManagedBy' - /// - [JsonProperty(PropertyName = "tenantCategory")] - public TenantCategory? TenantCategory { get; private set; } - - /// - /// Gets country/region name of the address for the tenant. - /// - [JsonProperty(PropertyName = "country")] - public string Country { get; private set; } - - /// - /// Gets country/region abbreviation for the tenant. - /// - [JsonProperty(PropertyName = "countryCode")] - public string CountryCode { get; private set; } - - /// - /// Gets the display name of the tenant. - /// - [JsonProperty(PropertyName = "displayName")] - public string DisplayName { get; private set; } - - /// - /// Gets the list of domains for the tenant. - /// - [JsonProperty(PropertyName = "domains")] - public IList Domains { get; private set; } - - /// - /// Gets the default domain for the tenant. - /// - [JsonProperty(PropertyName = "defaultDomain")] - public string DefaultDomain { get; private set; } - - /// - /// Gets the tenant type. Only available for 'Home' tenant category. - /// - [JsonProperty(PropertyName = "tenantType")] - public string TenantType { get; private set; } - - /// - /// Gets the tenant's branding logo URL. Only available for 'Home' - /// tenant category. - /// - [JsonProperty(PropertyName = "tenantBrandingLogoUrl")] - public string TenantBrandingLogoUrl { get; private set; } - - } -} diff --git a/src/Resources/Resources.Sdk/Generated/OperationsExtensions.cs b/src/Resources/Resources.Sdk/Generated/OperationsExtensions.cs deleted file mode 100644 index 4c67ffb50c97..000000000000 --- a/src/Resources/Resources.Sdk/Generated/OperationsExtensions.cs +++ /dev/null @@ -1,87 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Resources -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Threading; - using System.Threading.Tasks; - - /// - /// Extension methods for Operations. - /// - public static partial class OperationsExtensions - { - /// - /// Lists all of the available Microsoft.Resources REST API operations. - /// - /// - /// The operations group for this extension method. - /// - public static IPage List(this IOperations operations) - { - return operations.ListAsync().GetAwaiter().GetResult(); - } - - /// - /// Lists all of the available Microsoft.Resources REST API operations. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IOperations operations, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Lists all of the available Microsoft.Resources REST API operations. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Lists all of the available Microsoft.Resources REST API operations. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this IOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - } -} diff --git a/src/Resources/Resources.Sdk/Generated/PrivateLinkAssociationOperationsExtensions.cs b/src/Resources/Resources.Sdk/Generated/PrivateLinkAssociationOperationsExtensions.cs deleted file mode 100644 index 59e41861831d..000000000000 --- a/src/Resources/Resources.Sdk/Generated/PrivateLinkAssociationOperationsExtensions.cs +++ /dev/null @@ -1,182 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Resources -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Threading; - using System.Threading.Tasks; - - /// - /// Extension methods for PrivateLinkAssociationOperations. - /// - public static partial class PrivateLinkAssociationOperationsExtensions - { - /// - /// Create a PrivateLinkAssociation - /// - /// - /// The operations group for this extension method. - /// - /// - /// The management group ID. - /// - /// - /// The ID of the PLA - /// - /// - /// Parameters supplied to create the private link association. - /// - public static PrivateLinkAssociation Put(this IPrivateLinkAssociationOperations operations, string groupId, string plaId, PrivateLinkAssociationObject parameters) - { - return operations.PutAsync(groupId, plaId, parameters).GetAwaiter().GetResult(); - } - - /// - /// Create a PrivateLinkAssociation - /// - /// - /// The operations group for this extension method. - /// - /// - /// The management group ID. - /// - /// - /// The ID of the PLA - /// - /// - /// Parameters supplied to create the private link association. - /// - /// - /// The cancellation token. - /// - public static async Task PutAsync(this IPrivateLinkAssociationOperations operations, string groupId, string plaId, PrivateLinkAssociationObject parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.PutWithHttpMessagesAsync(groupId, plaId, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Get a single private link association - /// - /// - /// The operations group for this extension method. - /// - /// - /// The management group ID. - /// - /// - /// The ID of the PLA - /// - public static PrivateLinkAssociation Get(this IPrivateLinkAssociationOperations operations, string groupId, string plaId) - { - return operations.GetAsync(groupId, plaId).GetAwaiter().GetResult(); - } - - /// - /// Get a single private link association - /// - /// - /// The operations group for this extension method. - /// - /// - /// The management group ID. - /// - /// - /// The ID of the PLA - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IPrivateLinkAssociationOperations operations, string groupId, string plaId, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(groupId, plaId, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Delete a PrivateLinkAssociation - /// - /// - /// The operations group for this extension method. - /// - /// - /// The management group ID. - /// - /// - /// The ID of the PLA - /// - public static void Delete(this IPrivateLinkAssociationOperations operations, string groupId, string plaId) - { - operations.DeleteAsync(groupId, plaId).GetAwaiter().GetResult(); - } - - /// - /// Delete a PrivateLinkAssociation - /// - /// - /// The operations group for this extension method. - /// - /// - /// The management group ID. - /// - /// - /// The ID of the PLA - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IPrivateLinkAssociationOperations operations, string groupId, string plaId, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(groupId, plaId, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Get a private link association for a management group scope - /// - /// - /// The operations group for this extension method. - /// - /// - /// The management group ID. - /// - public static PrivateLinkAssociationGetResult List(this IPrivateLinkAssociationOperations operations, string groupId) - { - return operations.ListAsync(groupId).GetAwaiter().GetResult(); - } - - /// - /// Get a private link association for a management group scope - /// - /// - /// The operations group for this extension method. - /// - /// - /// The management group ID. - /// - /// - /// The cancellation token. - /// - public static async Task ListAsync(this IPrivateLinkAssociationOperations operations, string groupId, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(groupId, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - } -} diff --git a/src/Resources/Resources.Sdk/Generated/ProviderResourceTypesOperationsExtensions.cs b/src/Resources/Resources.Sdk/Generated/ProviderResourceTypesOperationsExtensions.cs deleted file mode 100644 index 36c18b1756b4..000000000000 --- a/src/Resources/Resources.Sdk/Generated/ProviderResourceTypesOperationsExtensions.cs +++ /dev/null @@ -1,67 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Resources -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Threading; - using System.Threading.Tasks; - - /// - /// Extension methods for ProviderResourceTypesOperations. - /// - public static partial class ProviderResourceTypesOperationsExtensions - { - /// - /// List the resource types for a specified resource provider. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The namespace of the resource provider. - /// - /// - /// The $expand query parameter. For example, to include property aliases in - /// response, use $expand=resourceTypes/aliases. - /// - public static ProviderResourceTypeListResult List(this IProviderResourceTypesOperations operations, string resourceProviderNamespace, string expand = default(string)) - { - return operations.ListAsync(resourceProviderNamespace, expand).GetAwaiter().GetResult(); - } - - /// - /// List the resource types for a specified resource provider. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The namespace of the resource provider. - /// - /// - /// The $expand query parameter. For example, to include property aliases in - /// response, use $expand=resourceTypes/aliases. - /// - /// - /// The cancellation token. - /// - public static async Task ListAsync(this IProviderResourceTypesOperations operations, string resourceProviderNamespace, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceProviderNamespace, expand, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - } -} diff --git a/src/Resources/Resources.Sdk/Generated/ProvidersOperationsExtensions.cs b/src/Resources/Resources.Sdk/Generated/ProvidersOperationsExtensions.cs deleted file mode 100644 index 7f98dffec6c4..000000000000 --- a/src/Resources/Resources.Sdk/Generated/ProvidersOperationsExtensions.cs +++ /dev/null @@ -1,410 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Resources -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Threading; - using System.Threading.Tasks; - - /// - /// Extension methods for ProvidersOperations. - /// - public static partial class ProvidersOperationsExtensions - { - /// - /// Unregisters a subscription from a resource provider. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The namespace of the resource provider to unregister. - /// - public static Provider Unregister(this IProvidersOperations operations, string resourceProviderNamespace) - { - return operations.UnregisterAsync(resourceProviderNamespace).GetAwaiter().GetResult(); - } - - /// - /// Unregisters a subscription from a resource provider. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The namespace of the resource provider to unregister. - /// - /// - /// The cancellation token. - /// - public static async Task UnregisterAsync(this IProvidersOperations operations, string resourceProviderNamespace, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.UnregisterWithHttpMessagesAsync(resourceProviderNamespace, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Registers a management group with a resource provider. Use this operation - /// to register a resource provider with resource types that can be deployed at - /// the management group scope. It does not recursively register subscriptions - /// within the management group. Instead, you must register subscriptions - /// individually. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The namespace of the resource provider to register. - /// - /// - /// The management group ID. - /// - public static void RegisterAtManagementGroupScope(this IProvidersOperations operations, string resourceProviderNamespace, string groupId) - { - operations.RegisterAtManagementGroupScopeAsync(resourceProviderNamespace, groupId).GetAwaiter().GetResult(); - } - - /// - /// Registers a management group with a resource provider. Use this operation - /// to register a resource provider with resource types that can be deployed at - /// the management group scope. It does not recursively register subscriptions - /// within the management group. Instead, you must register subscriptions - /// individually. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The namespace of the resource provider to register. - /// - /// - /// The management group ID. - /// - /// - /// The cancellation token. - /// - public static async Task RegisterAtManagementGroupScopeAsync(this IProvidersOperations operations, string resourceProviderNamespace, string groupId, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.RegisterAtManagementGroupScopeWithHttpMessagesAsync(resourceProviderNamespace, groupId, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Get the provider permissions. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The namespace of the resource provider. - /// - public static ProviderPermissionListResult ProviderPermissions(this IProvidersOperations operations, string resourceProviderNamespace) - { - return operations.ProviderPermissionsAsync(resourceProviderNamespace).GetAwaiter().GetResult(); - } - - /// - /// Get the provider permissions. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The namespace of the resource provider. - /// - /// - /// The cancellation token. - /// - public static async Task ProviderPermissionsAsync(this IProvidersOperations operations, string resourceProviderNamespace, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ProviderPermissionsWithHttpMessagesAsync(resourceProviderNamespace, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Registers a subscription with a resource provider. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The namespace of the resource provider to register. - /// - /// - /// The third party consent for S2S. - /// - public static Provider Register(this IProvidersOperations operations, string resourceProviderNamespace, ProviderRegistrationRequest properties = default(ProviderRegistrationRequest)) - { - return operations.RegisterAsync(resourceProviderNamespace, properties).GetAwaiter().GetResult(); - } - - /// - /// Registers a subscription with a resource provider. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The namespace of the resource provider to register. - /// - /// - /// The third party consent for S2S. - /// - /// - /// The cancellation token. - /// - public static async Task RegisterAsync(this IProvidersOperations operations, string resourceProviderNamespace, ProviderRegistrationRequest properties = default(ProviderRegistrationRequest), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.RegisterWithHttpMessagesAsync(resourceProviderNamespace, properties, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets all resource providers for a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The properties to include in the results. For example, use - /// &$expand=metadata in the query string to retrieve resource provider - /// metadata. To include property aliases in response, use - /// $expand=resourceTypes/aliases. - /// - public static IPage List(this IProvidersOperations operations, string expand = default(string)) - { - return operations.ListAsync(expand).GetAwaiter().GetResult(); - } - - /// - /// Gets all resource providers for a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The properties to include in the results. For example, use - /// &$expand=metadata in the query string to retrieve resource provider - /// metadata. To include property aliases in response, use - /// $expand=resourceTypes/aliases. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IProvidersOperations operations, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(expand, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets all resource providers for the tenant. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The properties to include in the results. For example, use - /// &$expand=metadata in the query string to retrieve resource provider - /// metadata. To include property aliases in response, use - /// $expand=resourceTypes/aliases. - /// - public static IPage ListAtTenantScope(this IProvidersOperations operations, string expand = default(string)) - { - return operations.ListAtTenantScopeAsync(expand).GetAwaiter().GetResult(); - } - - /// - /// Gets all resource providers for the tenant. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The properties to include in the results. For example, use - /// &$expand=metadata in the query string to retrieve resource provider - /// metadata. To include property aliases in response, use - /// $expand=resourceTypes/aliases. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAtTenantScopeAsync(this IProvidersOperations operations, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListAtTenantScopeWithHttpMessagesAsync(expand, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets the specified resource provider. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The namespace of the resource provider. - /// - /// - /// The $expand query parameter. For example, to include property aliases in - /// response, use $expand=resourceTypes/aliases. - /// - public static Provider Get(this IProvidersOperations operations, string resourceProviderNamespace, string expand = default(string)) - { - return operations.GetAsync(resourceProviderNamespace, expand).GetAwaiter().GetResult(); - } - - /// - /// Gets the specified resource provider. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The namespace of the resource provider. - /// - /// - /// The $expand query parameter. For example, to include property aliases in - /// response, use $expand=resourceTypes/aliases. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IProvidersOperations operations, string resourceProviderNamespace, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceProviderNamespace, expand, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets the specified resource provider at the tenant level. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The namespace of the resource provider. - /// - /// - /// The $expand query parameter. For example, to include property aliases in - /// response, use $expand=resourceTypes/aliases. - /// - public static Provider GetAtTenantScope(this IProvidersOperations operations, string resourceProviderNamespace, string expand = default(string)) - { - return operations.GetAtTenantScopeAsync(resourceProviderNamespace, expand).GetAwaiter().GetResult(); - } - - /// - /// Gets the specified resource provider at the tenant level. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The namespace of the resource provider. - /// - /// - /// The $expand query parameter. For example, to include property aliases in - /// response, use $expand=resourceTypes/aliases. - /// - /// - /// The cancellation token. - /// - public static async Task GetAtTenantScopeAsync(this IProvidersOperations operations, string resourceProviderNamespace, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetAtTenantScopeWithHttpMessagesAsync(resourceProviderNamespace, expand, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets all resource providers for a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IProvidersOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets all resource providers for a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this IProvidersOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets all resource providers for the tenant. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListAtTenantScopeNext(this IProvidersOperations operations, string nextPageLink) - { - return operations.ListAtTenantScopeNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets all resource providers for the tenant. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAtTenantScopeNextAsync(this IProvidersOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListAtTenantScopeNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - } -} diff --git a/src/Resources/Resources.Sdk/Generated/ResourceGroupsOperationsExtensions.cs b/src/Resources/Resources.Sdk/Generated/ResourceGroupsOperationsExtensions.cs deleted file mode 100644 index 3754340c8539..000000000000 --- a/src/Resources/Resources.Sdk/Generated/ResourceGroupsOperationsExtensions.cs +++ /dev/null @@ -1,438 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Resources -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Microsoft.Rest.Azure.OData; - using Models; - using System.Threading; - using System.Threading.Tasks; - - /// - /// Extension methods for ResourceGroupsOperations. - /// - public static partial class ResourceGroupsOperationsExtensions - { - /// - /// Checks whether a resource group exists. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group to check. The name is case insensitive. - /// - public static bool CheckExistence(this IResourceGroupsOperations operations, string resourceGroupName) - { - return operations.CheckExistenceAsync(resourceGroupName).GetAwaiter().GetResult(); - } - - /// - /// Checks whether a resource group exists. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group to check. The name is case insensitive. - /// - /// - /// The cancellation token. - /// - public static async Task CheckExistenceAsync(this IResourceGroupsOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CheckExistenceWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Creates or updates a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group to create or update. Can include - /// alphanumeric, underscore, parentheses, hyphen, period (except at end), and - /// Unicode characters that match the allowed characters. - /// - /// - /// Parameters supplied to the create or update a resource group. - /// - public static ResourceGroup CreateOrUpdate(this IResourceGroupsOperations operations, string resourceGroupName, ResourceGroup parameters) - { - return operations.CreateOrUpdateAsync(resourceGroupName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Creates or updates a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group to create or update. Can include - /// alphanumeric, underscore, parentheses, hyphen, period (except at end), and - /// Unicode characters that match the allowed characters. - /// - /// - /// Parameters supplied to the create or update a resource group. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IResourceGroupsOperations operations, string resourceGroupName, ResourceGroup parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes a resource group. - /// - /// - /// When you delete a resource group, all of its resources are also deleted. - /// Deleting a resource group deletes all of its template deployments and - /// currently stored operations. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group to delete. The name is case insensitive. - /// - /// - /// The resource types you want to force delete. Currently, only the following - /// is supported: - /// forceDeletionTypes=Microsoft.Compute/virtualMachines,Microsoft.Compute/virtualMachineScaleSets - /// - public static void Delete(this IResourceGroupsOperations operations, string resourceGroupName, string forceDeletionTypes = default(string)) - { - operations.DeleteAsync(resourceGroupName, forceDeletionTypes).GetAwaiter().GetResult(); - } - - /// - /// Deletes a resource group. - /// - /// - /// When you delete a resource group, all of its resources are also deleted. - /// Deleting a resource group deletes all of its template deployments and - /// currently stored operations. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group to delete. The name is case insensitive. - /// - /// - /// The resource types you want to force delete. Currently, only the following - /// is supported: - /// forceDeletionTypes=Microsoft.Compute/virtualMachines,Microsoft.Compute/virtualMachineScaleSets - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IResourceGroupsOperations operations, string resourceGroupName, string forceDeletionTypes = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, forceDeletionTypes, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Gets a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group to get. The name is case insensitive. - /// - public static ResourceGroup Get(this IResourceGroupsOperations operations, string resourceGroupName) - { - return operations.GetAsync(resourceGroupName).GetAwaiter().GetResult(); - } - - /// - /// Gets a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group to get. The name is case insensitive. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IResourceGroupsOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Updates a resource group. - /// - /// - /// Resource groups can be updated through a simple PATCH operation to a group - /// address. The format of the request is the same as that for creating a - /// resource group. If a field is unspecified, the current value is retained. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group to update. The name is case insensitive. - /// - /// - /// Parameters supplied to update a resource group. - /// - public static ResourceGroup Update(this IResourceGroupsOperations operations, string resourceGroupName, ResourceGroupPatchable parameters) - { - return operations.UpdateAsync(resourceGroupName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Updates a resource group. - /// - /// - /// Resource groups can be updated through a simple PATCH operation to a group - /// address. The format of the request is the same as that for creating a - /// resource group. If a field is unspecified, the current value is retained. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group to update. The name is case insensitive. - /// - /// - /// Parameters supplied to update a resource group. - /// - /// - /// The cancellation token. - /// - public static async Task UpdateAsync(this IResourceGroupsOperations operations, string resourceGroupName, ResourceGroupPatchable parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Captures the specified resource group as a template. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Parameters for exporting the template. - /// - public static ResourceGroupExportResult ExportTemplate(this IResourceGroupsOperations operations, string resourceGroupName, ExportTemplateRequest parameters) - { - return operations.ExportTemplateAsync(resourceGroupName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Captures the specified resource group as a template. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Parameters for exporting the template. - /// - /// - /// The cancellation token. - /// - public static async Task ExportTemplateAsync(this IResourceGroupsOperations operations, string resourceGroupName, ExportTemplateRequest parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ExportTemplateWithHttpMessagesAsync(resourceGroupName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets all the resource groups for a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// OData parameters to apply to the operation. - /// - public static IPage List(this IResourceGroupsOperations operations, ODataQuery odataQuery = default(ODataQuery)) - { - return operations.ListAsync(odataQuery).GetAwaiter().GetResult(); - } - - /// - /// Gets all the resource groups for a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IResourceGroupsOperations operations, ODataQuery odataQuery = default(ODataQuery), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(odataQuery, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes a resource group. - /// - /// - /// When you delete a resource group, all of its resources are also deleted. - /// Deleting a resource group deletes all of its template deployments and - /// currently stored operations. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group to delete. The name is case insensitive. - /// - /// - /// The resource types you want to force delete. Currently, only the following - /// is supported: - /// forceDeletionTypes=Microsoft.Compute/virtualMachines,Microsoft.Compute/virtualMachineScaleSets - /// - public static void BeginDelete(this IResourceGroupsOperations operations, string resourceGroupName, string forceDeletionTypes = default(string)) - { - operations.BeginDeleteAsync(resourceGroupName, forceDeletionTypes).GetAwaiter().GetResult(); - } - - /// - /// Deletes a resource group. - /// - /// - /// When you delete a resource group, all of its resources are also deleted. - /// Deleting a resource group deletes all of its template deployments and - /// currently stored operations. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group to delete. The name is case insensitive. - /// - /// - /// The resource types you want to force delete. Currently, only the following - /// is supported: - /// forceDeletionTypes=Microsoft.Compute/virtualMachines,Microsoft.Compute/virtualMachineScaleSets - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IResourceGroupsOperations operations, string resourceGroupName, string forceDeletionTypes = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, forceDeletionTypes, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Captures the specified resource group as a template. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Parameters for exporting the template. - /// - public static ResourceGroupExportResult BeginExportTemplate(this IResourceGroupsOperations operations, string resourceGroupName, ExportTemplateRequest parameters) - { - return operations.BeginExportTemplateAsync(resourceGroupName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Captures the specified resource group as a template. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Parameters for exporting the template. - /// - /// - /// The cancellation token. - /// - public static async Task BeginExportTemplateAsync(this IResourceGroupsOperations operations, string resourceGroupName, ExportTemplateRequest parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginExportTemplateWithHttpMessagesAsync(resourceGroupName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets all the resource groups for a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IResourceGroupsOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets all the resource groups for a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this IResourceGroupsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - } -} diff --git a/src/Resources/Resources.Sdk/Generated/ResourceManagementPrivateLinkOperationsExtensions.cs b/src/Resources/Resources.Sdk/Generated/ResourceManagementPrivateLinkOperationsExtensions.cs deleted file mode 100644 index 8ff27f962593..000000000000 --- a/src/Resources/Resources.Sdk/Generated/ResourceManagementPrivateLinkOperationsExtensions.cs +++ /dev/null @@ -1,210 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Resources -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Threading; - using System.Threading.Tasks; - - /// - /// Extension methods for ResourceManagementPrivateLinkOperations. - /// - public static partial class ResourceManagementPrivateLinkOperationsExtensions - { - /// - /// Create a resource management group private link. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the resource management private link. - /// - /// - /// The region to create the Resource Management private link. - /// - public static ResourceManagementPrivateLink Put(this IResourceManagementPrivateLinkOperations operations, string resourceGroupName, string rmplName, ResourceManagementPrivateLinkLocation parameters) - { - return operations.PutAsync(resourceGroupName, rmplName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Create a resource management group private link. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the resource management private link. - /// - /// - /// The region to create the Resource Management private link. - /// - /// - /// The cancellation token. - /// - public static async Task PutAsync(this IResourceManagementPrivateLinkOperations operations, string resourceGroupName, string rmplName, ResourceManagementPrivateLinkLocation parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.PutWithHttpMessagesAsync(resourceGroupName, rmplName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Get a resource management private link(resource-level). - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the resource management private link. - /// - public static ResourceManagementPrivateLink Get(this IResourceManagementPrivateLinkOperations operations, string resourceGroupName, string rmplName) - { - return operations.GetAsync(resourceGroupName, rmplName).GetAwaiter().GetResult(); - } - - /// - /// Get a resource management private link(resource-level). - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the resource management private link. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IResourceManagementPrivateLinkOperations operations, string resourceGroupName, string rmplName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, rmplName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Delete a resource management private link. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the resource management private link. - /// - public static void Delete(this IResourceManagementPrivateLinkOperations operations, string resourceGroupName, string rmplName) - { - operations.DeleteAsync(resourceGroupName, rmplName).GetAwaiter().GetResult(); - } - - /// - /// Delete a resource management private link. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the resource management private link. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IResourceManagementPrivateLinkOperations operations, string resourceGroupName, string rmplName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, rmplName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Get all the resource management private links in a subscription. - /// - /// - /// The operations group for this extension method. - /// - public static ResourceManagementPrivateLinkListResult List(this IResourceManagementPrivateLinkOperations operations) - { - return operations.ListAsync().GetAwaiter().GetResult(); - } - - /// - /// Get all the resource management private links in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The cancellation token. - /// - public static async Task ListAsync(this IResourceManagementPrivateLinkOperations operations, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Get all the resource management private links in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - public static ResourceManagementPrivateLinkListResult ListByResourceGroup(this IResourceManagementPrivateLinkOperations operations, string resourceGroupName) - { - return operations.ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); - } - - /// - /// Get all the resource management private links in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The cancellation token. - /// - public static async Task ListByResourceGroupAsync(this IResourceManagementPrivateLinkOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - } -} diff --git a/src/Resources/Resources.Sdk/Generated/ResourcesOperationsExtensions.cs b/src/Resources/Resources.Sdk/Generated/ResourcesOperationsExtensions.cs deleted file mode 100644 index a63fddffbce6..000000000000 --- a/src/Resources/Resources.Sdk/Generated/ResourcesOperationsExtensions.cs +++ /dev/null @@ -1,1314 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Resources -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Microsoft.Rest.Azure.OData; - using Models; - using System.Threading; - using System.Threading.Tasks; - - /// - /// Extension methods for ResourcesOperations. - /// - public static partial class ResourcesOperationsExtensions - { - /// - /// Get all the resources for a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group with the resources to get. - /// - /// - /// OData parameters to apply to the operation. - /// - public static IPage ListByResourceGroup(this IResourcesOperations operations, string resourceGroupName, ODataQuery odataQuery = default(ODataQuery)) - { - return operations.ListByResourceGroupAsync(resourceGroupName, odataQuery).GetAwaiter().GetResult(); - } - - /// - /// Get all the resources for a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group with the resources to get. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByResourceGroupAsync(this IResourcesOperations operations, string resourceGroupName, ODataQuery odataQuery = default(ODataQuery), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, odataQuery, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Moves resources from one resource group to another resource group. - /// - /// - /// The resources to be moved must be in the same source resource group in the - /// source subscription being used. The target resource group may be in a - /// different subscription. When moving resources, both the source group and - /// the target group are locked for the duration of the operation. Write and - /// delete operations are blocked on the groups until the move completes. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group from the source subscription containing the - /// resources to be moved. - /// - /// - /// Parameters for moving resources. - /// - public static void MoveResources(this IResourcesOperations operations, string sourceResourceGroupName, ResourcesMoveInfo parameters) - { - operations.MoveResourcesAsync(sourceResourceGroupName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Moves resources from one resource group to another resource group. - /// - /// - /// The resources to be moved must be in the same source resource group in the - /// source subscription being used. The target resource group may be in a - /// different subscription. When moving resources, both the source group and - /// the target group are locked for the duration of the operation. Write and - /// delete operations are blocked on the groups until the move completes. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group from the source subscription containing the - /// resources to be moved. - /// - /// - /// Parameters for moving resources. - /// - /// - /// The cancellation token. - /// - public static async Task MoveResourcesAsync(this IResourcesOperations operations, string sourceResourceGroupName, ResourcesMoveInfo parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.MoveResourcesWithHttpMessagesAsync(sourceResourceGroupName, parameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Validates whether resources can be moved from one resource group to another - /// resource group. - /// - /// - /// This operation checks whether the specified resources can be moved to the - /// target. The resources to be moved must be in the same source resource group - /// in the source subscription being used. The target resource group may be in - /// a different subscription. If validation succeeds, it returns HTTP response - /// code 204 (no content). If validation fails, it returns HTTP response code - /// 409 (Conflict) with an error message. Retrieve the URL in the Location - /// header value to check the result of the long-running operation. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group from the source subscription containing the - /// resources to be validated for move. - /// - /// - /// Parameters for moving resources. - /// - public static void ValidateMoveResources(this IResourcesOperations operations, string sourceResourceGroupName, ResourcesMoveInfo parameters) - { - operations.ValidateMoveResourcesAsync(sourceResourceGroupName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Validates whether resources can be moved from one resource group to another - /// resource group. - /// - /// - /// This operation checks whether the specified resources can be moved to the - /// target. The resources to be moved must be in the same source resource group - /// in the source subscription being used. The target resource group may be in - /// a different subscription. If validation succeeds, it returns HTTP response - /// code 204 (no content). If validation fails, it returns HTTP response code - /// 409 (Conflict) with an error message. Retrieve the URL in the Location - /// header value to check the result of the long-running operation. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group from the source subscription containing the - /// resources to be validated for move. - /// - /// - /// Parameters for moving resources. - /// - /// - /// The cancellation token. - /// - public static async Task ValidateMoveResourcesAsync(this IResourcesOperations operations, string sourceResourceGroupName, ResourcesMoveInfo parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.ValidateMoveResourcesWithHttpMessagesAsync(sourceResourceGroupName, parameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Get all the resources in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// OData parameters to apply to the operation. - /// - public static IPage List(this IResourcesOperations operations, ODataQuery odataQuery = default(ODataQuery)) - { - return operations.ListAsync(odataQuery).GetAwaiter().GetResult(); - } - - /// - /// Get all the resources in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IResourcesOperations operations, ODataQuery odataQuery = default(ODataQuery), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(odataQuery, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Checks whether a resource exists. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group containing the resource to check. The name - /// is case insensitive. - /// - /// - /// The resource provider of the resource to check. - /// - /// - /// The parent resource identity. - /// - /// - /// The resource type. - /// - /// - /// The name of the resource to check whether it exists. - /// - /// - /// The API version to use for the operation. - /// - public static bool CheckExistence(this IResourcesOperations operations, string resourceGroupName, string resourceProviderNamespace, string parentResourcePath, string resourceType, string resourceName, string apiVersion) - { - return operations.CheckExistenceAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion).GetAwaiter().GetResult(); - } - - /// - /// Checks whether a resource exists. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group containing the resource to check. The name - /// is case insensitive. - /// - /// - /// The resource provider of the resource to check. - /// - /// - /// The parent resource identity. - /// - /// - /// The resource type. - /// - /// - /// The name of the resource to check whether it exists. - /// - /// - /// The API version to use for the operation. - /// - /// - /// The cancellation token. - /// - public static async Task CheckExistenceAsync(this IResourcesOperations operations, string resourceGroupName, string resourceProviderNamespace, string parentResourcePath, string resourceType, string resourceName, string apiVersion, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CheckExistenceWithHttpMessagesAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes a resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group that contains the resource to delete. The - /// name is case insensitive. - /// - /// - /// The namespace of the resource provider. - /// - /// - /// The parent resource identity. - /// - /// - /// The resource type. - /// - /// - /// The name of the resource to delete. - /// - /// - /// The API version to use for the operation. - /// - public static void Delete(this IResourcesOperations operations, string resourceGroupName, string resourceProviderNamespace, string parentResourcePath, string resourceType, string resourceName, string apiVersion) - { - operations.DeleteAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion).GetAwaiter().GetResult(); - } - - /// - /// Deletes a resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group that contains the resource to delete. The - /// name is case insensitive. - /// - /// - /// The namespace of the resource provider. - /// - /// - /// The parent resource identity. - /// - /// - /// The resource type. - /// - /// - /// The name of the resource to delete. - /// - /// - /// The API version to use for the operation. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IResourcesOperations operations, string resourceGroupName, string resourceProviderNamespace, string parentResourcePath, string resourceType, string resourceName, string apiVersion, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Creates a resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group for the resource. The name is case - /// insensitive. - /// - /// - /// The namespace of the resource provider. - /// - /// - /// The parent resource identity. - /// - /// - /// The resource type of the resource to create. - /// - /// - /// The name of the resource to create. - /// - /// - /// The API version to use for the operation. - /// - /// - /// Parameters for creating or updating the resource. - /// - public static GenericResource CreateOrUpdate(this IResourcesOperations operations, string resourceGroupName, string resourceProviderNamespace, string parentResourcePath, string resourceType, string resourceName, string apiVersion, GenericResource parameters) - { - return operations.CreateOrUpdateAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion, parameters).GetAwaiter().GetResult(); - } - - /// - /// Creates a resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group for the resource. The name is case - /// insensitive. - /// - /// - /// The namespace of the resource provider. - /// - /// - /// The parent resource identity. - /// - /// - /// The resource type of the resource to create. - /// - /// - /// The name of the resource to create. - /// - /// - /// The API version to use for the operation. - /// - /// - /// Parameters for creating or updating the resource. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IResourcesOperations operations, string resourceGroupName, string resourceProviderNamespace, string parentResourcePath, string resourceType, string resourceName, string apiVersion, GenericResource parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Updates a resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group for the resource. The name is case - /// insensitive. - /// - /// - /// The namespace of the resource provider. - /// - /// - /// The parent resource identity. - /// - /// - /// The resource type of the resource to update. - /// - /// - /// The name of the resource to update. - /// - /// - /// The API version to use for the operation. - /// - /// - /// Parameters for updating the resource. - /// - public static GenericResource Update(this IResourcesOperations operations, string resourceGroupName, string resourceProviderNamespace, string parentResourcePath, string resourceType, string resourceName, string apiVersion, GenericResource parameters) - { - return operations.UpdateAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion, parameters).GetAwaiter().GetResult(); - } - - /// - /// Updates a resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group for the resource. The name is case - /// insensitive. - /// - /// - /// The namespace of the resource provider. - /// - /// - /// The parent resource identity. - /// - /// - /// The resource type of the resource to update. - /// - /// - /// The name of the resource to update. - /// - /// - /// The API version to use for the operation. - /// - /// - /// Parameters for updating the resource. - /// - /// - /// The cancellation token. - /// - public static async Task UpdateAsync(this IResourcesOperations operations, string resourceGroupName, string resourceProviderNamespace, string parentResourcePath, string resourceType, string resourceName, string apiVersion, GenericResource parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets a resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group containing the resource to get. The name is - /// case insensitive. - /// - /// - /// The namespace of the resource provider. - /// - /// - /// The parent resource identity. - /// - /// - /// The resource type of the resource. - /// - /// - /// The name of the resource to get. - /// - /// - /// The API version to use for the operation. - /// - public static GenericResource Get(this IResourcesOperations operations, string resourceGroupName, string resourceProviderNamespace, string parentResourcePath, string resourceType, string resourceName, string apiVersion) - { - return operations.GetAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion).GetAwaiter().GetResult(); - } - - /// - /// Gets a resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group containing the resource to get. The name is - /// case insensitive. - /// - /// - /// The namespace of the resource provider. - /// - /// - /// The parent resource identity. - /// - /// - /// The resource type of the resource. - /// - /// - /// The name of the resource to get. - /// - /// - /// The API version to use for the operation. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IResourcesOperations operations, string resourceGroupName, string resourceProviderNamespace, string parentResourcePath, string resourceType, string resourceName, string apiVersion, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Checks by ID whether a resource exists. This API currently works only for a - /// limited set of Resource providers. In the event that a Resource provider - /// does not implement this API, ARM will respond with a 405. The alternative - /// then is to use the GET API to check for the existence of the resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The fully qualified ID of the resource, including the resource name and - /// resource type. Use the format, - /// /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} - /// - /// - /// The API version to use for the operation. - /// - public static bool CheckExistenceById(this IResourcesOperations operations, string resourceId, string apiVersion) - { - return operations.CheckExistenceByIdAsync(resourceId, apiVersion).GetAwaiter().GetResult(); - } - - /// - /// Checks by ID whether a resource exists. This API currently works only for a - /// limited set of Resource providers. In the event that a Resource provider - /// does not implement this API, ARM will respond with a 405. The alternative - /// then is to use the GET API to check for the existence of the resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The fully qualified ID of the resource, including the resource name and - /// resource type. Use the format, - /// /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} - /// - /// - /// The API version to use for the operation. - /// - /// - /// The cancellation token. - /// - public static async Task CheckExistenceByIdAsync(this IResourcesOperations operations, string resourceId, string apiVersion, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CheckExistenceByIdWithHttpMessagesAsync(resourceId, apiVersion, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes a resource by ID. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The fully qualified ID of the resource, including the resource name and - /// resource type. Use the format, - /// /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} - /// - /// - /// The API version to use for the operation. - /// - public static void DeleteById(this IResourcesOperations operations, string resourceId, string apiVersion) - { - operations.DeleteByIdAsync(resourceId, apiVersion).GetAwaiter().GetResult(); - } - - /// - /// Deletes a resource by ID. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The fully qualified ID of the resource, including the resource name and - /// resource type. Use the format, - /// /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} - /// - /// - /// The API version to use for the operation. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteByIdAsync(this IResourcesOperations operations, string resourceId, string apiVersion, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteByIdWithHttpMessagesAsync(resourceId, apiVersion, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Create a resource by ID. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The fully qualified ID of the resource, including the resource name and - /// resource type. Use the format, - /// /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} - /// - /// - /// The API version to use for the operation. - /// - /// - /// Create or update resource parameters. - /// - public static GenericResource CreateOrUpdateById(this IResourcesOperations operations, string resourceId, string apiVersion, GenericResource parameters) - { - return operations.CreateOrUpdateByIdAsync(resourceId, apiVersion, parameters).GetAwaiter().GetResult(); - } - - /// - /// Create a resource by ID. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The fully qualified ID of the resource, including the resource name and - /// resource type. Use the format, - /// /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} - /// - /// - /// The API version to use for the operation. - /// - /// - /// Create or update resource parameters. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateByIdAsync(this IResourcesOperations operations, string resourceId, string apiVersion, GenericResource parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateByIdWithHttpMessagesAsync(resourceId, apiVersion, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Updates a resource by ID. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The fully qualified ID of the resource, including the resource name and - /// resource type. Use the format, - /// /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} - /// - /// - /// The API version to use for the operation. - /// - /// - /// Update resource parameters. - /// - public static GenericResource UpdateById(this IResourcesOperations operations, string resourceId, string apiVersion, GenericResource parameters) - { - return operations.UpdateByIdAsync(resourceId, apiVersion, parameters).GetAwaiter().GetResult(); - } - - /// - /// Updates a resource by ID. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The fully qualified ID of the resource, including the resource name and - /// resource type. Use the format, - /// /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} - /// - /// - /// The API version to use for the operation. - /// - /// - /// Update resource parameters. - /// - /// - /// The cancellation token. - /// - public static async Task UpdateByIdAsync(this IResourcesOperations operations, string resourceId, string apiVersion, GenericResource parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.UpdateByIdWithHttpMessagesAsync(resourceId, apiVersion, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets a resource by ID. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The fully qualified ID of the resource, including the resource name and - /// resource type. Use the format, - /// /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} - /// - /// - /// The API version to use for the operation. - /// - public static GenericResource GetById(this IResourcesOperations operations, string resourceId, string apiVersion) - { - return operations.GetByIdAsync(resourceId, apiVersion).GetAwaiter().GetResult(); - } - - /// - /// Gets a resource by ID. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The fully qualified ID of the resource, including the resource name and - /// resource type. Use the format, - /// /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} - /// - /// - /// The API version to use for the operation. - /// - /// - /// The cancellation token. - /// - public static async Task GetByIdAsync(this IResourcesOperations operations, string resourceId, string apiVersion, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetByIdWithHttpMessagesAsync(resourceId, apiVersion, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Moves resources from one resource group to another resource group. - /// - /// - /// The resources to be moved must be in the same source resource group in the - /// source subscription being used. The target resource group may be in a - /// different subscription. When moving resources, both the source group and - /// the target group are locked for the duration of the operation. Write and - /// delete operations are blocked on the groups until the move completes. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group from the source subscription containing the - /// resources to be moved. - /// - /// - /// Parameters for moving resources. - /// - public static void BeginMoveResources(this IResourcesOperations operations, string sourceResourceGroupName, ResourcesMoveInfo parameters) - { - operations.BeginMoveResourcesAsync(sourceResourceGroupName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Moves resources from one resource group to another resource group. - /// - /// - /// The resources to be moved must be in the same source resource group in the - /// source subscription being used. The target resource group may be in a - /// different subscription. When moving resources, both the source group and - /// the target group are locked for the duration of the operation. Write and - /// delete operations are blocked on the groups until the move completes. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group from the source subscription containing the - /// resources to be moved. - /// - /// - /// Parameters for moving resources. - /// - /// - /// The cancellation token. - /// - public static async Task BeginMoveResourcesAsync(this IResourcesOperations operations, string sourceResourceGroupName, ResourcesMoveInfo parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginMoveResourcesWithHttpMessagesAsync(sourceResourceGroupName, parameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Validates whether resources can be moved from one resource group to another - /// resource group. - /// - /// - /// This operation checks whether the specified resources can be moved to the - /// target. The resources to be moved must be in the same source resource group - /// in the source subscription being used. The target resource group may be in - /// a different subscription. If validation succeeds, it returns HTTP response - /// code 204 (no content). If validation fails, it returns HTTP response code - /// 409 (Conflict) with an error message. Retrieve the URL in the Location - /// header value to check the result of the long-running operation. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group from the source subscription containing the - /// resources to be validated for move. - /// - /// - /// Parameters for moving resources. - /// - public static void BeginValidateMoveResources(this IResourcesOperations operations, string sourceResourceGroupName, ResourcesMoveInfo parameters) - { - operations.BeginValidateMoveResourcesAsync(sourceResourceGroupName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Validates whether resources can be moved from one resource group to another - /// resource group. - /// - /// - /// This operation checks whether the specified resources can be moved to the - /// target. The resources to be moved must be in the same source resource group - /// in the source subscription being used. The target resource group may be in - /// a different subscription. If validation succeeds, it returns HTTP response - /// code 204 (no content). If validation fails, it returns HTTP response code - /// 409 (Conflict) with an error message. Retrieve the URL in the Location - /// header value to check the result of the long-running operation. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group from the source subscription containing the - /// resources to be validated for move. - /// - /// - /// Parameters for moving resources. - /// - /// - /// The cancellation token. - /// - public static async Task BeginValidateMoveResourcesAsync(this IResourcesOperations operations, string sourceResourceGroupName, ResourcesMoveInfo parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginValidateMoveResourcesWithHttpMessagesAsync(sourceResourceGroupName, parameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Deletes a resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group that contains the resource to delete. The - /// name is case insensitive. - /// - /// - /// The namespace of the resource provider. - /// - /// - /// The parent resource identity. - /// - /// - /// The resource type. - /// - /// - /// The name of the resource to delete. - /// - /// - /// The API version to use for the operation. - /// - public static void BeginDelete(this IResourcesOperations operations, string resourceGroupName, string resourceProviderNamespace, string parentResourcePath, string resourceType, string resourceName, string apiVersion) - { - operations.BeginDeleteAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion).GetAwaiter().GetResult(); - } - - /// - /// Deletes a resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group that contains the resource to delete. The - /// name is case insensitive. - /// - /// - /// The namespace of the resource provider. - /// - /// - /// The parent resource identity. - /// - /// - /// The resource type. - /// - /// - /// The name of the resource to delete. - /// - /// - /// The API version to use for the operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IResourcesOperations operations, string resourceGroupName, string resourceProviderNamespace, string parentResourcePath, string resourceType, string resourceName, string apiVersion, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Creates a resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group for the resource. The name is case - /// insensitive. - /// - /// - /// The namespace of the resource provider. - /// - /// - /// The parent resource identity. - /// - /// - /// The resource type of the resource to create. - /// - /// - /// The name of the resource to create. - /// - /// - /// The API version to use for the operation. - /// - /// - /// Parameters for creating or updating the resource. - /// - public static GenericResource BeginCreateOrUpdate(this IResourcesOperations operations, string resourceGroupName, string resourceProviderNamespace, string parentResourcePath, string resourceType, string resourceName, string apiVersion, GenericResource parameters) - { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion, parameters).GetAwaiter().GetResult(); - } - - /// - /// Creates a resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group for the resource. The name is case - /// insensitive. - /// - /// - /// The namespace of the resource provider. - /// - /// - /// The parent resource identity. - /// - /// - /// The resource type of the resource to create. - /// - /// - /// The name of the resource to create. - /// - /// - /// The API version to use for the operation. - /// - /// - /// Parameters for creating or updating the resource. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this IResourcesOperations operations, string resourceGroupName, string resourceProviderNamespace, string parentResourcePath, string resourceType, string resourceName, string apiVersion, GenericResource parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Updates a resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group for the resource. The name is case - /// insensitive. - /// - /// - /// The namespace of the resource provider. - /// - /// - /// The parent resource identity. - /// - /// - /// The resource type of the resource to update. - /// - /// - /// The name of the resource to update. - /// - /// - /// The API version to use for the operation. - /// - /// - /// Parameters for updating the resource. - /// - public static GenericResource BeginUpdate(this IResourcesOperations operations, string resourceGroupName, string resourceProviderNamespace, string parentResourcePath, string resourceType, string resourceName, string apiVersion, GenericResource parameters) - { - return operations.BeginUpdateAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion, parameters).GetAwaiter().GetResult(); - } - - /// - /// Updates a resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group for the resource. The name is case - /// insensitive. - /// - /// - /// The namespace of the resource provider. - /// - /// - /// The parent resource identity. - /// - /// - /// The resource type of the resource to update. - /// - /// - /// The name of the resource to update. - /// - /// - /// The API version to use for the operation. - /// - /// - /// Parameters for updating the resource. - /// - /// - /// The cancellation token. - /// - public static async Task BeginUpdateAsync(this IResourcesOperations operations, string resourceGroupName, string resourceProviderNamespace, string parentResourcePath, string resourceType, string resourceName, string apiVersion, GenericResource parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes a resource by ID. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The fully qualified ID of the resource, including the resource name and - /// resource type. Use the format, - /// /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} - /// - /// - /// The API version to use for the operation. - /// - public static void BeginDeleteById(this IResourcesOperations operations, string resourceId, string apiVersion) - { - operations.BeginDeleteByIdAsync(resourceId, apiVersion).GetAwaiter().GetResult(); - } - - /// - /// Deletes a resource by ID. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The fully qualified ID of the resource, including the resource name and - /// resource type. Use the format, - /// /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} - /// - /// - /// The API version to use for the operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteByIdAsync(this IResourcesOperations operations, string resourceId, string apiVersion, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDeleteByIdWithHttpMessagesAsync(resourceId, apiVersion, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Create a resource by ID. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The fully qualified ID of the resource, including the resource name and - /// resource type. Use the format, - /// /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} - /// - /// - /// The API version to use for the operation. - /// - /// - /// Create or update resource parameters. - /// - public static GenericResource BeginCreateOrUpdateById(this IResourcesOperations operations, string resourceId, string apiVersion, GenericResource parameters) - { - return operations.BeginCreateOrUpdateByIdAsync(resourceId, apiVersion, parameters).GetAwaiter().GetResult(); - } - - /// - /// Create a resource by ID. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The fully qualified ID of the resource, including the resource name and - /// resource type. Use the format, - /// /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} - /// - /// - /// The API version to use for the operation. - /// - /// - /// Create or update resource parameters. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateByIdAsync(this IResourcesOperations operations, string resourceId, string apiVersion, GenericResource parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginCreateOrUpdateByIdWithHttpMessagesAsync(resourceId, apiVersion, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Updates a resource by ID. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The fully qualified ID of the resource, including the resource name and - /// resource type. Use the format, - /// /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} - /// - /// - /// The API version to use for the operation. - /// - /// - /// Update resource parameters. - /// - public static GenericResource BeginUpdateById(this IResourcesOperations operations, string resourceId, string apiVersion, GenericResource parameters) - { - return operations.BeginUpdateByIdAsync(resourceId, apiVersion, parameters).GetAwaiter().GetResult(); - } - - /// - /// Updates a resource by ID. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The fully qualified ID of the resource, including the resource name and - /// resource type. Use the format, - /// /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} - /// - /// - /// The API version to use for the operation. - /// - /// - /// Update resource parameters. - /// - /// - /// The cancellation token. - /// - public static async Task BeginUpdateByIdAsync(this IResourcesOperations operations, string resourceId, string apiVersion, GenericResource parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginUpdateByIdWithHttpMessagesAsync(resourceId, apiVersion, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Get all the resources for a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListByResourceGroupNext(this IResourcesOperations operations, string nextPageLink) - { - return operations.ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Get all the resources for a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByResourceGroupNextAsync(this IResourcesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Get all the resources in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IResourcesOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Get all the resources in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this IResourcesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - } -} diff --git a/src/Resources/Resources.Sdk/Generated/SdkInfo_DeploymentScriptsClient.cs b/src/Resources/Resources.Sdk/Generated/SdkInfo_DeploymentScriptsClient.cs deleted file mode 100644 index 45317cac72c7..000000000000 --- a/src/Resources/Resources.Sdk/Generated/SdkInfo_DeploymentScriptsClient.cs +++ /dev/null @@ -1,27 +0,0 @@ - -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Resources -{ - using System; - using System.Collections.Generic; - using System.Linq; - - internal static partial class SdkInfo - { - public static IEnumerable> ApiInfo_DeploymentScriptsClient - { - get - { - return new Tuple[] - { - new Tuple("Resources", "DeploymentScripts", "2020-10-01"), - }.AsEnumerable(); - } - } - } -} diff --git a/src/Resources/Resources.Sdk/Generated/SdkInfo_DeploymentStacksClient.cs b/src/Resources/Resources.Sdk/Generated/SdkInfo_DeploymentStacksClient.cs deleted file mode 100644 index 3ae1c2d32600..000000000000 --- a/src/Resources/Resources.Sdk/Generated/SdkInfo_DeploymentStacksClient.cs +++ /dev/null @@ -1,28 +0,0 @@ - -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Resources -{ - using System; - using System.Collections.Generic; - using System.Linq; - - internal static partial class SdkInfo - { - public static IEnumerable> ApiInfo_DeploymentStacksClient - { - get - { - return new Tuple[] - { - new Tuple("Management", "DeploymentStacks", "2022-08-01-preview"), - new Tuple("Resources", "DeploymentStacks", "2022-08-01-preview"), - }.AsEnumerable(); - } - } - } -} diff --git a/src/Resources/Resources.Sdk/Generated/SdkInfo_FeatureClient.cs b/src/Resources/Resources.Sdk/Generated/SdkInfo_FeatureClient.cs deleted file mode 100644 index 2ee2062124de..000000000000 --- a/src/Resources/Resources.Sdk/Generated/SdkInfo_FeatureClient.cs +++ /dev/null @@ -1,29 +0,0 @@ - -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Resources -{ - using System; - using System.Collections.Generic; - using System.Linq; - - internal static partial class SdkInfo - { - public static IEnumerable> ApiInfo_FeatureClient - { - get - { - return new Tuple[] - { - new Tuple("Features", "Features", "2021-07-01"), - new Tuple("Features", "ListOperations", "2021-07-01"), - new Tuple("Features", "SubscriptionFeatureRegistrations", "2021-07-01"), - }.AsEnumerable(); - } - } - } -} diff --git a/src/Resources/Resources.Sdk/Generated/SdkInfo_ResourceManagementClient.cs b/src/Resources/Resources.Sdk/Generated/SdkInfo_ResourceManagementClient.cs deleted file mode 100644 index 98cc75263051..000000000000 --- a/src/Resources/Resources.Sdk/Generated/SdkInfo_ResourceManagementClient.cs +++ /dev/null @@ -1,39 +0,0 @@ - -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Resources -{ - using System; - using System.Collections.Generic; - using System.Linq; - - internal static partial class SdkInfo - { - public static IEnumerable> ApiInfo_ResourceManagementClient - { - get - { - return new Tuple[] - { - new Tuple("Management", "DeploymentOperations", "2021-04-01"), - new Tuple("Management", "Deployments", "2021-04-01"), - new Tuple("Management", "Providers", "2021-04-01"), - new Tuple("ResourceManagementClient", "DeploymentOperations", "2021-04-01"), - new Tuple("ResourceManagementClient", "ProviderResourceTypes", "2021-04-01"), - new Tuple("ResourceManagementClient", "Providers", "2021-04-01"), - new Tuple("ResourceManagementClient", "ResourceGroups", "2021-04-01"), - new Tuple("ResourceManagementClient", "Resources", "2021-04-01"), - new Tuple("ResourceManagementClient", "Tags", "2021-04-01"), - new Tuple("Resources", "DeploymentOperations", "2021-04-01"), - new Tuple("Resources", "Deployments", "2021-04-01"), - new Tuple("Resources", "Operations", "2021-04-01"), - new Tuple("Resources", "Tags", "2021-04-01"), - }.AsEnumerable(); - } - } - } -} diff --git a/src/Resources/Resources.Sdk/Generated/SdkInfo_ResourcePrivateLinkClient.cs b/src/Resources/Resources.Sdk/Generated/SdkInfo_ResourcePrivateLinkClient.cs deleted file mode 100644 index 366cb80af515..000000000000 --- a/src/Resources/Resources.Sdk/Generated/SdkInfo_ResourcePrivateLinkClient.cs +++ /dev/null @@ -1,28 +0,0 @@ - -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Resources -{ - using System; - using System.Collections.Generic; - using System.Linq; - - internal static partial class SdkInfo - { - public static IEnumerable> ApiInfo_ResourcePrivateLinkClient - { - get - { - return new Tuple[] - { - new Tuple("Authorization", "ResourceManagementPrivateLink", "2020-05-01"), - new Tuple("Management", "PrivateLinkAssociation", "2020-05-01"), - }.AsEnumerable(); - } - } - } -} diff --git a/src/Resources/Resources.Sdk/Generated/SdkInfo_SubscriptionClient.cs b/src/Resources/Resources.Sdk/Generated/SdkInfo_SubscriptionClient.cs deleted file mode 100644 index 1c2d5f376b40..000000000000 --- a/src/Resources/Resources.Sdk/Generated/SdkInfo_SubscriptionClient.cs +++ /dev/null @@ -1,30 +0,0 @@ - -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Resources -{ - using System; - using System.Collections.Generic; - using System.Linq; - - internal static partial class SdkInfo - { - public static IEnumerable> ApiInfo_SubscriptionClient - { - get - { - return new Tuple[] - { - new Tuple("Resources", "Subscriptions", "2021-01-01"), - new Tuple("Resources", "checkResourceName", "2021-01-01"), - new Tuple("SubscriptionClient", "Subscriptions", "2021-01-01"), - new Tuple("SubscriptionClient", "Tenants", "2021-01-01"), - }.AsEnumerable(); - } - } - } -} diff --git a/src/Resources/Resources.Sdk/Generated/SdkInfo_TemplateSpecsClient.cs b/src/Resources/Resources.Sdk/Generated/SdkInfo_TemplateSpecsClient.cs deleted file mode 100644 index 0eb0af5b94c0..000000000000 --- a/src/Resources/Resources.Sdk/Generated/SdkInfo_TemplateSpecsClient.cs +++ /dev/null @@ -1,28 +0,0 @@ - -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Resources -{ - using System; - using System.Collections.Generic; - using System.Linq; - - internal static partial class SdkInfo - { - public static IEnumerable> ApiInfo_TemplateSpecsClient - { - get - { - return new Tuple[] - { - new Tuple("Resources", "TemplateSpecVersions", "2021-05-01"), - new Tuple("Resources", "TemplateSpecs", "2021-05-01"), - }.AsEnumerable(); - } - } - } -} diff --git a/src/Resources/Resources.Sdk/Generated/SubscriptionClientExtensions.cs b/src/Resources/Resources.Sdk/Generated/SubscriptionClientExtensions.cs deleted file mode 100644 index 27db02a39d15..000000000000 --- a/src/Resources/Resources.Sdk/Generated/SubscriptionClientExtensions.cs +++ /dev/null @@ -1,67 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Resources -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Threading; - using System.Threading.Tasks; - - /// - /// Extension methods for SubscriptionClient. - /// - public static partial class SubscriptionClientExtensions - { - /// - /// Checks resource name validity - /// - /// - /// A resource name is valid if it is not a reserved word, does not contains a - /// reserved word and does not start with a reserved word - /// - /// - /// The operations group for this extension method. - /// - /// - /// Resource object with values for resource name and resource type - /// - public static CheckResourceNameResult CheckResourceName(this ISubscriptionClient operations, ResourceName resourceNameDefinition = default(ResourceName)) - { - return operations.CheckResourceNameAsync(resourceNameDefinition).GetAwaiter().GetResult(); - } - - /// - /// Checks resource name validity - /// - /// - /// A resource name is valid if it is not a reserved word, does not contains a - /// reserved word and does not start with a reserved word - /// - /// - /// The operations group for this extension method. - /// - /// - /// Resource object with values for resource name and resource type - /// - /// - /// The cancellation token. - /// - public static async Task CheckResourceNameAsync(this ISubscriptionClient operations, ResourceName resourceNameDefinition = default(ResourceName), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CheckResourceNameWithHttpMessagesAsync(resourceNameDefinition, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - } -} diff --git a/src/Resources/Resources.Sdk/Generated/SubscriptionFeatureRegistrationsOperationsExtensions.cs b/src/Resources/Resources.Sdk/Generated/SubscriptionFeatureRegistrationsOperationsExtensions.cs deleted file mode 100644 index 97b3779b3a9b..000000000000 --- a/src/Resources/Resources.Sdk/Generated/SubscriptionFeatureRegistrationsOperationsExtensions.cs +++ /dev/null @@ -1,282 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Resources -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Threading; - using System.Threading.Tasks; - - /// - /// Extension methods for SubscriptionFeatureRegistrationsOperations. - /// - public static partial class SubscriptionFeatureRegistrationsOperationsExtensions - { - /// - /// Returns a feature registration - /// - /// - /// The operations group for this extension method. - /// - /// - /// The provider namespace. - /// - /// - /// The feature name. - /// - public static SubscriptionFeatureRegistration Get(this ISubscriptionFeatureRegistrationsOperations operations, string providerNamespace, string featureName) - { - return operations.GetAsync(providerNamespace, featureName).GetAwaiter().GetResult(); - } - - /// - /// Returns a feature registration - /// - /// - /// The operations group for this extension method. - /// - /// - /// The provider namespace. - /// - /// - /// The feature name. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this ISubscriptionFeatureRegistrationsOperations operations, string providerNamespace, string featureName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(providerNamespace, featureName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Create or update a feature registration. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The provider namespace. - /// - /// - /// The feature name. - /// - /// - /// Subscription Feature Registration Type details. - /// - public static SubscriptionFeatureRegistration CreateOrUpdate(this ISubscriptionFeatureRegistrationsOperations operations, string providerNamespace, string featureName, SubscriptionFeatureRegistration subscriptionFeatureRegistrationType = default(SubscriptionFeatureRegistration)) - { - return operations.CreateOrUpdateAsync(providerNamespace, featureName, subscriptionFeatureRegistrationType).GetAwaiter().GetResult(); - } - - /// - /// Create or update a feature registration. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The provider namespace. - /// - /// - /// The feature name. - /// - /// - /// Subscription Feature Registration Type details. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this ISubscriptionFeatureRegistrationsOperations operations, string providerNamespace, string featureName, SubscriptionFeatureRegistration subscriptionFeatureRegistrationType = default(SubscriptionFeatureRegistration), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(providerNamespace, featureName, subscriptionFeatureRegistrationType, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes a feature registration - /// - /// - /// The operations group for this extension method. - /// - /// - /// The provider namespace. - /// - /// - /// The feature name. - /// - public static void Delete(this ISubscriptionFeatureRegistrationsOperations operations, string providerNamespace, string featureName) - { - operations.DeleteAsync(providerNamespace, featureName).GetAwaiter().GetResult(); - } - - /// - /// Deletes a feature registration - /// - /// - /// The operations group for this extension method. - /// - /// - /// The provider namespace. - /// - /// - /// The feature name. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this ISubscriptionFeatureRegistrationsOperations operations, string providerNamespace, string featureName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(providerNamespace, featureName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Returns subscription feature registrations for given subscription and - /// provider namespace. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The provider namespace. - /// - public static IPage ListBySubscription(this ISubscriptionFeatureRegistrationsOperations operations, string providerNamespace) - { - return operations.ListBySubscriptionAsync(providerNamespace).GetAwaiter().GetResult(); - } - - /// - /// Returns subscription feature registrations for given subscription and - /// provider namespace. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The provider namespace. - /// - /// - /// The cancellation token. - /// - public static async Task> ListBySubscriptionAsync(this ISubscriptionFeatureRegistrationsOperations operations, string providerNamespace, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListBySubscriptionWithHttpMessagesAsync(providerNamespace, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Returns subscription feature registrations for given subscription. - /// - /// - /// The operations group for this extension method. - /// - public static IPage ListAllBySubscription(this ISubscriptionFeatureRegistrationsOperations operations) - { - return operations.ListAllBySubscriptionAsync().GetAwaiter().GetResult(); - } - - /// - /// Returns subscription feature registrations for given subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAllBySubscriptionAsync(this ISubscriptionFeatureRegistrationsOperations operations, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListAllBySubscriptionWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Returns subscription feature registrations for given subscription and - /// provider namespace. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListBySubscriptionNext(this ISubscriptionFeatureRegistrationsOperations operations, string nextPageLink) - { - return operations.ListBySubscriptionNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Returns subscription feature registrations for given subscription and - /// provider namespace. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListBySubscriptionNextAsync(this ISubscriptionFeatureRegistrationsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListBySubscriptionNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Returns subscription feature registrations for given subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListAllBySubscriptionNext(this ISubscriptionFeatureRegistrationsOperations operations, string nextPageLink) - { - return operations.ListAllBySubscriptionNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Returns subscription feature registrations for given subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAllBySubscriptionNextAsync(this ISubscriptionFeatureRegistrationsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListAllBySubscriptionNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - } -} diff --git a/src/Resources/Resources.Sdk/Generated/SubscriptionsOperationsExtensions.cs b/src/Resources/Resources.Sdk/Generated/SubscriptionsOperationsExtensions.cs deleted file mode 100644 index 5dd4e0ea761e..000000000000 --- a/src/Resources/Resources.Sdk/Generated/SubscriptionsOperationsExtensions.cs +++ /dev/null @@ -1,213 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Resources -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; - - /// - /// Extension methods for SubscriptionsOperations. - /// - public static partial class SubscriptionsOperationsExtensions - { - /// - /// Gets all available geo-locations. - /// - /// - /// This operation provides all the locations that are available for resource - /// providers; however, each resource provider may support a subset of this - /// list. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The ID of the target subscription. - /// - /// - /// Whether to include extended locations. - /// - public static IEnumerable ListLocations(this ISubscriptionsOperations operations, string subscriptionId, bool? includeExtendedLocations = default(bool?)) - { - return operations.ListLocationsAsync(subscriptionId, includeExtendedLocations).GetAwaiter().GetResult(); - } - - /// - /// Gets all available geo-locations. - /// - /// - /// This operation provides all the locations that are available for resource - /// providers; however, each resource provider may support a subset of this - /// list. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The ID of the target subscription. - /// - /// - /// Whether to include extended locations. - /// - /// - /// The cancellation token. - /// - public static async Task> ListLocationsAsync(this ISubscriptionsOperations operations, string subscriptionId, bool? includeExtendedLocations = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListLocationsWithHttpMessagesAsync(subscriptionId, includeExtendedLocations, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets details about a specified subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The ID of the target subscription. - /// - public static Subscription Get(this ISubscriptionsOperations operations, string subscriptionId) - { - return operations.GetAsync(subscriptionId).GetAwaiter().GetResult(); - } - - /// - /// Gets details about a specified subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The ID of the target subscription. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this ISubscriptionsOperations operations, string subscriptionId, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(subscriptionId, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets all subscriptions for a tenant. - /// - /// - /// The operations group for this extension method. - /// - public static IPage List(this ISubscriptionsOperations operations) - { - return operations.ListAsync().GetAwaiter().GetResult(); - } - - /// - /// Gets all subscriptions for a tenant. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this ISubscriptionsOperations operations, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Compares a subscriptions logical zone mapping - /// - /// - /// The operations group for this extension method. - /// - /// - /// The ID of the target subscription. - /// - /// - /// Parameters for checking zone peers. - /// - public static CheckZonePeersResult CheckZonePeers(this ISubscriptionsOperations operations, string subscriptionId, CheckZonePeersRequest parameters) - { - return operations.CheckZonePeersAsync(subscriptionId, parameters).GetAwaiter().GetResult(); - } - - /// - /// Compares a subscriptions logical zone mapping - /// - /// - /// The operations group for this extension method. - /// - /// - /// The ID of the target subscription. - /// - /// - /// Parameters for checking zone peers. - /// - /// - /// The cancellation token. - /// - public static async Task CheckZonePeersAsync(this ISubscriptionsOperations operations, string subscriptionId, CheckZonePeersRequest parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CheckZonePeersWithHttpMessagesAsync(subscriptionId, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets all subscriptions for a tenant. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this ISubscriptionsOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets all subscriptions for a tenant. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this ISubscriptionsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - } -} diff --git a/src/Resources/Resources.Sdk/Generated/TagsOperationsExtensions.cs b/src/Resources/Resources.Sdk/Generated/TagsOperationsExtensions.cs deleted file mode 100644 index ef6fa37ad5d4..000000000000 --- a/src/Resources/Resources.Sdk/Generated/TagsOperationsExtensions.cs +++ /dev/null @@ -1,466 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Resources -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Threading; - using System.Threading.Tasks; - - /// - /// Extension methods for TagsOperations. - /// - public static partial class TagsOperationsExtensions - { - /// - /// Deletes a predefined tag value for a predefined tag name. - /// - /// - /// This operation allows deleting a value from the list of predefined values - /// for an existing predefined tag name. The value being deleted must not be in - /// use as a tag value for the given tag name for any resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the tag. - /// - /// - /// The value of the tag to delete. - /// - public static void DeleteValue(this ITagsOperations operations, string tagName, string tagValue) - { - operations.DeleteValueAsync(tagName, tagValue).GetAwaiter().GetResult(); - } - - /// - /// Deletes a predefined tag value for a predefined tag name. - /// - /// - /// This operation allows deleting a value from the list of predefined values - /// for an existing predefined tag name. The value being deleted must not be in - /// use as a tag value for the given tag name for any resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the tag. - /// - /// - /// The value of the tag to delete. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteValueAsync(this ITagsOperations operations, string tagName, string tagValue, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteValueWithHttpMessagesAsync(tagName, tagValue, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Creates a predefined value for a predefined tag name. - /// - /// - /// This operation allows adding a value to the list of predefined values for - /// an existing predefined tag name. A tag value can have a maximum of 256 - /// characters. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the tag. - /// - /// - /// The value of the tag to create. - /// - public static TagValue CreateOrUpdateValue(this ITagsOperations operations, string tagName, string tagValue) - { - return operations.CreateOrUpdateValueAsync(tagName, tagValue).GetAwaiter().GetResult(); - } - - /// - /// Creates a predefined value for a predefined tag name. - /// - /// - /// This operation allows adding a value to the list of predefined values for - /// an existing predefined tag name. A tag value can have a maximum of 256 - /// characters. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the tag. - /// - /// - /// The value of the tag to create. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateValueAsync(this ITagsOperations operations, string tagName, string tagValue, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateValueWithHttpMessagesAsync(tagName, tagValue, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Creates a predefined tag name. - /// - /// - /// This operation allows adding a name to the list of predefined tag names for - /// the given subscription. A tag name can have a maximum of 512 characters and - /// is case-insensitive. Tag names cannot have the following prefixes which are - /// reserved for Azure use: 'microsoft', 'azure', 'windows'. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the tag to create. - /// - public static TagDetails CreateOrUpdate(this ITagsOperations operations, string tagName) - { - return operations.CreateOrUpdateAsync(tagName).GetAwaiter().GetResult(); - } - - /// - /// Creates a predefined tag name. - /// - /// - /// This operation allows adding a name to the list of predefined tag names for - /// the given subscription. A tag name can have a maximum of 512 characters and - /// is case-insensitive. Tag names cannot have the following prefixes which are - /// reserved for Azure use: 'microsoft', 'azure', 'windows'. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the tag to create. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this ITagsOperations operations, string tagName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(tagName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes a predefined tag name. - /// - /// - /// This operation allows deleting a name from the list of predefined tag names - /// for the given subscription. The name being deleted must not be in use as a - /// tag name for any resource. All predefined values for the given name must - /// have already been deleted. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the tag. - /// - public static void Delete(this ITagsOperations operations, string tagName) - { - operations.DeleteAsync(tagName).GetAwaiter().GetResult(); - } - - /// - /// Deletes a predefined tag name. - /// - /// - /// This operation allows deleting a name from the list of predefined tag names - /// for the given subscription. The name being deleted must not be in use as a - /// tag name for any resource. All predefined values for the given name must - /// have already been deleted. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the tag. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this ITagsOperations operations, string tagName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(tagName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Gets a summary of tag usage under the subscription. - /// - /// - /// This operation performs a union of predefined tags, resource tags, resource - /// group tags and subscription tags, and returns a summary of usage for each - /// tag name and value under the given subscription. In case of a large number - /// of tags, this operation may return a previously cached result. - /// - /// - /// The operations group for this extension method. - /// - public static IPage List(this ITagsOperations operations) - { - return operations.ListAsync().GetAwaiter().GetResult(); - } - - /// - /// Gets a summary of tag usage under the subscription. - /// - /// - /// This operation performs a union of predefined tags, resource tags, resource - /// group tags and subscription tags, and returns a summary of usage for each - /// tag name and value under the given subscription. In case of a large number - /// of tags, this operation may return a previously cached result. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this ITagsOperations operations, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Creates or updates the entire set of tags on a resource or subscription. - /// - /// - /// This operation allows adding or replacing the entire set of tags on the - /// specified resource or subscription. The specified entity can have a maximum - /// of 50 tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource scope. - /// - /// - /// - public static TagsResource CreateOrUpdateAtScope(this ITagsOperations operations, string scope, TagsResource parameters) - { - return operations.CreateOrUpdateAtScopeAsync(scope, parameters).GetAwaiter().GetResult(); - } - - /// - /// Creates or updates the entire set of tags on a resource or subscription. - /// - /// - /// This operation allows adding or replacing the entire set of tags on the - /// specified resource or subscription. The specified entity can have a maximum - /// of 50 tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource scope. - /// - /// - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAtScopeAsync(this ITagsOperations operations, string scope, TagsResource parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateAtScopeWithHttpMessagesAsync(scope, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Selectively updates the set of tags on a resource or subscription. - /// - /// - /// This operation allows replacing, merging or selectively deleting tags on - /// the specified resource or subscription. The specified entity can have a - /// maximum of 50 tags at the end of the operation. The 'replace' option - /// replaces the entire set of existing tags with a new set. The 'merge' option - /// allows adding tags with new names and updating the values of tags with - /// existing names. The 'delete' option allows selectively deleting tags based - /// on given names or name/value pairs. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource scope. - /// - /// - /// - public static TagsResource UpdateAtScope(this ITagsOperations operations, string scope, TagsPatchResource parameters) - { - return operations.UpdateAtScopeAsync(scope, parameters).GetAwaiter().GetResult(); - } - - /// - /// Selectively updates the set of tags on a resource or subscription. - /// - /// - /// This operation allows replacing, merging or selectively deleting tags on - /// the specified resource or subscription. The specified entity can have a - /// maximum of 50 tags at the end of the operation. The 'replace' option - /// replaces the entire set of existing tags with a new set. The 'merge' option - /// allows adding tags with new names and updating the values of tags with - /// existing names. The 'delete' option allows selectively deleting tags based - /// on given names or name/value pairs. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource scope. - /// - /// - /// - /// - /// The cancellation token. - /// - public static async Task UpdateAtScopeAsync(this ITagsOperations operations, string scope, TagsPatchResource parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.UpdateAtScopeWithHttpMessagesAsync(scope, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets the entire set of tags on a resource or subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource scope. - /// - public static TagsResource GetAtScope(this ITagsOperations operations, string scope) - { - return operations.GetAtScopeAsync(scope).GetAwaiter().GetResult(); - } - - /// - /// Gets the entire set of tags on a resource or subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource scope. - /// - /// - /// The cancellation token. - /// - public static async Task GetAtScopeAsync(this ITagsOperations operations, string scope, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetAtScopeWithHttpMessagesAsync(scope, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes the entire set of tags on a resource or subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource scope. - /// - public static void DeleteAtScope(this ITagsOperations operations, string scope) - { - operations.DeleteAtScopeAsync(scope).GetAwaiter().GetResult(); - } - - /// - /// Deletes the entire set of tags on a resource or subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource scope. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAtScopeAsync(this ITagsOperations operations, string scope, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteAtScopeWithHttpMessagesAsync(scope, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Gets a summary of tag usage under the subscription. - /// - /// - /// This operation performs a union of predefined tags, resource tags, resource - /// group tags and subscription tags, and returns a summary of usage for each - /// tag name and value under the given subscription. In case of a large number - /// of tags, this operation may return a previously cached result. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this ITagsOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets a summary of tag usage under the subscription. - /// - /// - /// This operation performs a union of predefined tags, resource tags, resource - /// group tags and subscription tags, and returns a summary of usage for each - /// tag name and value under the given subscription. In case of a large number - /// of tags, this operation may return a previously cached result. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this ITagsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - } -} diff --git a/src/Resources/Resources.Sdk/Generated/TemplateSpecVersionsOperationsExtensions.cs b/src/Resources/Resources.Sdk/Generated/TemplateSpecVersionsOperationsExtensions.cs deleted file mode 100644 index c691907a9034..000000000000 --- a/src/Resources/Resources.Sdk/Generated/TemplateSpecVersionsOperationsExtensions.cs +++ /dev/null @@ -1,294 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Resources -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Threading; - using System.Threading.Tasks; - - /// - /// Extension methods for TemplateSpecVersionsOperations. - /// - public static partial class TemplateSpecVersionsOperationsExtensions - { - /// - /// Creates or updates a Template Spec version. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Name of the Template Spec. - /// - /// - /// The version of the Template Spec. - /// - /// - /// Template Spec Version supplied to the operation. - /// - public static TemplateSpecVersion CreateOrUpdate(this ITemplateSpecVersionsOperations operations, string resourceGroupName, string templateSpecName, string templateSpecVersion, TemplateSpecVersion templateSpecVersionModel) - { - return operations.CreateOrUpdateAsync(resourceGroupName, templateSpecName, templateSpecVersion, templateSpecVersionModel).GetAwaiter().GetResult(); - } - - /// - /// Creates or updates a Template Spec version. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Name of the Template Spec. - /// - /// - /// The version of the Template Spec. - /// - /// - /// Template Spec Version supplied to the operation. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this ITemplateSpecVersionsOperations operations, string resourceGroupName, string templateSpecName, string templateSpecVersion, TemplateSpecVersion templateSpecVersionModel, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, templateSpecName, templateSpecVersion, templateSpecVersionModel, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Updates Template Spec Version tags with specified values. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Name of the Template Spec. - /// - /// - /// The version of the Template Spec. - /// - /// - /// Template Spec Version resource with the tags to be updated. - /// - public static TemplateSpecVersion Update(this ITemplateSpecVersionsOperations operations, string resourceGroupName, string templateSpecName, string templateSpecVersion, TemplateSpecVersionUpdateModel templateSpecVersionUpdateModel = default(TemplateSpecVersionUpdateModel)) - { - return operations.UpdateAsync(resourceGroupName, templateSpecName, templateSpecVersion, templateSpecVersionUpdateModel).GetAwaiter().GetResult(); - } - - /// - /// Updates Template Spec Version tags with specified values. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Name of the Template Spec. - /// - /// - /// The version of the Template Spec. - /// - /// - /// Template Spec Version resource with the tags to be updated. - /// - /// - /// The cancellation token. - /// - public static async Task UpdateAsync(this ITemplateSpecVersionsOperations operations, string resourceGroupName, string templateSpecName, string templateSpecVersion, TemplateSpecVersionUpdateModel templateSpecVersionUpdateModel = default(TemplateSpecVersionUpdateModel), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, templateSpecName, templateSpecVersion, templateSpecVersionUpdateModel, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets a Template Spec version from a specific Template Spec. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Name of the Template Spec. - /// - /// - /// The version of the Template Spec. - /// - public static TemplateSpecVersion Get(this ITemplateSpecVersionsOperations operations, string resourceGroupName, string templateSpecName, string templateSpecVersion) - { - return operations.GetAsync(resourceGroupName, templateSpecName, templateSpecVersion).GetAwaiter().GetResult(); - } - - /// - /// Gets a Template Spec version from a specific Template Spec. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Name of the Template Spec. - /// - /// - /// The version of the Template Spec. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this ITemplateSpecVersionsOperations operations, string resourceGroupName, string templateSpecName, string templateSpecVersion, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, templateSpecName, templateSpecVersion, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes a specific version from a Template Spec. When operation completes, - /// status code 200 returned without content. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Name of the Template Spec. - /// - /// - /// The version of the Template Spec. - /// - public static void Delete(this ITemplateSpecVersionsOperations operations, string resourceGroupName, string templateSpecName, string templateSpecVersion) - { - operations.DeleteAsync(resourceGroupName, templateSpecName, templateSpecVersion).GetAwaiter().GetResult(); - } - - /// - /// Deletes a specific version from a Template Spec. When operation completes, - /// status code 200 returned without content. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Name of the Template Spec. - /// - /// - /// The version of the Template Spec. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this ITemplateSpecVersionsOperations operations, string resourceGroupName, string templateSpecName, string templateSpecVersion, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, templateSpecName, templateSpecVersion, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Lists all the Template Spec versions in the specified Template Spec. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Name of the Template Spec. - /// - public static IPage List(this ITemplateSpecVersionsOperations operations, string resourceGroupName, string templateSpecName) - { - return operations.ListAsync(resourceGroupName, templateSpecName).GetAwaiter().GetResult(); - } - - /// - /// Lists all the Template Spec versions in the specified Template Spec. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Name of the Template Spec. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this ITemplateSpecVersionsOperations operations, string resourceGroupName, string templateSpecName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, templateSpecName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Lists all the Template Spec versions in the specified Template Spec. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this ITemplateSpecVersionsOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Lists all the Template Spec versions in the specified Template Spec. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this ITemplateSpecVersionsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - } -} diff --git a/src/Resources/Resources.Sdk/Generated/TemplateSpecsOperationsExtensions.cs b/src/Resources/Resources.Sdk/Generated/TemplateSpecsOperationsExtensions.cs deleted file mode 100644 index df08233560c8..000000000000 --- a/src/Resources/Resources.Sdk/Generated/TemplateSpecsOperationsExtensions.cs +++ /dev/null @@ -1,350 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Resources -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Threading; - using System.Threading.Tasks; - - /// - /// Extension methods for TemplateSpecsOperations. - /// - public static partial class TemplateSpecsOperationsExtensions - { - /// - /// Creates or updates a Template Spec. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Name of the Template Spec. - /// - /// - /// Template Spec supplied to the operation. - /// - public static TemplateSpec CreateOrUpdate(this ITemplateSpecsOperations operations, string resourceGroupName, string templateSpecName, TemplateSpec templateSpec) - { - return operations.CreateOrUpdateAsync(resourceGroupName, templateSpecName, templateSpec).GetAwaiter().GetResult(); - } - - /// - /// Creates or updates a Template Spec. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Name of the Template Spec. - /// - /// - /// Template Spec supplied to the operation. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this ITemplateSpecsOperations operations, string resourceGroupName, string templateSpecName, TemplateSpec templateSpec, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, templateSpecName, templateSpec, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Updates Template Spec tags with specified values. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Name of the Template Spec. - /// - /// - /// Template Spec resource with the tags to be updated. - /// - public static TemplateSpec Update(this ITemplateSpecsOperations operations, string resourceGroupName, string templateSpecName, TemplateSpecUpdateModel templateSpec = default(TemplateSpecUpdateModel)) - { - return operations.UpdateAsync(resourceGroupName, templateSpecName, templateSpec).GetAwaiter().GetResult(); - } - - /// - /// Updates Template Spec tags with specified values. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Name of the Template Spec. - /// - /// - /// Template Spec resource with the tags to be updated. - /// - /// - /// The cancellation token. - /// - public static async Task UpdateAsync(this ITemplateSpecsOperations operations, string resourceGroupName, string templateSpecName, TemplateSpecUpdateModel templateSpec = default(TemplateSpecUpdateModel), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, templateSpecName, templateSpec, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets a Template Spec with a given name. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Name of the Template Spec. - /// - /// - /// Allows for expansion of additional Template Spec details in the response. - /// Optional. Possible values include: 'versions' - /// - public static TemplateSpec Get(this ITemplateSpecsOperations operations, string resourceGroupName, string templateSpecName, string expand = default(string)) - { - return operations.GetAsync(resourceGroupName, templateSpecName, expand).GetAwaiter().GetResult(); - } - - /// - /// Gets a Template Spec with a given name. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Name of the Template Spec. - /// - /// - /// Allows for expansion of additional Template Spec details in the response. - /// Optional. Possible values include: 'versions' - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this ITemplateSpecsOperations operations, string resourceGroupName, string templateSpecName, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, templateSpecName, expand, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes a Template Spec by name. When operation completes, status code 200 - /// returned without content. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Name of the Template Spec. - /// - public static void Delete(this ITemplateSpecsOperations operations, string resourceGroupName, string templateSpecName) - { - operations.DeleteAsync(resourceGroupName, templateSpecName).GetAwaiter().GetResult(); - } - - /// - /// Deletes a Template Spec by name. When operation completes, status code 200 - /// returned without content. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Name of the Template Spec. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this ITemplateSpecsOperations operations, string resourceGroupName, string templateSpecName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, templateSpecName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Lists all the Template Specs within the specified subscriptions. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Allows for expansion of additional Template Spec details in the response. - /// Optional. Possible values include: 'versions' - /// - public static IPage ListBySubscription(this ITemplateSpecsOperations operations, string expand = default(string)) - { - return operations.ListBySubscriptionAsync(expand).GetAwaiter().GetResult(); - } - - /// - /// Lists all the Template Specs within the specified subscriptions. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Allows for expansion of additional Template Spec details in the response. - /// Optional. Possible values include: 'versions' - /// - /// - /// The cancellation token. - /// - public static async Task> ListBySubscriptionAsync(this ITemplateSpecsOperations operations, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListBySubscriptionWithHttpMessagesAsync(expand, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Lists all the Template Specs within the specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Allows for expansion of additional Template Spec details in the response. - /// Optional. Possible values include: 'versions' - /// - public static IPage ListByResourceGroup(this ITemplateSpecsOperations operations, string resourceGroupName, string expand = default(string)) - { - return operations.ListByResourceGroupAsync(resourceGroupName, expand).GetAwaiter().GetResult(); - } - - /// - /// Lists all the Template Specs within the specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Allows for expansion of additional Template Spec details in the response. - /// Optional. Possible values include: 'versions' - /// - /// - /// The cancellation token. - /// - public static async Task> ListByResourceGroupAsync(this ITemplateSpecsOperations operations, string resourceGroupName, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, expand, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Lists all the Template Specs within the specified subscriptions. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListBySubscriptionNext(this ITemplateSpecsOperations operations, string nextPageLink) - { - return operations.ListBySubscriptionNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Lists all the Template Specs within the specified subscriptions. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListBySubscriptionNextAsync(this ITemplateSpecsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListBySubscriptionNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Lists all the Template Specs within the specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListByResourceGroupNext(this ITemplateSpecsOperations operations, string nextPageLink) - { - return operations.ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Lists all the Template Specs within the specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByResourceGroupNextAsync(this ITemplateSpecsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - } -} diff --git a/src/Resources/Resources.Sdk/Generated/TenantsOperationsExtensions.cs b/src/Resources/Resources.Sdk/Generated/TenantsOperationsExtensions.cs deleted file mode 100644 index 43a761b0fd2e..000000000000 --- a/src/Resources/Resources.Sdk/Generated/TenantsOperationsExtensions.cs +++ /dev/null @@ -1,87 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Resources -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Threading; - using System.Threading.Tasks; - - /// - /// Extension methods for TenantsOperations. - /// - public static partial class TenantsOperationsExtensions - { - /// - /// Gets the tenants for your account. - /// - /// - /// The operations group for this extension method. - /// - public static IPage List(this ITenantsOperations operations) - { - return operations.ListAsync().GetAwaiter().GetResult(); - } - - /// - /// Gets the tenants for your account. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this ITenantsOperations operations, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets the tenants for your account. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this ITenantsOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets the tenants for your account. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this ITenantsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - } -} diff --git a/src/Resources/Resources.Test/Resources.Test.csproj b/src/Resources/Resources.Test/Resources.Test.csproj index ac0b72538c10..c0604e708013 100644 --- a/src/Resources/Resources.Test/Resources.Test.csproj +++ b/src/Resources/Resources.Test/Resources.Test.csproj @@ -27,7 +27,7 @@ - + diff --git a/src/Resources/Resources.sln b/src/Resources/Resources.sln index af23bd0bade2..f6cdea4dbd5b 100644 --- a/src/Resources/Resources.sln +++ b/src/Resources/Resources.sln @@ -47,7 +47,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Az.MSGraph", "MSGraph.Autor EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ResourceManager", "ResourceManager\ResourceManager.csproj", "{F25C740F-1FC7-4536-A597-837DF0C611A8}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Resources.Sdk", "Resources.Sdk\Resources.Sdk.csproj", "{06D245AC-A806-40CB-AD44-459AA3F90E21}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Resources.Management.Sdk", "Resources.Management.Sdk\Resources.Management.Sdk.csproj", "{06D245AC-A806-40CB-AD44-459AA3F90E21}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Resources.Test", "Resources.Test\Resources.Test.csproj", "{79B1C27E-AB8F-458C-B872-A5DC5041BE08}" EndProject diff --git a/src/Resources/Tags/Tags.csproj b/src/Resources/Tags/Tags.csproj index 540132d8262a..e3dd8d64850b 100644 --- a/src/Resources/Tags/Tags.csproj +++ b/src/Resources/Tags/Tags.csproj @@ -12,7 +12,7 @@ - + diff --git a/tools/StaticAnalysis/GeneratedSdkAnalyzer/SDKGeneratedCodeVerify.ps1 b/tools/StaticAnalysis/GeneratedSdkAnalyzer/SDKGeneratedCodeVerify.ps1 index ba5050299369..501dd72d7f80 100644 --- a/tools/StaticAnalysis/GeneratedSdkAnalyzer/SDKGeneratedCodeVerify.ps1 +++ b/tools/StaticAnalysis/GeneratedSdkAnalyzer/SDKGeneratedCodeVerify.ps1 @@ -86,6 +86,13 @@ try { Write-Host "Preparing Autorest..." npx autorest --reset foreach ($_ in $ChangedSdks) { + # If it is Resources.Management.Sdk, flag and will use tag for sdk generation + $IsResources = $false; + if ($_ -match "Resources.Management.Sdk") + { + $IsResources = $true; + } + # Extract Module Name $ModuleName = "Az." + ($_ -split "\/|\\")[1] @@ -107,7 +114,22 @@ try { if ([regex]::Matches($readMeContent, '\s*powershell\s*:\s*true\s*') -and [regex]::Matches($readMeContent, '\s*isSdkGenerator\s*:\s*true\s*')) { Write-Host "Using autorest powershell v4:`nRe-generating SDK under Generated folder for $ModuleName..." - npx autorest + if ($IsResources) + { + Write-Host "Specific generation for Resources.Management.Sdk" + rm -r Generated/* + npx autorest --use:@autorest/powershell@4.x --tag=package-privatelinks-2020-05 + npx autorest --use:@autorest/powershell@4.x --tag=package-subscriptions-2021-01 + npx autorest --use:@autorest/powershell@4.x --tag=package-features-2021-07 + npx autorest --use:@autorest/powershell@4.x --tag=package-deploymentscripts-2020-10 + npx autorest --use:@autorest/powershell@4.x --tag=package-resources-2021-04 + npx autorest --use:@autorest/powershell@4.x --tag=package-deploymentstacks-2022-08-preview + npx autorest --use:@autorest/powershell@4.x --tag=package-templatespecs-2021-05 + } + else + { + npx autorest + } } elseif ([regex]::Matches($readMeContent, '\s*csharp\s*:\s*true\s*')) {